Problem Statement / Feature Objective
Validators who misbehave (equivocate, propose invalid blocks, miss too many attestations) must be slashed. A slashing condition verification system must be built that detects misbehavior from on-chain evidence, verifies fraud proofs, computes the slashing amount (proportional to severity), and executes the slashing by burning the validator's stake. A challenge period must allow the accused validator to submit counter-evidence.
Technical Invariants & Bounds
- Slashable offenses: equivocation (2 conflicting blocks at same height), unavailability (missed > 100 attestations in 24h), invalid proposal.
- Evidence submission: anyone can submit
(validator_id, offense_type, evidence: Vec<u8>, bond: u64).
- Fraud proof: for equivocation, evidence = two signed blocks with same height and different hashes.
- Challenge period: 7 days; accused validator can submit counter-evidence; if successful, challenger's bond is slashed.
- Slashing amount: equivocation = 100% of stake; unavailability = 0.1% per missed attestation (max 10%); invalid proposal = 2% of stake.
- Slashed funds: 50% burned, 50% distributed to active validators.
Codebase Navigation Guide
src/consensus/slashing/detector.rs — slashing condition detector.
src/consensus/slashing/evidence.rs — evidence submission and verification.
src/consensus/slashing/challenge.rs — challenge period and counter-evidence.
src/consensus/slashing/executor.rs — stake slashing and fund distribution.
Implementation Blueprint
- Implement
detector.rs: scan for equivocation proposals, monitor attestation inclusion, detect invalid blocks.
- Implement
evidence.rs: accept evidence with bond, verify cryptographic proofs.
- Implement
challenge.rs: 7-day challenge window; if counter-evidence wins, challenger loses bond.
- Implement
executor.rs: burn slashed stake, distribute 50% to active validators.
- Integration test: submit equivocation evidence, fast-forward 7 days, verify slashing execution.
Problem Statement / Feature Objective
Validators who misbehave (equivocate, propose invalid blocks, miss too many attestations) must be slashed. A slashing condition verification system must be built that detects misbehavior from on-chain evidence, verifies fraud proofs, computes the slashing amount (proportional to severity), and executes the slashing by burning the validator's stake. A challenge period must allow the accused validator to submit counter-evidence.
Technical Invariants & Bounds
(validator_id, offense_type, evidence: Vec<u8>, bond: u64).Codebase Navigation Guide
src/consensus/slashing/detector.rs— slashing condition detector.src/consensus/slashing/evidence.rs— evidence submission and verification.src/consensus/slashing/challenge.rs— challenge period and counter-evidence.src/consensus/slashing/executor.rs— stake slashing and fund distribution.Implementation Blueprint
detector.rs: scan for equivocation proposals, monitor attestation inclusion, detect invalid blocks.evidence.rs: accept evidence with bond, verify cryptographic proofs.challenge.rs: 7-day challenge window; if counter-evidence wins, challenger loses bond.executor.rs: burn slashed stake, distribute 50% to active validators.