Overview
The Fenines consensus layer implements a Hybrid Proof-of-Authority (PoA) mechanism named Fenine, which combines deterministic block production with smart contract-governed validator selection. This architecture decouples consensus validation from validator governance, enabling dynamic validator sets without protocol-level modifications.Consensus Type: Proof-of-Authority (PoA)
Signature Algorithm: ECDSA (secp256k1)
Block Time: 3 seconds ()
Epoch Length: 200 blocks ()
Signature Algorithm: ECDSA (secp256k1)
Block Time: 3 seconds ()
Epoch Length: 200 blocks ()
Consensus Engine Architecture
Core Components
The Fenine consensus engine consists of four primary modules:Mathematical Foundation
1. In-Turn Block Production
Validators produce blocks in a deterministic round-robin schedule defined by: where:- = Block at height
- = Ordered validator set from FenineSystem contract
- = Cardinality of active validators ()
2. Difficulty Assignment
Block difficulty encodes the in-turn status:Difficulty serves as a tie-breaker during chain reorganizations, not a computational puzzle. Fenine uses signature verification, not hash-based mining.
3. Signature Verification
Each block header contains an ECDSA signature in theextraData field:
Signature verification ensures:
where:
- = 65-byte ECDSA signature (R, S, V)
- = Keccak256 hash of block header (excluding signature)
Block Production Protocol
Timing Model
Block production follows strict timing constraints to prevent network partitioning: where:Seal Algorithm
1
Header Preparation
2
Hash Computation
Compute block hash without signature:
3
Signature Generation
Sign the hash using validator’s private key:
4
Signature Embedding
Replace placeholder with actual signature:
Anti-Split-Brain Protection
To prevent simultaneous node startup from creating chain splits, Fenine implements a random delay: This ensures statistical convergence to a single canonical chain within: blocks, where .Snapshot System
Snapshot Data Structure
Snapshots cache validator sets to avoid repeated contract reads:Snapshot Evolution
Snapshots evolve through the chain via theapply() function:
where:
Snapshot Persistence
Snapshots are persisted to disk at checkpoint intervals to enable fast sync: Database key schema:LRU Caching Strategy
In-memory caching follows a dual-LRU architecture:
Cache hit rate analysis:
For and , hit rate exceeds 99% for lookbacks.
System Transaction Mechanism
Epoch Boundary Protocol
At every epoch block (), three system transactions execute atomically:1
updateValidatorCandidates()
Purpose: Refresh active validator set from contract stateFunction Selector:
0x3c1cc290Effect: Synchronizes with 2
distributeBlockReward(uint256)
Purpose: Distribute epoch rewards to validatorsFunction Selector:
0x9a2e5597Reward Calculation:Distribution:3
syncRewardState()
Purpose: Activate pending reward changesFunction Selector:
0x4d73a62aState Transition:System Transaction Properties
System transactions have special characteristics:Header Verification Rules
Comprehensive Verification
TheverifyHeader() function enforces 12 consensus rules:
1. Uncle Hash
1. Uncle Hash
2. Coinbase (Signer Recovery)
2. Coinbase (Signer Recovery)
3. Timestamp Monotonicity
3. Timestamp Monotonicity
4. Block Time Constraint
4. Block Time Constraint
5. Nonce Check
5. Nonce Check
0x0000000000000000 (no voting in Fenine).6. ExtraData Length
6. ExtraData Length
7. Mix Digest
7. Mix Digest
8. Difficulty
8. Difficulty
9. Signature Validity
9. Signature Validity
11. Recent Signer Check
11. Recent Signer Check
12. Gas Limit Validation
12. Gas Limit Validation
Block Difficulty Calculation
CalcDifficulty Algorithm
In-Turn Status Determination
where:- = Block number
- = Signer address
- = Sorted validator set (lexicographic order)
Lexicographic Ordering
Validators are sorted by address to ensure determinism:Finality Semantics
Probabilistic Finality
Fenine provides probabilistic finality based on confirmation depth: where is the number of confirmations.Recommended Confirmations:
- Small transactions: 3 blocks (9s)
- Medium value: 6 blocks (18s)
- High value: 12 blocks (36s)
Economic Finality
For transactions exceeding , required confirmations: where is the minimum validator stake (10,000 FEN).Chain Reorganization Handling
Fork Choice Rule
During competing chains, selection follows: where:- Prefer chain with higher cumulative difficulty
- Tie-break by chain length
- Tie-break by lexicographically smallest block hash
Reorg Protection
Maximum reorganization depth is bounded by: Beyond 128 blocks, snapshots are checkpointed and considered immutable.Performance Metrics
Block Production Latency
End-to-end block production time decomposition: Typical values:Throughput Characteristics
Theoretical limits:Consensus Safety Guarantees
Byzantine Fault Tolerance
Safety threshold: where:- = Number of Byzantine validators
- = Total active validators
Liveness Guarantee
Chain progresses if: Even a single honest validator ensures liveness (though centralization risk).Censorship Resistance
Transaction inclusion probability after blocks: For (30% adversarial):- : 70% chance
- : 97.3% chance
- : 99.76% chance
Related Topics
System Contracts
FenineSystem contract specification
FPoS Economics
Validator selection and rewards
Security Model
Attack vectors and mitigations
Network Parameters
Configurable consensus constants