Skip to content

Commit

Permalink
Add feature flag to enable v2 assignments (#2444)
Browse files Browse the repository at this point in the history
Scaffold everything, so that we can enable v2 assignments via a node
feature bit, once all nodes have upgraded to the new protocol.

Implements: #628

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
  • Loading branch information
alexggh committed Dec 11, 2023
1 parent 6cedb0c commit 84c932c
Show file tree
Hide file tree
Showing 12 changed files with 393 additions and 166 deletions.
4 changes: 3 additions & 1 deletion polkadot/node/core/approval-voting/src/criteria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ pub(crate) trait AssignmentCriteria {
relay_vrf_story: RelayVRFStory,
config: &Config,
leaving_cores: Vec<(CandidateHash, CoreIndex, GroupIndex)>,
enable_v2_assignments: bool,
) -> HashMap<CoreIndex, OurAssignment>;

fn check_assignment_cert(
Expand All @@ -284,8 +285,9 @@ impl AssignmentCriteria for RealAssignmentCriteria {
relay_vrf_story: RelayVRFStory,
config: &Config,
leaving_cores: Vec<(CandidateHash, CoreIndex, GroupIndex)>,
enable_v2_assignments: bool,
) -> HashMap<CoreIndex, OurAssignment> {
compute_assignments(keystore, relay_vrf_story, config, leaving_cores, false)
compute_assignments(keystore, relay_vrf_story, config, leaving_cores, enable_v2_assignments)
}

fn check_assignment_cert(
Expand Down
Loading

0 comments on commit 84c932c

Please sign in to comment.