Skip to content

Simpler upload/instantiate flow for permissioned chains #840

@ethanfrey

Description

@ethanfrey

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.

  1. Anyone can upload a contract. (7 million gas of so)
  2. Default InstantiatePermission is Nobody, so the code cannot be run
  3. Make a proposal to allow everyone (or just you) to instantiate the contract (with normal gas costs)
  4. If passed, you can now instantiate the contract, which is the key point "permissioned cosmwasm" seeks to control

This would replace the current flow:

  1. Default CodeUpload permission is nobody
  2. Make a proposal to upload some code (voting is very expensive... several million gas), along with the instantiateconfig
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    optionalNot absolutely required for the milestone

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions