Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: asset canister permissions can be set via upgrade args #2237

Merged
merged 7 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ They can do so by running the following command:
dfx sns prepare-canisters add-nns-root $CANISTER_ID
```

They also remove themselves from the list of principals that may change frontend canister content on their own.
sesi200 marked this conversation as resolved.
Show resolved Hide resolved

```bash
dfx canister call $CANISTER_ID revoke_permission '(record {of_principal = principal "<developer principal"; permission = variant { Commit;};})'
```

If any other canisters in the dapp contain custom access control, these permission lists should also be prepared for decentralization.
sesi200 marked this conversation as resolved.
Show resolved Hide resolved

### 2. Dapp developers choose the initial parameters of the SNS for a dapp.

Typically, dapp developers choose initial parameters that will be used in subsequent proposals.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ This is necessary in order for the rest of the steps to work automatically.
As any eligible NNS neuron can submit the proposal in Stage 3, this is an important step
where the dapp developers explicity express their intent to hand over their dapp to a DAO.

In this step, the dapp developers also deregister themselves from asset canisters as principals that may change website content without going through a vote.
If any other canisters in the dapp contain custom access control, these permission lists should also be prepared for decentralization.
sesi200 marked this conversation as resolved.
Show resolved Hide resolved

If successful, at the end of stage, the following has changed:

#### Table 1: Canisters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The general overview of deploying an asset canister during an SNS launch is as f
- First, the asset canister must be created with or upgraded to a Wasm file from [dfx 0.15.2+](https://github.com/dfinity/sdk/blob/release-0.15.2/src/distributed/assetstorage.wasm.gz).
- Then, developers should use `revoke_permission` to remove their own permissions (especially `Commit`) that allow them to update the assets arbitrarily.
- Then, after launching the SNS, the SNS's function should be [registered](#sns-genericnervoussystemfunctions) to commit proposed changes.
- Last, using upgrade arguments, updated permissions can be set. This is only possible after launching an SNS because before the launch the principal id of SNS governance is not known yet
- Last, using upgrade arguments, updated permissions can be set. This is only possible after the SNS canisters have been successfully deployed and [initialized](../launching/launch-summary-1proposal.md#7-automatically-sns-w-initializes-sns-canisters-according-to-settings-from-step-1) because before the launch the principal id of SNS governance is not known yet
- The SNS governance canister is given `Commit` permissions. With `Commit`, SNS governance may apply a batch of proposed asset updates to the assets served by the asset canister.
- To give certain individuals the permission to upload changes to the asset canister that can then be put to vote, these principals can be granted `Prepare` permissions. Changes created using `Prepare` permissions must be approved through a proposal before they are applied to the asset canister.
- To facilitate permission management via custom SNS proposals, it can make sense to grant SNS governance the `ManagePermissions` permission. With this permission, it is not necessary to upgrade the asset canister every time permissions are supposed to change.
Expand Down
Loading