-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Feature]: simulate nested messages #15809
Comments
You mean if a transaction contains a message that gets put into a queue or something to be processed at |
the simulate would be more of a check of validation then gas consumption if thats what you mean |
Hi @tac0turtle, I have some doubts: What do you mean by |
messages can embed other messages in them that will be executed at a later time (gov, etc..). These messages are not simulated so they could fail at a later date when the state machine goes to execute them. simulation is exposed via an endpoint or cli. here is a link to the code that handles this. Simulating a transaction is used in order to see if a transaction will pass or fail when executing it. Lines 988 to 1010 in b4e7df2
Lmk if you have any more questions, happy to hop on a quick call to explain things if needed as well |
Ok, I understand what the simulation is and the meaning of a nested message (if it's possible I'd like to see an example, I still have doubts about what type the embedded messages have, I'd expect something like a
But then, what do you mean by the validation check of the nested message? What validation would be done in the simulation? Could you explain that? If not, I'd be happy to have a quick call |
yes, gov submit proposal is a good example: cosmos-sdk/x/gov/types/v1/tx.pb.go Lines 41 to 72 in 7b7a72a
|
After taking a look at this, I came to the conclusion that nested messages should be checked in their parent MsgHandler. The handler should always check:
In the case of SubmitProposal, messages are not checked deliberately: cosmos-sdk/x/gov/keeper/proposal.go Lines 94 to 102 in 4c446f8
Here is the discussion about it. Maybe a cli command to simulate a proposals makes sense as pointed in the discussion. |
Summary
Currently users are able to simulate transactions, this is useful to make sure the tx will pass, but with the adoption of delayed execution on nested messages the simulations dont check the nested message. We should adapt the simulation check for transactions to also check nested messages.
Problem Definition
Nested messages dont get checked in transaction simulations if the message will be queued for delayed execution
Proposal
Extend simulations to check nested messages if they exist within a transaction
The text was updated successfully, but these errors were encountered: