# anza-xyz/agave architecture

> Architecture diagram of the GitHub repository anza-xyz/agave, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anza-xyz/agave
- Repository: https://github.com/anza-xyz/agave

## Overview

Agave is a Rust-based Solana validator and its supporting node software. The main product workflow is transaction ingress and banking, followed by ledger persistence and replay/consensus; account state and snapshots support that operation. The tree also exposes RPC, gossip, validator administration, and Geyser plugin capabilities. The available excerpts are mostly storage-focused, so several major runtime stages are represented from the source index and tree, while unsupported control-flow links are omitted.

Main entry points: [`core/src/validator.rs`](https://github.com/anza-xyz/agave/blob/master/core/src/validator.rs) (Validator Process), [`core/src/replay_stage.rs`](https://github.com/anza-xyz/agave/blob/master/core/src/replay_stage.rs) (Ledger Replay), [`accounts-db/src/accounts_db.rs`](https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_db.rs) (Accounts Database), [`core/src/banking_stage.rs`](https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage.rs) (Banking Stage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Validator Runtime"]
  node_validator["Validator Process<br/>[validator.rs]"]
  node_ingress["Transaction Ingress<br/>[tpu.rs]"]
  node_banking["Banking Stage<br/>[banking_stage.rs]"]
  node_consumer["Transaction Consumer<br/>[consumer.rs]"]
  node_scheduler["Transaction Scheduler"]
  node_consensus["Fork Choice<br/>[consensus.rs]"]
  node_replay["Ledger Replay<br/>[replay_stage.rs]"]
end

subgraph group_state["Accounts and Snapshots"]
  node_ledger[("Blockstore<br/>[blockstore.rs]")]
  node_accounts[("Accounts Database<br/>[accounts_db.rs]")]
  node_account_index["Accounts Index<br/>[accounts_index.rs]"]
  node_account_storage[("Account Storage<br/>[account_storage.rs]")]
  node_snapshot["Snapshot Serialization<br/>[serde_snapshot.rs]"]
  node_snapshot_rebuild["Storage Rebuilder"]
  node_storage_list["Snapshot Storage List<br/>[storages_list.rs]"]
end

subgraph group_network["Network and API"]
  node_gossip["Cluster Gossip<br/>[gossip_service.rs]"]
  node_rpc["RPC Service<br/>[rpc_service.rs]"]
end

subgraph group_ops["Operations and Extensions"]
  node_cli["Command Line<br/>[main.rs]"]
  node_geyser["Geyser Plugins"]
end

node_operator(("Node Operator"))

node_operator -.->|"runs"| node_validator
node_banking -->|"uses"| node_consumer
node_banking -->|"uses"| node_scheduler
node_account_index -.->|"supports"| node_accounts
node_account_index -.->|"indexes"| node_account_storage
node_account_storage -->|"managed by"| node_accounts
node_snapshot -->|"uses"| node_storage_list
node_snapshot_rebuild -->|"reads formats"| node_snapshot
node_snapshot_rebuild -->|"rebuilds from"| node_storage_list
node_validator -.->|"configures"| node_ingress
node_validator -.->|"configures"| node_consensus
node_validator -.->|"configures"| node_replay
node_validator -.->|"starts"| node_gossip
node_validator -.->|"starts"| node_rpc
node_validator -.->|"can enable"| node_geyser
node_cli -.->|"can query"| node_rpc
node_replay -.->|"reads"| node_ledger
node_replay -.->|"updates"| node_accounts

click node_validator "https://github.com/anza-xyz/agave/blob/master/core/src/validator.rs"
click node_ingress "https://github.com/anza-xyz/agave/blob/master/core/src/tpu.rs"
click node_banking "https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage.rs"
click node_consumer "https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage/consumer.rs"
click node_scheduler "https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs"
click node_consensus "https://github.com/anza-xyz/agave/blob/master/core/src/consensus.rs"
click node_replay "https://github.com/anza-xyz/agave/blob/master/core/src/replay_stage.rs"
click node_ledger "https://github.com/anza-xyz/agave/blob/master/ledger/src/blockstore.rs"
click node_accounts "https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_db.rs"
click node_account_index "https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_index.rs"
click node_account_storage "https://github.com/anza-xyz/agave/blob/master/accounts-db/src/account_storage.rs"
click node_snapshot "https://github.com/anza-xyz/agave/blob/master/runtime/src/serde_snapshot.rs"
click node_snapshot_rebuild "https://github.com/anza-xyz/agave/blob/master/runtime/src/snapshot_utils/snapshot_storage_rebuilder.rs"
click node_storage_list "https://github.com/anza-xyz/agave/blob/master/runtime/src/serde_snapshot/storages_list.rs"
click node_gossip "https://github.com/anza-xyz/agave/blob/master/gossip/src/gossip_service.rs"
click node_rpc "https://github.com/anza-xyz/agave/blob/master/rpc/src/rpc_service.rs"
click node_cli "https://github.com/anza-xyz/agave/blob/master/cli/src/main.rs"
click node_geyser "https://github.com/anza-xyz/agave/blob/master/geyser-plugin-manager/src/geyser_plugin_manager.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_validator,node_ingress,node_banking,node_consumer,node_scheduler,node_consensus,node_replay toneBlue
class node_ledger,node_accounts,node_account_index,node_account_storage,node_snapshot,node_snapshot_rebuild,node_storage_list toneAmber
class node_gossip,node_rpc toneMint
class node_cli,node_geyser toneRose
class node_operator toneIndigo
```

## Components

### Validator Runtime

- [Validator Process](https://github.com/anza-xyz/agave/blob/master/core/src/validator.rs): `core/src/validator.rs`
- [Transaction Ingress](https://github.com/anza-xyz/agave/blob/master/core/src/tpu.rs): `core/src/tpu.rs`
- [Banking Stage](https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage.rs): `core/src/banking_stage.rs`
- [Transaction Consumer](https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage/consumer.rs): `core/src/banking_stage/consumer.rs`
- [Transaction Scheduler](https://github.com/anza-xyz/agave/blob/master/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs): `core/src/banking_stage/transaction_scheduler/scheduler_controller.rs`
- [Fork Choice](https://github.com/anza-xyz/agave/blob/master/core/src/consensus.rs): `core/src/consensus.rs`
- [Ledger Replay](https://github.com/anza-xyz/agave/blob/master/core/src/replay_stage.rs): `core/src/replay_stage.rs`

### Accounts and Snapshots

- [Blockstore](https://github.com/anza-xyz/agave/blob/master/ledger/src/blockstore.rs): `ledger/src/blockstore.rs`
- [Accounts Database](https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_db.rs): `accounts-db/src/accounts_db.rs`
- [Accounts Index](https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_index.rs): `accounts-db/src/accounts_index.rs`
- [Account Storage](https://github.com/anza-xyz/agave/blob/master/accounts-db/src/account_storage.rs): `accounts-db/src/account_storage.rs`
- [Snapshot Serialization](https://github.com/anza-xyz/agave/blob/master/runtime/src/serde_snapshot.rs): `runtime/src/serde_snapshot.rs`
- [Storage Rebuilder](https://github.com/anza-xyz/agave/blob/master/runtime/src/snapshot_utils/snapshot_storage_rebuilder.rs): `runtime/src/snapshot_utils/snapshot_storage_rebuilder.rs`
- [Snapshot Storage List](https://github.com/anza-xyz/agave/blob/master/runtime/src/serde_snapshot/storages_list.rs): `runtime/src/serde_snapshot/storages_list.rs`

### Network and API

- [Cluster Gossip](https://github.com/anza-xyz/agave/blob/master/gossip/src/gossip_service.rs): `gossip/src/gossip_service.rs`
- [RPC Service](https://github.com/anza-xyz/agave/blob/master/rpc/src/rpc_service.rs): `rpc/src/rpc_service.rs`

### Operations and Extensions

- [Command Line](https://github.com/anza-xyz/agave/blob/master/cli/src/main.rs): `cli/src/main.rs`
- [Geyser Plugins](https://github.com/anza-xyz/agave/blob/master/geyser-plugin-manager/src/geyser_plugin_manager.rs): `geyser-plugin-manager/src/geyser_plugin_manager.rs`

### Other components

- **Node Operator**

## Connections

- Node Operator → Validator Process: runs
- Banking Stage → Transaction Consumer: uses (evidence: `core/src/banking_stage.rs`)
- Banking Stage → Transaction Scheduler: uses (evidence: `core/src/banking_stage.rs`)
- Accounts Index → Accounts Database: supports
- Accounts Index → Account Storage: indexes
- Account Storage → Accounts Database: managed by (evidence: `accounts-db/src/account_storage.rs`)
- Snapshot Serialization → Snapshot Storage List: uses (evidence: `runtime/src/serde_snapshot.rs`)
- Storage Rebuilder → Snapshot Serialization: reads formats (evidence: `runtime/src/snapshot_utils/snapshot_storage_rebuilder.rs`)
- Storage Rebuilder → Snapshot Storage List: rebuilds from (evidence: `runtime/src/snapshot_utils/snapshot_storage_rebuilder.rs`)
- Validator Process → Transaction Ingress: configures
- Validator Process → Fork Choice: configures
- Validator Process → Ledger Replay: configures
- Validator Process → Cluster Gossip: starts
- Validator Process → RPC Service: starts
- Validator Process → Geyser Plugins: can enable
- Command Line → RPC Service: can query
- Ledger Replay → Blockstore: reads
- Ledger Replay → Accounts Database: updates
