Context
The slashing mechanism was directly ported from Scala to Rust as a 1:1 translation. No new design work or modifications were made. Full documentation and test plan are in system-integration (see F1R3FLY-io/system-integration#51).
Rust Source Files
| Component |
File |
| Block validation (17+ checks) |
casper/src/rust/validate.rs |
| InvalidBlock enum |
casper/src/rust/block_status.rs |
| Equivocation detection |
casper/src/rust/equivocation_detector.rs |
| Recording invalid blocks |
casper/src/rust/multi_parent_casper_impl.rs |
| SlashDeploy generation |
casper/src/rust/blocks/proposer/block_creator.rs |
| SlashDeploy execution |
casper/src/rust/util/rholang/costacc/slash_deploy.rs |
| PoS contract |
PoS.rhox (Rholang) |
Known Gaps
1. IgnorableEquivocation DOS Vector
block_status.rs has a TODO:
"Make IgnorableEquivocation slashable again... The above will become a DOS vector if we don't fix."
Equivocations not pulled in as dependencies are ignored rather than slashed. An attacker could flood the network with equivocating blocks without penalty.
2. No Configurable Slashing Parameters
One-strike full forfeiture is hardcoded in the PoS contract. No threshold, no graduated penalties, no cool-down. Whether this needs to change depends on production requirements.
3. No Integration Test Coverage
test_slash.py in system-integration was written for the Scala test infrastructure and is completely broken. Needs full rewrite to use current start_custom_shard infrastructure. See F1R3FLY-io/system-integration#51 for the detailed test porting plan.
4. PoS Multi-Sig Keys
pos-multi-sig-public-keys in defaults.conf are original RChain Coop keys carried over from the port. Should be replaced with F1R3FLY-controlled keys for production.
Co-Authored-By: Claude noreply@anthropic.com
Context
The slashing mechanism was directly ported from Scala to Rust as a 1:1 translation. No new design work or modifications were made. Full documentation and test plan are in system-integration (see F1R3FLY-io/system-integration#51).
Rust Source Files
casper/src/rust/validate.rscasper/src/rust/block_status.rscasper/src/rust/equivocation_detector.rscasper/src/rust/multi_parent_casper_impl.rscasper/src/rust/blocks/proposer/block_creator.rscasper/src/rust/util/rholang/costacc/slash_deploy.rsPoS.rhox(Rholang)Known Gaps
1. IgnorableEquivocation DOS Vector
block_status.rshas a TODO:Equivocations not pulled in as dependencies are ignored rather than slashed. An attacker could flood the network with equivocating blocks without penalty.
2. No Configurable Slashing Parameters
One-strike full forfeiture is hardcoded in the PoS contract. No threshold, no graduated penalties, no cool-down. Whether this needs to change depends on production requirements.
3. No Integration Test Coverage
test_slash.pyin system-integration was written for the Scala test infrastructure and is completely broken. Needs full rewrite to use currentstart_custom_shardinfrastructure. See F1R3FLY-io/system-integration#51 for the detailed test porting plan.4. PoS Multi-Sig Keys
pos-multi-sig-public-keysindefaults.confare original RChain Coop keys carried over from the port. Should be replaced with F1R3FLY-controlled keys for production.Co-Authored-By: Claude noreply@anthropic.com