Add feature flag to enable v2 assignments (#2444)

Scaffold everything, so that we can enable v2 assignments via a node
feature bit, once all nodes have upgraded to the new protocol.

Implements: https://github.com/paritytech/polkadot-sdk/issues/628

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
Alexandru Gheorghe
2023-12-11 12:49:11 +02:00
committed by GitHub
parent 6cedb0c78d
commit 84c932cd8a
12 changed files with 397 additions and 170 deletions
+16
View File
@@ -22,3 +22,19 @@ use bitvec::vec::BitVec;
/// Bit indices in the `HostConfiguration.node_features` that correspond to different node features.
pub type NodeFeatures = BitVec<u8, bitvec::order::Lsb0>;
/// Module containing feature-specific bit indices into the `NodeFeatures` bitvec.
pub mod node_features {
/// A feature index used to indentify a bit into the node_features array stored
/// in the HostConfiguration.
#[repr(u8)]
pub enum FeatureIndex {
/// Tells if tranch0 assignments could be sent in a single certificate.
/// Reserved for: `<https://github.com/paritytech/polkadot-sdk/issues/628>`
EnableAssignmentsV2 = 0,
/// First unassigned feature bit.
/// Every time a new feature flag is assigned it should take this value.
/// and this should be incremented.
FirstUnassigned = 1,
}
}