Purpose and Scope
This document provides an overview of StableNet’s core blockchain components and their interaction model. It explains the overall architecture of StableNet by focusing on the roles of each component and the relationships between them. For detailed information on specific subsystems, refer to the following:- Node startup and service registration: Node Initialization and Lifecycle
- Block insertion and chain reorganization: Blockchain Management
- State trie and account management: State Management
- Transaction validation and queues: Transaction Pool
- Transaction data structures: Transaction Types and Encoding
- Block data structures: Block Structure and Encoding
- Consensus mechanisms: Consensus and Block Production
- P2P networking: Networking
- RPC interfaces: RPC and APIs
Architecture Overview
A StableNet node is composed of a layered architecture. At the top sits the node container (node.Node), within which the Ethereum protocol implementation (eth.Ethereum) coordinates core components such as the blockchain, transaction pool, and consensus engine.
Core Components
node.Node — Service Container
The top-level container that manages the lifecycle of all services. It initializes the P2P server, RPC/IPC/WebSocket servers, and databases, and starts and stops registered services in order. It does not contain blockchain logic; instead, it provides the infrastructure layer required to run a node.eth.Ethereum — Ethereum Protocol Implementation
The main service that coordinates core blockchain components. During initialization, it creates and connects the database, blockchain, transaction pool, miner/worker, and consensus engine. It also registers RPC APIs and P2P protocols with the node, enabling external interaction.BlockChain — Canonical Chain Management
The core component responsible for managing the canonical chain. It coordinates block validation, insertion, state execution, and chain reorganization (reorg). Block validity is verified through the consensus engine, while account and storage state are managed via StateDB. Frequently accessed blocks and receipts are cached using LRU caches to optimize query performance. For details, see Blockchain Management.StateDB — State Management
Provides a caching layer on top of the Merkle Patricia Trie to manage account balances, nonces, contract code, and storage. State changes during transaction execution are journaled to support rollback on failure, and snapshots are used to enable fast state queries. For details, see State Management.TxPool — Transaction Pool
Manages pending transactions that have not yet been included in a block. Transactions are received via RPC and P2P, validated for signature, nonce, balance, and gas conditions, and then classified as executable (pending) or future (queued). The pool consists of alegacypool for standard transactions and a blobpool for blob transactions (EIP-4844). For details, see Transaction Pool.
Miner/Worker — Block Production
The block proposer assembles a block candidate by including pending transactions and finalizes it through validator consensus via the consensus engine. The Worker runs four goroutines—mainLoop, newWorkLoop, taskLoop, and resultLoop—to perform transaction selection, block assembly, sealing requests, and result handling in parallel.
consensus.Engine — Consensus Engine
An interface that abstracts block validation and sealing. In StableNet, the Anzeon WBFT consensus engine is used, and it is responsible for block proposal, voting, and seal verification.StableNet-Specific Design
StableNet is based on go-ethereum, but it introduces the following extensions to support stablecoin operations and governance-centric consensus.Anzeon WBFT Consensus
- Governance-based validators: The validator set is determined by voting results from the GovValidator contract; staking is not used.
- No block rewards: There is no inflation from new issuance; validators are rewarded only through transaction fees.
- BLS signature aggregation: BLS aggregated signatures are used for PREPARE/COMMIT consensus messages to reduce verification costs.
- Epoch-based validator updates: Changes to the validator set are applied only at epoch blocks.
Gas Fee Policy
- Governance-controlled gas tip: The minimum gas tip (priority fee) is managed as a network-wide value by the GovValidator contract.
- Approved account exceptions: Accounts approved by governance are allowed to specify custom gas tips.
- Dynamic gas tip propagation: The latest gas tip is synchronized to the worker and transaction pool each time a new block is added to the chain.
Fee Delegation
Using the StableNet-specific transaction type (0x16), the sender and the fee payer can be separated. In this case, ECDSA signatures from both the sender and the fee payer are required.Automatic Etherbase Configuration
In the Anzeon network, the etherbase is automatically derived from the node’s operational key (nodekey) and cannot be manually configured by the user.Initialization Flow Summary
A StableNet node is initialized in the following order:- CLI flag parsing — Load network settings, data directory, and TOML configuration
- Node creation —
node.Nodeprepares P2P, RPC, and database infrastructure - Database opening — Initialize chaindata and ancient (freezer) stores
- Consensus engine creation — Select WBFT/Clique/Ethash based on chain configuration
- Blockchain initialization — Load genesis, create BlockChain, configure snapshots
- Transaction pool setup — Create legacypool and blobpool
- Miner/worker creation — Start goroutines related to block assembly
- API and protocol registration — Register RPC handlers and P2P protocols
- Service startup — Start registered services in order
Data Flow Overview
Transaction Processing Flow
Block Synchronization Flow
Database Structure
The storage layer is composed of the following hierarchy:- ChainDB: A persistent store based on LevelDB or Pebble that stores blocks, receipts, and canonical mappings.
- Ancient Store (Freezer): Separates old block data into an append-only store to manage ChainDB size.
- TrieDB: Manages Merkle Patricia Trie nodes and supports both hash-based and path-based schemes.
- Snapshot: Stores state in a flattened key-value structure to enable fast queries.
Chain Configuration
Chain-specific parameters are defined inparams.ChainConfig and control fork activation points, consensus rules, and network-specific settings.
| Item | Description |
|---|---|
ChainID | Unique chain identifier |
| Fork activation blocks | Block heights at which EIPs are activated |
Anzeon | WBFT consensus parameters and system contract configuration |
BlockPeriod), epoch size (Epoch), and request timeout (RequestTimeout), as well as system contract initialization information.
