pub trait RelayChainInterface: Send + Sync {
Show 23 methods // Required methods fn get_storage_by_key<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<StorageValue>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn validators<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<ValidatorId>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn best_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn header<'life0, 'async_trait>( &'life0 self, block_id: BlockId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PHeader>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn finalized_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_runtime_api<'life0, 'life1, 'async_trait>( &'life0 self, method_name: &'static str, hash: RelayHash, payload: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn retrieve_dmq_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<InboundDownwardMessage>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn retrieve_all_inbound_hrmp_channel_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<ParaId, Vec<InboundHrmpMessage>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn persisted_validation_data<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, __arg3: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PersistedValidationData>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn candidate_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<CommittedCandidateReceipt>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn session_index_for_child<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<SessionIndex>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn import_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn new_best_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wait_for_block<'life0, 'async_trait>( &'life0 self, hash: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn finality_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn is_major_syncing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn overseer_handle(&self) -> RelayChainResult<OverseerHandle>; fn prove_read<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, relevant_keys: &'life1 Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = RelayChainResult<StorageProof>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn validation_code_hash<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, para_id: ParaId, occupied_core_assumption: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<ValidationCodeHash>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn candidates_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CommittedCandidateReceipt>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn version<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<RuntimeVersion>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn availability_cores<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CoreState<PHash, BlockNumber>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn claim_queue<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<CoreIndex, VecDeque<ParaId>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Trait that provides all necessary methods for interaction between collator and relay chain.

Required Methods§

source

fn get_storage_by_key<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<StorageValue>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a storage item by key.

source

fn validators<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<ValidatorId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch a vector of current validators.

source

fn best_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the hash of the current best block.

source

fn header<'life0, 'async_trait>( &'life0 self, block_id: BlockId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PHeader>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the block header of a given hash or height, if it exists.

source

fn finalized_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the hash of the finalized block.

source

fn call_runtime_api<'life0, 'life1, 'async_trait>( &'life0 self, method_name: &'static str, hash: RelayHash, payload: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Call an arbitrary runtime api. The input and output are SCALE-encoded.

source

fn retrieve_dmq_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<InboundDownwardMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the whole contents of the downward message queue for the parachain we are collating for.

Returns None in case of an error.

source

fn retrieve_all_inbound_hrmp_channel_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<ParaId, Vec<InboundHrmpMessage>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns channels contents for each inbound HRMP channel addressed to the parachain we are collating for.

Empty channels are also included.

source

fn persisted_validation_data<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, __arg3: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PersistedValidationData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Yields the persisted validation data for the given ParaId along with an assumption that should be used if the para currently occupies a core.

Returns None if either the para is not registered or the assumption is Freed and the para already occupies a core.

source

fn candidate_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<CommittedCandidateReceipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

👎Deprecated: candidate_pending_availability only returns one candidate and is deprecated. Use candidates_pending_availability instead.

Get the receipt of the first candidate pending availability of this para_id. This returns Some for any paras assigned to occupied cores in availability_cores and None otherwise.

source

fn session_index_for_child<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<SessionIndex>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the session index expected at a child of the block.

source

fn import_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a stream of import block notifications.

source

fn new_best_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a stream of new best block notifications.

source

fn wait_for_block<'life0, 'async_trait>( &'life0 self, hash: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait for a block with a given hash in the relay chain.

This method returns immediately on error or if the block is already reported to be in chain. Otherwise, it waits for the block to arrive.

source

fn finality_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a stream of finality notifications.

source

fn is_major_syncing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether the synchronization service is undergoing major sync. Returns true if so.

source

fn overseer_handle(&self) -> RelayChainResult<OverseerHandle>

Get a handle to the overseer.

source

fn prove_read<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, relevant_keys: &'life1 Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = RelayChainResult<StorageProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a storage read proof.

source

fn validation_code_hash<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, para_id: ParaId, occupied_core_assumption: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<ValidationCodeHash>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the validation code hash for the given para_id using the given occupied_core_assumption.

source

fn candidates_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CommittedCandidateReceipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the receipts of all candidates pending availability for this para_id.

source

fn version<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<RuntimeVersion>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the runtime version of the relay chain.

source

fn availability_cores<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CoreState<PHash, BlockNumber>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Yields information on all availability cores as relevant to the child block.

Cores are either free, scheduled or occupied. Free cores can have paras assigned to them.

source

fn claim_queue<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<CoreIndex, VecDeque<ParaId>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the claim queue.

Implementations on Foreign Types§

source§

impl<T> RelayChainInterface for Arc<T>

source§

fn retrieve_dmq_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<InboundDownwardMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn retrieve_all_inbound_hrmp_channel_contents<'life0, 'async_trait>( &'life0 self, para_id: ParaId, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<ParaId, Vec<InboundHrmpMessage>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn persisted_validation_data<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, occupied_core_assumption: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PersistedValidationData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn candidate_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<CommittedCandidateReceipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

👎Deprecated: candidate_pending_availability only returns one candidate and is deprecated. Use candidates_pending_availability instead.
source§

fn session_index_for_child<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<SessionIndex>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn validators<'life0, 'async_trait>( &'life0 self, block_id: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<ValidatorId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn import_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn finality_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn best_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn finalized_block_hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<PHash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn call_runtime_api<'life0, 'life1, 'async_trait>( &'life0 self, method_name: &'static str, hash: RelayHash, payload: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn is_major_syncing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn overseer_handle(&self) -> RelayChainResult<OverseerHandle>

source§

fn get_storage_by_key<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<StorageValue>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn prove_read<'life0, 'life1, 'async_trait>( &'life0 self, relay_parent: PHash, relevant_keys: &'life1 Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = RelayChainResult<StorageProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn wait_for_block<'life0, 'async_trait>( &'life0 self, hash: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn new_best_notification_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Pin<Box<dyn Stream<Item = PHeader> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn header<'life0, 'async_trait>( &'life0 self, block_id: BlockId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<PHeader>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn validation_code_hash<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, para_id: ParaId, occupied_core_assumption: OccupiedCoreAssumption, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Option<ValidationCodeHash>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn availability_cores<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CoreState<PHash, BlockNumber>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn candidates_pending_availability<'life0, 'async_trait>( &'life0 self, block_id: PHash, para_id: ParaId, ) -> Pin<Box<dyn Future<Output = RelayChainResult<Vec<CommittedCandidateReceipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn version<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<RuntimeVersion>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn claim_queue<'life0, 'async_trait>( &'life0 self, relay_parent: PHash, ) -> Pin<Box<dyn Future<Output = RelayChainResult<BTreeMap<CoreIndex, VecDeque<ParaId>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§