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

Submitter: bump fee cap with tip cap #2412

Merged
merged 6 commits into from
Apr 2, 2024
Merged

Submitter: bump fee cap with tip cap #2412

merged 6 commits into from
Apr 2, 2024

Conversation

dwasse
Copy link
Collaborator

@dwasse dwasse commented Apr 1, 2024

Description
Instead of using our max gas price for gas fee cap, we use eth.suggestGasPrice() for this value, and bump it in accordance with tip cap.

Metadata

Summary by CodeRabbit

  • New Features

    • Improved dynamic transaction fee adjustment to better handle network congestion and ensure fees do not exceed a predetermined maximum.
  • Refactor

    • Enhanced the logic for setting gas prices, including better support for EIP1559 and more efficient handling of gas price parameters.
  • Chores

    • Updated the default gas bump percentage to better align with current network conditions.

@dwasse dwasse requested a review from trajan0x as a code owner April 1, 2024 19:38
Copy link
Contributor

coderabbitai bot commented Apr 1, 2024

Warning

Rate Limit Exceeded

@dwasse has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 30 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 3477378 and e71d4b7.

Walkthrough

The recent updates aim to enhance gas fee management in the Ethergo project. Changes include dynamic fee calculations to prevent exceeding a set maximum, an increase in the default gas bump percentage for better network alignment, and refined gas price setting logic, especially for EIP1559 support.

Changes

Files Summary
ethergo/chain/gas/cmp.go Introduced dynamic fee cap calculation to prevent exceeding maximum price.
ethergo/submitter/config/... Raised default gas bump percentage from 5% to 10% and added reference link.
ethergo/submitter/submitter.go Refined gas price setting, including EIP1559 support and maximum price cap handling.

🐰✨
In the land of code and ether,
Where transactions flow and mingle,
A rabbit hopped, with changes so clever,
Making gas fees dynamically jingle.
No more shall the fees exceed,
For the rabbit's wisdom leads the deed.
🌟🥕

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 your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added go Pull requests that update Go code size/xs labels Apr 1, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.87817%. Comparing base (bf0e73d) to head (e71d4b7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2412         +/-   ##
===================================================
+ Coverage   46.84711%   46.87817%   +0.03105%     
===================================================
  Files            400         400                 
  Lines          30591       30575         -16     
  Branches          83          83                 
===================================================
+ Hits           14331       14333          +2     
+ Misses         14726       14714         -12     
+ Partials        1534        1528          -6     
Flag Coverage Δ
cctp-relayer 43.53414% <ø> (ø)
committee 62.20028% <ø> (-0.70523%) ⬇️
explorer 24.80122% <ø> (ø)
omnirpc 53.23194% <ø> (ø)
promexporter 75.91241% <ø> (ø)
rfq 29.09708% <ø> (ø)
scribe 52.02703% <ø> (ø)
sin-executor 60.59113% <ø> (ø)
stiprelayer 3.33333% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Apr 1, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: e71d4b7
Status: ✅  Deploy successful!
Preview URL: https://86bf0964.sanguine-fe.pages.dev
Branch Preview URL: https://feat-bump-fee-cap.sanguine-fe.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 4fbad16 and 9ed2dd0.
Files selected for processing (3)
  • ethergo/chain/gas/cmp.go (2 hunks)
  • ethergo/submitter/config/config.go (1 hunks)
  • ethergo/submitter/submitter.go (2 hunks)
Additional Context Used
Additional comments not posted (3)
ethergo/chain/gas/cmp.go (1)

96-102: The logic for updating the GasFeeCap based on the maxPrice comparison is sound. However, it's important to ensure that the logger.Warnf call provides enough context for debugging. Consider including the percentIncrease and baseFee values in the log message for better traceability.

ethergo/submitter/config/config.go (1)

60-61: The update to DefaultGasBumpPercentage from 5 to 10 is clear and aligns with the PR objectives. Ensure that the reference link provided is accessible and relevant to the context.

ethergo/submitter/submitter.go (1)

370-381: The logic for fetching and setting the GasFeeCap and GasTipCap based on EIP1559 support is correctly implemented. However, ensure that the shouldBump flag is used appropriately throughout the function to prevent unnecessary gas price bumps when the maximum configured gas price is reached.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 9ed2dd0 and 3477378.
Files selected for processing (1)
  • ethergo/chain/gas/cmp_test.go (3 hunks)
Additional Context Used
Additional comments not posted (3)
ethergo/chain/gas/cmp_test.go (3)

4-7: The addition of math/big, testing, and time imports, along with the reordering of import statements, aligns with Go conventions and supports the updated logic in the test cases. Good practice to keep standard library and external packages grouped and separated.


410-410: The update of expectedGasFeeCap to big.NewInt(110) in the dynamic transaction test case aligns with the PR's objective of introducing dynamic gas fee calculations. Consider adding a comment explaining the choice of 110 as the new expected value for clarity and future reference.


1-10: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-510]

The changes in cmp_test.go, including the addition of new imports, updates to test cases, and the integration of dynamic gas fee calculation logic, are well-integrated and consistent with the existing codebase. The updates enhance the test coverage and align with the PR's objectives to improve gas fee calculation accuracy and efficiency.

@dwasse dwasse merged commit 0003141 into master Apr 2, 2024
46 of 49 checks passed
@dwasse dwasse deleted the feat/bump-fee-cap branch April 2, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/xs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants