Aller au contenu principal

Code

https://github.com/ethereum-optimism/optimism

Process​


Fault Proof​

https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md#fault-proof-program

A fault proof, also known as fraud proof or interactive game, consists of 3 components:

  • Program: given a commitment to all rollup inputs (L1 data) and the dispute, verify the dispute statelessly.
  • VM: given a stateless program and its inputs, trace any instruction step, and prove it on L1.
  • Interactive Dispute Game: bisect a dispute down to a single instruction, and resolve the base-case using the VM.

VM

The VM emulates the program, as prepared for the VM target architecture, and generates the state-root or instruction proof data as requested through the VM CLI.

Fault Proof VMs:

  • Cannon: big-endian 32-bit MIPS proof, by OP Labs, in active development.
  • Asterisc: little-endian 64-bit RISC-V proof, by @protolambda, in active development.

Interactive Dispute Game

https://github.com/ethereum-optimism/optimism/blob/develop/specs/dispute-game.md

https://github.com/ethereum-optimism/optimism/blob/develop/specs/dispute-game-interface.md

Code​


op-stack codebase has been used in production as the OP-Mainnet went Bedrock upgrade in June, 2023. The codebase has been used in production

├──docs: A collection of documents including audits and post-mortems
├──op-bindings: Go bindings for Bedrock smart contracts.
├──op-batcher: L2-Batch Submitter, submits bundles of batches to L1
├──op-bootnode: Standalone op-node discovery bootnode
├──op-chain-ops: State surgery utilities
├──op-challenger: Dispute game challenge agent
├──op-e2e: End-to-End testing of all bedrock components in Go
├──op-exporter: Prometheus exporter client
├──op-heartbeat: Heartbeat monitor service
├──op-node: rollup consensus-layer client
├──op-program: Fault proof program
├──op-proposer: L2-Output Submitter, submits proposals to L1
├──op-service: Common codebase utilities
├──op-signer: Client signer
├──op-wheel: Database utilities
├──ops-bedrock: Bedrock devnet work
├──packages
│ ├──chain-mon: Chain monitoring services
│ ├──common-ts: Common tools for building apps in TypeScript
│ ├──contracts-ts: ABI and Address constants
│ ├──contracts-bedrock: Bedrock smart contracts
│ ├──core-utils: Low-level utilities that make building Optimism easier
│ └──sdk: provides a set of tools for interacting with Optimism
├──proxyd: Configurable RPC request router and proxy
└──specs: Specs of the rollup starting at the Bedrock upgrade

https://github.com/ethereum-optimism/optimism

op-batcher​

https://github.com/ethereum-optimism/optimism/tree/develop/op-batcher

https://github.com/ethereum-optimism/optimism/blob/develop/specs/batcher.md

https://github.com/ethereum-optimism/optimism/blob/develop/specs/derivation.md#batch-submission

The most minimal batcher implementation can be defined as a loop of the following operations:

  1. See if the unsafe L2 block number is past the safe block number: unsafe data needs to be submitted.
  2. Iterate over all unsafe L2 blocks, skip any that were previously submitted.
  3. Open a channel, buffer all the L2 block data to be submitted, while applying the encoding and compression as defined in the derivation spec.
  4. Pull frames from the channel to fill data transactions with, until the channel is empty.
  5. Submit the data transactions to L1

The L2 view of safe/unsafe does not instantly update after data is submitted, nor when it gets confirmed on L1, so special care may have to be taken to not duplicate data submissions.

op-challenger​

The op-challenger is a modular op-stack challenge agent written in golang for dispute games including, but not limited to, attestation games, fault games, and validity games. To learn more about dispute games, visit the dispute game specs.

op-node​

op-program​

https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md#fault-proof-program

The program consists of:

  • Prologue: load the inputs, given minimal bootstrapping, with possible test-overrides.
  • Main content: process the L2 state-transition, i.e. derive the state changes from the L1 inputs.
  • Epilogue: inspect the state changes to verify the claim.

op-proposer​

packages/contracts-bedrock​