Updated architecture docs are now live!

Example Usage and Deployment

Example Usage and Deployment

  1. Deployment: A script (e.g., DeployGateway.sol) deploys Gateway.sol, assigns DEFAULT_ADMIN_ROLE to a Gnosis Safe, plus APPENDER_ROLE to the aggregator account.

  2. Genesis Batch: The aggregator calls submitBatch with bytes32(0) for prevBatchHash. This finalizes initialization.

  3. Normal Batches: Each L2 block is compressed into a BatchHeader. The aggregator calls submitBatch(header) referencing the current _lastCommitHash.

  4. Fork Creation: If needed, a user with FORKER_ROLE calls forkChain(header, targetForkId). The system abandons irrelevant forks and increments currentForkId.

  5. Pause and Unpause: If an emergency arises, an admin with PAUSER_ROLE calls pause(). No further commits/forks can happen. Once resolved, unpause() is invoked by the UNPAUSER_ROLE.

Last updated

Was this helpful?