-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add congestion price oracle contract #908
Description
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: uint256owner: address
- Functions:
getCongestionPrice()- RETURNS
congestionPrice
- RETURNS
setCongestionPrice(newCongestionPrice: uint256)- REQUIRES
msg.senderis equal toowner - SETS
congestionPriceto the suppliednewCongestionPrice
- REQUIRES
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.