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

Fix gas estimation for reverts that are considered consensus errors #2088

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

StefanIliev545
Copy link
Contributor

Why this change is needed

Gas estimation which we copied from geth fails when there is a revert while searching for proper gas. This is due to the error not being the correct gas too low (for whatever reason). This is a workaround.

What changes were made as part of this PR

Please provide a high level list of the changes made

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

// If the error is not nil(consensus error), it means the provided message
// call or transaction will never be accepted no matter how much gas it is
// assigned. Return the error directly, don't struggle any more.
if err != nil {
/*if err != nil && isFailedAtMax {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this comment on purpose?

Copy link
Contributor Author

@StefanIliev545 StefanIliev545 Oct 14, 2024

Choose a reason for hiding this comment

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

yes, i decided to remove this altogether. Left it for clarity, as it's just a workaround. This whole bit of code was copy pasted ages ago, and I dont think it plays well with our codebase, but for the time being this should do.

Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

lgtm

@StefanIliev545 StefanIliev545 merged commit 1c196b0 into main Oct 14, 2024
2 checks passed
@StefanIliev545 StefanIliev545 deleted the siliev/gas-estimation-fix branch October 14, 2024 17:17
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