diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index 23cff25ccb40..d87d517e93bc 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -175,7 +175,7 @@ declare module '@polkadot/api/types/submittable' { * * The schedule must have a greater version than the stored schedule. **/ - updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; opCostGrowMem?: any; opCostRegular?: any; apiCostCaller?: any; apiCostAddress?: any; apiCostGasLeft?: any; apiCostBalance?: any; apiCostValueTransferred?: any; apiCostMinimumBalance?: any; apiCostTombstoneDeposit?: any; apiCostRentAllowance?: any; apiCostBlockNumber?: any; apiCostNow?: any; apiCostWeightToFee?: any; apiCostGas?: any; apiCostInput?: any; apiCostInputPerByte?: any; apiCostReturn?: any; apiCostReturnPerByte?: any; apiCostTerminate?: any; apiCostRestoreTo?: any; apiCostRestoreToPer_delta?: any; apiCostRandom?: any; apiCostDepositEvent?: any; apiCostDepositEventPerTopic?: any; apiCostDepositEventPerByte?: any; apiCostSetRentAllowance?: any; apiCostSetStorage?: any; apiCostSetStoragePerByte?: any; apiCostClearStorage?: any; apiCostGetStorage?: any; apiCostGetStoragePerByte?: any; apiCostTransfer?: any; apiCostCall?: any; apiCostCallTransferSurcharge?: any; apiCostCallPerInputByte?: any; apiCostCallPerOutputByte?: any; apiCostInstantiate?: any; apiCostInstantiatePerInputByte?: any; apiCostInstantiatePerOutputByte?: any; apiCostHashSha2256?: any; apiCostHashSha2256PerByte?: any; apiCostHashKeccak256?: any; apiCostHashKeccak256PerByte?: any; apiCostHashBlake2256?: any; apiCostHashBlake2256PerByte?: any; apiCostHashBlake2128?: any; apiCostHashBlake2128PerByte?: any; enablePrintln?: any; maxEventTopics?: any; maxStackHeight?: any; maxMemoryPages?: any; maxTableSize?: any; maxSubjectLen?: any; maxCodeSize?: any } | string | Uint8Array) => SubmittableExtrinsic>; + updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; instructionWeights?: any; hostFnWeights?: any; enablePrintln?: any; maxEventTopics?: any; maxStackHeight?: any; maxMemoryPages?: any; maxTableSize?: any; maxSubjectLen?: any; maxCodeSize?: any } | string | Uint8Array) => SubmittableExtrinsic>; }; council: { [key: string]: SubmittableExtrinsicFunction; diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index eb5d4bca4bd4..9e3bbde7d77c 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -14,7 +14,7 @@ import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; import { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; -import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultSuccess, ContractExecResultSuccessTo255, ContractExecResultTo255, ContractInfo, ContractStorageKey, Gas, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; +import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultSuccess, ContractExecResultSuccessTo255, ContractExecResultTo255, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; import { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; @@ -498,6 +498,12 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Option': Option; 'Vec': Vec; + HostFnWeights: HostFnWeights; + 'Option': Option; + 'Vec': Vec; + InstructionWeights: InstructionWeights; + 'Option': Option; + 'Vec': Vec; PrefabWasmModule: PrefabWasmModule; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/contracts/definitions.ts b/packages/types/src/interfaces/contracts/definitions.ts index 2fe7dc533881..0de592f034d3 100644 --- a/packages/types/src/interfaces/contracts/definitions.ts +++ b/packages/types/src/interfaces/contracts/definitions.ts @@ -107,6 +107,57 @@ export default { }, ContractStorageKey: '[u8; 32]', Gas: 'u64', + HostFnWeights: { + caller: 'Weight', + address: 'Weight', + gasLeft: 'Weight', + balance: 'Weight', + valueTransferred: 'Weight', + minimumBalance: 'Weight', + tombstoneDeposit: 'Weight', + rentAllowance: 'Weight', + blockNumber: 'Weight', + now: 'Weight', + weightToFee: 'Weight', + gas: 'Weight', + input: 'Weight', + inputPerByte: 'Weight', + return: 'Weight', + returnPerByte: 'Weight', + terminate: 'Weight', + restoreTo: 'Weight', + restoreToPerDelta: 'Weight', + random: 'Weight', + depositEvent: 'Weight', + depositEventPerTopic: 'Weight', + depositEventPerByte: 'Weight', + setRentAllowance: 'Weight', + setStorage: 'Weight', + setStoragePerByte: 'Weight', + clearStorage: 'Weight', + getStorage: 'Weight', + getStoragePerByte: 'Weight', + transfer: 'Weight', + call: 'Weight', + callTransferSurcharge: 'Weight', + callPerInputByte: 'Weight', + callPerOutputByte: 'Weight', + instantiate: 'Weight', + instantiatePerInputByte: 'Weight', + instantiatePerOutputByte: 'Weight', + hashSha2256: 'Weight', + hashSha2256PerByte: 'Weight', + hashKeccak256: 'Weight', + hashKeccak256PerByte: 'Weight', + hashBlake2256: 'Weight', + hashBlake2256PerByte: 'Weight', + hashBlake2128: 'Weight', + hashBlake2128PerByte: 'Weight' + }, + InstructionWeights: { + growMem: 'Weight', + regular: 'Weight' + }, PrefabWasmModule: { scheduleVersion: 'Compact', initial: 'Compact', @@ -152,53 +203,8 @@ export default { }, Schedule: { version: 'u32', - opCostGrowMem: 'Weight', - opCostRegular: 'Weight', - apiCostCaller: 'Weight', - apiCostAddress: 'Weight', - apiCostGasLeft: 'Weight', - apiCostBalance: 'Weight', - apiCostValueTransferred: 'Weight', - apiCostMinimumBalance: 'Weight', - apiCostTombstoneDeposit: 'Weight', - apiCostRentAllowance: 'Weight', - apiCostBlockNumber: 'Weight', - apiCostNow: 'Weight', - apiCostWeightToFee: 'Weight', - apiCostGas: 'Weight', - apiCostInput: 'Weight', - apiCostInputPerByte: 'Weight', - apiCostReturn: 'Weight', - apiCostReturnPerByte: 'Weight', - apiCostTerminate: 'Weight', - apiCostRestoreTo: 'Weight', - apiCostRestoreToPer_delta: 'Weight', - apiCostRandom: 'Weight', - apiCostDepositEvent: 'Weight', - apiCostDepositEventPerTopic: 'Weight', - apiCostDepositEventPerByte: 'Weight', - apiCostSetRentAllowance: 'Weight', - apiCostSetStorage: 'Weight', - apiCostSetStoragePerByte: 'Weight', - apiCostClearStorage: 'Weight', - apiCostGetStorage: 'Weight', - apiCostGetStoragePerByte: 'Weight', - apiCostTransfer: 'Weight', - apiCostCall: 'Weight', - apiCostCallTransferSurcharge: 'Weight', - apiCostCallPerInputByte: 'Weight', - apiCostCallPerOutputByte: 'Weight', - apiCostInstantiate: 'Weight', - apiCostInstantiatePerInputByte: 'Weight', - apiCostInstantiatePerOutputByte: 'Weight', - apiCostHashSha2256: 'Weight', - apiCostHashSha2256PerByte: 'Weight', - apiCostHashKeccak256: 'Weight', - apiCostHashKeccak256PerByte: 'Weight', - apiCostHashBlake2256: 'Weight', - apiCostHashBlake2256PerByte: 'Weight', - apiCostHashBlake2128: 'Weight', - apiCostHashBlake2128PerByte: 'Weight', + instructionWeights: 'InstructionWeights', + hostFnWeights: 'HostFnWeights', enablePrintln: 'bool', maxEventTopics: 'u32', maxStackHeight: 'u32', diff --git a/packages/types/src/interfaces/contracts/types.ts b/packages/types/src/interfaces/contracts/types.ts index fe7de4255f9b..12a68580e75d 100644 --- a/packages/types/src/interfaces/contracts/types.ts +++ b/packages/types/src/interfaces/contracts/types.ts @@ -68,6 +68,61 @@ export interface ContractStorageKey extends U8aFixed {} /** @name Gas */ export interface Gas extends u64 {} +/** @name HostFnWeights */ +export interface HostFnWeights extends Struct { + readonly caller: Weight; + readonly address: Weight; + readonly gasLeft: Weight; + readonly balance: Weight; + readonly valueTransferred: Weight; + readonly minimumBalance: Weight; + readonly tombstoneDeposit: Weight; + readonly rentAllowance: Weight; + readonly blockNumber: Weight; + readonly now: Weight; + readonly weightToFee: Weight; + readonly gas: Weight; + readonly input: Weight; + readonly inputPerByte: Weight; + readonly return: Weight; + readonly returnPerByte: Weight; + readonly terminate: Weight; + readonly restoreTo: Weight; + readonly restoreToPerDelta: Weight; + readonly random: Weight; + readonly depositEvent: Weight; + readonly depositEventPerTopic: Weight; + readonly depositEventPerByte: Weight; + readonly setRentAllowance: Weight; + readonly setStorage: Weight; + readonly setStoragePerByte: Weight; + readonly clearStorage: Weight; + readonly getStorage: Weight; + readonly getStoragePerByte: Weight; + readonly transfer: Weight; + readonly call: Weight; + readonly callTransferSurcharge: Weight; + readonly callPerInputByte: Weight; + readonly callPerOutputByte: Weight; + readonly instantiate: Weight; + readonly instantiatePerInputByte: Weight; + readonly instantiatePerOutputByte: Weight; + readonly hashSha2256: Weight; + readonly hashSha2256PerByte: Weight; + readonly hashKeccak256: Weight; + readonly hashKeccak256PerByte: Weight; + readonly hashBlake2256: Weight; + readonly hashBlake2256PerByte: Weight; + readonly hashBlake2128: Weight; + readonly hashBlake2128PerByte: Weight; +} + +/** @name InstructionWeights */ +export interface InstructionWeights extends Struct { + readonly growMem: Weight; + readonly regular: Weight; +} + /** @name PrefabWasmModule */ export interface PrefabWasmModule extends Struct { readonly scheduleVersion: Compact; @@ -83,53 +138,8 @@ export interface PrefabWasmModuleReserved extends Option {} /** @name Schedule */ export interface Schedule extends Struct { readonly version: u32; - readonly opCostGrowMem: Weight; - readonly opCostRegular: Weight; - readonly apiCostCaller: Weight; - readonly apiCostAddress: Weight; - readonly apiCostGasLeft: Weight; - readonly apiCostBalance: Weight; - readonly apiCostValueTransferred: Weight; - readonly apiCostMinimumBalance: Weight; - readonly apiCostTombstoneDeposit: Weight; - readonly apiCostRentAllowance: Weight; - readonly apiCostBlockNumber: Weight; - readonly apiCostNow: Weight; - readonly apiCostWeightToFee: Weight; - readonly apiCostGas: Weight; - readonly apiCostInput: Weight; - readonly apiCostInputPerByte: Weight; - readonly apiCostReturn: Weight; - readonly apiCostReturnPerByte: Weight; - readonly apiCostTerminate: Weight; - readonly apiCostRestoreTo: Weight; - readonly apiCostRestoreToPer_delta: Weight; - readonly apiCostRandom: Weight; - readonly apiCostDepositEvent: Weight; - readonly apiCostDepositEventPerTopic: Weight; - readonly apiCostDepositEventPerByte: Weight; - readonly apiCostSetRentAllowance: Weight; - readonly apiCostSetStorage: Weight; - readonly apiCostSetStoragePerByte: Weight; - readonly apiCostClearStorage: Weight; - readonly apiCostGetStorage: Weight; - readonly apiCostGetStoragePerByte: Weight; - readonly apiCostTransfer: Weight; - readonly apiCostCall: Weight; - readonly apiCostCallTransferSurcharge: Weight; - readonly apiCostCallPerInputByte: Weight; - readonly apiCostCallPerOutputByte: Weight; - readonly apiCostInstantiate: Weight; - readonly apiCostInstantiatePerInputByte: Weight; - readonly apiCostInstantiatePerOutputByte: Weight; - readonly apiCostHashSha2256: Weight; - readonly apiCostHashSha2256PerByte: Weight; - readonly apiCostHashKeccak256: Weight; - readonly apiCostHashKeccak256PerByte: Weight; - readonly apiCostHashBlake2256: Weight; - readonly apiCostHashBlake2256PerByte: Weight; - readonly apiCostHashBlake2128: Weight; - readonly apiCostHashBlake2128PerByte: Weight; + readonly instructionWeights: InstructionWeights; + readonly hostFnWeights: HostFnWeights; readonly enablePrintln: bool; readonly maxEventTopics: u32; readonly maxStackHeight: u32;