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.
Sub-crates
Section titled “Sub-crates”| Crate | Package Name | Purpose |
|---|---|---|
| cli | kona-cli | Consensus node CLI |
| derive | kona-derive | L1 derivation pipeline |
| disc | kona-disc | Peer discovery |
| engine | kona-engine | Consensus engine driver |
| genesis | kona-genesis | Genesis state and chain configuration |
| gossip | kona-gossip | Gossip protocol implementation |
| hardforks | kona-hardforks | OP Stack hardfork definitions |
| macros | kona-macros | Procedural macros for consensus code |
| peers | kona-peers | Peer management |
| protocol | base-protocol | Base-specific protocol extensions |
| providers-alloy | kona-providers-alloy | Alloy-based data providers for L1/L2 |
| registry | kona-registry | Chain and rollup configuration registry |
| rpc | base-consensus-rpc | Consensus RPC endpoints |
| service | kona-node-service | Consensus node service orchestration |
| sources | kona-sources | Data source abstractions for derivation |
Role in the Architecture
Section titled “Role in the Architecture”The consensus layer runs independently from the execution layer, communicating via the Engine API. It:
- Connects to L1 Ethereum to read rollup data (
sources,providers-alloy) - Derives L2 blocks from L1 data using the derivation pipeline (
derive) - Manages P2P networking for block gossip (
gossip,disc,peers) - Drives the consensus engine that feeds payloads to the execution layer (
engine) - Handles chain configuration and hardfork activation (
genesis,hardforks,registry)
The base-consensus binary (in bin/consensus) runs this layer.