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-oracle): fetch base fee from the latest L1 block #920

Merged
merged 11 commits into from
Sep 5, 2023

Conversation

colinlyguo
Copy link
Member

@colinlyguo colinlyguo commented Sep 4, 2023

Purpose or design rationale of this PR

Previously, the gas oracle sender utilized the base fee of the most recently finalized block to update the L2 gas oracle's recommended L1 gas price. This method caused a delay of at least 12.8 minutes, which is equivalent to 2 epochs.

In this PR, we have optimized the process to reduce this delay.

Key Changes:

  1. The L1 watcher now extracts the base fee from the most recent L1 block.
  2. When reorgs, soft-delete the outdated block and insert the new one.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • fix: A bug fix

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

@colinlyguo colinlyguo self-assigned this Sep 4, 2023
@colinlyguo colinlyguo changed the title fix(gas-oracle): fetch base fee of the latest block fix(gas-oracle): fetch base fee from the latest L1 block Sep 4, 2023
@colinlyguo colinlyguo marked this pull request as ready for review September 4, 2023 07:11
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Merging #920 (1813fec) into develop (f4663fd) will increase coverage by 0.35%.
The diff coverage is 57.14%.

❗ Current head 1813fec differs from pull request most recent head 6a442e2. Consider uploading reports for the commit 6a442e2 to get more accurate results

@@             Coverage Diff             @@
##           develop     #920      +/-   ##
===========================================
+ Coverage    49.23%   49.59%   +0.35%     
===========================================
  Files           95       95              
  Lines         9899     9906       +7     
===========================================
+ Hits          4874     4913      +39     
+ Misses        4619     4580      -39     
- Partials       406      413       +7     
Flag Coverage Δ
rollup 63.34% <57.14%> (+1.14%) ⬆️

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

Files Changed Coverage Δ
rollup/internal/orm/l1_block.go 65.00% <57.14%> (+65.00%) ⬆️

georgehao
georgehao previously approved these changes Sep 4, 2023
@colinlyguo colinlyguo added the bump-version Bump the version tag for deployment label Sep 4, 2023
georgehao
georgehao previously approved these changes Sep 5, 2023
@georgehao georgehao merged commit 25b956f into develop Sep 5, 2023
@georgehao georgehao deleted the fix-gas-oracle-delay branch September 5, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-version Bump the version tag for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants