feat!: Adds all stargate queries for smart contracts
Closes #714
TODO:
- add go test and/or e2e test with ic for EVERY one of these
- lint
I'm hyped but also scared
We need to double check event returns to be ordered and determinism of each of these
@dimiandre totally agree - I want to have a contract / e2e test which checks all of this with -race across 8+ vals on a network to ensure its safe before merge
@mikedotexe Are you able to work on a contract for this? You have more rustc proto experience than I do - or maybe a contract which uses Nois's Anybuf?
Guidelines if so:
Run this repo with the instructions in ./scripts/test_node.sh at the top in this branch
- We need a contract which has query endpoint as the module names. (ex: '{"bank":{}}') - for query gas reasons & narrowing down issues
- Each contract query would have multiple stargate queries inside it for said module (Bank would be https://github.com/CosmosContracts/juno/pull/715/files#diff-1ac782d2fab1d48ad7f7ef06cf2d58b37c99b6b4c98879a5ad86a985b73fad58R628-R639, use the env.contract_addr as the address to check)
- I do not think we have to care about the return values? Just that the query does not crash the chain
Then I can build a e2e test with 8 validators so we can ensure the chain does not halt for non-determinism.
Are you able to work on a contract for this?
Hey! My honest answer is I will probably need to reduce my time after AwesomWasm and OsmoCon to catch up on energy I've lost during my CosmWasm marathon. Maybe we can chat about this in late August?
I'm hyped but also scared
I feel the same way. If it's preferable, perhaps we can consider adding a handful of Stargate queries that might unlock a lot of potential. I know Yieldmos is keen on having Authz and FeeGrant queries going. Those might be worthwhile to get in before a larger, blanket acceptance of all Stargate queries?
Anybuf example
https://github.com/noislabs/nois-contracts/blob/v0.13.6/contracts/nois-payment/src/contract.rs#L112-L118
Going to have to postpone for a future upgrade, don't have time atm to write the test to ensure these all work.
- I do not think we have to care about the return values? Just that the query does not crash the chain
@Reecepbcups return values must be deterministic and in same order if array, same for return events
@dimiandre is right, this is something we should be hyped and scared about, it needs tests.