Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ParachainHost runtime Api v6 7 8 9 10 #5850

Merged
merged 4 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 128 additions & 2 deletions packages/api-augment/src/kusama/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import '@polkadot/api-base/types/calls';

import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U64, Vec, u32 } from '@polkadot/types-codec';
import type { Bytes, Null, Option, Result, U64, Vec, bool, u32 } from '@polkadot/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
import type { BeefyAuthoritySet, BeefyEquivocationProof, BeefyNextAuthoritySet, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
Expand All @@ -19,8 +19,11 @@ import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/t
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError } from '@polkadot/types/interfaces/mmr';
import type { NpPoolId } from '@polkadot/types/interfaces/nompools';
import type { ApprovalVotingParams, AsyncBackingParams, BackingState, CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreState, DisputeProof, DisputeState, ExecutorParams, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PendingSlashes, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Balance, Block, BlockNumber, Call, Hash, Header, Index, KeyTypeId, Slot, Weight } from '@polkadot/types/interfaces/runtime';
import type { AccountId, Balance, Block, BlockNumber, Call, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { ValidatorIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
Expand Down Expand Up @@ -278,6 +281,129 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xaf2c0297a23e6d3d/10 */
parachainHost: {
/**
* Approval voting configuration parameters
**/
approvalVotingParams: AugmentedCall<ApiType, () => Observable<ApprovalVotingParams>>;
/**
* Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.
**/
assumedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, hash: Hash | string | Uint8Array) => Observable<Option<ITuple<[PersistedValidationData, ValidationCodeHash]>>>>;
/**
* Returns candidate's acceptance limitations for asynchronous backing for a relay parent
**/
asyncBackingParams: AugmentedCall<ApiType, () => Observable<AsyncBackingParams>>;
/**
* Yields information on all availability cores as relevant to the child block.
**/
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<CoreState>>>;
/**
* Get a vector of events concerning candidates that occurred within a block.
**/
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<CandidateEvent>>>;
/**
* Get the receipt of a candidate pending availability.
**/
candidatePendingAvailability: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<CommittedCandidateReceipt>>>;
/**
* Checks if the given validation outputs pass the acceptance criteria.
**/
checkValidationOutputs: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, outputs: CandidateCommitments | { upwardMessages?: any; horizontalMessages?: any; newValidationCode?: any; headData?: any; processedDownwardMessages?: any; hrmpWatermark?: any } | string | Uint8Array) => Observable<bool>>;
/**
* Returns a list of all disabled validators at the given block
**/
disabledValidators: AugmentedCall<ApiType, () => Observable<ValidatorIndex>>;
/**
* Returns all onchain disputes.
**/
disputes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[SessionIndex, CandidateHash, DisputeState]>>>>;
/**
* Get all the pending inbound messages in the downward message queue for a para.
**/
dmqContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundDownwardMessage>>>;
/**
* Get the contents of all channels addressed to the given recipient.
**/
inboundHrmpChannelsContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundHrmpMessage>>>;
/**
* Returns a merkle proof of a validator session key
**/
keyOwnershipProof: AugmentedCall<ApiType, (validatorId: ValidatorId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Get the minimum number of backing votes for a parachain candidate. This is a staging method! Do not use on production runtimes!
**/
minimumBackingVotes: AugmentedCall<ApiType, () => Observable<u32>>;
/**
* Get node features. This is a staging method! Do not use on production runtimes!
**/
nodeFeatures: AugmentedCall<ApiType, () => Observable<NodeFeatures>>;
/**
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
**/
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<ScrapedOnChainVotes>>>;
/**
* Returns the state of parachain backing for a given para
**/
paraBackingState: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<BackingState>>>;
/**
* Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.
**/
persistedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<PersistedValidationData>>>;
/**
* Returns code hashes of PVFs that require pre-checking by validators in the active set.
**/
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<ValidationCodeHash>>>;
/**
* Returns execution parameters for the session.
**/
sessionExecutorParams: AugmentedCall<ApiType, (sessionIndex: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<ExecutorParams>>>;
/**
* Returns the session index expected at a child of the block.
**/
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<SessionIndex>>;
/**
* Get the session info for the given session, if stored.
**/
sessionInfo: AugmentedCall<ApiType, (index: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<SessionInfo>>>;
/**
* Submits a PVF pre-checking statement into the transaction pool.
**/
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: ValidatorSignature | string | Uint8Array) => Observable<Null>>;
/**
* Submit an unsigned extrinsic to slash validators who lost a dispute about a candidate of a past session
**/
submitReportDisputeLost: AugmentedCall<ApiType, (disputeProof: DisputeProof | { timeSlot?: any; kind?: any; validatorIndex?: any; validatorId?: any } | string | Uint8Array, keyOwnershipProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Returns a list of validators that lost a past session dispute and need to be slashed
**/
unappliedSlashes: AugmentedCall<ApiType, () => Observable<Vec<ITuple<[SessionIndex, CandidateHash, PendingSlashes]>>>>;
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCode>>>;
/**
* Get the validation code from its hash.
**/
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
/**
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCodeHash: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCodeHash>>>;
/**
* Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on
**/
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo]>>>;
/**
* Get the current validators.
**/
validators: AugmentedCall<ApiType, () => Observable<Vec<ValidatorId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/1 */
sessionKeys: {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/api-augment/src/polkadot/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ declare module '@polkadot/api-base/types/calls' {
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<ValidationCode>>;
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCode>>>;
/**
* Get the validation code from its hash.
**/
Expand Down
9 changes: 8 additions & 1 deletion packages/types-augment/src/registry/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import type { NftCollectionId, NftItemId } from '@polkadot/types/interfaces/nfts
import type { NpApiError, NpPoolId } from '@polkadot/types/interfaces/nompools';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeProof, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DisputesTimeSlot, DoubleVoteReport, DownwardMessage, ExecutorParam, ExecutorParams, ExecutorParamsHash, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PendingSlashes, PersistedValidationData, PvfCheckStatement, PvfExecTimeoutKind, PvfPrepTimeoutKind, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlashingOffenceKind, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, ApprovalVotingParams, AssignmentId, AssignmentKind, AsyncBackingParams, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, BackingState, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, Constraints, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeProof, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DisputesTimeSlot, DoubleVoteReport, DownwardMessage, ExecutorParam, ExecutorParams, ExecutorParamsHash, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpLimitations, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, NodeFeatures, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpChannelLimitations, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PendingSlashes, PersistedValidationData, PvfCheckStatement, PvfExecTimeoutKind, PvfPrepTimeoutKind, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlashingOffenceKind, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo, RuntimeDispatchInfoV1, RuntimeDispatchInfoV2 } from '@polkadot/types/interfaces/payment';
import type { Approvals } from '@polkadot/types/interfaces/poll';
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
Expand Down Expand Up @@ -112,6 +112,7 @@ declare module '@polkadot/types/types/registry' {
ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6;
ApprovalFlag: ApprovalFlag;
Approvals: Approvals;
ApprovalVotingParams: ApprovalVotingParams;
ArithmeticError: ArithmeticError;
AssetApproval: AssetApproval;
AssetApprovalKey: AssetApprovalKey;
Expand All @@ -127,6 +128,7 @@ declare module '@polkadot/types/types/registry' {
AssetOptions: AssetOptions;
AssignmentId: AssignmentId;
AssignmentKind: AssignmentKind;
AsyncBackingParams: AsyncBackingParams;
AttestedCandidate: AttestedCandidate;
AuctionIndex: AuctionIndex;
AuthIndex: AuthIndex;
Expand All @@ -149,6 +151,7 @@ declare module '@polkadot/types/types/registry' {
BabeGenesisConfigurationV1: BabeGenesisConfigurationV1;
BabeWeight: BabeWeight;
BackedCandidate: BackedCandidate;
BackingState: BackingState;
Balance: Balance;
BalanceLock: BalanceLock;
BalanceLockTo212: BalanceLockTo212;
Expand Down Expand Up @@ -251,6 +254,7 @@ declare module '@polkadot/types/types/registry' {
ConfigData: ConfigData;
Consensus: Consensus;
ConsensusEngineId: ConsensusEngineId;
Constraints: Constraints;
ConsumedWeight: ConsumedWeight;
ContractCallFlags: ContractCallFlags;
ContractCallRequest: ContractCallRequest;
Expand Down Expand Up @@ -585,6 +589,7 @@ declare module '@polkadot/types/types/registry' {
ImmortalEra: ImmortalEra;
ImportedAux: ImportedAux;
InboundDownwardMessage: InboundDownwardMessage;
InboundHrmpLimitations: InboundHrmpLimitations;
InboundHrmpMessage: InboundHrmpMessage;
InboundHrmpMessages: InboundHrmpMessages;
InboundLaneData: InboundLaneData;
Expand Down Expand Up @@ -730,6 +735,7 @@ declare module '@polkadot/types/types/registry' {
NextConfigDescriptorV1: NextConfigDescriptorV1;
NftCollectionId: NftCollectionId;
NftItemId: NftItemId;
NodeFeatures: NodeFeatures;
NodeRole: NodeRole;
Nominations: Nominations;
NominatorIndex: NominatorIndex;
Expand Down Expand Up @@ -763,6 +769,7 @@ declare module '@polkadot/types/types/registry' {
OriginKindV0: OriginKindV0;
OriginKindV1: OriginKindV1;
OriginKindV2: OriginKindV2;
OutboundHrmpChannelLimitations: OutboundHrmpChannelLimitations;
OutboundHrmpMessage: OutboundHrmpMessage;
OutboundLaneData: OutboundLaneData;
OutboundMessageFee: OutboundMessageFee;
Expand Down
Loading
Loading