Update disputes prioritisation in `dispute-coordinator` (#6130)
* Scraper processes CandidateBacked events * Change definition of best-effort * Fix `dispute-coordinator` tests * Unit test for dispute filtering * Clarification comment * Add tests * Fix logic If a dispute is not backed, not included and not confirmed we don't participate but we do import votes. * Add metrics for refrained participations * Revert "Add tests" This reverts commit 7b8391a087922ced942cde9cd2b50ff3f633efc0. * Revert "Unit test for dispute filtering" This reverts commit 92ba5fe678214ab360306313a33c781338e600a0. * fix dispute-coordinator tests * Fix scraping * new tests * Small fixes in guide * Apply suggestions from code review Co-authored-by:Andrei Sandu <54316454+sandreim@users.noreply.github.com> * Fix some comments and remove a pointless test * Code review feedback * Clarification comment in tests * Some tests * Reference counted `CandidateHash` in scraper * Proper handling for Backed and Included candidates in scraper Backed candidates which are not included should be kept for a predetermined window of finalized blocks. E.g. if a candidate is backed but not included in block 2, and the window size is 2, the same candidate should be cleaned after block 4 is finalized. Add reference counting for candidates in scraper. A candidate can be added on multiple block heights so we have to make sure we don't clean it prematurely from the scraper. Add tests. * Update comments in tests * Guide update * Fix cleanup logic for `backed_candidates_by_block_number` * Simplify cleanup * Make spellcheck happy * Update tests * Extract candidate backing logic in separate struct * Code review feedback * Treat backed and included candidates in the same fashion * Update some comments * Small improvements in test * spell check * Fix some more comments * clean -> prune * Code review feedback * Reword comment * spelling Co-authored-by:
Andrei Sandu <54316454+sandreim@users.noreply.github.com>
Showing
- polkadot/node/core/dispute-coordinator/src/initialized.rs 31 additions, 5 deletionspolkadot/node/core/dispute-coordinator/src/initialized.rs
- polkadot/node/core/dispute-coordinator/src/lib.rs 1 addition, 1 deletionpolkadot/node/core/dispute-coordinator/src/lib.rs
- polkadot/node/core/dispute-coordinator/src/metrics.rs 16 additions, 0 deletionspolkadot/node/core/dispute-coordinator/src/metrics.rs
- polkadot/node/core/dispute-coordinator/src/scraping/candidates.rs 148 additions, 0 deletions.../node/core/dispute-coordinator/src/scraping/candidates.rs
- polkadot/node/core/dispute-coordinator/src/scraping/mod.rs 74 additions, 46 deletionspolkadot/node/core/dispute-coordinator/src/scraping/mod.rs
- polkadot/node/core/dispute-coordinator/src/scraping/tests.rs 241 additions, 9 deletionspolkadot/node/core/dispute-coordinator/src/scraping/tests.rs
- polkadot/node/core/dispute-coordinator/src/tests.rs 356 additions, 35 deletionspolkadot/node/core/dispute-coordinator/src/tests.rs
- polkadot/roadmap/implementers-guide/src/node/disputes/dispute-coordinator.md 6 additions, 3 deletions...plementers-guide/src/node/disputes/dispute-coordinator.md
Please register or sign in to comment