Core Components
Sui’s architecture consists of several interconnected layers that work together to process and finalize transactions:Authority State
TheAuthorityState is the central component of a Sui validator node. It manages transaction processing, object storage, and coordination with consensus.
The AuthorityState is defined in
crates/sui-core/src/authority.rs and serves as the primary interface for transaction execution and validation.Key Responsibilities
- Transaction Validation: Verifies transaction signatures, checks object ownership, and validates gas budgets
- Object Management: Tracks object versions and ownership through the Authority Store
- Execution Coordination: Routes transactions to the appropriate execution path (simple vs. consensus)
- Checkpoint Participation: Signs and aggregates checkpoint summaries
Per-Epoch Isolation
Sui maintains separate storage per epoch through theAuthorityPerEpochStore:
- Committee configuration
- Protocol version and configuration
- Consensus state
- Transaction processing state
Storage Architecture
Sui uses a multi-layered storage system optimized for different access patterns:Authority Store
Permanent storage for objects, transactions, and effects:- Objects Table: Stores the current version of all objects
- Transactions Table: Stores signed transaction data
- Effects Table: Stores transaction execution results
- Locks Table: Manages object locks for transaction execution
The Authority Store uses RocksDB for persistent storage, with custom optimizations for point lookups and range scans.
Execution Cache
The execution cache provides fast access to frequently used data:- Reduces database reads for hot objects
- Enables fast transaction lookups
- Supports efficient checkpoint building
Checkpoint Store
Stores certified checkpoints and their contents:- Maps checkpoint sequence numbers to certified summaries
- Stores full checkpoint contents for state sync
- Maintains epoch boundaries and watermarks
Transaction Processing Pipeline
Simple Transactions
Transactions that only access owned objects can be processed immediately:- Validation: Check signatures, gas, and object ownership
- Execution: Run the Move transaction and produce effects
- Certification: Collect validator signatures on effects
- Finalization: Update object versions and notify clients
Consensus Transactions
Transactions accessing shared objects must go through consensus:- Submission: Client submits transaction to validators
- Consensus Ordering: Transaction is sequenced through the DAG
- Scheduling: Consensus handler assigns object versions
- Execution: Transaction executes with assigned versions
- Checkpoint Inclusion: Results are included in the next checkpoint
Network Architecture
Validator Network
Validators communicate through two main networks: Consensus Network (Anemo-based):- DAG block propagation
- Commit vote exchange
- Low-latency block streaming
- Checkpoint distribution
- Object synchronization
- Catch-up for slow validators
Client-Validator Communication
Clients interact with validators through:- JSON-RPC: Read queries and transaction submission
- gRPC: High-performance transaction execution API
- WebSocket: Real-time event subscriptions
Execution Model
Sui uses a sophisticated execution scheduler to maximize throughput:Parallel Execution
TheExecutionScheduler analyzes transaction dependencies and executes non-conflicting transactions in parallel:
Congestion Control
Sui implements per-object congestion tracking to prevent hotspots:- Monitors transaction throughput per shared object
- Applies backpressure when objects are overloaded
- Defers transactions that would exceed capacity
Congestion control is enabled through the
PerObjectCongestionControlMode protocol configuration.State Synchronization
Validators synchronize state through checkpoints:- Checkpoint Building: Validators build checkpoints from executed transactions
- Certification: Validators sign checkpoint summaries
- Distribution: Certified checkpoints are shared across the network
- Execution: Lagging validators execute checkpoint contents to catch up
Global State Hashing
TheGlobalStateHasher maintains a cryptographic commitment to the entire object state:
- Uses accumulator-based hashing for efficient updates
- Enables state sync verification
- Supports light client proofs
Monitoring and Metrics
Sui exposes comprehensive metrics for monitoring:- Transaction Metrics: Throughput, latency, error rates
- Consensus Metrics: Round progression, commit latency
- Storage Metrics: Database sizes, cache hit rates
- Network Metrics: Peer connectivity, message rates
Key Implementation Files
- Authority State:
crates/sui-core/src/authority.rs - Authority Store:
crates/sui-core/src/authority/authority_store.rs - Execution Cache:
crates/sui-core/src/execution_cache/ - Checkpoint System:
crates/sui-core/src/checkpoints/mod.rs - Consensus Integration:
crates/sui-core/src/consensus_adapter.rs