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

txmgr: Include the revert reason in the error when estimateGas fails #10829

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Jun 14, 2024

Description

Include the revert reason in the error message when estimateGas fails in the tx mgr. Makes it much easier to understand why the transaction is failing to send.

e.g.:

t=2024-06-14T14:14:00+0000 lvl=warn msg="Failed to create a transaction, will retry" service=proposer err="failed to estimate gas: execution reverted, reason: 0xf40239db486a8f5cc1827b835ff127a4ba9a4c13ae70198dba5d66400c997f730853ae62"

The reason here is what comes back from the evm and can be decoded with cast 4byte-decode:

$ cast 4byte-decode 0xf40239db486a8f5cc1827b835ff127a4ba9a4c13ae70198dba5d66400c997f730853ae62
1) "UnexpectedRootClaim(bytes32)"
0x486a8f5cc1827b835ff127a4ba9a4c13ae70198dba5d66400c997f730853ae62

Tests

Added unit tests, confirmed with manual testing.

@ajsutton ajsutton requested a review from a team as a code owner June 14, 2024 14:11
@ajsutton ajsutton requested review from tynes and sebastianst and removed request for tynes June 14, 2024 14:11
@tynes tynes added this pull request to the merge queue Jun 14, 2024
Merged via the queue into develop with commit f99eca3 Jun 14, 2024
60 checks passed
@tynes tynes deleted the aj/capture-revert-reason branch June 14, 2024 14:57
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 this pull request may close these issues.

2 participants