Support ParachainHost runtime Api v6 7 8 9 10 (#5850)
* Add initial update for parachainHost * Add v6,7,8,9,10 * fix version nit * change bytes to u32 for usize
This commit is contained in:
@@ -130,6 +130,9 @@ export default {
|
||||
totalSize: 'u32',
|
||||
mqcHead: 'Option<Hash>'
|
||||
},
|
||||
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<ValidityAttestation>',
|
||||
@@ -153,6 +160,10 @@ export default {
|
||||
validityVotes: 'Vec<ValidityAttestation>',
|
||||
validatorIndices: 'BitVec'
|
||||
},
|
||||
BackingState: {
|
||||
constraints: 'Constraints',
|
||||
pendingAvailability: 'Vec<CandidatePendingAvailability>'
|
||||
},
|
||||
BufferedSessionChange: {
|
||||
applyAt: 'BlockNumber',
|
||||
validators: 'Vec<ValidatorId>',
|
||||
@@ -215,6 +226,22 @@ export default {
|
||||
descriptor: 'CandidateDescriptor',
|
||||
commitments: 'CandidateCommitments'
|
||||
},
|
||||
Constraints: {
|
||||
minRelayParentNumber: 'BlockNumber',
|
||||
maxPovSize: 'u32',
|
||||
maxCodeSize: 'u32',
|
||||
umpRemaining: 'u32',
|
||||
umpRemainingBytes: 'u32',
|
||||
maxUmpNumPerCandidate: 'u32',
|
||||
dmpRemainingMessages: 'Vec<BlockNumber>',
|
||||
hrmpInbound: 'InboundHrmpLimitations',
|
||||
hrmpChannelsOut: 'HashMap<ParaId, OutboundHrmpChannelLimitations>',
|
||||
maxHrmpNumPerCandidate: 'u32',
|
||||
requiredParent: 'HeadData',
|
||||
validationCodeHash: 'ValidationCodeHash',
|
||||
upgradeRestriction: 'Option<UpgradeRestriction>',
|
||||
futureValidationCode: 'Option<(BlockNumber, ValidationCodeHash)>'
|
||||
},
|
||||
CoreAssignment: {
|
||||
core: 'CoreIndex',
|
||||
paraId: 'ParaId',
|
||||
@@ -315,6 +342,9 @@ export default {
|
||||
sentAt: 'BlockNumber',
|
||||
data: 'Bytes'
|
||||
},
|
||||
InboundHrmpLimitations: {
|
||||
validWatermarks: 'Vec<BlockNumber>'
|
||||
},
|
||||
InboundHrmpMessages: 'Vec<InboundHrmpMessage>',
|
||||
LocalValidationData: {
|
||||
parentHead: 'HeadData',
|
||||
@@ -326,6 +356,7 @@ export default {
|
||||
horizontalMessages: 'BTreeMap<ParaId, InboundHrmpMessages>'
|
||||
},
|
||||
MessageQueueChain: 'RelayChainHash',
|
||||
NodeFeatures: 'BitVec',
|
||||
OccupiedCore: {
|
||||
nextUpOnAvailable: 'Option<ScheduledCore>',
|
||||
occupiedSince: 'BlockNumber',
|
||||
@@ -339,6 +370,10 @@ export default {
|
||||
OccupiedCoreAssumption: {
|
||||
_enum: ['Included,', 'TimedOut', 'Free']
|
||||
},
|
||||
OutboundHrmpChannelLimitations: {
|
||||
bytesRemaining: 'u32',
|
||||
messagesRemaining: 'u32'
|
||||
},
|
||||
OutboundHrmpMessage: {
|
||||
recipient: 'u32',
|
||||
data: 'Bytes'
|
||||
|
||||
@@ -108,7 +108,7 @@ const PH_V1_TO_V2: DefinitionsCallEntry['methods'] = {
|
||||
type: 'OccupiedCoreAssumption'
|
||||
}
|
||||
],
|
||||
type: 'ValidationCode'
|
||||
type: 'Option<ValidationCode>'
|
||||
},
|
||||
validation_code_by_hash: {
|
||||
description: 'Get the validation code from its hash.',
|
||||
@@ -231,8 +231,123 @@ const PH_V5: DefinitionsCallEntry['methods'] = {
|
||||
}
|
||||
};
|
||||
|
||||
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<BackingState>'
|
||||
}
|
||||
};
|
||||
|
||||
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: 9
|
||||
},
|
||||
{
|
||||
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,
|
||||
|
||||
@@ -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<Hash>;
|
||||
}
|
||||
|
||||
/** @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<CandidatePendingAvailability>;
|
||||
}
|
||||
|
||||
/** @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: u32;
|
||||
readonly maxCodeSize: u32;
|
||||
readonly umpRemaining: u32;
|
||||
readonly umpRemainingBytes: u32;
|
||||
readonly maxUmpNumPerCandidate: u32;
|
||||
readonly dmpRemainingMessages: Vec<BlockNumber>;
|
||||
readonly hrmpInbound: InboundHrmpLimitations;
|
||||
readonly hrmpChannelsOut: HashMap<ParaId, OutboundHrmpChannelLimitations>;
|
||||
readonly maxHrmpNumPerCandidate: u32;
|
||||
readonly requiredParent: HeadData;
|
||||
readonly validationCodeHash: ValidationCodeHash;
|
||||
readonly upgradeRestriction: Option<UpgradeRestriction>;
|
||||
readonly futureValidationCode: Option<ITuple<[BlockNumber, ValidationCodeHash]>>;
|
||||
}
|
||||
|
||||
/** @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<BlockNumber>;
|
||||
}
|
||||
|
||||
/** @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<ScheduledCore>;
|
||||
@@ -514,6 +557,12 @@ export interface OldV1SessionInfo extends Struct {
|
||||
readonly neededApprovals: u32;
|
||||
}
|
||||
|
||||
/** @name OutboundHrmpChannelLimitations */
|
||||
export interface OutboundHrmpChannelLimitations extends Struct {
|
||||
readonly bytesRemaining: u32;
|
||||
readonly messagesRemaining: u32;
|
||||
}
|
||||
|
||||
/** @name OutboundHrmpMessage */
|
||||
export interface OutboundHrmpMessage extends Struct {
|
||||
readonly recipient: u32;
|
||||
|
||||
Reference in New Issue
Block a user