hotmint-staking
Staking toolkit for the Hotmint BFT consensus framework.
Provides validator registration, delegation, slashing, unbonding, and reward distribution with a pluggable storage backend.
Features
- Validator management — register/unregister validators with minimum self-stake requirements
- Delegation — delegate and undelegate stake to validators
- Slashing — configurable penalties for double-signing and downtime, applied to both self-stake and delegations
- Unbonding queue — time-locked unstaking with configurable unbonding period
- Rewards — per-block proposer rewards
- Jailing — automatic jailing on slash with configurable jail duration
- Pluggable storage — implement
StakingStorefor any backend; includesInMemoryStakingStorefor testing
Usage
use *;
let config = StakingConfig ;
let store = new;
let mut manager = new;
// Register a validator with self-stake
manager.register_validator.unwrap;
// Delegate stake
manager.delegate.unwrap;
// Slash for misbehavior
manager.slash.unwrap;
// Process unbonding at each block
manager.process_unbonding;
Types
| Type | Description |
|---|---|
StakingManager<S> |
Central manager, generic over storage backend |
StakingConfig |
Configuration (limits, rates, periods) |
ValidatorState |
Validator metadata, stakes, reputation, jail status |
StakeEntry |
A single delegation entry |
UnbondingEntry |
Pending unstake with completion height |
SlashReason |
DoubleSign or Downtime |
SlashResult |
Result of a slash operation |
License
GPL-3.0-only