Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
504b919
add new collation advertisement
ordian Feb 6, 2024
efceb5e
remove v3 in favor of enum variant
ordian Feb 14, 2024
94ba49b
get rid of with_elastic_scaling
ordian Feb 16, 2024
211edb7
no maybes
ordian Feb 19, 2024
739e63c
Merge branch 'master' into ao-collator-parent-head-data
ordian Feb 19, 2024
3320447
prdoc
ordian Feb 19, 2024
10a3e9c
sanity check the provided parent head data hash
ordian Feb 20, 2024
b7466c2
address review: use enum for parent head-data
ordian Feb 27, 2024
1ff7a54
test validator sanity check parent_head_data hash
ordian Feb 28, 2024
8b70d0f
Merge remote-tracking branch 'origin/master' into ao-collator-parent-…
ordian Feb 28, 2024
bd2ee35
collator-side: send parent head data
ordian Feb 29, 2024
560da60
test parent head data is sent
ordian Feb 29, 2024
a7cc059
address nits
ordian Mar 1, 2024
cc5f0e5
fmt
ordian Mar 1, 2024
e2751f5
prdoc
ordian Mar 1, 2024
f44d58e
Merge remote-tracking branch 'origin/master' into ao-collator-parent-…
ordian Mar 1, 2024
366b101
Merge branch 'ao-collator-parent-head-data' into ao-send-parent-head-…
ordian Mar 1, 2024
8910798
Merge branch 'master' into ao-collator-parent-head-data
ordian Mar 4, 2024
7322058
add a comment (review)
ordian Mar 4, 2024
6109444
Merge branch 'ao-collator-parent-head-data' into ao-send-parent-head-…
ordian Mar 4, 2024
227ff93
Merge branch 'master' into ao-send-parent-head-data
ordian Mar 16, 2024
1e2a32c
Merge branch 'master' into ao-send-parent-head-data
ordian Mar 18, 2024
4f4ef35
removed `pallet::getter` usage from cumulus pallets (#3471)
muraca Mar 18, 2024
867edcd
Bump the known_good_semver group with 2 updates (#3726)
dependabot[bot] Mar 19, 2024
03f5577
Add HRMP notification handlers to the xcm-executor (#3696)
JuaniRios Mar 19, 2024
4697b7b
Make `availability-recovery-regression-bench` a benchmark (#3741)
bkchr Mar 19, 2024
d40a2a6
gate collator changes under elastic-scaling-experimental
ordian Mar 19, 2024
6d34dcb
Merge branch 'master' into ao-send-parent-head-data
ordian Mar 19, 2024
ee7ccdf
taplo format --config .config/taplo.toml
ordian Mar 19, 2024
2579796
fix clippy?
ordian Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions polkadot/node/collation-generation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ async fn construct_and_distribute_receipt(
} = collation;

let persisted_validation_data_hash = validation_data.hash();
let parent_head_data = validation_data.parent_head.clone();
let parent_head_data_hash = validation_data.parent_head.hash();

// Apply compression to the block data.
Expand Down Expand Up @@ -551,12 +552,13 @@ async fn construct_and_distribute_receipt(
metrics.on_collation_generated();

sender
.send_message(CollatorProtocolMessage::DistributeCollation(
ccr,
.send_message(CollatorProtocolMessage::DistributeCollation {
candidate_receipt: ccr,
parent_head_data_hash,
pov,
parent_head_data,
result_sender,
))
})
.await;
}

Expand Down
33 changes: 17 additions & 16 deletions polkadot/node/collation-generation/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,11 @@ fn sends_distribute_collation_message() {

assert_eq!(to_collator_protocol.len(), 1);
match AllMessages::from(to_collator_protocol.pop().unwrap()) {
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation(
CandidateReceipt { descriptor, .. },
_pov,
..,
)) => {
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation {
candidate_receipt,
..
}) => {
let CandidateReceipt { descriptor, .. } = candidate_receipt;
// signature generation is non-deterministic, so we can't just assert that the
// expected descriptor is correct. What we can do is validate that the produced
// descriptor has a valid signature, then just copy in the generated signature
Expand Down Expand Up @@ -529,11 +529,11 @@ fn fallback_when_no_validation_code_hash_api() {

assert_eq!(to_collator_protocol.len(), 1);
match &to_collator_protocol[0] {
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation(
CandidateReceipt { descriptor, .. },
_pov,
..,
)) => {
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation {
candidate_receipt,
..
}) => {
let CandidateReceipt { descriptor, .. } = candidate_receipt;
assert_eq!(expect_validation_code_hash, descriptor.validation_code_hash);
},
_ => panic!("received wrong message type"),
Expand Down Expand Up @@ -619,15 +619,16 @@ fn submit_collation_leads_to_distribution() {

assert_matches!(
overseer_recv(&mut virtual_overseer).await,
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation(
ccr,
AllMessages::CollatorProtocol(CollatorProtocolMessage::DistributeCollation {
candidate_receipt,
parent_head_data_hash,
..
)) => {
}) => {
let CandidateReceipt { descriptor, .. } = candidate_receipt;
assert_eq!(parent_head_data_hash, parent_head.hash());
assert_eq!(ccr.descriptor().persisted_validation_data_hash, expected_pvd.hash());
assert_eq!(ccr.descriptor().para_head, dummy_head_data().hash());
assert_eq!(ccr.descriptor().validation_code_hash, validation_code_hash);
assert_eq!(descriptor.persisted_validation_data_hash, expected_pvd.hash());
assert_eq!(descriptor.para_head, dummy_head_data().hash());
assert_eq!(descriptor.validation_code_hash, validation_code_hash);
}
);

Expand Down
17 changes: 12 additions & 5 deletions polkadot/node/core/prospective-parachains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ use futures::{channel::oneshot, prelude::*};
use polkadot_node_subsystem::{
messages::{
Ancestors, ChainApiMessage, FragmentTreeMembership, HypotheticalCandidate,
HypotheticalFrontierRequest, IntroduceCandidateRequest, ProspectiveParachainsMessage,
ProspectiveValidationDataRequest, RuntimeApiMessage, RuntimeApiRequest,
HypotheticalFrontierRequest, IntroduceCandidateRequest, ParentHeadData,
ProspectiveParachainsMessage, ProspectiveValidationDataRequest, RuntimeApiMessage,
RuntimeApiRequest,
},
overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
};
Expand Down Expand Up @@ -764,8 +765,14 @@ fn answer_prospective_validation_data_request(
Some(s) => s,
};

let mut head_data =
storage.head_data_by_hash(&request.parent_head_data_hash).map(|x| x.clone());
let (mut head_data, parent_head_data_hash) = match request.parent_head_data {
ParentHeadData::OnlyHash(parent_head_data_hash) => (
storage.head_data_by_hash(&parent_head_data_hash).map(|x| x.clone()),
parent_head_data_hash,
),
ParentHeadData::WithData { head_data, hash } => (Some(head_data), hash),
};

let mut relay_parent_info = None;
let mut max_pov_size = None;

Expand All @@ -783,7 +790,7 @@ fn answer_prospective_validation_data_request(
}
if head_data.is_none() {
let required_parent = &fragment_tree.scope().base_constraints().required_parent;
if required_parent.hash() == request.parent_head_data_hash {
if required_parent.hash() == parent_head_data_hash {
head_data = Some(required_parent.clone());
}
}
Expand Down
4 changes: 2 additions & 2 deletions polkadot/node/core/prospective-parachains/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use assert_matches::assert_matches;
use polkadot_node_subsystem::{
errors::RuntimeApiError,
messages::{
AllMessages, HypotheticalFrontierRequest, ProspectiveParachainsMessage,
AllMessages, HypotheticalFrontierRequest, ParentHeadData, ProspectiveParachainsMessage,
ProspectiveValidationDataRequest,
},
};
Expand Down Expand Up @@ -468,7 +468,7 @@ async fn get_pvd(
let request = ProspectiveValidationDataRequest {
para_id,
candidate_relay_parent,
parent_head_data_hash: parent_head_data.hash(),
parent_head_data: ParentHeadData::OnlyHash(parent_head_data.hash()),
};
let (tx, rx) = oneshot::channel();
virtual_overseer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use polkadot_node_network_protocol::{
PeerId,
};
use polkadot_node_primitives::PoV;
use polkadot_node_subsystem::messages::ParentHeadData;
use polkadot_primitives::{CandidateHash, CandidateReceipt, Hash, Id as ParaId};

/// The status of a collation as seen from the collator.
Expand Down Expand Up @@ -59,10 +60,10 @@ impl CollationStatus {
pub struct Collation {
/// Candidate receipt.
pub receipt: CandidateReceipt,
/// Parent head-data hash.
pub parent_head_data_hash: Hash,
/// Proof to verify the state transition of the parachain.
pub pov: PoV,
/// Parent head-data (or just hash).
pub parent_head_data: ParentHeadData,
/// Collation status.
pub status: CollationStatus,
}
Expand Down
Loading