Dispute Coordinator Subsystem (#3150)
* skeleton for dispute-coordinator * add coordinator and participation message types * begin dispute-coordinator DB * functions for loading * implement strongly-typed DB transaction * add some tests for DB transaction * core logic for pruning * guide: update candidate-votes key for coordinator * update candidate-votes key * use big-endian encoding for session, and implement upper bound generator * finish implementing pruning * add a test for note_current_session * define state of the subsystem itself * barebones subsystem definition * control flow * more control flow * implement session-updating logic * trace * control flow for message handling * Update node/core/dispute-coordinator/src/lib.rs Co-authored-by:André Silva <123550+andresilva@users.noreply.github.com> * Update node/subsystem/src/messages.rs Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com> * some more control flow * guide: remove overlay * more control flow * implement some DB getters * make progress on importing statements * add SignedDisputeStatement struct * move ApprovalVote to shared primitives * add a signing-payload API to explicit dispute statements * add signing-payload to CompactStatement * add relay-parent hash to seconded/valid dispute variatns * correct import * type-safe wrapper around dispute statements * use checked dispute statement in message type * extract rolling session window cache to subsystem-util * extract session window tests * approval-voting: use rolling session info cache * reduce dispute window to match runtime in practice * add byzantine_threshold and supermajority_threshold utilities to primitives * integrate rolling session window * Add PartialOrd to CandidateHash * add Ord to CandidateHash * implement active dispute update * add dispute messages to AllMessages * add dispute stubs to overseer * inform dispute participation to participate * implement issue_local_statement * implement `determine_undisputed_chain` * fix warnings * test harness for dispute coordinator tests * add more helpers to test harness * add some more helpers * some tests for dispute coordinator * ignore wrong validator indices * test finality voting rule constraint * add more tests * add variants to network bridge * fix test compilation * remove most dispute coordinator functionality as of #3222 we can do most of the work within the approval voting subsystem * Revert "remove most dispute coordinator functionality" This reverts commit 9cd615e8eb6ca0b382cbaff525d813e753d6004e. * Use thiserror Co-authored-by:
Bernhard Schuster <bernhard@ahoi.io> * Update node/core/dispute-coordinator/src/lib.rs Co-authored-by:
Bernhard Schuster <bernhard@ahoi.io> * extract tests to separate module * address nit * adjust run_iteration API Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by:
Bernhard Schuster <bernhard@ahoi.io>
Showing
- polkadot/Cargo.lock 25 additions, 0 deletionspolkadot/Cargo.lock
- polkadot/Cargo.toml 1 addition, 0 deletionspolkadot/Cargo.toml
- polkadot/core-primitives/src/lib.rs 1 addition, 1 deletionpolkadot/core-primitives/src/lib.rs
- polkadot/node/core/approval-voting/src/import.rs 48 additions, 535 deletionspolkadot/node/core/approval-voting/src/import.rs
- polkadot/node/core/approval-voting/src/lib.rs 8 additions, 23 deletionspolkadot/node/core/approval-voting/src/lib.rs
- polkadot/node/core/approval-voting/src/tests.rs 7 additions, 6 deletionspolkadot/node/core/approval-voting/src/tests.rs
- polkadot/node/core/dispute-coordinator/Cargo.toml 29 additions, 0 deletionspolkadot/node/core/dispute-coordinator/Cargo.toml
- polkadot/node/core/dispute-coordinator/src/db/mod.rs 19 additions, 0 deletionspolkadot/node/core/dispute-coordinator/src/db/mod.rs
- polkadot/node/core/dispute-coordinator/src/db/v1.rs 585 additions, 0 deletionspolkadot/node/core/dispute-coordinator/src/db/v1.rs
- polkadot/node/core/dispute-coordinator/src/lib.rs 649 additions, 0 deletionspolkadot/node/core/dispute-coordinator/src/lib.rs
- polkadot/node/core/dispute-coordinator/src/tests.rs 706 additions, 0 deletionspolkadot/node/core/dispute-coordinator/src/tests.rs
- polkadot/node/network/bridge/src/tests.rs 7 additions, 5 deletionspolkadot/node/network/bridge/src/tests.rs
- polkadot/node/overseer/src/lib.rs 6 additions, 0 deletionspolkadot/node/overseer/src/lib.rs
- polkadot/node/primitives/Cargo.toml 1 addition, 0 deletionspolkadot/node/primitives/Cargo.toml
- polkadot/node/primitives/src/approval.rs 0 additions, 4 deletionspolkadot/node/primitives/src/approval.rs
- polkadot/node/primitives/src/lib.rs 133 additions, 1 deletionpolkadot/node/primitives/src/lib.rs
- polkadot/node/subsystem-util/src/lib.rs 2 additions, 0 deletionspolkadot/node/subsystem-util/src/lib.rs
- polkadot/node/subsystem-util/src/rolling_session_window.rs 635 additions, 0 deletionspolkadot/node/subsystem-util/src/rolling_session_window.rs
- polkadot/node/subsystem/src/messages.rs 75 additions, 2 deletionspolkadot/node/subsystem/src/messages.rs
- polkadot/primitives/src/v0.rs 8 additions, 0 deletionspolkadot/primitives/src/v0.rs
Please register or sign in to comment