Skip to content

Commit

Permalink
CNS-784: PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-lava committed Jan 2, 2024
1 parent 641c907 commit 189b875
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions x/plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ The `Extensions` field is intended to enable the use of certain APIs to obtain d

The `Mixed` field is designed to enable a combination of regular and extension/addon supporting providers. For instance, if the `archive` extension is defined but the `Mixed` field is set to `false`, the consumer's project will only be paired with providers that support the specified extensions and addons. On the other hand, if the `Mixed` field is set to `true`, the consumer's project will also be paired with providers that don't fully support the extenstion/addons.

For more details on `CollectionData` object, see the spec module's [README](../spec/README.md).

#### Geolocation

Geolocation profile allows consumers to get paired with providers that support these geolocations, ultimately optimizing latency and improving the quality of service for end-users. The geolocations are defined as a bitmap so the `int32` field in the policy can represent multiple geolocations.
Expand Down
8 changes: 4 additions & 4 deletions x/projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ enum Kinds {
}
```

The admin key lets the admin edit the project's admin policy, enable/disable the project and add/delete other project keys. A single user can be admin in multiple projects. The subscription owner is automatically considered an admin in all of the project created under it.
The admin key lets the admin edit the project's admin policy, enable/disable the project and add/delete other project keys. A single user can be admin in multiple projects. The subscription owner is automatically considered an admin in all of the projects created under it.

The developer key lets a user to use the project, i.e., make RPC calls and use the project's CU. A single user (consumer) can only be a developer in one project. The project's developer can be viewed as a dapp developer that wants to use Lava to get RPC data for their dapp. To allow end users use their project to get RPC data, the dapp developer will need to use badges. For more details on badges, see [below](#badges).

Note that the admin cannot use the project's CU like a developer, they can only edit the project's properties.

### Badges

Badges are a method to grant compute units (CU) from projects to other users. Given a subscription with projects, a developer key (in a project) can be used to generate a badge key, to be signed by an external badge-server. The badge is ephemeral, limited in time and in CU capacity; It can be used to get pairing with providers, and for requests from providers - which will be charged to the respective project after verification.
Badges are a method to grant compute units (CU) from projects to other users. Given a subscription with projects, a developer key (in a project) can be used to generate a badge key, to be signed by an external badge-server. The badge is ephemeral, limited in time and in CU capacity; End users, who are not the original developers of the project, can use the badge to pair with providers on behalf of the developer key. The requests made by end users using the badge will be charged to the corresponding project after verification.

A badge is defined as follows:

Expand All @@ -93,7 +93,7 @@ type Badge struct {
}
```

The badge's `Epoch` field is the epoch in which the badge is valid. When the epoch changes, the badge becomes invalid. The badge's `VirtualEpoch` is used in emergency mode (see `Downtime` module's README for more details).
The badge's `Epoch` field is the epoch in which the badge is valid in. When the epoch changes, the badge becomes invalid. The badge's `VirtualEpoch` is used in emergency mode (see `Downtime` module's README for more details).

When a badge user sends a relay request to the provider, the first request must be accompanied by the signed message (proof of grant, i.e., a valid `ProjectSig` which should be the developer key's signature). Subsequent relays from the same badge don't have to add a valid `ProjectSig`.

Expand Down Expand Up @@ -185,7 +185,7 @@ Policy:
- chain_id: "*" # allows all other chains without specifying
```
All fields are not mandatory. An unfilled field will be replaced with a default value or be ignored.
All fields are optional. An unfilled field will be replaced with a default value or be ignored.
### Project Keys YAML
Expand Down
2 changes: 1 addition & 1 deletion x/projects/keeper/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func (k Keeper) SetProjectPolicy(ctx sdk.Context, projectIDs []string, policy *p
if setPolicyEnum == types.SET_ADMIN_POLICY {
utils.LogLavaEvent(ctx, k.Logger(ctx), types.SetAdminPolicyEventName, details, "set admin policy successfully")
} else if setPolicyEnum == types.SET_SUBSCRIPTION_POLICY {
utils.LogLavaEvent(ctx, k.Logger(ctx), types.SetSubscriptionPolicyEventName, details, "set admin policy successfully")
utils.LogLavaEvent(ctx, k.Logger(ctx), types.SetSubscriptionPolicyEventName, details, "set subscription policy successfully")
}
return nil
}
Expand Down

0 comments on commit 189b875

Please sign in to comment.