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

Handling transaction revert in eth_estimateGas #2846

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

rmoreliovlabs
Copy link
Contributor

Align eth_estimateGas behavior with Geth for reverted transactions

Description

This PR refactors the eth_estimateGas RPC call on RSK to handle reverted transactions similarly to Geth. Previously, the eth_estimateGas call on RSK did not return an error when a transaction was reverted. This change adds a missing check to ensure that when a transaction is reverted, the eth_estimateGas call returns an error, aligning with Geth’s behavior. Check this documentation for more info: https://www.notion.so/iovlabs/Analysis-of-eth_estimateGas-Behavior-on-RSKJ-Node-for-Reverted-Transactions-13cc132873f980c0aa87de78ed0f84a0

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

Copy link

github-actions bot commented Nov 14, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link
Contributor

@fmacleal fmacleal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! It was indeed a tricky issue to find. My suggestion would be to add a test to validate this revert. You could use the contract you created to debug. If you add it, it would be awesome. 🙂

Copy link
Contributor

@fmacleal fmacleal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good job.

Copy link

sonarcloud bot commented Nov 18, 2024

@Vovchyk Vovchyk merged commit fb418b5 into master Nov 22, 2024
12 checks passed
@Vovchyk Vovchyk deleted the feature/handle_transaction_revert branch November 22, 2024 08:24
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.

3 participants