approval-voting: Make importing of duplicate assignment idempotent (#6971)
Normally, approval-voting wouldn't receive duplicate assignments because approval-distribution makes sure of it, however in the situation where we restart we might receive the same assignment again and since approval-voting already persisted it we will end up inserting it twice in `ApprovalEntry.tranches.assignments` because that's an array. Fix this by making sure duplicate assignments are a noop if the validator already had an assignment imported at the same tranche. --------- Signed-off-by:Alexandru Gheorghe <alexandru.gheorghe@parity.io> Co-authored-by:
ordian <write@reusable.software>
parent
d5539aa6
Showing
- polkadot/node/core/approval-voting/src/approval_checking.rs 50 additions, 28 deletionspolkadot/node/core/approval-voting/src/approval_checking.rs
- polkadot/node/core/approval-voting/src/lib.rs 9 additions, 2 deletionspolkadot/node/core/approval-voting/src/lib.rs
- polkadot/node/core/approval-voting/src/persisted_entries.rs 11 additions, 3 deletionspolkadot/node/core/approval-voting/src/persisted_entries.rs
- prdoc/pr_6971.prdoc 16 additions, 0 deletionsprdoc/pr_6971.prdoc