mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 09:41:07 +00:00
Full chunk messages for availability-recovery (#2466)
* add full data messages * handle new messages * flip condition
This commit is contained in:
committed by
GitHub
parent
64691eefba
commit
4a5e5f13ae
@@ -662,6 +662,10 @@ async fn handle_network_update(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
protocol_v1::AvailabilityRecoveryMessage::RequestFullData(_, _) |
|
||||||
|
protocol_v1::AvailabilityRecoveryMessage::FullData(_, _) => {
|
||||||
|
// handled in https://github.com/paritytech/polkadot/pull/2453
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We do not really need to track the peers' views in this subsystem
|
// We do not really need to track the peers' views in this subsystem
|
||||||
@@ -727,7 +731,7 @@ fn cleanup_awaited_chunks(state: &mut State) {
|
|||||||
let mut removed_tokens = Vec::new();
|
let mut removed_tokens = Vec::new();
|
||||||
|
|
||||||
for (_, v) in state.discovering_validators.iter_mut() {
|
for (_, v) in state.discovering_validators.iter_mut() {
|
||||||
v.retain(|e| if !e.response.is_canceled() {
|
v.retain(|e| if e.response.is_canceled() {
|
||||||
removed_tokens.push(e.token);
|
removed_tokens.push(e.token);
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ impl View {
|
|||||||
pub mod v1 {
|
pub mod v1 {
|
||||||
use polkadot_primitives::v1::{
|
use polkadot_primitives::v1::{
|
||||||
Hash, CollatorId, Id as ParaId, ErasureChunk, CandidateReceipt,
|
Hash, CollatorId, Id as ParaId, ErasureChunk, CandidateReceipt,
|
||||||
SignedAvailabilityBitfield, PoV, CandidateHash, ValidatorIndex, CandidateIndex,
|
SignedAvailabilityBitfield, PoV, CandidateHash, ValidatorIndex, CandidateIndex, AvailableData,
|
||||||
};
|
};
|
||||||
use polkadot_node_primitives::{
|
use polkadot_node_primitives::{
|
||||||
SignedFullStatement,
|
SignedFullStatement,
|
||||||
@@ -268,6 +268,11 @@ pub mod v1 {
|
|||||||
/// Respond with chunk for a given candidate hash and validator index.
|
/// Respond with chunk for a given candidate hash and validator index.
|
||||||
/// The response may be `None` if the requestee does not have the chunk.
|
/// The response may be `None` if the requestee does not have the chunk.
|
||||||
Chunk(RequestId, Option<ErasureChunk>),
|
Chunk(RequestId, Option<ErasureChunk>),
|
||||||
|
/// Request full data for a given candidate hash.
|
||||||
|
RequestFullData(RequestId, CandidateHash),
|
||||||
|
/// Respond with full data for a given candidate hash.
|
||||||
|
/// The response may be `None` if the requestee does not have the data.
|
||||||
|
FullData(RequestId, Option<AvailableData>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Network messages used by the bitfield distribution subsystem.
|
/// Network messages used by the bitfield distribution subsystem.
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ pub enum CoreOccupied {
|
|||||||
|
|
||||||
/// This is the data we keep available for each candidate included in the relay chain.
|
/// This is the data we keep available for each candidate included in the relay chain.
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
#[derive(Clone, Encode, Decode, PartialEq, Debug)]
|
#[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
|
||||||
pub struct AvailableData {
|
pub struct AvailableData {
|
||||||
/// The Proof-of-Validation of the candidate.
|
/// The Proof-of-Validation of the candidate.
|
||||||
pub pov: std::sync::Arc<PoV>,
|
pub pov: std::sync::Arc<PoV>,
|
||||||
|
|||||||
Reference in New Issue
Block a user