Purpose and Scope
This document describes the consensus mechanism and block production process of StableNet.It covers the Anzeon WBFT consensus protocol, the block production pipeline, validator management, and the application of the gas tip policy. For details on the validator governance contract, see Validator Governance (GovValidator). For transaction processing within a block, see Transaction Processing.
Consensus Architecture Overview
StableNet uses the Anzeon WBFT consensus engine, which is a Proof-of-Authority (PoA) variant of the Wemix Byzantine Fault Tolerance protocol.The consensus layer coordinates with the block production layer (Worker) to create, validate, and finalize blocks.
System Components
Anzeon WBFT Consensus Protocol
Protocol Characteristics
Anzeon WBFT is the application of the WBFT consensus algorithm tailored for StableNet. Its key characteristics are as follows:| Property | Value |
|---|---|
| Type | Byzantine Fault Tolerant (BFT) |
| Model | Proof-of-Authority (PoA) |
| Block Time | 1 second (configurable) |
| Finality | Deterministic, immediate |
| Signature Scheme | BLS (Boneh–Lynn–Shacham) |
| Fault Tolerance | Up to f = ⌊(n-1)/3⌋ Byzantine validators |
| Epoch Length | 10 blocks (configurable) |
Differences from Standard WBFT
Anzeon WBFT removes several features from the original WBFT implementation to align with StableNet’s stablecoin-oriented design. Key Modifications- No staking requirement: Validators are managed purely through governance voting, without token deposits
- No block rewards: Validators earn only transaction fees, preserving a 1:1 stablecoin peg
- Anzeon fork enabled: Anzeon is active from the genesis block
- BLS key storage change: Moved from the
GovStakingcontract to theGovValidatorcontract - Removed governance contracts:
GovStaking,GovConfig,GovNCP, andGovRewardeeImpare not used
Consensus Configuration
Anzeon configuration is defined in the genesis block. Configuration Structureanzeon.wbft: Core consensus parameters (epoch length, block period, timeouts)anzeon.init: Initial validator set active during epoch 0anzeon.systemContracts.govValidator: Validator governance parameters, including the validator set from epoch 1 onward
init.validators applies only to the first epoch.The
govValidator.validators parameter defines the active validator set starting from epoch 1.
Block Finalization Flow
WBFT consensus follows a two-phase commit protocol (PREPARE and COMMIT) with BLS signature aggregation for efficiency.A block is considered finalized and irreversible once
2f+1 validators (where f is the maximum number of tolerated Byzantine faults) have signed both phases.
Block Production Pipeline
The Worker component (miner/worker.go) is responsible for assembling and producing blocks.It coordinates transaction selection, state transitions, and integration with the consensus engine.
Worker Architecture
Worker Event Loop (WBFT Mode)
In WBFT mode, the worker uses a simplified event loop compared to standard Ethereum mining. Key Differences from Standard Mining- No periodic re-commit: Standard Ethereum miners periodically rebuild blocks to include higher-fee transactions, whereas WBFT relies on consensus timing
- Consensus-driven timing: The
readyToCommitChsignal is emitted by the WBFT engine when it is time to produce a block - Round-based: Each consensus round triggers exactly one block production attempt
Block Assembly Process
ThecommitWork() function orchestrates the entire block assembly process.
Core Functions
commitWork(interrupt, timestamp): Main coordinator, handles interrupt signalsgenerateWork(params): Builds the execution environment and statecommitTransactions(txs, coinbase): Applies transactions sequentially while respecting the gas limitcommit(env, interval): Submits work to the consensus engine for finalization
Transaction Selection and Ordering
Transaction Selection Algorithm- Fetch pending transactions: Retrieve all transactions from the pool that satisfy the minimum gas tip requirement
- Local priority: Local transactions are processed first
- Gas tip application: In Anzeon mode, regular accounts must use the gas tip defined by
GovValidator, while authorized accounts may specify a custom tip - Nonce ordering: Transactions must be processed sequentially by nonce within each account
- Price ordering: Across accounts, transactions with higher effective gas prices have priority
- Gas limit enforcement: Stop when the block gas limit is reached
Gas Tip Management
StableNet’s gas tip policy is enforced through the Worker’s integration with theGovValidator contract.
Implementation Details
- Initialization: The Worker reads the gas tip from
GovValidatorduring creation - Callback registration: The blockchain registers
updateGasTipFromContractas a callback after each block import - Synchronization: The Worker’s internal
tipfield and the transaction pool’s minimum price are updated together - Lock-free updates: The callback only updates state, avoiding lock contention with the Worker’s main loop
Validator Management
Key Management
StableNet validators use three keys for governance, block production, and consensus messaging.For detailed descriptions of each key’s role, usage, and derivation, see Validator Operations.
Validator Registration and Rotation
Validator Set Updates- Epoch blocks: Validator set changes are applied only at epoch blocks
- Contract reads: When producing an epoch block, the WBFT engine reads the current validator list from
GovValidator - Member versioning: The
memberVersionfield tracks changes, and the WBFT engine detects updates by comparing versions - Immediate effect: Once a new epoch starts, the validator set remains fixed for the duration of that epoch
Genesis vs Runtime Validator Sets
StableNet supports two validator set specifications in its genesis configuration. Important Configuration Notes- Epoch 0: The validator set active from block 1 to the first epoch block is defined by
anzeon.init.validators - Epoch 1+: From block
epochLength + 1, the validator set is read from thevalidatorsparameter of theGovValidatorcontract - Best practice: Unless a controlled validator migration is intended, these two lists should be identical
Integration Points
Worker–WBFT Integration
The Worker and the WBFT engine coordinate through a callback-based mechanism. Code Flow- Startup:
eth.StartMining()callsminer.Start(), which invokesworker.start() - Engine start:
worker.start()callswbftEngine.Start()with thereadyToCommitcallback - Consensus trigger: When the WBFT core determines it is time to propose a block, it calls
readyToCommit(round) - Block creation: The callback signals
readyToCommitCh, triggeringcommitWork() - Sealing: The assembled block is sent to
engine.Seal()for consensus processing
Miner Initialization
The miner is initialized during Ethereum backend setup. Anzeon-Specific Settings- Forced etherbase: In Anzeon mode, the etherbase is automatically set to the node key–derived address and cannot be configured by the user
- Gas tip initialization: The Worker reads the initial gas tip from
GovValidatorduring configuration
Summary
StableNet’s consensus and block production system has the following characteristics:- Deterministic finality: Anzeon WBFT provides immediate, irreversible finality through BFT consensus
- Governance-driven validators: Validator sets are fully managed by on-chain governance via the
GovValidatorcontract - Stablecoin-aligned economics: No block rewards, no token burning, validators earn only transaction fees
- Dynamic gas tip policy: Network-wide gas tips enforced and automatically updated by
GovValidator - Key security model: Separation of governance, block production, and consensus signing keys
- Epoch-based rotation: Validator set changes are applied only at epoch blocks for stability

