Make sure to preserve backing votes (#6382)

* Guide updates

* Consider more dead forks.

* Ensure backing votes don't get overridden.

* Fix spelling.

* Fix comments.

* Update node/primitives/src/lib.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
This commit is contained in:
eskimor
2022-12-07 18:14:13 +01:00
committed by GitHub
parent 1b9f62cd73
commit c748250748
11 changed files with 301 additions and 183 deletions
@@ -216,7 +216,7 @@ where
// Check if votes are within the limit
for (session_index, candidate_hash, selected_votes) in votes {
let votes_len = selected_votes.valid.len() + selected_votes.invalid.len();
let votes_len = selected_votes.valid.raw().len() + selected_votes.invalid.len();
if votes_len + total_votes_len > MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME {
// we are done - no more votes can be added
return result
@@ -393,7 +393,9 @@ impl TestDisputes {
ValidDisputeStatementKind::Explicit,
0,
local_votes_count,
),
)
.into_iter()
.collect(),
invalid: BTreeMap::new(),
},
);