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

Add congestion price oracle contract #908

Closed
karlfloersch opened this issue May 18, 2021 · 0 comments · Fixed by #906
Closed

Add congestion price oracle contract #908

karlfloersch opened this issue May 18, 2021 · 0 comments · Fixed by #906
Assignees

Comments

@karlfloersch
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The congestion price (used in #823 ) must be propagated to all OE nodes. This will allow replica nodes which sync the sequencer to accurately serve eth_estimateGas requests.

Describe the solution you'd like
Create a smart contract on L2 which exposes the current congestion price and allows a specified off-chain owner to set it:

  • Data Structures:
    • congestionPrice: uint256
    • owner: address
  • Functions:
    • getCongestionPrice()
      • RETURNS congestionPrice
    • setCongestionPrice(newCongestionPrice: uint256)
      • REQUIRES msg.sender is equal to owner
      • SETS congestionPrice to the supplied newCongestionPrice

This contract should be included in the predeploys on L2. The owner should be easily configurable.

Describe alternatives you've considered
Exposing an endpoint in the sequencer rollup_getCongestionPrice. The downside with this approach is it does not scale as cleanly as setting the congestion price in the state because all replicas now need additional information to the rollup chain blocks.

Keeping the congestion price in the state also has the added benefit because in the long term the chain congestion should be tracked in the L2 state & so this is a reasonable first step towards that vision.

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 a pull request may close this issue.

3 participants