Skip to content
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
1 change: 1 addition & 0 deletions cumulus/client/consensus/aura/src/collator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ where
relay_parent_descendants
.map(RelayParentData::into_inherent_descendant_list)
.unwrap_or_default(),
Vec::new(),
)
.await;

Expand Down
10 changes: 10 additions & 0 deletions cumulus/client/parachain-inherent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async fn collect_relay_storage_proof(
relay_parent: PHash,
include_authorities: bool,
include_next_authorities: bool,
additional_relay_state_keys: Vec<Vec<u8>>,
) -> Option<sp_state_machine::StorageProof> {
use relay_chain::well_known_keys as relay_well_known_keys;

Expand Down Expand Up @@ -133,6 +134,13 @@ async fn collect_relay_storage_proof(
relevant_keys.push(relay_well_known_keys::NEXT_AUTHORITIES.to_vec());
}

// Add additional relay state keys
let unique_keys: Vec<Vec<u8>> = additional_relay_state_keys
.into_iter()
.filter(|key| !relevant_keys.contains(key))
.collect();
relevant_keys.extend(unique_keys);

relay_chain_interface
.prove_read(relay_parent, &relevant_keys)
.await
Expand All @@ -159,6 +167,7 @@ impl ParachainInherentDataProvider {
validation_data: &PersistedValidationData,
para_id: ParaId,
relay_parent_descendants: Vec<RelayHeader>,
additional_relay_state_keys: Vec<Vec<u8>>,
) -> Option<ParachainInherentData> {
// Only include next epoch authorities when the descendants include an epoch digest.
// Skip the first entry because this is the relay parent itself.
Expand All @@ -174,6 +183,7 @@ impl ParachainInherentDataProvider {
relay_parent,
!relay_parent_descendants.is_empty(),
include_next_authorities,
additional_relay_state_keys,
)
.await?;

Expand Down
10 changes: 10 additions & 0 deletions prdoc/pr_9262.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: 'Adds support for additional relay state keys in parachain validation data inherent'
doc:
- audience: Node Dev
description: |-
Adds the possibility for parachain clients to collect additional relay state keys into the validation data inherent.
crates:
- name: cumulus-client-consensus-aura
bump: patch
- name: cumulus-client-parachain-inherent
bump: major