Skip to main content

cumulus_primitives_core/
lib.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3// SPDX-License-Identifier: Apache-2.0
4
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// 	http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17//! Cumulus related core primitive types and traits.
18
19#![cfg_attr(not(feature = "std"), no_std)]
20
21extern crate alloc;
22
23use alloc::vec::Vec;
24use codec::{Compact, Decode, DecodeAll, DecodeWithMemTracking, Encode, MaxEncodedLen};
25use polkadot_parachain_primitives::primitives::HeadData;
26use scale_info::TypeInfo;
27use Debug;
28
29/// The ref time per core in seconds.
30///
31/// This is the execution time each PoV gets on a core on the relay chain.
32pub const REF_TIME_PER_CORE_IN_SECS: u64 = 2;
33
34pub mod parachain_block_data;
35
36pub use parachain_block_data::ParachainBlockData;
37pub use polkadot_core_primitives::InboundDownwardMessage;
38pub use polkadot_parachain_primitives::primitives::{
39	DmpMessageHandler, Id as ParaId, IsSystem, UpwardMessage, ValidationParams, XcmpMessageFormat,
40	XcmpMessageHandler,
41};
42pub use polkadot_primitives::{
43	AbridgedHostConfiguration, AbridgedHrmpChannel, ClaimQueueOffset, CoreSelector,
44	PersistedValidationData,
45};
46pub use sp_runtime::{
47	generic::{Digest, DigestItem},
48	traits::Block as BlockT,
49	ConsensusEngineId,
50};
51pub use xcm::latest::prelude::*;
52
53/// A module that re-exports relevant relay chain definitions.
54pub mod relay_chain {
55	pub use polkadot_core_primitives::*;
56	pub use polkadot_primitives::*;
57}
58
59/// An inbound HRMP message.
60pub type InboundHrmpMessage = polkadot_primitives::InboundHrmpMessage<relay_chain::BlockNumber>;
61
62/// And outbound HRMP message
63pub type OutboundHrmpMessage = polkadot_primitives::OutboundHrmpMessage<ParaId>;
64
65/// Error description of a message send failure.
66#[derive(Eq, PartialEq, Copy, Clone, Debug, Encode, Decode)]
67pub enum MessageSendError {
68	/// The dispatch queue is full.
69	QueueFull,
70	/// There does not exist a channel for sending the message.
71	NoChannel,
72	/// The message is too big to ever fit in a channel.
73	TooBig,
74	/// Some other error.
75	Other,
76	/// There are too many channels open at once.
77	TooManyChannels,
78}
79
80impl From<MessageSendError> for &'static str {
81	fn from(e: MessageSendError) -> Self {
82		use MessageSendError::*;
83		match e {
84			QueueFull => "QueueFull",
85			NoChannel => "NoChannel",
86			TooBig => "TooBig",
87			Other => "Other",
88			TooManyChannels => "TooManyChannels",
89		}
90	}
91}
92
93/// The origin of an inbound message.
94#[derive(
95	Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, Clone, Eq, PartialEq, TypeInfo, Debug,
96)]
97pub enum AggregateMessageOrigin {
98	/// The message came from the para-chain itself.
99	Here,
100	/// The message came from the relay-chain.
101	///
102	/// This is used by the DMP queue.
103	Parent,
104	/// The message came from a sibling para-chain.
105	///
106	/// This is used by the HRMP queue.
107	Sibling(ParaId),
108}
109
110impl From<AggregateMessageOrigin> for Location {
111	fn from(origin: AggregateMessageOrigin) -> Self {
112		match origin {
113			AggregateMessageOrigin::Here => Location::here(),
114			AggregateMessageOrigin::Parent => Location::parent(),
115			AggregateMessageOrigin::Sibling(id) => Location::new(1, Junction::Parachain(id.into())),
116		}
117	}
118}
119
120#[cfg(feature = "runtime-benchmarks")]
121impl From<u32> for AggregateMessageOrigin {
122	fn from(x: u32) -> Self {
123		match x {
124			0 => Self::Here,
125			1 => Self::Parent,
126			p => Self::Sibling(ParaId::from(p)),
127		}
128	}
129}
130
131/// Information about an XCMP channel.
132pub struct ChannelInfo {
133	/// The maximum number of messages that can be pending in the channel at once.
134	pub max_capacity: u32,
135	/// The maximum total size of the messages that can be pending in the channel at once.
136	pub max_total_size: u32,
137	/// The maximum message size that could be put into the channel.
138	pub max_message_size: u32,
139	/// The current number of messages pending in the channel.
140	/// Invariant: should be less or equal to `max_capacity`.s`.
141	pub msg_count: u32,
142	/// The total size in bytes of all message payloads in the channel.
143	/// Invariant: should be less or equal to `max_total_size`.
144	pub total_size: u32,
145}
146
147pub trait GetChannelInfo {
148	fn get_channel_status(id: ParaId) -> ChannelStatus;
149	fn get_channel_info(id: ParaId) -> Option<ChannelInfo>;
150}
151
152/// List all open outgoing channels.
153pub trait ListChannelInfos {
154	fn outgoing_channels() -> Vec<ParaId>;
155}
156
157/// Something that should be called when sending an upward message.
158pub trait UpwardMessageSender {
159	/// Send the given UMP message; return the expected number of blocks before the message will
160	/// be dispatched or an error if the message cannot be sent.
161	/// return the hash of the message sent
162	fn send_upward_message(message: UpwardMessage) -> Result<(u32, XcmHash), MessageSendError>;
163
164	/// Pre-check the given UMP message.
165	fn can_send_upward_message(message: &UpwardMessage) -> Result<(), MessageSendError>;
166
167	/// Ensure `[Self::send_upward_message]` is successful when called in benchmarks/tests.
168	#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
169	fn ensure_successful_delivery() {}
170}
171
172impl UpwardMessageSender for () {
173	fn send_upward_message(_message: UpwardMessage) -> Result<(u32, XcmHash), MessageSendError> {
174		Err(MessageSendError::NoChannel)
175	}
176
177	fn can_send_upward_message(_message: &UpwardMessage) -> Result<(), MessageSendError> {
178		Err(MessageSendError::Other)
179	}
180}
181
182/// The status of a channel.
183pub enum ChannelStatus {
184	/// Channel doesn't exist/has been closed.
185	Closed,
186	/// Channel is completely full right now.
187	Full,
188	/// Channel is ready for sending; the two parameters are the maximum size a valid message may
189	/// have right now, and the maximum size a message may ever have (this will generally have been
190	/// available during message construction, but it's possible the channel parameters changed in
191	/// the meantime).
192	Ready(usize, usize),
193}
194
195/// A means of figuring out what outbound XCMP messages should be being sent.
196pub trait XcmpMessageSource {
197	/// Take a single XCMP message from the queue for the given `dest`, if one exists.
198	fn take_outbound_messages(maximum_channels: usize) -> Vec<(ParaId, Vec<u8>)>;
199}
200
201impl XcmpMessageSource for () {
202	fn take_outbound_messages(_maximum_channels: usize) -> Vec<(ParaId, Vec<u8>)> {
203		Vec::new()
204	}
205}
206
207/// The "quality of service" considerations for message sending.
208#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)]
209pub enum ServiceQuality {
210	/// Ensure that this message is dispatched in the same relative order as any other messages
211	/// that were also sent with `Ordered`. This only guarantees message ordering on the dispatch
212	/// side, and not necessarily on the execution side.
213	Ordered,
214	/// Ensure that the message is dispatched as soon as possible, which could result in it being
215	/// dispatched before other messages which are larger and/or rely on relative ordering.
216	Fast,
217}
218
219/// A consensus engine ID indicating that this is a Cumulus Parachain.
220pub const CUMULUS_CONSENSUS_ID: ConsensusEngineId = *b"CMLS";
221
222/// Information about the core on the relay chain this block will be validated on.
223#[derive(Clone, Debug, Decode, Encode, PartialEq, Eq)]
224pub struct CoreInfo {
225	/// The selector that determines the actual core at `claim_queue_offset`.
226	pub selector: CoreSelector,
227	/// The claim queue offset that determines how far "into the future" the core is selected.
228	pub claim_queue_offset: ClaimQueueOffset,
229	/// The number of cores assigned to the parachain at `claim_queue_offset`.
230	pub number_of_cores: Compact<u16>,
231}
232
233impl core::hash::Hash for CoreInfo {
234	fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
235		state.write_u8(self.selector.0);
236		state.write_u8(self.claim_queue_offset.0);
237		state.write_u16(self.number_of_cores.0);
238	}
239}
240
241impl CoreInfo {
242	/// Puts this into a [`CumulusDigestItem::CoreInfo`] and then encodes it as a Substrate
243	/// [`DigestItem`].
244	pub fn to_digest_item(&self) -> DigestItem {
245		CumulusDigestItem::CoreInfo(self.clone()).to_digest_item()
246	}
247}
248
249/// Information about a block that is part of a PoV bundle.
250#[derive(Clone, Debug, Decode, Encode, PartialEq)]
251pub struct BundleInfo {
252	/// The index of the block in the bundle.
253	pub index: u8,
254	/// Is this the last block in the bundle from the point of view of the node?
255	///
256	/// It is possible that the runtime outputs the
257	/// [`CumulusDigestItem::UseFullCore`] to inform the node to use an entire for one block
258	/// only.
259	pub maybe_last: bool,
260}
261
262impl BundleInfo {
263	/// Puts this into a [`CumulusDigestItem::BundleInfo`] and then encodes it as a Substrate
264	/// [`DigestItem`].
265	pub fn to_digest_item(&self) -> DigestItem {
266		CumulusDigestItem::BundleInfo(self.clone()).to_digest_item()
267	}
268}
269
270/// Return value of [`CumulusDigestItem::core_info_exists_at_max_once`]
271#[derive(Debug, Clone, PartialEq, Eq)]
272pub enum CoreInfoExistsAtMaxOnce {
273	/// Exists exactly once.
274	Once(CoreInfo),
275	/// Not found.
276	NotFound,
277	/// Found more than once.
278	MoreThanOnce,
279}
280
281/// Identifier for a relay chain block used by [`CumulusDigestItem`].
282#[derive(Clone, Debug, PartialEq, Hash, Eq)]
283pub enum RelayBlockIdentifier {
284	/// The block is identified using its block hash.
285	ByHash(relay_chain::Hash),
286	/// The block is identified using its storage root and block number.
287	ByStorageRoot { storage_root: relay_chain::Hash, block_number: relay_chain::BlockNumber },
288}
289
290/// Consensus header digests for Cumulus parachains.
291#[derive(Clone, Debug, Decode, Encode, PartialEq)]
292pub enum CumulusDigestItem {
293	/// A digest item indicating the relay-parent a parachain block was built against.
294	#[codec(index = 0)]
295	RelayParent(relay_chain::Hash),
296	/// A digest item providing information about the core selected on the relay chain for this
297	/// block.
298	#[codec(index = 1)]
299	CoreInfo(CoreInfo),
300	/// A digest item providing information about the position of the block in the bundle.
301	#[codec(index = 2)]
302	BundleInfo(BundleInfo),
303	/// A digest item informing the node that this block should be put alone onto a core.
304	///
305	/// In other words, the core should not be shared with other blocks.
306	///
307	/// Under certain conditions (mainly runtime misconfigurations) the digest is still set when
308	/// there are muliple blocks per core. This is done to communicate to the collator that block
309	/// production for this core should be stopped.
310	#[codec(index = 3)]
311	UseFullCore,
312}
313
314impl CumulusDigestItem {
315	/// Encode this as a Substrate [`DigestItem`].
316	pub fn to_digest_item(&self) -> DigestItem {
317		let encoded = self.encode();
318
319		match self {
320			Self::RelayParent(_) | Self::UseFullCore => {
321				DigestItem::Consensus(CUMULUS_CONSENSUS_ID, encoded)
322			},
323			_ => DigestItem::PreRuntime(CUMULUS_CONSENSUS_ID, encoded),
324		}
325	}
326
327	/// Find [`CumulusDigestItem::CoreInfo`] in the given `digest`.
328	///
329	/// If there are multiple valid digests, this returns the value of the first one.
330	pub fn find_core_info(digest: &Digest) -> Option<CoreInfo> {
331		digest.convert_first(|d| match d {
332			DigestItem::PreRuntime(id, val) if id == &CUMULUS_CONSENSUS_ID => {
333				let Ok(CumulusDigestItem::CoreInfo(core_info)) =
334					CumulusDigestItem::decode_all(&mut &val[..])
335				else {
336					return None;
337				};
338
339				Some(core_info)
340			},
341			_ => None,
342		})
343	}
344
345	/// Returns the found [`CoreInfo`] and iff [`Self::CoreInfo`] exists at max once in the given
346	/// `digest`.
347	pub fn core_info_exists_at_max_once(digest: &Digest) -> CoreInfoExistsAtMaxOnce {
348		let mut core_info = None;
349		if digest
350			.logs()
351			.iter()
352			.filter(|l| match l {
353				DigestItem::PreRuntime(CUMULUS_CONSENSUS_ID, d) => {
354					if let Ok(Self::CoreInfo(ci)) = Self::decode_all(&mut &d[..]) {
355						core_info = Some(ci);
356						true
357					} else {
358						false
359					}
360				},
361				_ => false,
362			})
363			.count() <= 1
364		{
365			core_info
366				.map(CoreInfoExistsAtMaxOnce::Once)
367				.unwrap_or(CoreInfoExistsAtMaxOnce::NotFound)
368		} else {
369			CoreInfoExistsAtMaxOnce::MoreThanOnce
370		}
371	}
372
373	/// Returns the [`RelayBlockIdentifier`] from the given `digest`.
374	///
375	/// The identifier corresponds to the relay parent used to build the parachain block.
376	pub fn find_relay_block_identifier(digest: &Digest) -> Option<RelayBlockIdentifier> {
377		digest.convert_first(|d| match d {
378			DigestItem::Consensus(id, val) if id == &CUMULUS_CONSENSUS_ID => {
379				let Ok(CumulusDigestItem::RelayParent(hash)) =
380					CumulusDigestItem::decode_all(&mut &val[..])
381				else {
382					return None;
383				};
384
385				Some(RelayBlockIdentifier::ByHash(hash))
386			},
387			DigestItem::Consensus(id, val) if id == &rpsr_digest::RPSR_CONSENSUS_ID => {
388				let Ok((storage_root, block_number)) =
389					rpsr_digest::RpsrType::decode_all(&mut &val[..])
390				else {
391					return None;
392				};
393
394				Some(RelayBlockIdentifier::ByStorageRoot {
395					storage_root,
396					block_number: block_number.into(),
397				})
398			},
399			_ => None,
400		})
401	}
402
403	/// Returns the [`BundleInfo`] from the given `digest`.
404	pub fn find_bundle_info(digest: &Digest) -> Option<BundleInfo> {
405		digest.convert_first(|d| match d {
406			DigestItem::PreRuntime(id, val) if id == &CUMULUS_CONSENSUS_ID => {
407				let Ok(CumulusDigestItem::BundleInfo(bundle_info)) =
408					CumulusDigestItem::decode_all(&mut &val[..])
409				else {
410					return None;
411				};
412
413				Some(bundle_info)
414			},
415			_ => None,
416		})
417	}
418
419	/// Returns `true` if the given `digest` contains the [`Self::UseFullCore`] item.
420	pub fn contains_use_full_core(digest: &Digest) -> bool {
421		digest
422			.convert_first(|d| match d {
423				DigestItem::Consensus(id, val) if id == &CUMULUS_CONSENSUS_ID => {
424					let Ok(CumulusDigestItem::UseFullCore) =
425						CumulusDigestItem::decode_all(&mut &val[..])
426					else {
427						return None;
428					};
429
430					Some(true)
431				},
432				_ => None,
433			})
434			.unwrap_or_default()
435	}
436}
437
438/// If there are multiple valid digests, this returns the value of the first one, although
439/// well-behaving runtimes should not produce headers with more than one.
440pub fn extract_relay_parent(digest: &Digest) -> Option<relay_chain::Hash> {
441	digest.convert_first(|d| match d {
442		DigestItem::Consensus(id, val) if id == &CUMULUS_CONSENSUS_ID => {
443			match CumulusDigestItem::decode(&mut &val[..]) {
444				Ok(CumulusDigestItem::RelayParent(hash)) => Some(hash),
445				_ => None,
446			}
447		},
448		_ => None,
449	})
450}
451
452/// Utilities for handling the relay-parent storage root as a digest item.
453///
454/// This is not intended to be part of the public API, as it is a workaround for
455/// <https://github.com/paritytech/cumulus/issues/303> via
456/// <https://github.com/paritytech/polkadot/issues/7191>.
457///
458/// Runtimes using the parachain-system pallet are expected to produce this digest item,
459/// but will stop as soon as they are able to provide the relay-parent hash directly.
460///
461/// The relay-chain storage root is, in practice, a unique identifier of a block
462/// in the absence of equivocations (which are slashable). This assumes that the relay chain
463/// uses BABE or SASSAFRAS, because the slot and the author's VRF randomness are both included
464/// in the relay-chain storage root in both cases.
465///
466/// Therefore, the relay-parent storage root is a suitable identifier of unique relay chain
467/// blocks in low-value scenarios such as performance optimizations.
468#[doc(hidden)]
469pub mod rpsr_digest {
470	use super::{relay_chain, ConsensusEngineId, DecodeAll, Digest, DigestItem, Encode};
471	use codec::Compact;
472
473	/// The type used to store the relay-parent storage root and number.
474	pub type RpsrType = (relay_chain::Hash, Compact<relay_chain::BlockNumber>);
475
476	/// A consensus engine ID for relay-parent storage root digests.
477	pub const RPSR_CONSENSUS_ID: ConsensusEngineId = *b"RPSR";
478
479	/// Construct a digest item for relay-parent storage roots.
480	pub fn relay_parent_storage_root_item(
481		storage_root: relay_chain::Hash,
482		number: impl Into<Compact<relay_chain::BlockNumber>>,
483	) -> DigestItem {
484		DigestItem::Consensus(
485			RPSR_CONSENSUS_ID,
486			RpsrType::from((storage_root, number.into())).encode(),
487		)
488	}
489
490	/// Extract the relay-parent storage root and number from the provided header digest. Returns
491	/// `None` if none were found.
492	pub fn extract_relay_parent_storage_root(
493		digest: &Digest,
494	) -> Option<(relay_chain::Hash, relay_chain::BlockNumber)> {
495		digest.convert_first(|d| match d {
496			DigestItem::Consensus(id, val) if id == &RPSR_CONSENSUS_ID => {
497				let (h, n) = RpsrType::decode_all(&mut &val[..]).ok()?;
498
499				Some((h, n.0))
500			},
501			_ => None,
502		})
503	}
504}
505
506/// Information about a collation.
507///
508/// This was used in version 1 of the [`CollectCollationInfo`] runtime api.
509#[derive(Clone, Debug, codec::Decode, codec::Encode, PartialEq)]
510pub struct CollationInfoV1 {
511	/// Messages destined to be interpreted by the Relay chain itself.
512	pub upward_messages: Vec<UpwardMessage>,
513	/// The horizontal messages sent by the parachain.
514	pub horizontal_messages: Vec<OutboundHrmpMessage>,
515	/// New validation code.
516	pub new_validation_code: Option<relay_chain::ValidationCode>,
517	/// The number of messages processed from the DMQ.
518	pub processed_downward_messages: u32,
519	/// The mark which specifies the block number up to which all inbound HRMP messages are
520	/// processed.
521	pub hrmp_watermark: relay_chain::BlockNumber,
522}
523
524impl CollationInfoV1 {
525	/// Convert into the latest version of the [`CollationInfo`] struct.
526	pub fn into_latest(self, head_data: HeadData) -> CollationInfo {
527		CollationInfo {
528			upward_messages: self.upward_messages,
529			horizontal_messages: self.horizontal_messages,
530			new_validation_code: self.new_validation_code,
531			processed_downward_messages: self.processed_downward_messages,
532			hrmp_watermark: self.hrmp_watermark,
533			head_data,
534		}
535	}
536}
537
538/// Information about a collation.
539#[derive(Clone, Debug, codec::Decode, codec::Encode, PartialEq, TypeInfo)]
540pub struct CollationInfo {
541	/// Messages destined to be interpreted by the Relay chain itself.
542	pub upward_messages: Vec<UpwardMessage>,
543	/// The horizontal messages sent by the parachain.
544	pub horizontal_messages: Vec<OutboundHrmpMessage>,
545	/// New validation code.
546	pub new_validation_code: Option<relay_chain::ValidationCode>,
547	/// The number of messages processed from the DMQ.
548	pub processed_downward_messages: u32,
549	/// The mark which specifies the block number up to which all inbound HRMP messages are
550	/// processed.
551	pub hrmp_watermark: relay_chain::BlockNumber,
552	/// The head data, aka encoded header, of the block that corresponds to the collation.
553	pub head_data: HeadData,
554}
555
556/// A relay chain storage key to be included in the storage proof.
557#[derive(Clone, Debug, Encode, Decode, TypeInfo, PartialEq, Eq)]
558pub enum RelayStorageKey {
559	/// Top-level relay chain storage key.
560	Top(Vec<u8>),
561	/// Child trie storage key.
562	Child {
563		/// Unprefixed storage key identifying the child trie root location.
564		/// Prefix `:child_storage:default:` is added when accessing storage.
565		/// Used to derive `ChildInfo` for reading child trie data.
566		/// Usage: let child_info = ChildInfo::new_default(&storage_key);
567		storage_key: Vec<u8>,
568		/// Key within the child trie.
569		key: Vec<u8>,
570	},
571}
572
573/// Request for proving relay chain storage data.
574///
575/// Contains a list of storage keys (either top-level or child trie keys)
576/// to be included in the relay chain state proof.
577#[derive(Clone, Debug, Encode, Decode, TypeInfo, PartialEq, Eq, Default)]
578pub struct RelayProofRequest {
579	/// Storage keys to include in the relay chain state proof.
580	pub keys: Vec<RelayStorageKey>,
581}
582
583sp_api::decl_runtime_apis! {
584	/// Runtime api to collect information about a collation.
585	///
586	/// Version history:
587	/// - Version 2: Changed [`Self::collect_collation_info`] signature
588	/// - Version 3: Signals to the node to use version 1 of [`ParachainBlockData`].
589	#[api_version(3)]
590	pub trait CollectCollationInfo {
591		/// Collect information about a collation.
592		#[changed_in(2)]
593		fn collect_collation_info() -> CollationInfoV1;
594		/// Collect information about a collation.
595		///
596		/// The given `header` is the header of the built block for that
597		/// we are collecting the collation info for.
598		fn collect_collation_info(header: &Block::Header) -> CollationInfo;
599	}
600
601	/// Runtime api used to access general info about a parachain runtime.
602	pub trait GetParachainInfo {
603		/// Retrieve the parachain id used for runtime.
604		fn parachain_id() -> ParaId;
605  }
606
607	/// API to tell the node side how the relay parent should be chosen.
608	///
609	/// A larger offset indicates that the relay parent should not be the tip of the relay chain,
610	/// but `N` blocks behind the tip. This offset is then enforced by the runtime.
611	pub trait RelayParentOffsetApi {
612		/// Fetch the slot offset that is expected from the relay chain.
613		fn relay_parent_offset() -> u32;
614	}
615
616	/// API for parachain target block rate.
617	///
618	/// This runtime API allows the parachain runtime to communicate the target block rate
619	/// to the node side. The target block rate is always valid for the next relay chain slot.
620	///
621	/// The runtime can not enforce this target block rate. It only acts as a maximum, but not more.
622	/// In the end it depends on the collator how many blocks will be produced. If there are no cores
623	/// available or the collator is offline, no blocks at all will be produced.
624	pub trait TargetBlockRate {
625		/// Get the target block rate for this parachain.
626		///
627		/// Returns the target number of blocks per relay chain slot.
628		fn target_block_rate() -> u32;
629	}
630
631	/// API for specifying which relay chain storage data to include in storage proofs.
632	///
633	/// This API allows parachains to request both top-level relay chain storage keys
634	/// and child trie storage keys to be included in the relay chain state proof.
635	pub trait KeyToIncludeInRelayProof {
636		/// Returns relay chain storage proof requests.
637		///
638		/// The collator will include them in the relay chain proof that is passed alongside the parachain inherent into the runtime.
639		fn keys_to_prove() -> RelayProofRequest;
640	}
641}