mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +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:
@@ -880,7 +880,9 @@ async fn handle_incoming_peer_message<Context>(
|
||||
use protocol_v2::CollatorProtocolMessage as V2;
|
||||
|
||||
match msg {
|
||||
Versioned::V1(V1::Declare(..)) | Versioned::V2(V2::Declare(..)) => {
|
||||
Versioned::V1(V1::Declare(..)) |
|
||||
Versioned::V2(V2::Declare(..)) |
|
||||
Versioned::VStaging(V2::Declare(..)) => {
|
||||
gum::trace!(
|
||||
target: LOG_TARGET,
|
||||
?origin,
|
||||
@@ -891,7 +893,9 @@ async fn handle_incoming_peer_message<Context>(
|
||||
ctx.send_message(NetworkBridgeTxMessage::DisconnectPeer(origin, PeerSet::Collation))
|
||||
.await;
|
||||
},
|
||||
Versioned::V1(V1::AdvertiseCollation(_)) | Versioned::V2(V2::AdvertiseCollation { .. }) => {
|
||||
Versioned::V1(V1::AdvertiseCollation(_)) |
|
||||
Versioned::V2(V2::AdvertiseCollation { .. }) |
|
||||
Versioned::VStaging(V2::AdvertiseCollation { .. }) => {
|
||||
gum::trace!(
|
||||
target: LOG_TARGET,
|
||||
?origin,
|
||||
@@ -906,7 +910,8 @@ async fn handle_incoming_peer_message<Context>(
|
||||
.await;
|
||||
},
|
||||
Versioned::V1(V1::CollationSeconded(relay_parent, statement)) |
|
||||
Versioned::V2(V2::CollationSeconded(relay_parent, statement)) => {
|
||||
Versioned::V2(V2::CollationSeconded(relay_parent, statement)) |
|
||||
Versioned::VStaging(V2::CollationSeconded(relay_parent, statement)) => {
|
||||
if !matches!(statement.unchecked_payload(), Statement::Seconded(_)) {
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
|
||||
@@ -776,7 +776,8 @@ async fn process_incoming_peer_message<Context>(
|
||||
|
||||
match msg {
|
||||
Versioned::V1(V1::Declare(collator_id, para_id, signature)) |
|
||||
Versioned::V2(V2::Declare(collator_id, para_id, signature)) => {
|
||||
Versioned::V2(V2::Declare(collator_id, para_id, signature)) |
|
||||
Versioned::VStaging(V2::Declare(collator_id, para_id, signature)) => {
|
||||
if collator_peer_id(&state.peer_data, &collator_id).is_some() {
|
||||
modify_reputation(
|
||||
&mut state.reputation,
|
||||
@@ -892,6 +893,11 @@ async fn process_incoming_peer_message<Context>(
|
||||
relay_parent,
|
||||
candidate_hash,
|
||||
parent_head_data_hash,
|
||||
}) |
|
||||
Versioned::VStaging(V2::AdvertiseCollation {
|
||||
relay_parent,
|
||||
candidate_hash,
|
||||
parent_head_data_hash,
|
||||
}) =>
|
||||
if let Err(err) = handle_advertisement(
|
||||
ctx.sender(),
|
||||
@@ -915,7 +921,9 @@ async fn process_incoming_peer_message<Context>(
|
||||
modify_reputation(&mut state.reputation, ctx.sender(), origin, rep).await;
|
||||
}
|
||||
},
|
||||
Versioned::V1(V1::CollationSeconded(..)) | Versioned::V2(V2::CollationSeconded(..)) => {
|
||||
Versioned::V1(V1::CollationSeconded(..)) |
|
||||
Versioned::V2(V2::CollationSeconded(..)) |
|
||||
Versioned::VStaging(V2::CollationSeconded(..)) => {
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
peer_id = ?origin,
|
||||
|
||||
Reference in New Issue
Block a user