pub trait ParachainHost<Block, H = H256, N = u32>: Core<Block>where
    Block: Block,
    H: Encode + Decode,
    N: Encode + Decode,{
Show 25 methods // Provided methods fn validators( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<Public, Global>, ApiError> { ... } fn validator_groups( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<(Vec<Vec<ValidatorIndex, Global>, Global>, GroupRotationInfo<N>), ApiError> { ... } fn availability_cores( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<CoreState<H, N>, Global>, ApiError> { ... } fn persisted_validation_data( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<PersistedValidationData<H, N>>, ApiError> { ... } fn assumed_validation_data( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, expected_persisted_validation_data_hash: H256 ) -> Result<Option<(PersistedValidationData<H, N>, ValidationCodeHash)>, ApiError> { ... } fn check_validation_outputs( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, outputs: CandidateCommitments<u32> ) -> Result<bool, ApiError> { ... } fn session_index_for_child( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<u32, ApiError> { ... } fn validation_code( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<ValidationCode>, ApiError> { ... } fn candidate_pending_availability( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id ) -> Result<Option<CommittedCandidateReceipt<H>>, ApiError> { ... } fn candidate_events( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<CandidateEvent<H>, Global>, ApiError> { ... } fn dmq_contents( &self, __runtime_api_at_param__: <Block as Block>::Hash, recipient: Id ) -> Result<Vec<InboundDownwardMessage<N>, Global>, ApiError> { ... } fn inbound_hrmp_channels_contents( &self, __runtime_api_at_param__: <Block as Block>::Hash, recipient: Id ) -> Result<BTreeMap<Id, Vec<InboundHrmpMessage<N>, Global>, Global>, ApiError> { ... } fn validation_code_by_hash( &self, __runtime_api_at_param__: <Block as Block>::Hash, hash: ValidationCodeHash ) -> Result<Option<ValidationCode>, ApiError> { ... } fn on_chain_votes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Option<ScrapedOnChainVotes<H>>, ApiError> { ... } fn session_info( &self, __runtime_api_at_param__: <Block as Block>::Hash, index: u32 ) -> Result<Option<SessionInfo>, ApiError> { ... } fn submit_pvf_check_statement( &self, __runtime_api_at_param__: <Block as Block>::Hash, stmt: PvfCheckStatement, signature: Signature ) -> Result<(), ApiError> { ... } fn pvfs_require_precheck( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<ValidationCodeHash, Global>, ApiError> { ... } fn validation_code_hash( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<ValidationCodeHash>, ApiError> { ... } fn disputes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<(u32, CandidateHash, DisputeState<u32>), Global>, ApiError> { ... } fn session_executor_params( &self, __runtime_api_at_param__: <Block as Block>::Hash, session_index: u32 ) -> Result<Option<ExecutorParams>, ApiError> { ... } fn unapplied_slashes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<(u32, CandidateHash, PendingSlashes), Global>, ApiError> { ... } fn key_ownership_proof( &self, __runtime_api_at_param__: <Block as Block>::Hash, validator_id: Public ) -> Result<Option<OpaqueKeyOwnershipProof>, ApiError> { ... } fn submit_report_dispute_lost( &self, __runtime_api_at_param__: <Block as Block>::Hash, dispute_proof: DisputeProof, key_ownership_proof: OpaqueKeyOwnershipProof ) -> Result<Option<()>, ApiError> { ... } fn staging_para_backing_state( &self, __runtime_api_at_param__: <Block as Block>::Hash, __runtime_api_generated_name_0__: Id ) -> Result<Option<BackingState<H, N>>, ApiError> { ... } fn staging_async_backing_params( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<AsyncBackingParams, ApiError> { ... }
}
Expand description

The API for querying the state of parachains on-chain.

Provided Methods§

fn validators( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<Public, Global>, ApiError>

Get the current validators.

fn validator_groups( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<(Vec<Vec<ValidatorIndex, Global>, Global>, GroupRotationInfo<N>), ApiError>

Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on. Note that now in the GroupRotationInfo should be the successor of the number of the block.

fn availability_cores( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<CoreState<H, N>, Global>, ApiError>

Yields information on all availability cores as relevant to the child block. Cores are either free or occupied. Free cores can have paras assigned to them.

fn persisted_validation_data( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<PersistedValidationData<H, N>>, ApiError>

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.

fn assumed_validation_data( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, expected_persisted_validation_data_hash: H256 ) -> Result<Option<(PersistedValidationData<H, N>, ValidationCodeHash)>, ApiError>

Returns the persisted validation data for the given ParaId along with the corresponding validation code hash. Instead of accepting assumption about the para, matches the validation data hash against an expected one and yields None if they’re not equal.

fn check_validation_outputs( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, outputs: CandidateCommitments<u32> ) -> Result<bool, ApiError>

Checks if the given validation outputs pass the acceptance criteria.

fn session_index_for_child( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<u32, ApiError>

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

This can be used to instantiate a SigningContext.

fn validation_code( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<ValidationCode>, ApiError>

Fetch the validation code used by a para, making the given OccupiedCoreAssumption.

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

fn candidate_pending_availability( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id ) -> Result<Option<CommittedCandidateReceipt<H>>, ApiError>

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

fn candidate_events( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<CandidateEvent<H>, Global>, ApiError>

Get a vector of events concerning candidates that occurred within a block.

fn dmq_contents( &self, __runtime_api_at_param__: <Block as Block>::Hash, recipient: Id ) -> Result<Vec<InboundDownwardMessage<N>, Global>, ApiError>

Get all the pending inbound messages in the downward message queue for a para.

fn inbound_hrmp_channels_contents( &self, __runtime_api_at_param__: <Block as Block>::Hash, recipient: Id ) -> Result<BTreeMap<Id, Vec<InboundHrmpMessage<N>, Global>, Global>, ApiError>

Get the contents of all channels addressed to the given recipient. Channels that have no messages in them are also included.

fn validation_code_by_hash( &self, __runtime_api_at_param__: <Block as Block>::Hash, hash: ValidationCodeHash ) -> Result<Option<ValidationCode>, ApiError>

Get the validation code from its hash.

fn on_chain_votes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Option<ScrapedOnChainVotes<H>>, ApiError>

Scrape dispute relevant from on-chain, backing votes and resolved disputes.

fn session_info( &self, __runtime_api_at_param__: <Block as Block>::Hash, index: u32 ) -> Result<Option<SessionInfo>, ApiError>

Get the session info for the given session, if stored.

NOTE: This function is only available since parachain host version 2.

fn submit_pvf_check_statement( &self, __runtime_api_at_param__: <Block as Block>::Hash, stmt: PvfCheckStatement, signature: Signature ) -> Result<(), ApiError>

Submits a PVF pre-checking statement into the transaction pool.

NOTE: This function is only available since parachain host version 2.

fn pvfs_require_precheck( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<ValidationCodeHash, Global>, ApiError>

Returns code hashes of PVFs that require pre-checking by validators in the active set.

NOTE: This function is only available since parachain host version 2.

fn validation_code_hash( &self, __runtime_api_at_param__: <Block as Block>::Hash, para_id: Id, assumption: OccupiedCoreAssumption ) -> Result<Option<ValidationCodeHash>, ApiError>

Fetch the hash of the validation code used by a para, making the given OccupiedCoreAssumption.

NOTE: This function is only available since parachain host version 2.

fn disputes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<(u32, CandidateHash, DisputeState<u32>), Global>, ApiError>

Returns all onchain disputes.

fn session_executor_params( &self, __runtime_api_at_param__: <Block as Block>::Hash, session_index: u32 ) -> Result<Option<ExecutorParams>, ApiError>

Returns execution parameters for the session.

fn unapplied_slashes( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<Vec<(u32, CandidateHash, PendingSlashes), Global>, ApiError>

Returns a list of validators that lost a past session dispute and need to be slashed. NOTE: This function is only available since parachain host version 5.

fn key_ownership_proof( &self, __runtime_api_at_param__: <Block as Block>::Hash, validator_id: Public ) -> Result<Option<OpaqueKeyOwnershipProof>, ApiError>

Returns a merkle proof of a validator session key. NOTE: This function is only available since parachain host version 5.

fn submit_report_dispute_lost( &self, __runtime_api_at_param__: <Block as Block>::Hash, dispute_proof: DisputeProof, key_ownership_proof: OpaqueKeyOwnershipProof ) -> Result<Option<()>, ApiError>

Submit an unsigned extrinsic to slash validators who lost a dispute about a candidate of a past session. NOTE: This function is only available since parachain host version 5.

fn staging_para_backing_state( &self, __runtime_api_at_param__: <Block as Block>::Hash, __runtime_api_generated_name_0__: Id ) -> Result<Option<BackingState<H, N>>, ApiError>

Returns the state of parachain backing for a given para. This is a staging method! Do not use on production runtimes!

fn staging_async_backing_params( &self, __runtime_api_at_param__: <Block as Block>::Hash ) -> Result<AsyncBackingParams, ApiError>

Returns candidate’s acceptance limitations for asynchronous backing for a relay parent.

Trait Implementations§

§

impl<Block, H, N> RuntimeApiInfo for dyn ParachainHost<Block, H, N> + 'staticwhere Block: Block, H: Encode + Decode, N: Encode + Decode,

§

const ID: [u8; 8] = [175u8, 44u8, 2u8, 151u8, 162u8, 62u8, 109u8, 61u8]

The identifier of the runtime api.
§

const VERSION: u32 = 5u32

The version of the runtime api.

Implementors§