ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
281 stars 735 forks source link

4844 prep: Add Ecotone fork check & refactor l1 / data availability cost functions #203

Closed roberto-bayardo closed 9 months ago

roberto-bayardo commented 9 months ago

Description

We intend to introduce EIP-4844 support with Ecotone upgrade, which will require the ability to switch L1 data cost functions when Ecotone is activated. This PR adds ability to check if Ecotone is active, and also refactors the L1CostFunc code to allow L1DataCost functions based on transaction properties other than "RollupDataGas". These abstractions also allow removal of some of the duplicated l1 data cost logic within receipts.go.

Tests

Added a unit test to codify behavior of existing cost function & receipt processing.