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 swapped fee/tip parameters to estimateGas #8572

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

roberto-bayardo
Copy link
Collaborator

@roberto-bayardo roberto-bayardo commented Dec 12, 2023

Description

fix the fact that tip & fee cap were swapped in gas limit re-estimation call, and consistently use tip->fee ordering to avoid future mixup.

Tests

Updated the mock backend with a check that would have caught this error.

Additional context

This was resulting in sporadic errors in our goerli-alpha proposer/batchers.

This bug didn't cause issues in the past because of what looks like a recent change in geth: ethereum/go-ethereum#28462

@roberto-bayardo roberto-bayardo marked this pull request as ready for review December 12, 2023 02:02
@roberto-bayardo roberto-bayardo requested a review from a team as a code owner December 12, 2023 02:02
Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

Walkthrough

The changes involve modifications to the gas fee calculation and transaction crafting logic in a Go codebase. Specifically, the GasFeeCap and GasTipCap fields have been swapped in two functions, affecting how transactions are created and gas prices are increased. Additionally, a new error condition has been added to the EstimateGas function to ensure GasFeeCap is not less than GasTipCap.

Changes

File(s) Summary
op-service/txmgr/txmgr.go Swapped GasFeeCap and GasTipCap in craftTx and increaseGasPrice functions.
op-service/.../txmgr_test.go Added a conditional error check in EstimateGas to compare GasFeeCap and GasTipCap.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #8572 (6ae65dd) into develop (10425c1) will decrease coverage by 0.09%.
Report is 10 commits behind head on develop.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8572      +/-   ##
===========================================
- Coverage    34.64%   34.56%   -0.09%     
===========================================
  Files          167      167              
  Lines         7155     7155              
  Branches      1209     1209              
===========================================
- Hits          2479     2473       -6     
- Misses        4525     4533       +8     
+ Partials       151      149       -2     
Flag Coverage Δ
cannon-go-tests 63.48% <ø> (ø)
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests 26.74% <ø> (ø)
contracts-bedrock-tests 20.10% <ø> (-0.29%) ⬇️
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests 44.03% <ø> (ø)
sdk-next-tests 42.18% <ø> (ø)
sdk-tests 42.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 5 files with indirect coverage changes

@protolambda protolambda requested review from ajsutton and trianglesphere and removed request for mslipper December 12, 2023 16:32
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

We had a Goerli safe head stall because of this a few hours ago and also fixed it (partially, #8578). Should have checked Github notifications first :D Thanks!

@sebastianst sebastianst added this pull request to the merge queue Dec 12, 2023
Merged via the queue into ethereum-optimism:develop with commit e9eb45c Dec 12, 2023
62 checks passed
trianglesphere pushed a commit that referenced this pull request Dec 12, 2023
fix swapped fee/tip parameters to estimateGas
ajsutton pushed a commit that referenced this pull request Dec 12, 2023
fix swapped fee/tip parameters to estimateGas
ajsutton added a commit that referenced this pull request Dec 12, 2023
…-canyon-mainnet

Backport #8572: fix swapped fee/tip parameters to estimateGas
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