-
Notifications
You must be signed in to change notification settings - Fork 400
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
Reference Contract Schema on chain #1043
Comments
Much needed feature +1 |
this would be great for codegen! If there is a way to do this would open up a lot of new and interesting ways to interact with contracts 🛠 |
Thanks @JakeHartnell for bringing this topic up again. It is important and will improve dev and users experience when integrated well into common tooling. Though our experience with on chain urls was not great in the past. The field was either empty or not filled with useful information. But this may be a lack of spec and tooling. |
The data should be the generated Use cases:
We want to use it with DAO DAO to provide a default contract interaction UI. If the field is empty, we could handle that, same if it doesn't return the correct information. We are working on a code-id registry that could provide needed verification. Most important to me is having someway to include a reference to the schema or the schema itself on-chain, personally I thinking an optional |
problem with this, is we need to make backwards compatibility for all chains from now on for this field. blockchains are immutable unless they run some migrations. x/wasm doesn't even have control of how it is deployed. so, adding fields to drop them later is not so good. We had discussed this long ago (much before we had this community or level of tooling). We can revisit it, but it would be good to read such discussions (yes, both from 2020): The feeling was that it was too inflexible to do in x/wasm and some service (either off-chain or inside a contract) would be much better way to experiment and iterate. Once a workable solution was found, we could move it into x/wasm. |
I think doing it inside a contract with something like |
Seems a bit wasteful, in that we only need to store this once per code id, rather than write state each contract, but it does seem a very easy to deploy opt-in solution. And each contract could opt-out later on. Do you want to raise an issue on cw-plus to discuss how to do so? Happy to have a discussion with @uint on that over in cw-plus |
Oh, cool. "Self-describing" contracts are exciting! |
Adding to the conversation from a usability perspective, from a subset of the issue being discussed. Current pain No way clear way to give communities all the ingredients to verify stored codes:
Too big doses of trust without it. |
So many developers build tools on top of CosmWasm have complained to me that there is no way to get the contract schema, and no reference to it on chain.
User story: As a developer, I would like to be able to query the contract's schema on chain.
With the latest version of
cosmwasm-schema
we're generating nice single file schemas. I see two viable paths for getting a first version of this shipped:--schema
option that takes aschema-url
which could simply be the IPFS address of the schemascheme-url
I will note that verification of the contract code and schema is a separate problem. Have a lot of devs asking for this, and would like to get something for them soon.
Related: #241
The text was updated successfully, but these errors were encountered: