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

On the necessity of AcceptedStargateQueries in Juno #714

Open
mikedotexe opened this issue Jun 15, 2023 · 2 comments · May be fixed by #715
Open

On the necessity of AcceptedStargateQueries in Juno #714

mikedotexe opened this issue Jun 15, 2023 · 2 comments · May be fixed by #715
Assignees

Comments

@mikedotexe
Copy link
Contributor

mikedotexe commented Jun 15, 2023

Background

I've been talking with some CosmWasm devs about what we want to build for upcoming hackathons. Some of the cutting-edge areas to explore involve having a smart contract be "self-aware" as well as aware of other contracts' details. I could see great value in having contracts have access to Stargate queries that return info about itself or other contracts.

For instance, ContractHistory could be a valuable query in the future.
https://github.com/CosmWasm/wasmd/blob/a4548ba17526027ced9cfd3fe783c4d66831f9e4/proto/cosmwasm/wasm/v1/query.proto#L97-L104

Currently, to allow this query message, we'd need to add it to keepers.go in Juno to the whitelist, similar to what I did here: https://github.com/CosmosContracts/juno/pull/658/files

For context, I want to note that there's a history of caution around Stargate queries because of real non-determinism experienced by Juno from some jokester who halted the chain.

Here's a screenshot from this Discord message in the CosmWasm Discord.

Screen Shot 2023-06-15 at 10 16 13 AM

Seeing as it's been a comfortable period of time since we've seen a chain halt due to non-determinism from a CosmWasm query, and Confio has addressed the shortcoming by not allowing the specific error message to be returned (which was deemed to be the root cause if I'm reading this correctly) perhaps it's time we reconsider whether we need a shortlist of allowed Stargate queries anymore. It's possible this was a smart, cautionary move, but this guard may become vestigial at some point in maturity. The question is whether that time is now.

Before ending this section, I want to mention that at the time of this writing, the Cosmos ecosystem at large has not figured out the implementation details for account abstraction, though we're all excited for it. I believe besides the ContractHistory example earlier, some of the most important Stargate queries we'll need are around authz and feegrant queries. This is where the sauce is gon' happen.

Do we want to individually add Stargate queries for authz? Or can we do a blanket allowance for certain modules?

Suggested Design

I'd suggest we hold a conversation around if we need this AcceptedStargateQueries approach anymore.

Acceptance Criteria

A good, solid conversation where people feel empowered and understand one another. Purvis chapter 6 verse 66.

Timeliness

Let's build some dope shit at the hackathons coming up in a month. Would be really cool to join heads on a long-term and temporary solution so hackers can change the world in real-time in a few weeks.

@Reecepbcups
Copy link
Contributor

I would like to enable all Stargate queries for contracts

I can work to get this into v16, though I need to write test for each query to ensure it does not halt.

I'm not sure if I can just do * somewhere or if I have to specify every message. May require some reflection hmm. will look into more

@Reecepbcups Reecepbcups self-assigned this Jun 15, 2023
@Reecepbcups Reecepbcups added the Priority This needs to be done ASAP label Jun 15, 2023
@mikedotexe
Copy link
Contributor Author

Thank you @Reecepbcups! You're on it as usual. I've had multiple conversations with the good folks at Yieldmos, and we're realizing that querying for authz grants might be more important than other messages, in the event that it gets complicated to do the blanket approach 🙏🏼

@Reecepbcups Reecepbcups removed the Priority This needs to be done ASAP label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants