alloy-rs / op-alloy

Apache License 2.0
28 stars 17 forks source link

[Feature] Avoid Passing RollupConfig in SystemConfig Update Log Processing #99

Open refcell opened 1 week ago

refcell commented 1 week ago

Component

genesis

Describe the feature you would like

PR https://github.com/alloy-rs/op-alloy/pull/97 introduces the op-alloy-genesis crate that contains the SystemConfig. As part of the SystemConfig, it contains functionality to handle update logs. The function signature to process the system config update log (raw bytes) is currently the following:

pub fn update_with_receipts(
    &mut self,
    receipts: &[Receipt],
    rollup_config: &RollupConfig,
    l1_time: u64,
) -> Result<(), SystemConfigUpdateError>

Internally, this update_with_receipts method only uses the rollup_config and l1_time to check if ecotone is active for the gas config update. We should be able to simplify this signature to pre-load the calculation, and simply pass in a boolean if ecotone is active.

pub fn update_with_receipts(&mut self, receipts: &[Receipt], ecotone_active: bool) -> Result<(), SystemConfigUpdateError>

Additional context

No response

refcell commented 1 week ago

[!WARNING]

This will have knock-on effects with kona since it uses this to update the SystemConfig.