Expand description
Chain operations for Moloch audit chain.
This crate provides chain management without networking:
- Chain state machine (apply/revert blocks)
- Validator registry (PoA consensus)
- Mempool (pending event queue)
- Block producer (timer-based production)
§Architecture
┌─────────────────────────────────────────────────────────┐
│ BlockProducer │
│ (Timer-based block creation from mempool events) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Mempool │
│ (Pending events: priority queue, dedup, expiration) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ ChainState │
│ (Head, height, validator set, apply/revert blocks) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ ValidatorSet │
│ (Authorized sealers, round-robin leader selection) │
└─────────────────────────────────────────────────────────┘Structs§
- Apply
Result - Result of applying a block.
- Block
Producer - Block producer that creates blocks from mempool events.
- Chain
Config - Chain configuration parameters.
- Chain
Snapshot - A lightweight snapshot of chain state.
- Chain
State - Current state of the audit chain.
- Concurrent
Mempool - Lock-free concurrent mempool for pending audit events.
- Concurrent
Mempool Config - Configuration for the concurrent mempool.
- Concurrent
Mempool Stats - Statistics for the concurrent mempool.
- Mempool
- Mempool for pending events.
- Mempool
Config - Configuration for the mempool.
- Mempool
Entry - An entry in the mempool.
- Producer
Config - Configuration for the block producer.
- Slashing
Evidence - Evidence of validator misbehavior (for slashing).
- Validator
Change - A pending validator set change.
- Validator
Set - A set of validators authorized to produce blocks.
Enums§
- Chain
Error - Errors specific to chain state operations.
- Misbehavior
Kind - Types of validator misbehavior.
- Validator
Change Kind - Type of validator set change.