mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 01:51:02 +00:00
approval-voting improvement: include all tranche0 assignments in one certificate (#1178)
**_PR migrated from https://github.com/paritytech/polkadot/pull/6782_** This PR will upgrade the network protocol to version 3 -> VStaging which will later be renamed to V3. This version introduces a new kind of assignment certificate that will be used for tranche0 assignments. Instead of issuing/importing one tranche0 assignment per candidate, there will be just one certificate per relay chain block per validator. However, we will not be sending out the new assignment certificates, yet. So everything should work exactly as before. Once the majority of the validators have been upgraded to the new protocol version we will enable the new certificates (starting at a specific relay chain block) with a new client update. There are still a few things that need to be done: - [x] Use bitfield instead of Vec<CandidateIndex>: https://github.com/paritytech/polkadot/pull/6802 - [x] Fix existing approval-distribution and approval-voting tests - [x] Fix bitfield-distribution and statement-distribution tests - [x] Fix network bridge tests - [x] Implement todos in the code - [x] Add tests to cover new code - [x] Update metrics - [x] Remove the approval distribution aggression levels: TBD PR - [x] Parachains DB migration - [x] Test network protocol upgrade on Versi - [x] Versi Load test - [x] Add Zombienet test - [x] Documentation updates - [x] Fix for sending DistributeAssignment for each candidate claimed by a v2 assignment (warning: Importing locally an already known assignment) - [x] Fix AcceptedDuplicate - [x] Fix DB migration so that we can still keep old data. - [x] Final Versi burn in --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> Co-authored-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
@@ -25,3 +25,4 @@ smallvec = "1.8.0"
|
||||
substrate-prometheus-endpoint = { path = "../../../substrate/utils/prometheus" }
|
||||
thiserror = "1.0.48"
|
||||
async-trait = "0.1.57"
|
||||
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
|
||||
|
||||
@@ -32,7 +32,10 @@ use polkadot_node_network_protocol::{
|
||||
self as net_protocol, peer_set::PeerSet, request_response::Requests, PeerId,
|
||||
};
|
||||
use polkadot_node_primitives::{
|
||||
approval::{BlockApprovalMeta, IndirectAssignmentCert, IndirectSignedApprovalVote},
|
||||
approval::{
|
||||
v1::{BlockApprovalMeta, IndirectSignedApprovalVote},
|
||||
v2::{CandidateBitfield, IndirectAssignmentCertV2},
|
||||
},
|
||||
AvailableData, BabeEpoch, BlockWeight, CandidateVotes, CollationGenerationConfig,
|
||||
CollationSecondedSignal, DisputeMessage, DisputeStatus, ErasureChunk, PoV,
|
||||
SignedDisputeStatement, SignedFullStatement, SignedFullStatementWithPVD, SubmitCollationParams,
|
||||
@@ -841,6 +844,8 @@ pub enum AssignmentCheckError {
|
||||
InvalidCert(ValidatorIndex, String),
|
||||
#[error("Internal state mismatch: {0:?}, {1:?}")]
|
||||
Internal(Hash, CandidateHash),
|
||||
#[error("Oversized candidate or core bitfield >= {0}")]
|
||||
InvalidBitfield(usize),
|
||||
}
|
||||
|
||||
/// The result type of [`ApprovalVotingMessage::CheckAndImportApproval`] request.
|
||||
@@ -906,8 +911,8 @@ pub enum ApprovalVotingMessage {
|
||||
/// Check if the assignment is valid and can be accepted by our view of the protocol.
|
||||
/// Should not be sent unless the block hash is known.
|
||||
CheckAndImportAssignment(
|
||||
IndirectAssignmentCert,
|
||||
CandidateIndex,
|
||||
IndirectAssignmentCertV2,
|
||||
CandidateBitfield,
|
||||
oneshot::Sender<AssignmentCheckResult>,
|
||||
),
|
||||
/// Check if the approval vote is valid and can be accepted by our view of the
|
||||
@@ -942,7 +947,7 @@ pub enum ApprovalDistributionMessage {
|
||||
NewBlocks(Vec<BlockApprovalMeta>),
|
||||
/// Distribute an assignment cert from the local validator. The cert is assumed
|
||||
/// to be valid, relevant, and for the given relay-parent and validator index.
|
||||
DistributeAssignment(IndirectAssignmentCert, CandidateIndex),
|
||||
DistributeAssignment(IndirectAssignmentCertV2, CandidateBitfield),
|
||||
/// Distribute an approval vote for the local validator. The approval vote is assumed to be
|
||||
/// valid, relevant, and the corresponding approval already issued.
|
||||
/// If not, the subsystem is free to drop the message.
|
||||
|
||||
Reference in New Issue
Block a user