-
Notifications
You must be signed in to change notification settings - Fork 359
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
Avoid submitting txs when simulation fails, except for one special case #1542
Conversation
4e75c61
to
da1e368
Compare
Feedback so far: love the PR title! 💯 Quick idea we can iterate on:
Since we noticed this special case in production, I wonder if it makes sense to quickly parse some production logs: (1) grep for |
A few thoughts:
Regarding the first case, it's been a lot on my mind as we see this very often in the packet worker. It happens when we have to split So in summary I thinking we should consider:
|
self.max_gas(), | ||
)); | ||
Err(e) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still check that the estimated gas is smaller than the configured max gas, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like solid work Romain, I'm still testing and will merge soon!
…se (informalsystems#1542) * Rename CosmosSdk::estimate_gas to simulate_gas * Rephrase a couple gRPC-related errors * Recover from `account seq mismatch` error during tx simulation * Add changelog entry * Fix doc test * Undo naming change * Continue when client state height too low rather than on account sequence mismatch * Check that the configured max gas is smaller than the max gas consensus param * Re-introduce check that the estimated gas is smaller than the max gas
Closes: #1479
Related: #712
Description
This PR changes the way the relayer reacts to tx simulation failures in the following way:
if the tx simulation failed because the client state height is too low, the relayer will fallback on the default gas setting and attempt to submit the tx anyway.
if the tx simulation failed for any other reason, we abort the submission of the tx and bubble the error up, and let the worker deal with the error. At the moment, workers do not handle these errors in any specific manner, and will just attempt to send the tx again for a fixed number of times. In that case, the overall behavior of the relayer does not change, except that we do not waste fees unnecessarily anymore because we won't attempt to actually submit the tx using the default gas.
How to test
Create a channel
In the Hermes config, set
max_msg_num = 5
for chainibc-0
Start Hermes
Send N > 5 packets to
ibc-0
Check the
hermes start
logs, you should find something like:For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.