Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4ac6204
feat: KeyToIncludeInRelayProofApi
metricaez Dec 17, 2025
25fa5d4
choir: shorter imports
metricaez Dec 17, 2025
b9fac0d
feat: better naming and batch merging of proofs
metricaez Dec 17, 2025
a9f3bc7
feat: naming and comment suggestions
metricaez Dec 19, 2025
f8c4aea
fix: name change occurences fix
metricaez Dec 19, 2025
de2e7c8
feat: collect static keys and unify prove_read
metricaez Dec 19, 2025
1f2a62e
feat: move relay proof handler to OnSystemEvent
metricaez Dec 20, 2025
a384b4c
feat: prove_child_read for relay rpc interface
metricaez Dec 20, 2025
500ad3d
feat: imp KeyToIncludeInRelayProof for test pallet
metricaez Dec 22, 2025
8f87300
choir: fmt and move api warn to debug
metricaez Dec 24, 2025
cbc8986
feat: test pallet check with Alice balance
metricaez Dec 24, 2025
6e6c669
feat: xcm Publish instruction and executor integration
metricaez Dec 9, 2025
522c7c6
feat: unit for runtimes
metricaez Dec 10, 2025
c0dd737
feat: pallet broadcaster impl
metricaez Dec 10, 2025
93914d9
feat: pallet broadcaster clean up and benchmark fixes
metricaez Dec 10, 2025
65d2f32
feat: rococo integration and adapter of broadcater handler
metricaez Dec 10, 2025
ad04ed8
feat: test utils and generic xcm benchmark fix
metricaez Dec 10, 2025
96b007c
choir: better order and rococo integration of intializer
metricaez Dec 10, 2025
2fe1e80
feat: fix benchmark generic
metricaez Dec 11, 2025
e153ab3
feat: KeyToIncludeInRelayProofApi
metricaez Dec 11, 2025
b01266a
feat: ProcessChildTrieData on parachain-system and pallet Subscriber
metricaez Dec 11, 2025
8e19e21
feat: pubsubConsumber and rococo parachain integration
metricaez Dec 11, 2025
d601131
feat: basic subscriber events, errors and cleanup
metricaez Dec 12, 2025
776ca97
feat: Subscriber tests
metricaez Dec 12, 2025
2a961e4
choir: better RelayStorageKey comments and naming
metricaez Dec 12, 2025
8c91f58
choir: ProcessChildTrieData to RelayProofKeysProcessor for better naming
metricaez Dec 12, 2025
6ed71cb
choir: better imports
metricaez Dec 12, 2025
cbeb13b
fix: Subscriber test
metricaez Dec 12, 2025
9dc9776
choir: unnecesary import
metricaez Dec 12, 2025
cb07bcf
feat: slight generalization of Subscriber
metricaez Dec 12, 2025
485b91a
Revert "feat: slight generalization of Subscriber"
metricaez Dec 12, 2025
b53d823
feat: cleanup messy sub weights and comments
metricaez Dec 12, 2025
5a9d839
feat: more Subscriber optimizations
metricaez Dec 12, 2025
3c6fb07
choir: Subscriber comments and optimization
metricaez Dec 12, 2025
ac99258
feat: Subscriber benchmarks first approach
metricaez Dec 12, 2025
6e26188
choir: pubsubConsumer cleanup
metricaez Dec 12, 2025
c1e05c1
feat: keys into hashes
metricaez Dec 13, 2025
c7f338e
feat: enforce max storage per publisher
metricaez Dec 14, 2025
9193e51
feat: early exit for empty data publishing
metricaez Dec 14, 2025
d1d8b5a
choir: same import syntax as crate
metricaez Dec 14, 2025
69fab79
choir: unify duplicated sproof generation code on Subscriber
metricaez Dec 14, 2025
7f92c30
fix: fix Subscriber buggy benchmark
metricaez Dec 14, 2025
2fc10ef
misc: build bench util
metricaez Dec 14, 2025
c8b9c20
fix: subscriber should not try to benchmark the handlers
metricaez Dec 15, 2025
47aada2
feat: account for data valua in benchmark
metricaez Dec 15, 2025
a89d075
feat: test utils and small optimization of Subs
metricaez Dec 15, 2025
6177be1
choir: some relevant comments on numbers and data
metricaez Dec 15, 2025
627717e
choir: simpler cargo of sub
metricaez Dec 15, 2025
d21b1ff
fix: separation of test utils and empty proof for bench
metricaez Dec 15, 2025
928081d
choir: unnecesary flag
metricaez Dec 15, 2025
3d34371
feat: no std proof generation and ah westend benchmark
metricaez Dec 16, 2025
0f00812
feat: weights and benchmark details
metricaez Dec 16, 2025
a579774
choir: duplicated child info derivation
metricaez Dec 16, 2025
5be81c8
choir: separate weights of sub and misleading param of zombienet
metricaez Dec 16, 2025
d700a13
fix: clippy and missing handler
metricaez Dec 16, 2025
0683512
feat: integrations cleanup
metricaez Dec 16, 2025
b75cac4
feat: max out publish on runtimes and unit weight for broadcaster
metricaez Dec 16, 2025
89aba2b
feat: refund weight
metricaez Dec 16, 2025
19202a1
feat: KeyToIncludeInRelayProofApi
metricaez Dec 17, 2025
f615241
choir: shorter imports
metricaez Dec 17, 2025
74112e0
feat: better naming and batch merging of proofs
metricaez Dec 17, 2025
0c01199
choir: minor comment fix
metricaez Dec 18, 2025
6cffde6
choir: more comments cleanup
metricaez Dec 18, 2025
de52b92
feat: naming and comment suggestions
metricaez Dec 19, 2025
2dd623d
fix: name change occurences fix
metricaez Dec 19, 2025
bcba0f9
feat: collect static keys and unify prove_read
metricaez Dec 19, 2025
be0b305
feat: move relay proof handler to OnSystemEvent
metricaez Dec 20, 2025
228f95f
feat: prove_child_read for relay rpc interface
metricaez Dec 20, 2025
5bd4f19
feat: imp KeyToIncludeInRelayProof for test pallet
metricaez Dec 22, 2025
d70c2c7
Merge branch 'feat/keys-to-proof-api' into feat/pubsub-rev1225
metricaez Dec 30, 2025
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
26 changes: 26 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ members = [
"cumulus/pallets/parachain-system/proc-macro",
"cumulus/pallets/session-benchmarking",
"cumulus/pallets/solo-to-para",
"cumulus/pallets/subscriber",
"cumulus/pallets/weight-reclaim",
"cumulus/pallets/xcm",
"cumulus/pallets/xcmp-queue",
Expand Down Expand Up @@ -748,6 +749,7 @@ cumulus-pallet-aura-ext = { path = "cumulus/pallets/aura-ext", default-features
cumulus-pallet-dmp-queue = { default-features = false, path = "cumulus/pallets/dmp-queue" }
cumulus-pallet-parachain-system = { path = "cumulus/pallets/parachain-system", default-features = false }
cumulus-pallet-parachain-system-proc-macro = { path = "cumulus/pallets/parachain-system/proc-macro", default-features = false }
cumulus-pallet-subscriber = { path = "cumulus/pallets/subscriber", default-features = false }
cumulus-pallet-session-benchmarking = { path = "cumulus/pallets/session-benchmarking", default-features = false }
cumulus-pallet-solo-to-para = { path = "cumulus/pallets/solo-to-para", default-features = false }
cumulus-pallet-weight-reclaim = { path = "cumulus/pallets/weight-reclaim", default-features = false }
Expand Down
5 changes: 5 additions & 0 deletions cumulus/client/consensus/aura/src/collator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use cumulus_client_consensus_common::{
use cumulus_client_parachain_inherent::{ParachainInherentData, ParachainInherentDataProvider};
use cumulus_primitives_core::{
relay_chain::Hash as PHash, DigestItem, ParachainBlockData, PersistedValidationData,
RelayProofRequest,
};
use cumulus_relay_chain_interface::RelayChainInterface;
use sc_client_api::BackendTransaction;
Expand Down Expand Up @@ -177,6 +178,7 @@ where
parent_hash: Block::Hash,
timestamp: impl Into<Option<Timestamp>>,
relay_parent_descendants: Option<RelayParentData>,
relay_proof_request: RelayProofRequest,
collator_peer_id: PeerId,
) -> Result<(ParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
let paras_inherent_data = ParachainInherentDataProvider::create_at(
Expand All @@ -188,6 +190,7 @@ where
.map(RelayParentData::into_inherent_descendant_list)
.unwrap_or_default(),
Vec::new(),
relay_proof_request,
collator_peer_id,
)
.await;
Expand Down Expand Up @@ -224,6 +227,7 @@ where
validation_data: &PersistedValidationData,
parent_hash: Block::Hash,
timestamp: impl Into<Option<Timestamp>>,
relay_proof_request: RelayProofRequest,
collator_peer_id: PeerId,
) -> Result<(ParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
self.create_inherent_data_with_rp_offset(
Expand All @@ -232,6 +236,7 @@ where
parent_hash,
timestamp,
None,
relay_proof_request,
collator_peer_id,
)
.await
Expand Down
1 change: 1 addition & 0 deletions cumulus/client/consensus/aura/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ where
&validation_data,
parent_hash,
claim.timestamp(),
Default::default(),
params.collator_peer_id,
)
.await
Expand Down
17 changes: 12 additions & 5 deletions cumulus/client/consensus/aura/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use codec::{Codec, Encode};
use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface;
use cumulus_client_consensus_common::{self as consensus_common, ParachainBlockImportMarker};
use cumulus_primitives_aura::AuraUnincludedSegmentApi;
use cumulus_primitives_core::{CollectCollationInfo, PersistedValidationData};
use cumulus_primitives_core::{CollectCollationInfo, KeyToIncludeInRelayProof, PersistedValidationData};
use cumulus_relay_chain_interface::RelayChainInterface;
use sp_consensus::Environment;

Expand Down Expand Up @@ -164,8 +164,10 @@ where
+ Send
+ Sync
+ 'static,
Client::Api:
AuraApi<Block, P::Public> + CollectCollationInfo<Block> + AuraUnincludedSegmentApi<Block>,
Client::Api: AuraApi<Block, P::Public>
+ CollectCollationInfo<Block>
+ AuraUnincludedSegmentApi<Block>
+ KeyToIncludeInRelayProof<Block>,
Backend: sc_client_api::Backend<Block> + 'static,
RClient: RelayChainInterface + Clone + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
Expand Down Expand Up @@ -216,8 +218,10 @@ where
+ Send
+ Sync
+ 'static,
Client::Api:
AuraApi<Block, P::Public> + CollectCollationInfo<Block> + AuraUnincludedSegmentApi<Block>,
Client::Api: AuraApi<Block, P::Public>
+ CollectCollationInfo<Block>
+ AuraUnincludedSegmentApi<Block>
+ KeyToIncludeInRelayProof<Block>,
Backend: sc_client_api::Backend<Block> + 'static,
RClient: RelayChainInterface + Clone + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
Expand Down Expand Up @@ -392,12 +396,15 @@ where

// Build and announce collations recursively until
// `can_build_upon` fails or building a collation fails.
let relay_proof_request = super::get_relay_proof_request(&*params.para_client, parent_hash);

let (parachain_inherent_data, other_inherent_data) = match collator
.create_inherent_data(
relay_parent,
&validation_data,
parent_hash,
slot_claim.timestamp(),
relay_proof_request,
params.collator_peer_id,
)
.await
Expand Down
32 changes: 31 additions & 1 deletion cumulus/client/consensus/aura/src/collators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use crate::collator::SlotClaim;
use codec::Codec;
use cumulus_client_consensus_common::{self as consensus_common, ParentSearchParams};
use cumulus_primitives_aura::{AuraUnincludedSegmentApi, Slot};
use cumulus_primitives_core::{relay_chain::Header as RelayHeader, BlockT};
use cumulus_primitives_core::{
relay_chain::Header as RelayHeader, BlockT, KeyToIncludeInRelayProof, RelayProofRequest,
};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use polkadot_node_subsystem::messages::{CollatorProtocolMessage, RuntimeApiRequest};
use polkadot_node_subsystem_util::runtime::ClaimQueueSnapshot;
Expand Down Expand Up @@ -662,6 +664,34 @@ mod tests {
}
}

/// Fetches relay chain storage proof requests from the parachain runtime.
///
/// Queries the runtime API to determine which relay chain storage keys
/// (both top-level and child trie keys) should be included in the relay chain state proof.
///
/// Falls back to an empty request if the runtime API call fails or is not implemented.
fn get_relay_proof_request<Block, Client>(
client: &Client,
parent_hash: Block::Hash,
) -> RelayProofRequest
where
Block: BlockT,
Client: ProvideRuntimeApi<Block>,
Client::Api: KeyToIncludeInRelayProof<Block>,
{
client
.runtime_api()
.keys_to_prove(parent_hash)
.unwrap_or_else(|e| {
tracing::debug!(
target: crate::LOG_TARGET,
error = ?e,
"Failed to fetch relay proof requests from runtime, using empty request"
);
Default::default()
})
}

/// Holds a relay parent and its descendants.
pub struct RelayParentData {
/// The relay parent block header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@ where
relay_parent_storage_root: *relay_parent_header.state_root(),
max_pov_size: *max_pov_size,
};

let (parachain_inherent_data, other_inherent_data) = match collator
.create_inherent_data_with_rp_offset(
relay_parent,
&validation_data,
parent_hash,
slot_claim.timestamp(),
Some(rp_data),
Default::default(),
collator_peer_id,
)
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,15 @@ impl RelayChainInterface for TestRelayClient {
unimplemented!("Not needed for test")
}

async fn prove_child_read(
&self,
_: RelayHash,
_: &cumulus_relay_chain_interface::ChildInfo,
_: &[Vec<u8>],
) -> RelayChainResult<sc_client_api::StorageProof> {
unimplemented!("Not needed for test")
}

async fn wait_for_block(&self, _: RelayHash) -> RelayChainResult<()> {
unimplemented!("Not needed for test")
}
Expand Down
Loading