-
Notifications
You must be signed in to change notification settings - Fork 522
Description
A proposed solution to solve #761
Once #796 is merged, governance can adjust the instantiation config after the fact.
Since voting on the actual "store wasm" is a huge blob and lots of gas, I could imagine using that to achieve a much simpler process for permissioned contracts.
- Anyone can upload a contract. (7 million gas of so)
- Default InstantiatePermission is Nobody, so the code cannot be run
- Make a proposal to allow everyone (or just you) to instantiate the contract (with normal gas costs)
- If passed, you can now instantiate the contract, which is the key point "permissioned cosmwasm" seeks to control
This would replace the current flow:
- Default CodeUpload permission is nobody
- Make a proposal to upload some code (voting is very expensive... several million gas), along with the instantiateconfig
- If passed, everyone (or just you) can now use this code
There is one last little gotcha... We currently allow the user to override the DefaultInstantiatePermssion upon code upload, so they could easily bypass control 2. However, if we make one change, this would work:
If InstantiatePermission is set on CodeUpload, it must be equal to or stricter than the default
- If the default is everyone, you can set anything there.
- If the default is OnlyAddress(x), you can either set the same OnlyAddress (but not changing the address), or Nobody
- If the default is Nobody, you can only set nobody.
- If not set, it will use the default.
This is a very minor change, but coupled with #796 we should solve many of the usability issues around uploading contracts on permsisioned CosmWasm chains.