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

feat(eth/tracers): convert OOG wrapped error to Out Of Gas parity error #30497

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Sep 23, 2024

No description provided.

@jsvisa jsvisa requested a review from s1na as a code owner September 23, 2024 13:30
Signed-off-by: jsvisa <[email protected]>
@@ -54,6 +54,7 @@ var parityErrorMapping = map[string]string{
}

var parityErrorMappingStartingWith = map[string]string{
"out of gas:": "Out of gas", // convert OOG wrapped errors, eg `out of gas: not enough gas for reentrancy sentry`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the casing correct here? Just asking to be sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, actually they come from https://github.com/ethereum/go-ethereum/blob/fad7e74a1b/core/vm/interpreter.go#L279-L281

			cost += dynamicCost // for tracing
			if err != nil {
				return nil, fmt.Errorf("%w: %v", ErrOutOfGas, err)
			}

Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

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

I think in general it is hard to strive for compatibility on error messages with other clients and it is not something we should shoot for.

However given that out of gas is pretty common and it is under consensus rules I think we can make an exception.

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