From 2dc205373ae5d11f792fecad54103ba77055b967 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Sat, 13 Apr 2024 14:29:49 -0400 Subject: [PATCH 1/4] Add initial update for parachainHost --- .../src/interfaces/parachains/runtime.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/packages/types/src/interfaces/parachains/runtime.ts b/packages/types/src/interfaces/parachains/runtime.ts index e27310342dbe..d54aac0102ea 100644 --- a/packages/types/src/interfaces/parachains/runtime.ts +++ b/packages/types/src/interfaces/parachains/runtime.ts @@ -231,6 +231,54 @@ const PH_V5: DefinitionsCallEntry['methods'] = { } }; +// const PH_V10: DefinitionsCallEntry['methods'] = { +// // Not sure which version it changed the return type from 'ValidationCode' to Option, but I noticed it when checking V10. +// validation_code: { +// description: 'Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.', +// params: [ +// { +// name: 'paraId', +// type: 'ParaId' +// }, +// { +// name: 'assumption', +// type: 'OccupiedCoreAssumption' +// } +// ], +// type: 'Option' +// }, +// minimum_backing_votes: { +// description: '', +// params: [], +// type: 'u32' +// }, +// para_backing_state: { +// description: '', +// params: [ +// { +// name: 'paraId', +// type: 'ParaId' +// } +// ], +// }, +// async_backing_params: { +// description: '', +// params: [], +// }, +// approval_voting_params: { +// description: '', +// params: [], +// }, +// disabled_validators: { +// description: '', +// params: [], +// }, +// node_features: { +// description: '', +// params: [], +// } +// } + export const runtime: DefinitionsCall = { ParachainHost: [ { From e975af6f9388ac72223ec96dc94fac8a260037ac Mon Sep 17 00:00:00 2001 From: tarikgul Date: Sat, 13 Apr 2024 15:56:59 -0400 Subject: [PATCH 2/4] Add v6,7,8,9,10 --- packages/api-augment/src/kusama/runtime.ts | 130 +++++++++++++- packages/api-augment/src/polkadot/runtime.ts | 2 +- .../types-augment/src/registry/interfaces.ts | 9 +- .../src/interfaces/parachains/definitions.ts | 35 ++++ .../src/interfaces/parachains/runtime.ts | 163 ++++++++++++------ .../types/src/interfaces/parachains/types.ts | 51 +++++- 6 files changed, 337 insertions(+), 53 deletions(-) diff --git a/packages/api-augment/src/kusama/runtime.ts b/packages/api-augment/src/kusama/runtime.ts index b8069bcf96fb..0d46f2fb4453 100644 --- a/packages/api-augment/src/kusama/runtime.ts +++ b/packages/api-augment/src/kusama/runtime.ts @@ -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'; @@ -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'; @@ -278,6 +281,129 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0xaf2c0297a23e6d3d/10 */ + parachainHost: { + /** + * Approval voting configuration parameters + **/ + approvalVotingParams: AugmentedCall Observable>; + /** + * Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash. + **/ + assumedValidationData: AugmentedCall Observable>>>; + /** + * Returns candidate's acceptance limitations for asynchronous backing for a relay parent + **/ + asyncBackingParams: AugmentedCall Observable>; + /** + * Yields information on all availability cores as relevant to the child block. + **/ + availabilityCores: AugmentedCall Observable>>; + /** + * Get a vector of events concerning candidates that occurred within a block. + **/ + candidateEvents: AugmentedCall Observable>>; + /** + * Get the receipt of a candidate pending availability. + **/ + candidatePendingAvailability: AugmentedCall Observable>>; + /** + * Checks if the given validation outputs pass the acceptance criteria. + **/ + checkValidationOutputs: AugmentedCall Observable>; + /** + * Returns a list of all disabled validators at the given block + **/ + disabledValidators: AugmentedCall Observable>; + /** + * Returns all onchain disputes. + **/ + disputes: AugmentedCall Observable>>>; + /** + * Get all the pending inbound messages in the downward message queue for a para. + **/ + dmqContents: AugmentedCall Observable>>; + /** + * Get the contents of all channels addressed to the given recipient. + **/ + inboundHrmpChannelsContents: AugmentedCall Observable>>; + /** + * Returns a merkle proof of a validator session key + **/ + keyOwnershipProof: AugmentedCall Observable>>; + /** + * Get the minimum number of backing votes for a parachain candidate. This is a staging method! Do not use on production runtimes! + **/ + minimumBackingVotes: AugmentedCall Observable>; + /** + * Get node features. This is a staging method! Do not use on production runtimes! + **/ + nodeFeatures: AugmentedCall Observable>; + /** + * Scrape dispute relevant from on-chain, backing votes and resolved disputes. + **/ + onChainVotes: AugmentedCall Observable>>; + /** + * Returns the state of parachain backing for a given para + **/ + paraBackingState: AugmentedCall Observable>>; + /** + * 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 Observable>>; + /** + * Returns code hashes of PVFs that require pre-checking by validators in the active set. + **/ + pvfsRequirePrecheck: AugmentedCall Observable>>; + /** + * Returns execution parameters for the session. + **/ + sessionExecutorParams: AugmentedCall Observable>>; + /** + * Returns the session index expected at a child of the block. + **/ + sessionIndexForChild: AugmentedCall Observable>; + /** + * Get the session info for the given session, if stored. + **/ + sessionInfo: AugmentedCall Observable>>; + /** + * Submits a PVF pre-checking statement into the transaction pool. + **/ + submitPvfCheckStatement: AugmentedCall Observable>; + /** + * Submit an unsigned extrinsic to slash validators who lost a dispute about a candidate of a past session + **/ + submitReportDisputeLost: AugmentedCall Observable>>; + /** + * Returns a list of validators that lost a past session dispute and need to be slashed + **/ + unappliedSlashes: AugmentedCall Observable>>>; + /** + * Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`. + **/ + validationCode: AugmentedCall Observable>>; + /** + * Get the validation code from its hash. + **/ + validationCodeByHash: AugmentedCall Observable>>; + /** + * Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`. + **/ + validationCodeHash: AugmentedCall Observable>>; + /** + * Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on + **/ + validatorGroups: AugmentedCall Observable>, GroupRotationInfo]>>>; + /** + * Get the current validators. + **/ + validators: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xab3c0572291feb8b/1 */ sessionKeys: { /** diff --git a/packages/api-augment/src/polkadot/runtime.ts b/packages/api-augment/src/polkadot/runtime.ts index 22cea870423a..dddf6fa10046 100644 --- a/packages/api-augment/src/polkadot/runtime.ts +++ b/packages/api-augment/src/polkadot/runtime.ts @@ -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 Observable>; + validationCode: AugmentedCall Observable>>; /** * Get the validation code from its hash. **/ diff --git a/packages/types-augment/src/registry/interfaces.ts b/packages/types-augment/src/registry/interfaces.ts index cd73b64c9d47..518300c4d260 100644 --- a/packages/types-augment/src/registry/interfaces.ts +++ b/packages/types-augment/src/registry/interfaces.ts @@ -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'; @@ -112,6 +112,7 @@ declare module '@polkadot/types/types/registry' { ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6; ApprovalFlag: ApprovalFlag; Approvals: Approvals; + ApprovalVotingParams: ApprovalVotingParams; ArithmeticError: ArithmeticError; AssetApproval: AssetApproval; AssetApprovalKey: AssetApprovalKey; @@ -127,6 +128,7 @@ declare module '@polkadot/types/types/registry' { AssetOptions: AssetOptions; AssignmentId: AssignmentId; AssignmentKind: AssignmentKind; + AsyncBackingParams: AsyncBackingParams; AttestedCandidate: AttestedCandidate; AuctionIndex: AuctionIndex; AuthIndex: AuthIndex; @@ -149,6 +151,7 @@ declare module '@polkadot/types/types/registry' { BabeGenesisConfigurationV1: BabeGenesisConfigurationV1; BabeWeight: BabeWeight; BackedCandidate: BackedCandidate; + BackingState: BackingState; Balance: Balance; BalanceLock: BalanceLock; BalanceLockTo212: BalanceLockTo212; @@ -251,6 +254,7 @@ declare module '@polkadot/types/types/registry' { ConfigData: ConfigData; Consensus: Consensus; ConsensusEngineId: ConsensusEngineId; + Constraints: Constraints; ConsumedWeight: ConsumedWeight; ContractCallFlags: ContractCallFlags; ContractCallRequest: ContractCallRequest; @@ -585,6 +589,7 @@ declare module '@polkadot/types/types/registry' { ImmortalEra: ImmortalEra; ImportedAux: ImportedAux; InboundDownwardMessage: InboundDownwardMessage; + InboundHrmpLimitations: InboundHrmpLimitations; InboundHrmpMessage: InboundHrmpMessage; InboundHrmpMessages: InboundHrmpMessages; InboundLaneData: InboundLaneData; @@ -730,6 +735,7 @@ declare module '@polkadot/types/types/registry' { NextConfigDescriptorV1: NextConfigDescriptorV1; NftCollectionId: NftCollectionId; NftItemId: NftItemId; + NodeFeatures: NodeFeatures; NodeRole: NodeRole; Nominations: Nominations; NominatorIndex: NominatorIndex; @@ -763,6 +769,7 @@ declare module '@polkadot/types/types/registry' { OriginKindV0: OriginKindV0; OriginKindV1: OriginKindV1; OriginKindV2: OriginKindV2; + OutboundHrmpChannelLimitations: OutboundHrmpChannelLimitations; OutboundHrmpMessage: OutboundHrmpMessage; OutboundLaneData: OutboundLaneData; OutboundMessageFee: OutboundMessageFee; diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index fe367bea10eb..8ac768cde325 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -130,6 +130,9 @@ export default { totalSize: 'u32', mqcHead: 'Option' }, + ApprovalVotingParams: { + maxApprovalCoalesceCount: 'u32' + }, AssignmentId: 'AccountId', AssignmentKind: { _enum: { @@ -137,6 +140,10 @@ export default { Parathread: '(CollatorId, u32)' } }, + AsyncBackingParams: { + maxCandidateDepth: 'u32', + allowedAncestryLen: 'u32' + }, AttestedCandidate: { candidate: 'AbridgedCandidateReceipt', validityVotes: 'Vec', @@ -153,6 +160,10 @@ export default { validityVotes: 'Vec', validatorIndices: 'BitVec' }, + BackingState: { + constraints: 'Constraints', + pendingAvailability: 'Vec' + }, BufferedSessionChange: { applyAt: 'BlockNumber', validators: 'Vec', @@ -215,6 +226,22 @@ export default { descriptor: 'CandidateDescriptor', commitments: 'CandidateCommitments' }, + Constraints: { + minRelayParentNumber: 'BlockNumber', + maxPovSize: 'Bytes', + maxCodeSize: 'Bytes', + umpRemaining: 'Bytes', + umpRemainingBytes: 'Bytes', + maxUmpNumPerCandidate: 'Bytes', + dmpRemainingMessages: 'Vec', + hrmpInbound: 'InboundHrmpLimitations', + hrmpChannelsOut: 'HashMap', + maxHrmpNumPerCandidate: 'Bytes', + requiredParent: 'HeadData', + validationCodeHash: 'ValidationCodeHash', + upgradeRestriction: 'Option', + futureValidationCode: 'Option<(BlockNumber, ValidationCodeHash)>' + }, CoreAssignment: { core: 'CoreIndex', paraId: 'ParaId', @@ -315,6 +342,9 @@ export default { sentAt: 'BlockNumber', data: 'Bytes' }, + InboundHrmpLimitations: { + validWatermarks: 'Vec' + }, InboundHrmpMessages: 'Vec', LocalValidationData: { parentHead: 'HeadData', @@ -326,6 +356,7 @@ export default { horizontalMessages: 'BTreeMap' }, MessageQueueChain: 'RelayChainHash', + NodeFeatures: 'BitVec', OccupiedCore: { nextUpOnAvailable: 'Option', occupiedSince: 'BlockNumber', @@ -339,6 +370,10 @@ export default { OccupiedCoreAssumption: { _enum: ['Included,', 'TimedOut', 'Free'] }, + OutboundHrmpChannelLimitations: { + bytesRemaining: 'Bytes', + messagesRemaining: 'Bytes' + }, OutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' diff --git a/packages/types/src/interfaces/parachains/runtime.ts b/packages/types/src/interfaces/parachains/runtime.ts index d54aac0102ea..675246942c60 100644 --- a/packages/types/src/interfaces/parachains/runtime.ts +++ b/packages/types/src/interfaces/parachains/runtime.ts @@ -108,7 +108,7 @@ const PH_V1_TO_V2: DefinitionsCallEntry['methods'] = { type: 'OccupiedCoreAssumption' } ], - type: 'ValidationCode' + type: 'Option' }, validation_code_by_hash: { description: 'Get the validation code from its hash.', @@ -231,56 +231,123 @@ const PH_V5: DefinitionsCallEntry['methods'] = { } }; -// const PH_V10: DefinitionsCallEntry['methods'] = { -// // Not sure which version it changed the return type from 'ValidationCode' to Option, but I noticed it when checking V10. -// validation_code: { -// description: 'Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.', -// params: [ -// { -// name: 'paraId', -// type: 'ParaId' -// }, -// { -// name: 'assumption', -// type: 'OccupiedCoreAssumption' -// } -// ], -// type: 'Option' -// }, -// minimum_backing_votes: { -// description: '', -// params: [], -// type: 'u32' -// }, -// para_backing_state: { -// description: '', -// params: [ -// { -// name: 'paraId', -// type: 'ParaId' -// } -// ], -// }, -// async_backing_params: { -// description: '', -// params: [], -// }, -// approval_voting_params: { -// description: '', -// params: [], -// }, -// disabled_validators: { -// description: '', -// params: [], -// }, -// node_features: { -// description: '', -// params: [], -// } -// } +const PH_V6: DefinitionsCallEntry['methods'] = { + minimum_backing_votes: { + description: 'Get the minimum number of backing votes for a parachain candidate. This is a staging method! Do not use on production runtimes!', + params: [], + type: 'u32' + } +}; + +const PH_V7: DefinitionsCallEntry['methods'] = { + async_backing_params: { + description: 'Returns candidate\'s acceptance limitations for asynchronous backing for a relay parent', + params: [], + type: 'AsyncBackingParams' + }, + para_backing_state: { + description: 'Returns the state of parachain backing for a given para', + params: [ + { + name: 'paraId', + type: 'ParaId' + } + ], + type: 'Option' + } +}; + +const PH_V8: DefinitionsCallEntry['methods'] = { + disabled_validators: { + description: 'Returns a list of all disabled validators at the given block', + params: [], + type: 'ValidatorIndex' + } +}; + +const PH_V9: DefinitionsCallEntry['methods'] = { + node_features: { + description: 'Get node features. This is a staging method! Do not use on production runtimes!', + params: [], + type: 'NodeFeatures' + } +}; + +const PH_V10: DefinitionsCallEntry['methods'] = { + approval_voting_params: { + description: 'Approval voting configuration parameters', + params: [], + type: 'ApprovalVotingParams' + } +}; export const runtime: DefinitionsCall = { ParachainHost: [ + { + methods: { + ...PH_V1_TO_V2, + ...PH_V2_TO_V3, + ...PH_V3, + ...PH_V4, + ...PH_V5, + ...PH_V6, + ...PH_V7, + ...PH_V8, + ...PH_V9, + ...PH_V10 + }, + version: 10 + }, + { + methods: { + ...PH_V1_TO_V2, + ...PH_V2_TO_V3, + ...PH_V3, + ...PH_V4, + ...PH_V5, + ...PH_V6, + ...PH_V7, + ...PH_V8, + ...PH_V9 + }, + version: 8 + }, + { + methods: { + ...PH_V1_TO_V2, + ...PH_V2_TO_V3, + ...PH_V3, + ...PH_V4, + ...PH_V5, + ...PH_V6, + ...PH_V7, + ...PH_V8 + }, + version: 8 + }, + { + methods: { + ...PH_V1_TO_V2, + ...PH_V2_TO_V3, + ...PH_V3, + ...PH_V4, + ...PH_V5, + ...PH_V6, + ...PH_V7 + }, + version: 7 + }, + { + methods: { + ...PH_V1_TO_V2, + ...PH_V2_TO_V3, + ...PH_V3, + ...PH_V4, + ...PH_V5, + ...PH_V6 + }, + version: 6 + }, { methods: { ...PH_V1_TO_V2, diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index f9e77063b148..b4ab060dbc5d 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { BTreeMap, BitVec, Bytes, Enum, Option, Struct, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types-codec'; +import type { BTreeMap, BitVec, Bytes, Enum, HashMap, Option, Struct, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { Signature } from '@polkadot/types/interfaces/extrinsics'; import type { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, Header, StorageProof, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; @@ -42,6 +42,11 @@ export interface AbridgedHrmpChannel extends Struct { readonly mqcHead: Option; } +/** @name ApprovalVotingParams */ +export interface ApprovalVotingParams extends Struct { + readonly maxApprovalCoalesceCount: u32; +} + /** @name AssignmentId */ export interface AssignmentId extends AccountId {} @@ -53,6 +58,12 @@ export interface AssignmentKind extends Enum { readonly type: 'Parachain' | 'Parathread'; } +/** @name AsyncBackingParams */ +export interface AsyncBackingParams extends Struct { + readonly maxCandidateDepth: u32; + readonly allowedAncestryLen: u32; +} + /** @name AttestedCandidate */ export interface AttestedCandidate extends Struct { readonly candidate: AbridgedCandidateReceipt; @@ -82,6 +93,12 @@ export interface BackedCandidate extends Struct { readonly validatorIndices: BitVec; } +/** @name BackingState */ +export interface BackingState extends Struct { + readonly constraints: Constraints; + readonly pendingAvailability: Vec; +} + /** @name Bidder */ export interface Bidder extends Enum { readonly isNew: boolean; @@ -172,6 +189,24 @@ export interface CommittedCandidateReceipt extends Struct { readonly commitments: CandidateCommitments; } +/** @name Constraints */ +export interface Constraints extends Struct { + readonly minRelayParentNumber: BlockNumber; + readonly maxPovSize: Bytes; + readonly maxCodeSize: Bytes; + readonly umpRemaining: Bytes; + readonly umpRemainingBytes: Bytes; + readonly maxUmpNumPerCandidate: Bytes; + readonly dmpRemainingMessages: Vec; + readonly hrmpInbound: InboundHrmpLimitations; + readonly hrmpChannelsOut: HashMap; + readonly maxHrmpNumPerCandidate: Bytes; + readonly requiredParent: HeadData; + readonly validationCodeHash: ValidationCodeHash; + readonly upgradeRestriction: Option; + readonly futureValidationCode: Option>; +} + /** @name CoreAssignment */ export interface CoreAssignment extends Struct { readonly core: CoreIndex; @@ -401,6 +436,11 @@ export interface InboundDownwardMessage extends Struct { readonly pubMsg: DownwardMessage; } +/** @name InboundHrmpLimitations */ +export interface InboundHrmpLimitations extends Struct { + readonly validWatermarks: Vec; +} + /** @name InboundHrmpMessage */ export interface InboundHrmpMessage extends Struct { readonly sentAt: BlockNumber; @@ -480,6 +520,9 @@ export interface NewBidder extends Struct { readonly sub: SubId; } +/** @name NodeFeatures */ +export interface NodeFeatures extends BitVec {} + /** @name OccupiedCore */ export interface OccupiedCore extends Struct { readonly nextUpOnAvailable: Option; @@ -514,6 +557,12 @@ export interface OldV1SessionInfo extends Struct { readonly neededApprovals: u32; } +/** @name OutboundHrmpChannelLimitations */ +export interface OutboundHrmpChannelLimitations extends Struct { + readonly bytesRemaining: Bytes; + readonly messagesRemaining: Bytes; +} + /** @name OutboundHrmpMessage */ export interface OutboundHrmpMessage extends Struct { readonly recipient: u32; From ef7c41fd7793c1f087459107082bed164a8ccbf5 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Sat, 13 Apr 2024 16:09:21 -0400 Subject: [PATCH 3/4] fix version nit --- packages/types/src/interfaces/parachains/runtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/interfaces/parachains/runtime.ts b/packages/types/src/interfaces/parachains/runtime.ts index 675246942c60..60ce905396be 100644 --- a/packages/types/src/interfaces/parachains/runtime.ts +++ b/packages/types/src/interfaces/parachains/runtime.ts @@ -310,7 +310,7 @@ export const runtime: DefinitionsCall = { ...PH_V8, ...PH_V9 }, - version: 8 + version: 9 }, { methods: { From d9b405fcab54adbe0690dac06f68572b8cb1c4cc Mon Sep 17 00:00:00 2001 From: tarikgul Date: Sat, 13 Apr 2024 16:56:40 -0400 Subject: [PATCH 4/4] change bytes to u32 for usize --- .../src/interfaces/parachains/definitions.ts | 16 ++++++++-------- .../types/src/interfaces/parachains/types.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index 8ac768cde325..ef10fb19938c 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -228,15 +228,15 @@ export default { }, Constraints: { minRelayParentNumber: 'BlockNumber', - maxPovSize: 'Bytes', - maxCodeSize: 'Bytes', - umpRemaining: 'Bytes', - umpRemainingBytes: 'Bytes', - maxUmpNumPerCandidate: 'Bytes', + maxPovSize: 'u32', + maxCodeSize: 'u32', + umpRemaining: 'u32', + umpRemainingBytes: 'u32', + maxUmpNumPerCandidate: 'u32', dmpRemainingMessages: 'Vec', hrmpInbound: 'InboundHrmpLimitations', hrmpChannelsOut: 'HashMap', - maxHrmpNumPerCandidate: 'Bytes', + maxHrmpNumPerCandidate: 'u32', requiredParent: 'HeadData', validationCodeHash: 'ValidationCodeHash', upgradeRestriction: 'Option', @@ -371,8 +371,8 @@ export default { _enum: ['Included,', 'TimedOut', 'Free'] }, OutboundHrmpChannelLimitations: { - bytesRemaining: 'Bytes', - messagesRemaining: 'Bytes' + bytesRemaining: 'u32', + messagesRemaining: 'u32' }, OutboundHrmpMessage: { recipient: 'u32', diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index b4ab060dbc5d..c15d9e404a01 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -192,15 +192,15 @@ export interface CommittedCandidateReceipt extends Struct { /** @name Constraints */ export interface Constraints extends Struct { readonly minRelayParentNumber: BlockNumber; - readonly maxPovSize: Bytes; - readonly maxCodeSize: Bytes; - readonly umpRemaining: Bytes; - readonly umpRemainingBytes: Bytes; - readonly maxUmpNumPerCandidate: Bytes; + readonly maxPovSize: u32; + readonly maxCodeSize: u32; + readonly umpRemaining: u32; + readonly umpRemainingBytes: u32; + readonly maxUmpNumPerCandidate: u32; readonly dmpRemainingMessages: Vec; readonly hrmpInbound: InboundHrmpLimitations; readonly hrmpChannelsOut: HashMap; - readonly maxHrmpNumPerCandidate: Bytes; + readonly maxHrmpNumPerCandidate: u32; readonly requiredParent: HeadData; readonly validationCodeHash: ValidationCodeHash; readonly upgradeRestriction: Option; @@ -559,8 +559,8 @@ export interface OldV1SessionInfo extends Struct { /** @name OutboundHrmpChannelLimitations */ export interface OutboundHrmpChannelLimitations extends Struct { - readonly bytesRemaining: Bytes; - readonly messagesRemaining: Bytes; + readonly bytesRemaining: u32; + readonly messagesRemaining: u32; } /** @name OutboundHrmpMessage */