pub trait RelayChainInterface: Send + Sync {
Show 17 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 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;
}
Expand description
Trait that provides all necessary methods for interaction between collator and relay chain.
Required Methods§
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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_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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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,
Get the receipt of a candidate pending availability. This returns Some
for any paras
assigned to occupied cores in availability_cores
and None
otherwise.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn overseer_handle(&self) -> RelayChainResult<OverseerHandle>
fn overseer_handle(&self) -> RelayChainResult<OverseerHandle>
Get a handle to the overseer.
sourcefn 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 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.