Skip to content

consensus

The consensus crate group implements the OP Stack consensus protocol for Base. The crates derive from the Kona project and handle L1 derivation, P2P networking, gossip, and block sequencing.

CratePackage NamePurpose
clikona-cliConsensus node CLI
derivekona-deriveL1 derivation pipeline
disckona-discPeer discovery
enginekona-engineConsensus engine driver
genesiskona-genesisGenesis state and chain configuration
gossipkona-gossipGossip protocol implementation
hardforkskona-hardforksOP Stack hardfork definitions
macroskona-macrosProcedural macros for consensus code
peerskona-peersPeer management
protocolbase-protocolBase-specific protocol extensions
providers-alloykona-providers-alloyAlloy-based data providers for L1/L2
registrykona-registryChain and rollup configuration registry
rpcbase-consensus-rpcConsensus RPC endpoints
servicekona-node-serviceConsensus node service orchestration
sourceskona-sourcesData source abstractions for derivation

The consensus layer runs independently from the execution layer, communicating via the Engine API. It:

  1. Connects to L1 Ethereum to read rollup data (sources, providers-alloy)
  2. Derives L2 blocks from L1 data using the derivation pipeline (derive)
  3. Manages P2P networking for block gossip (gossip, disc, peers)
  4. Drives the consensus engine that feeds payloads to the execution layer (engine)
  5. Handles chain configuration and hardfork activation (genesis, hardforks, registry)

The base-consensus binary (in bin/consensus) runs this layer.

crates/consensus/