Improved dispute votes import in provisioner (#5567)
* Add `DisputeState` to `DisputeCoordinatorMessage::RecentDisputes` The new signature of the message is: ``` RecentDisputes(oneshot::Sender<Vec<(SessionIndex, CandidateHash, DisputeStatus)>>), ``` As part of the change also add `DispiteStatus` to `polkadot_node_primitives`. * Move dummy_signature() in primitives/test-helpers * Enable staging runtime api on Rococo * Implementation * Move disputes to separate module * Vote prioritisation * Duplicates handling * Double vote handling * Unit tests * Logs and metrics * Code review feedback * Fix ACTIVE/INACTIVE separation and update partition names * Add `fn dispute_is_inactive` to node primitives and refactor `fn get_active_with_status()` logic * Keep the 'old' logic if the staging api is not enabled * Fix some comments in tests * Add warning message if there are any inactive_unknown_onchain disputes * Add file headers and remove `use super::*;` usage outside tests * Adding doc comments * Fix test methods names * Fix staging api usage * Fix `get_disputes` runtime function implementation * Fix compilation error * Fix arithmetic operations in tests * Use smaller test data * Rename `RuntimeApiRequest::StagingDisputes` to `RuntimeApiRequest::Disputes` * Remove `staging-client` feature flag * fmt * Remove `vstaging` feature flag * Some comments regarding the staging api * Rename dispute selection modules in provisioner with_staging_api -> prioritized_selection without_staging_api -> random_selection * Comments for staging api * Comments * Additional logging * Code review feedback process_selected_disputes -> into_multi_dispute_statement_set typo In trait VoteType: vote_value -> is_valid * Code review feedback * Fix metrics * get_disputes -> disputes * Get time only once during partitioning * Fix partitioning * Comments * Reduce the number of hardcoded api versions * Code review feedback * Unused import * Comments * More precise log messages * Code review feedback * Code review feedback * Code review feedback - remove `trait VoteType` * Code review feedback * Trace log for DisputeCoordinatorMessage::QueryCandidateVotes counter in vote_selection
Showing
- polkadot/Cargo.lock 2 additions, 0 deletionspolkadot/Cargo.lock
- polkadot/Cargo.toml 0 additions, 1 deletionpolkadot/Cargo.toml
- polkadot/cli/Cargo.toml 0 additions, 1 deletionpolkadot/cli/Cargo.toml
- polkadot/node/core/dispute-coordinator/src/db/v1.rs 1 addition, 1 deletionpolkadot/node/core/dispute-coordinator/src/db/v1.rs
- polkadot/node/core/dispute-coordinator/src/initialized.rs 6 additions, 4 deletionspolkadot/node/core/dispute-coordinator/src/initialized.rs
- polkadot/node/core/dispute-coordinator/src/status.rs 3 additions, 110 deletionspolkadot/node/core/dispute-coordinator/src/status.rs
- polkadot/node/core/dispute-coordinator/src/tests.rs 2 additions, 1 deletionpolkadot/node/core/dispute-coordinator/src/tests.rs
- polkadot/node/core/provisioner/Cargo.toml 1 addition, 4 deletionspolkadot/node/core/provisioner/Cargo.toml
- polkadot/node/core/provisioner/src/disputes/mod.rs 53 additions, 0 deletionspolkadot/node/core/provisioner/src/disputes/mod.rs
- polkadot/node/core/provisioner/src/disputes/prioritized_selection/mod.rs 470 additions, 0 deletions...ore/provisioner/src/disputes/prioritized_selection/mod.rs
- polkadot/node/core/provisioner/src/disputes/prioritized_selection/tests.rs 722 additions, 0 deletions...e/provisioner/src/disputes/prioritized_selection/tests.rs
- polkadot/node/core/provisioner/src/disputes/random_selection/mod.rs 194 additions, 0 deletions...ode/core/provisioner/src/disputes/random_selection/mod.rs
- polkadot/node/core/provisioner/src/error.rs 1 addition, 3 deletionspolkadot/node/core/provisioner/src/error.rs
- polkadot/node/core/provisioner/src/lib.rs 63 additions, 271 deletionspolkadot/node/core/provisioner/src/lib.rs
- polkadot/node/core/provisioner/src/metrics.rs 52 additions, 0 deletionspolkadot/node/core/provisioner/src/metrics.rs
- polkadot/node/core/provisioner/src/onchain_disputes.rs 0 additions, 77 deletionspolkadot/node/core/provisioner/src/onchain_disputes.rs
- polkadot/node/core/provisioner/src/tests.rs 1 addition, 401 deletionspolkadot/node/core/provisioner/src/tests.rs
- polkadot/node/core/runtime-api/src/cache.rs 1 addition, 1 deletionpolkadot/node/core/runtime-api/src/cache.rs
- polkadot/node/core/runtime-api/src/lib.rs 8 additions, 7 deletionspolkadot/node/core/runtime-api/src/lib.rs
- polkadot/node/core/runtime-api/src/tests.rs 5 additions, 9 deletionspolkadot/node/core/runtime-api/src/tests.rs
Please register or sign in to comment