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): handle Optimism Ecotone blob fees #352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sylvaincormier
Copy link

Overview

Fixes gas price overestimation issue in the Optimism gas oracle following the Ecotone upgrade which introduced blob fees.

Changes

  • Add OptimismGasComponents struct to track L1/L2 fees
  • Implement proper L1 data posting cost calculation
  • Consider both base fee and blob fee with scalars
  • Fix gas price overestimation issue

Testing

  • Added unit tests covering:
    • Total gas calculation including L2 execution and L1 data fees
    • L2 data cost calculation with mock data
    • Both tests pass and verify correct fee calculations

Impact

This fix ensures accurate gas estimations for Optimism transactions by properly accounting for:

  • Base fee with scalar
  • Blob fee with scalar (new in Ecotone)
  • L2 execution costs

Fixes #336

- Add OptimismGasComponents struct to track L1/L2 fees
- Implement proper L1 data posting cost calculation
- Consider both base fee and blob fee with scalars
- Fix gas price overestimation issue

Fixes polytope-labs#336
@Wizdave97
Copy link
Member

Thanks for this. In the code comments where the gas price calculations are implemented, please add relevant links to the OpStack repo.

}

#[tokio::test]
async fn test_optimism_total_gas_calculation() {
Copy link
Member

Choose a reason for hiding this comment

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

It would be much better to test this using OpSepolia directly

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.

Fix bug in optimism gas oracle
2 participants