pub trait ParachainHost<Block: BlockT>: Core<Block> {
Show 31 methods
// Provided methods
fn validators(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidatorId>, ApiError> { ... }
fn validator_groups(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Vec<Vec<ValidatorIndex>>, GroupRotationInfo<BlockNumber>), ApiError> { ... }
fn availability_cores(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<CoreState<Hash, BlockNumber>>, ApiError> { ... }
fn persisted_validation_data(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<PersistedValidationData<Hash, BlockNumber>>, ApiError> { ... }
fn assumed_validation_data(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
expected_persisted_validation_data_hash: Hash,
) -> Result<Option<(PersistedValidationData<Hash, BlockNumber>, ValidationCodeHash)>, ApiError> { ... }
fn check_validation_outputs(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
outputs: CandidateCommitments,
) -> Result<bool, ApiError> { ... }
fn session_index_for_child(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SessionIndex, ApiError> { ... }
fn validation_code(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<ValidationCode>, ApiError> { ... }
fn candidate_pending_availability(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
) -> Result<Option<CommittedCandidateReceipt<Hash>>, ApiError> { ... }
fn candidate_events(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<CandidateEvent<Hash>>, ApiError> { ... }
fn dmq_contents(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
recipient: Id,
) -> Result<Vec<InboundDownwardMessage<BlockNumber>>, ApiError> { ... }
fn inbound_hrmp_channels_contents(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
recipient: Id,
) -> Result<BTreeMap<Id, Vec<InboundHrmpMessage<BlockNumber>>>, ApiError> { ... }
fn validation_code_by_hash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
hash: ValidationCodeHash,
) -> Result<Option<ValidationCode>, ApiError> { ... }
fn on_chain_votes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<ScrapedOnChainVotes<Hash>>, ApiError> { ... }
fn session_info(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
index: SessionIndex,
) -> Result<Option<SessionInfo>, ApiError> { ... }
fn submit_pvf_check_statement(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
stmt: PvfCheckStatement,
signature: ValidatorSignature,
) -> Result<(), ApiError> { ... }
fn pvfs_require_precheck(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidationCodeHash>, ApiError> { ... }
fn validation_code_hash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<ValidationCodeHash>, ApiError> { ... }
fn disputes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<(SessionIndex, CandidateHash, DisputeState<BlockNumber>)>, ApiError> { ... }
fn session_executor_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
session_index: SessionIndex,
) -> Result<Option<ExecutorParams>, ApiError> { ... }
fn unapplied_slashes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<(SessionIndex, CandidateHash, PendingSlashes)>, ApiError> { ... }
fn key_ownership_proof(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
validator_id: ValidatorId,
) -> Result<Option<OpaqueKeyOwnershipProof>, ApiError> { ... }
fn submit_report_dispute_lost(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dispute_proof: DisputeProof,
key_ownership_proof: OpaqueKeyOwnershipProof,
) -> Result<Option<()>, ApiError> { ... }
fn minimum_backing_votes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u32, ApiError> { ... }
fn para_backing_state(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
__runtime_api_generated_name_0__: Id,
) -> Result<Option<BackingState<Hash, BlockNumber>>, ApiError> { ... }
fn async_backing_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<AsyncBackingParams, ApiError> { ... }
fn disabled_validators(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidatorIndex>, ApiError> { ... }
fn node_features(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<NodeFeatures, ApiError> { ... }
fn approval_voting_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ApprovalVotingParams, ApiError> { ... }
fn claim_queue(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BTreeMap<CoreIndex, VecDeque<Id>>, ApiError> { ... }
fn candidates_pending_availability(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
) -> Result<Vec<CommittedCandidateReceipt<Hash>>, ApiError> { ... }
}
Expand description
The API for querying the state of parachains on-chain.
Provided Methods§
sourcefn validators(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidatorId>, ApiError>
fn validators( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<ValidatorId>, ApiError>
Get the current validators.
sourcefn validator_groups(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Vec<Vec<ValidatorIndex>>, GroupRotationInfo<BlockNumber>), ApiError>
fn validator_groups( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(Vec<Vec<ValidatorIndex>>, GroupRotationInfo<BlockNumber>), 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.
sourcefn availability_cores(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<CoreState<Hash, BlockNumber>>, ApiError>
fn availability_cores( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<CoreState<Hash, BlockNumber>>, 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.
sourcefn persisted_validation_data(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<PersistedValidationData<Hash, BlockNumber>>, ApiError>
fn persisted_validation_data( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, para_id: Id, assumption: OccupiedCoreAssumption, ) -> Result<Option<PersistedValidationData<Hash, BlockNumber>>, 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.
sourcefn assumed_validation_data(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
expected_persisted_validation_data_hash: Hash,
) -> Result<Option<(PersistedValidationData<Hash, BlockNumber>, ValidationCodeHash)>, ApiError>
fn assumed_validation_data( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, para_id: Id, expected_persisted_validation_data_hash: Hash, ) -> Result<Option<(PersistedValidationData<Hash, BlockNumber>, 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.
sourcefn check_validation_outputs(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
outputs: CandidateCommitments,
) -> Result<bool, ApiError>
fn check_validation_outputs( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, para_id: Id, outputs: CandidateCommitments, ) -> Result<bool, ApiError>
Checks if the given validation outputs pass the acceptance criteria.
sourcefn session_index_for_child(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SessionIndex, ApiError>
fn session_index_for_child( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<SessionIndex, ApiError>
Returns the session index expected at a child of the block.
This can be used to instantiate a SigningContext
.
sourcefn validation_code(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<ValidationCode>, ApiError>
fn validation_code( &self, __runtime_api_at_param__: <Block as BlockT>::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.
sourcefn candidate_pending_availability(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
) -> Result<Option<CommittedCandidateReceipt<Hash>>, ApiError>
fn candidate_pending_availability( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, para_id: Id, ) -> Result<Option<CommittedCandidateReceipt<Hash>>, 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.
sourcefn candidate_events(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<CandidateEvent<Hash>>, ApiError>
fn candidate_events( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<CandidateEvent<Hash>>, ApiError>
Get a vector of events concerning candidates that occurred within a block.
sourcefn dmq_contents(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
recipient: Id,
) -> Result<Vec<InboundDownwardMessage<BlockNumber>>, ApiError>
fn dmq_contents( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, recipient: Id, ) -> Result<Vec<InboundDownwardMessage<BlockNumber>>, ApiError>
Get all the pending inbound messages in the downward message queue for a para.
sourcefn inbound_hrmp_channels_contents(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
recipient: Id,
) -> Result<BTreeMap<Id, Vec<InboundHrmpMessage<BlockNumber>>>, ApiError>
fn inbound_hrmp_channels_contents( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, recipient: Id, ) -> Result<BTreeMap<Id, Vec<InboundHrmpMessage<BlockNumber>>>, ApiError>
Get the contents of all channels addressed to the given recipient. Channels that have no messages in them are also included.
sourcefn validation_code_by_hash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
hash: ValidationCodeHash,
) -> Result<Option<ValidationCode>, ApiError>
fn validation_code_by_hash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, hash: ValidationCodeHash, ) -> Result<Option<ValidationCode>, ApiError>
Get the validation code from its hash.
sourcefn on_chain_votes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<ScrapedOnChainVotes<Hash>>, ApiError>
fn on_chain_votes( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<ScrapedOnChainVotes<Hash>>, ApiError>
Scrape dispute relevant from on-chain, backing votes and resolved disputes.
sourcefn session_info(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
index: SessionIndex,
) -> Result<Option<SessionInfo>, ApiError>
fn session_info( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, index: SessionIndex, ) -> 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.
sourcefn submit_pvf_check_statement(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
stmt: PvfCheckStatement,
signature: ValidatorSignature,
) -> Result<(), ApiError>
fn submit_pvf_check_statement( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, stmt: PvfCheckStatement, signature: ValidatorSignature, ) -> Result<(), ApiError>
Submits a PVF pre-checking statement into the transaction pool.
NOTE: This function is only available since parachain host version 2.
sourcefn pvfs_require_precheck(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidationCodeHash>, ApiError>
fn pvfs_require_precheck( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<ValidationCodeHash>, 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.
sourcefn validation_code_hash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
assumption: OccupiedCoreAssumption,
) -> Result<Option<ValidationCodeHash>, ApiError>
fn validation_code_hash( &self, __runtime_api_at_param__: <Block as BlockT>::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.
sourcefn disputes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<(SessionIndex, CandidateHash, DisputeState<BlockNumber>)>, ApiError>
fn disputes( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<(SessionIndex, CandidateHash, DisputeState<BlockNumber>)>, ApiError>
Returns all onchain disputes.
sourcefn session_executor_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
session_index: SessionIndex,
) -> Result<Option<ExecutorParams>, ApiError>
fn session_executor_params( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, session_index: SessionIndex, ) -> Result<Option<ExecutorParams>, ApiError>
Returns execution parameters for the session.
sourcefn unapplied_slashes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<(SessionIndex, CandidateHash, PendingSlashes)>, ApiError>
fn unapplied_slashes( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<(SessionIndex, CandidateHash, PendingSlashes)>, 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.
sourcefn key_ownership_proof(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
validator_id: ValidatorId,
) -> Result<Option<OpaqueKeyOwnershipProof>, ApiError>
fn key_ownership_proof( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, validator_id: ValidatorId, ) -> Result<Option<OpaqueKeyOwnershipProof>, ApiError>
Returns a merkle proof of a validator session key. NOTE: This function is only available since parachain host version 5.
sourcefn submit_report_dispute_lost(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dispute_proof: DisputeProof,
key_ownership_proof: OpaqueKeyOwnershipProof,
) -> Result<Option<()>, ApiError>
fn submit_report_dispute_lost( &self, __runtime_api_at_param__: <Block as BlockT>::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.
sourcefn minimum_backing_votes(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u32, ApiError>
fn minimum_backing_votes( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u32, ApiError>
Get the minimum number of backing votes for a parachain candidate. This is a staging method! Do not use on production runtimes!
sourcefn para_backing_state(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
__runtime_api_generated_name_0__: Id,
) -> Result<Option<BackingState<Hash, BlockNumber>>, ApiError>
fn para_backing_state( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, __runtime_api_generated_name_0__: Id, ) -> Result<Option<BackingState<Hash, BlockNumber>>, ApiError>
Returns the state of parachain backing for a given para.
sourcefn async_backing_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<AsyncBackingParams, ApiError>
fn async_backing_params( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<AsyncBackingParams, ApiError>
Returns candidate’s acceptance limitations for asynchronous backing for a relay parent.
sourcefn disabled_validators(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<ValidatorIndex>, ApiError>
fn disabled_validators( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<ValidatorIndex>, ApiError>
Returns a list of all disabled validators at the given block.
sourcefn node_features(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<NodeFeatures, ApiError>
fn node_features( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<NodeFeatures, ApiError>
Get node features. This is a staging method! Do not use on production runtimes!
sourcefn approval_voting_params(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ApprovalVotingParams, ApiError>
fn approval_voting_params( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<ApprovalVotingParams, ApiError>
Approval voting configuration parameters
sourcefn claim_queue(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BTreeMap<CoreIndex, VecDeque<Id>>, ApiError>
fn claim_queue( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<BTreeMap<CoreIndex, VecDeque<Id>>, ApiError>
Claim queue
sourcefn candidates_pending_availability(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
para_id: Id,
) -> Result<Vec<CommittedCandidateReceipt<Hash>>, ApiError>
fn candidates_pending_availability( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, para_id: Id, ) -> Result<Vec<CommittedCandidateReceipt<Hash>>, ApiError>
Elastic scaling support