Optimism Documentation

repository·develop·Indexed 27 days ago

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

Documentation for the Optimism repository, featuring the OP Stack and Cannon. Cannon is a fault-proof VM consisting of an onchain MIPS64.sol EVM implementation and an offchain Go-based mipsevm emulator for verifying MIPS instruction execution. The repository also includes op-chain-ops for chain setup and deployment, as well as guides for deploying OP Stack L2 rollup testnets using Docker.

Tokens
284.2K
Snippets
519
Records
1.5K
Agent score
89%

What's inside optimism

  1. Overview of kona-mpt

    develop

    kona-mpt is a recursive, in-memory implementation of Ethereum's hexary Merkle Patricia Trie (MPT). It is designed to serve as a backend for stateless Ethereum block executors, such as the kona-executor crate.

    Key capabilities include:

    • Retrieval: Accessing values within the trie.
    • Insertion: Adding new values.
    • Deletion: Removing values.
    • Root Computation: Calculating the trie root and performing Trie Node RLP Encoding.

    To perform operations, you start with a trie root and use a TrieNode to unravel the structure. These operations rely on a TrieProvider to fetch the preimages of hashed trie nodes.

  2. Overview of OP Supernode

    develop
    OP Supernode is a runtime component designed for operators of interop chains. It runs every chain in an interop dependency set as virtual nodes within a single process. This architecture collapses the duplication of running separate op-node instances for every chain by sharing L1 and beacon-chain plumbing, reducing the need for multiple L1/beacon clients and optimizing the derivation pipeline.
  3. Overview of Kona Rust components

    develop

    Kona is the Rust implementation of OP Stack rollup components. The repository contains the following key binaries and crates:

    Binaries

    • bin/client: Fault proof program for prover targets.
    • bin/host: Native preimage-oracle host program.
    • bin/node: Rust rollup-node implementation.
    • bin/kona-cli: (via kona-cli package)

    Crates

    • crates/protocol/*: Protocol types including derivation, genesis, hardfork, interop, and registry.
    • crates/proof/*: Proof SDK, executor, MPT, preimage, and FPVM support.
    • crates/node/*: Rollup-node service, engine, RPC, P2P, and source utilities.
    • crates/providers/* and crates/utilities/*: Shared provider and utility crates.

    Note: OP Stack Alloy extensions are located in the rust/op-alloy directory.

  4. Overview of kona-node

    develop

    kona-node

    kona-node is the Rust implementation of the OP Stack consensus-layer (rollup node) client, part of the Kona project. It performs the following protocol roles:

    • Data Processing: Reads batch data and deposits from the data availability layer.
    • Chain Derivation: Derives the canonical L2 chain.
    • Execution Driving: Drives an execution-layer client (e.g., op-reth) via the Engine API.
    • Networking: Participates in the unsafe-block gossip network.
    • Sequencing: Can be run in sequencer mode by chain operators.

    Note: kona-node is currently in active development and should be considered experimental.

  5. Overview of op-reth execution client

    develop

    op-reth is the OP Stack execution client built on reth. It provides a high-performance execution layer for Optimism and all OP Stack chains.

    Key Features

    • Full OP Stack support: Handles deposit transactions, L2-specific fee handling, and all OP Stack protocol changes.
    • Superchain Registry: Built-in support for all chains in the superchain registry. You can select specific chains using the --chain flag (e.g., --chain unichain, --chain base).
    • High performance: Leverages reth's modular architecture with parallelized execution and efficient storage.
  6. Overview of op-batcher

    develop

    The op-batcher is the OP Stack's batch submitter service. Its primary role is to make an L2 chain's transaction data available by posting it to the data availability (DA) layer.

    Key Functions:

    • Reads unsafe blocks from the sequencer.
    • Compresses blocks into channels and splits them into frames.
    • Submits frames to the DA layer (Ethereum calldata, blobs, or an Alt-DA layer).
    • Automatically selects between calldata and blobs based on current L1 prices.

    Operational Importance:

    • Verifier nodes cannot derive the chain or advance the safe head until op-batcher posts the block data.
    • Batches must land within the chain's sequencing window.
    • During DA backlogs, op-batcher can instruct the block builder to throttle the amount of DA-consuming data included in new L2 blocks.
  7. Overview of op-reth CLI commands

    develop
    The op-reth binary provides a single entry point for both running the execution client and performing operational tasks. The primary command for daily operation is op-reth node. Other subcommands are used for database initialization, importing history, or performing maintenance and diagnostics. Most operational subcommands work against the same data directory and should typically not be run while the node is active.
  8. Overview of Optimism Interop Monitor

    develop
    The Optimism Interop Monitor is an independent watchdog service designed to monitor Executing Messages between OP Protocol chains. Its primary purpose is to detect and report invalid messages to ensure the reliability of cross-chain communication. It functions by reading L2 receipts directly from each chain to perform its own validity checks, rather than relying on external services. The service outputs metrics to Prometheus, which can be used to alert operators of cross-chain communication issues.