Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions node/core/prospective-parachains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,14 @@ fn answer_prospective_validation_data_request(
let mut head_data =
storage.head_data_by_hash(&request.parent_head_data_hash).map(|x| x.clone());
let mut relay_parent_info = None;
let mut max_pov_size = None;

for fragment_tree in view
.active_leaves
.values()
.filter_map(|x| x.fragment_trees.get(&request.para_id))
{
if head_data.is_some() && relay_parent_info.is_some() {
if head_data.is_some() && relay_parent_info.is_some() && max_pov_size.is_some() {
break
}
if relay_parent_info.is_none() {
Expand All @@ -525,14 +526,27 @@ fn answer_prospective_validation_data_request(
head_data = Some(required_parent.clone());
}
}
if max_pov_size.is_none() {
let contains_ancestor = fragment_tree
.scope()
.ancestor_by_hash(&request.candidate_relay_parent)
.is_some();
if contains_ancestor {
// We are leaning hard on two assumptions here.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both seem sensible, configuration changes are buffered to be applied on new session

// 1. That the fragment tree never contains allowed relay-parents whose session for children
// is different from that of the base block's.
// 2. That the max_pov_size is only configurable per session.
max_pov_size = Some(fragment_tree.scope().base_constraints().max_pov_size);
}
}
}

let _ = tx.send(match (head_data, relay_parent_info) {
(Some(h), Some(i)) => Some(PersistedValidationData {
let _ = tx.send(match (head_data, relay_parent_info, max_pov_size) {
(Some(h), Some(i), Some(m)) => Some(PersistedValidationData {
parent_head: h,
relay_parent_number: i.number,
relay_parent_storage_root: i.storage_root,
max_pov_size: request.max_pov_size,
max_pov_size: m as _,
}),
_ => None,
});
Expand Down
3 changes: 0 additions & 3 deletions node/subsystem-types/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,6 @@ pub struct ProspectiveValidationDataRequest {
pub candidate_relay_parent: Hash,
/// The parent head-data hash.
pub parent_head_data_hash: Hash,
/// The maximum POV size expected of this candidate. This should be
/// the maximum as configured during the session.
pub max_pov_size: u32,
}

/// Indicates the relay-parents whose fragment tree a candidate
Expand Down