ethereum-optimism / mocktimism

[WIP!] Coordinates two anvil process (L1 and L2) for testing / forking op-stack chains (mocktimism placeholder name)
MIT License
20 stars 7 forks source link

Fork a Network Based on L1 Chain #8

Closed roninjin10 closed 10 months ago

roninjin10 commented 10 months ago

Title: Fork a Network Based on L1 Chain Block to Ensure L1-L2 Synchronization

Description

We need to ensure that the L1 and L2 (potentially more than 1) chains are in sync when we initiate a fork. The most straightforward way to achieve this synchronization is by basing our fork on an L1 block. From this L1 block, we will derive the appropriate L2 block to fork. This approach guarantees that both chains are consistent and reflective of one another in the forked environment.

Reasoning

L1 and L2 chains are interdependent, with events and data on the L1 chain influencing the state and behavior of the L2 chain. For accurate testing, debugging, and other operational capabilities, it's crucial that a forked environment maintains this synchronization. For this reason, we base our forks on the L1 chain and derive the corresponding L2 block from there.

Acceptance Criteria