From 1c8bd896e1f0050703119d04854b33048c522fc9 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Sun, 26 Apr 2020 11:56:32 +0000 Subject: [PATCH] [CI Skip] 1.12.0-beta.9 skip-checks: true --- lerna.json | 2 +- packages/api-contract/package.json | 8 +- packages/api-derive/package.json | 10 +- packages/api/package.json | 14 +- packages/api/src/augment/consts.ts | 98 ++++++++----- packages/api/src/augment/query.ts | 10 +- packages/api/src/augment/tx.ts | 135 ++++++++++++++---- packages/metadata/package.json | 6 +- packages/rpc-core/package.json | 8 +- packages/rpc-provider/package.json | 6 +- packages/typegen/package.json | 10 +- packages/types-known/package.json | 4 +- packages/types/package.json | 4 +- packages/types/src/augment/registry.ts | 8 +- .../types/src/interfaces/runtime/types.ts | 9 ++ yarn.lock | 66 ++++----- 16 files changed, 261 insertions(+), 137 deletions(-) diff --git a/lerna.json b/lerna.json index 3877b2e2d6..9f64334a47 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ "packages": [ "packages/*" ], - "version": "1.12.0-beta.8" + "version": "1.12.0-beta.9" } diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index f865d8e59f..dcd499adb9 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-contract", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Interfaces for interacting with contracts and contract ABIs", "main": "index.js", "keywords": [ @@ -27,9 +27,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.12.0-beta.8", - "@polkadot/rpc-core": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/api": "1.12.0-beta.9", + "@polkadot/rpc-core": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "bn.js": "^5.1.1", "rxjs": "^6.5.5" diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index 57a0720709..ec2ca45629 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-derive", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "main": "index.js", "keywords": [ @@ -28,10 +28,10 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.12.0-beta.8", - "@polkadot/rpc-core": "1.12.0-beta.8", - "@polkadot/rpc-provider": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/api": "1.12.0-beta.9", + "@polkadot/rpc-core": "1.12.0-beta.9", + "@polkadot/rpc-provider": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "@polkadot/util-crypto": "^2.9.0-beta.1", "bn.js": "^5.1.1", diff --git a/packages/api/package.json b/packages/api/package.json index 92097daf6b..4448b4cb3a 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Promise and RxJS wrappers around the Polkadot JS RPC", "main": "index.js", "keywords": [ @@ -27,13 +27,13 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api-derive": "1.12.0-beta.8", + "@polkadot/api-derive": "1.12.0-beta.9", "@polkadot/keyring": "^2.9.0-beta.1", - "@polkadot/metadata": "1.12.0-beta.8", - "@polkadot/rpc-core": "1.12.0-beta.8", - "@polkadot/rpc-provider": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", - "@polkadot/types-known": "1.12.0-beta.8", + "@polkadot/metadata": "1.12.0-beta.9", + "@polkadot/rpc-core": "1.12.0-beta.9", + "@polkadot/rpc-provider": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", + "@polkadot/types-known": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "@polkadot/util-crypto": "^2.9.0-beta.1", "bn.js": "^5.1.1", diff --git a/packages/api/src/augment/consts.ts b/packages/api/src/augment/consts.ts index 25a906149c..625bf8332a 100644 --- a/packages/api/src/augment/consts.ts +++ b/packages/api/src/augment/consts.ts @@ -3,8 +3,7 @@ import { Codec } from '@polkadot/types/types'; import { u32, u64 } from '@polkadot/types/primitive'; -import { Gas } from '@polkadot/types/interfaces/contracts'; -import { Balance, BalanceOf, BlockNumber, Moment, Percent, Permill } from '@polkadot/types/interfaces/runtime'; +import { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; import { SessionIndex } from '@polkadot/types/interfaces/session'; import { EraIndex } from '@polkadot/types/interfaces/staking'; @@ -36,26 +35,6 @@ declare module '@polkadot/metadata/Decorated/consts/types' { }; contracts: { [index: string]: AugmentedConst; - /** - * The maximum amount of gas that could be expended per block. A reasonable - * default value is 10_000_000. - **/ - blockGasLimit: AugmentedConst; - /** - * The base fee charged for calling into a contract. A reasonable default - * value is 135. - **/ - callBaseFee: AugmentedConst; - /** - * The fee required to instantiate a contract instance. A reasonable default value - * is 21. - **/ - contractFee: AugmentedConst; - /** - * The base fee charged for instantiating a contract. A reasonable default value - * is 175. - **/ - instantiateBaseFee: AugmentedConst; /** * The maximum nesting level of a call/instantiate stack. A reasonable default * value is 100. @@ -98,14 +77,6 @@ declare module '@polkadot/metadata/Decorated/consts/types' { * The minimum amount required to generate a tombstone. **/ tombstoneDeposit: AugmentedConst; - /** - * The fee to be paid for making a transaction; the base. - **/ - transactionBaseFee: AugmentedConst; - /** - * The fee to be paid for making a transaction; the per-byte portion. - **/ - transactionByteFee: AugmentedConst; }; democracy: { [index: string]: AugmentedConst; @@ -146,6 +117,7 @@ declare module '@polkadot/metadata/Decorated/consts/types' { candidacyBond: AugmentedConst; desiredMembers: AugmentedConst; desiredRunnersUp: AugmentedConst; + moduleId: AugmentedConst; termDuration: AugmentedConst; votingBond: AugmentedConst; }; @@ -160,6 +132,37 @@ declare module '@polkadot/metadata/Decorated/consts/types' { **/ windowSize: AugmentedConst; }; + identity: { + [index: string]: AugmentedConst; + /** + * The amount held on deposit for a registered identity. + **/ + basicDeposit: AugmentedConst; + /** + * The amount held on deposit per additional field for a registered identity. + **/ + fieldDeposit: AugmentedConst; + /** + * Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O + * required to access an identity, but can be pretty high. + **/ + maxAdditionalFields: AugmentedConst; + /** + * Maxmimum number of registrars allowed in the system. Needed to bound the complexity + * of, e.g., updating judgements. + **/ + maxRegistrars: AugmentedConst; + /** + * The maximum number of sub-accounts allowed per identified account. + **/ + maxSubAccounts: AugmentedConst; + /** + * The amount held on deposit for a registered subaccount. This should account for the fact + * that one storage item's value will increase by the size of an account ID, and there will be + * another trie item whose value is the size of an account ID plus 32 bytes. + **/ + subAccountDeposit: AugmentedConst; + }; society: { [index: string]: AugmentedConst; /** @@ -175,6 +178,10 @@ declare module '@polkadot/metadata/Decorated/consts/types' { * before they become suspended. **/ maxStrikes: AugmentedConst; + /** + * The societies's module id + **/ + moduleId: AugmentedConst; /** * The amount of incentive paid within each period. Doesn't include VoterTip. **/ @@ -200,6 +207,29 @@ declare module '@polkadot/metadata/Decorated/consts/types' { **/ sessionsPerEra: AugmentedConst; }; + system: { + [index: string]: AugmentedConst; + /** + * The base weight of executing a block, independent of the transactions in the block. + **/ + blockExecutionWeight: AugmentedConst; + /** + * The weight of runtime database operations the runtime can invoke. + **/ + dbWeight: AugmentedConst; + /** + * The base weight of an Extrinsic in the block, independent of the of extrinsic being executed. + **/ + extrinsicBaseWeight: AugmentedConst; + /** + * The maximum length of a block (in bytes). + **/ + maximumBlockLength: AugmentedConst; + /** + * The maximum weight of a block. + **/ + maximumBlockWeight: AugmentedConst; + }; timestamp: { [index: string]: AugmentedConst; /** @@ -212,10 +242,6 @@ declare module '@polkadot/metadata/Decorated/consts/types' { }; transactionPayment: { [index: string]: AugmentedConst; - /** - * The fee to be paid for making a transaction; the base. - **/ - transactionBaseFee: AugmentedConst; /** * The fee to be paid for making a transaction; the per-byte portion. **/ @@ -227,6 +253,10 @@ declare module '@polkadot/metadata/Decorated/consts/types' { * Percentage of spare funds (if any) that are burnt per spend period. **/ burn: AugmentedConst; + /** + * The treasury's module id, used for deriving its sovereign account ID. + **/ + moduleId: AugmentedConst; /** * Fraction of a proposal's value that should be bonded in order to place the proposal. * An accepted proposal gets these back. A rejected proposal does not. diff --git a/packages/api/src/augment/query.ts b/packages/api/src/augment/query.ts index 18e96ba7ba..179c1eed3b 100644 --- a/packages/api/src/augment/query.ts +++ b/packages/api/src/augment/query.ts @@ -9,7 +9,7 @@ import { BabeAuthorityWeight, MaybeVrf, Randomness } from '@polkadot/types/inter import { AccountData, BalanceLock, ReleasesBalances } from '@polkadot/types/interfaces/balances'; import { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective'; import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; -import { CodeHash, ContractInfo, Gas, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; +import { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; import { PreimageStatus, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy'; import { VoteThreshold } from '@polkadot/types/interfaces/elections'; import { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; @@ -146,14 +146,6 @@ declare module '@polkadot/api/types/storage' { * Current cost schedule for contracts. **/ currentSchedule: AugmentedQuery Observable> & QueryableStorageEntry; - /** - * The price of one unit of gas. - **/ - gasPrice: AugmentedQuery Observable> & QueryableStorageEntry; - /** - * Gas spent so far in this block. - **/ - gasSpent: AugmentedQuery Observable> & QueryableStorageEntry; /** * A mapping from an original code hash to the original code, untouched by instrumentation. **/ diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index 4ad7e2af95..6c673fdbdb 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -33,6 +33,10 @@ declare module '@polkadot/api/types/submittable' { /** * Exactly as `transfer`, except the origin must be root and the source account may be * specified. + * # + * - Same as transfer, but additional read and write because the source account is + * not assumed to be in the overlay. + * # **/ forceTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; /** @@ -110,7 +114,7 @@ declare module '@polkadot/api/types/submittable' { * Stores the given binary Wasm code into the chain's storage and returns its `codehash`. * You can instantiate contracts only with stored code. **/ - putCode: AugmentedSubmittable<(gasLimit: Compact | AnyNumber | Uint8Array, code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; + putCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; /** * Updates the schedule for metering contracts. * The schedule must have a greater version than the stored schedule. @@ -630,9 +634,12 @@ declare module '@polkadot/api/types/submittable' { * - `account`: the account of the registrar. * Emits `RegistrarAdded` if successful. * # - * - `O(R)` where `R` registrar-count (governance-bounded). + * - `O(R)` where `R` registrar-count (governance-bounded and code-bounded). * - One storage mutation (codec `O(R)`). * - One event. + * - Benchmarks: + * - 78.71 + R * 0.965 µs (min squares analysis) + * - 94.28 + R * 0.991 µs (min squares analysis) * # **/ addRegistrar: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic>; @@ -648,20 +655,29 @@ declare module '@polkadot/api/types/submittable' { * - One balance-reserve operation. * - One storage mutation `O(R + X)`. * - One event. + * - Benchmarks: + * - 135.3 + R * 0.574 + X * 3.394 µs (min squares analysis) + * - 144.3 + R * 0.316 + X * 3.53 µs (min squares analysis) * # **/ cancelRequest: AugmentedSubmittable<(regIndex: RegistrarIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic>; /** - * Clear an account's identity info and all sub-account and return all deposits. + * Clear an account's identity info and all sub-accounts and return all deposits. * Payment: All reserved balances on the account are returned. * The dispatch origin for this call must be _Signed_ and the sender must have a registered * identity. * Emits `IdentityCleared` if successful. * # - * - `O(R + S + X)`. - * - One balance-reserve operation. - * - `S + 2` storage deletions. + * - `O(R + S + X)` + * - where `R` registrar-count (governance-bounded). + * - where `S` subs-count (hard- and deposit-bounded). + * - where `X` additional-field-count (deposit-bounded and code-bounded). + * - One balance-unreserve operation. + * - `2` storage reads and `S + 2` storage deletions. * - One event. + * - Benchmarks: + * - 152.3 + R * 0.306 + S * 4.967 + X * 1.697 µs (min squares analysis) + * - 139.5 + R * 0.466 + S * 5.304 + X * 1.895 µs (min squares analysis) * # **/ clearIdentity: AugmentedSubmittable<() => SubmittableExtrinsic>; @@ -679,6 +695,7 @@ declare module '@polkadot/api/types/submittable' { * - One balance-reserve operation. * - `S + 2` storage mutations. * - One event. + * - Benchmark: 167.4 + R * 1.107 + S * 5.343 + X * 2.294 µs (min squares analysis) * # **/ killIdentity: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic>; @@ -697,6 +714,7 @@ declare module '@polkadot/api/types/submittable' { * - Up to one account-lookup operation. * - Storage: 1 read `O(R)`, 1 mutate `O(R + X)`. * - One event. + * - Benchmark: 110.7 + R * 1.066 + X * 3.402 µs (min squares analysis) * # **/ provideJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic>; @@ -709,7 +727,7 @@ declare module '@polkadot/api/types/submittable' { * - `reg_index`: The index of the registrar whose judgement is requested. * - `max_fee`: The maximum fee that may be paid. This should just be auto-populated as: * ```nocompile - * Self::registrars(reg_index).unwrap().fee + * Self::registrars().get(reg_index).unwrap().fee * ``` * Emits `JudgementRequested` if successful. * # @@ -717,6 +735,9 @@ declare module '@polkadot/api/types/submittable' { * - One balance-reserve operation. * - Storage: 1 read `O(R)`, 1 mutate `O(X + R)`. * - One event. + * - Benchmarks: + * - 154 + R * 0.932 + X * 3.302 µs (min squares analysis) + * - 172.9 + R * 0.69 + X * 3.304 µs (min squares analysis) * # **/ requestJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, maxFee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; @@ -729,6 +750,7 @@ declare module '@polkadot/api/types/submittable' { * # * - `O(R)`. * - One storage mutation `O(R)`. + * - Benchmark: 24.59 + R * 0.832 µs (min squares analysis) * # **/ setAccountId: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, updated: AccountId | string | Uint8Array) => SubmittableExtrinsic>; @@ -741,6 +763,8 @@ declare module '@polkadot/api/types/submittable' { * # * - `O(R)`. * - One storage mutation `O(R)`. + * - Benchmarks: + * - 23.81 + R * 0.774 µs (min squares analysis) * # **/ setFee: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; @@ -753,6 +777,7 @@ declare module '@polkadot/api/types/submittable' { * # * - `O(R)`. * - One storage mutation `O(R)`. + * - Benchmark: 22.85 + R * 0.853 µs (min squares analysis) * # **/ setFields: AugmentedSubmittable<(index: Compact | AnyNumber | Uint8Array, fields: IdentityFields) => SubmittableExtrinsic>; @@ -760,15 +785,19 @@ declare module '@polkadot/api/types/submittable' { * Set an account's identity information and reserve the appropriate deposit. * If the account already has identity information, the deposit is taken as part payment * for the new deposit. - * The dispatch origin for this call must be _Signed_ and the sender must have a registered - * identity. + * The dispatch origin for this call must be _Signed_. * - `info`: The identity information. * Emits `IdentitySet` if successful. * # - * - `O(X + X' + R)` where `X` additional-field-count (deposit-bounded and code-bounded). - * - At most two balance operations. + * - `O(X + X' + R)` + * - where `X` additional-field-count (deposit-bounded and code-bounded) + * - where `R` judgements-count (registrar-count-bounded) + * - One balance reserve operation. * - One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`). * - One event. + * - Benchmarks: + * - 136.6 + R * 0.62 + X * 2.62 µs (min squares analysis) + * - 146.2 + R * 0.372 + X * 2.98 µs (min squares analysis) * # **/ setIdentity: AugmentedSubmittable<(info: IdentityInfo | { additional?: any; display?: any; legal?: any; web?: any; riot?: any; email?: any; pgpFingerprint?: any; image?: any; twitter?: any } | string | Uint8Array) => SubmittableExtrinsic>; @@ -778,12 +807,20 @@ declare module '@polkadot/api/types/submittable' { * and an amount `SubAccountDeposit` will be reserved for each item in `subs`. * The dispatch origin for this call must be _Signed_ and the sender must have a registered * identity. - * - `subs`: The identity's sub-accounts. + * - `subs`: The identity's (new) sub-accounts. * # - * - `O(S)` where `S` subs-count (hard- and deposit-bounded). - * - At most two balance operations. - * - At most O(2 * S + 1) storage mutations; codec complexity `O(1 * S + S * 1)`); - * one storage-exists. + * - `O(P + S)` + * - where `P` old-subs-count (hard- and deposit-bounded). + * - where `S` subs-count (hard- and deposit-bounded). + * - At most one balance operations. + * - DB: + * - `P + S` storage mutations (codec complexity `O(1)`) + * - One storage read (codec complexity `O(P)`). + * - One storage write (codec complexity `O(S)`). + * - One storage-exists (`IdentityOf::contains_key`). + * - Benchmarks: + * - 115.2 + P * 5.11 + S * 6.67 µs (min squares analysis) + * - 121 + P * 4.852 + S * 7.111 µs (min squares analysis) * # **/ setSubs: AugmentedSubmittable<(subs: Vec> | ([AccountId | string | Uint8Array, Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array])[]) => SubmittableExtrinsic>; @@ -1024,9 +1061,11 @@ declare module '@polkadot/api/types/submittable' { * This doesn't take effect until the next session. * The dispatch origin of this function must be signed. * # - * - O(N) in number of key types. - * - Removes N + 1 DB entries. - * - Reduces system account refs by one on success. + * - Complexity: `O(1)` in number of key types. + * Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed. + * - DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account` + * - DbWrites: `NextKeys`, `origin account` + * - DbWrites per key id: `KeyOwnder` * # **/ purgeKeys: AugmentedSubmittable<() => SubmittableExtrinsic>; @@ -1036,10 +1075,12 @@ declare module '@polkadot/api/types/submittable' { * This doesn't take effect until the next session. * The dispatch origin of this function must be signed. * # - * - O(log n) in number of accounts. - * - One extra DB entry. - * - Increases system account refs by one on success iff there were previously no keys set. - * In this case, purge_keys will need to be called before the account can be removed. + * - Complexity: `O(1)` + * Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed. + * - DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys` + * - DbWrites: `origin account`, `NextKeys` + * - DbReads per key id: `KeyOwner` + * - DbWrites per key id: `KeyOwner` * # **/ setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic>; @@ -1558,7 +1599,7 @@ declare module '@polkadot/api/types/submittable' { * - Storage: O(n) reads `AccountId` to fetch `snapshot_nominators`. * - Memory: O(n + m) reads to map index to `AccountId` for un-compact. * - Storage: O(e) accountid reads from `Nomination` to read correct nominations. - * - Storage: O(e) calls into `slashable_balance_of_extended` to convert ratio to staked. + * - Storage: O(e) calls into `slashable_balance_of_vote_weight` to convert ratio to staked. * - Memory: build_support_map. O(e). * - Memory: evaluate_support: O(E). * - Storage: O(e) writes to `QueuedElected`. @@ -1672,39 +1713,80 @@ declare module '@polkadot/api/types/submittable' { fillBlock: AugmentedSubmittable<(ratio: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic>; /** * Kill all storage items with a key that starts with the given prefix. + * # + * - `O(P)` where `P` amount of keys with prefix `prefix` + * - `P` storage deletions. + * # **/ killPrefix: AugmentedSubmittable<(prefix: Key | string | Uint8Array) => SubmittableExtrinsic>; /** * Kill some items from storage. + * # + * - `O(VK)` where `V` length of `keys` and `K` length of one key + * - `V` storage deletions. + * # **/ killStorage: AugmentedSubmittable<(keys: Vec | (Key | string | Uint8Array)[]) => SubmittableExtrinsic>; /** * Make some on-chain remark. + * # + * - `O(1)` + * # **/ remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic>; /** * Set the new changes trie configuration. + * # + * - `O(D)` where `D` length of `Digest` + * - 1 storage write or delete (codec `O(1)`). + * - 1 call to `deposit_log`: `O(D)` (which depends on the length of `Digest`) + * # **/ setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option | null | object | string | Uint8Array) => SubmittableExtrinsic>; /** * Set the new runtime code. + * # + * - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code` + * - 1 storage write (codec `O(C)`). + * - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is expensive). + * - 1 event. + * # **/ setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; /** * Set the new runtime code without doing any checks of the given `code`. + * # + * - `O(C)` where `C` length of `code` + * - 1 storage write (codec `O(C)`). + * - 1 event. + * # **/ setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic>; /** * Set the number of pages in the WebAssembly environment's heap. + * # + * - `O(1)` + * - 1 storage write. + * # **/ setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic>; /** * Set some items of storage. + * # + * - `O(I)` where `I` length of `items` + * - `I` storage writes (`O(1)`). + * # **/ setStorage: AugmentedSubmittable<(items: Vec | (KeyValue)[]) => SubmittableExtrinsic>; /** * Kill the sending account, assuming there are no references outstanding and the composite * data is equal to its default value. + * # + * - `O(K)` with `K` being complexity of `on_killed_account` + * - 1 storage read and deletion. + * - 1 call to `on_killed_account` callback with unknown complexity `K` + * - 1 event. + * # **/ suicide: AugmentedSubmittable<() => SubmittableExtrinsic>; }; @@ -1799,6 +1881,11 @@ declare module '@polkadot/api/types/submittable' { * The timestamp should be greater than the previous one by the amount specified by * `MinimumPeriod`. * The dispatch origin for this call must be `Inherent`. + * # + * - `O(T)` where `T` complexity of `on_timestamp_set` + * - 2 storage mutations (codec `O(1)`). + * - 1 event handler `on_timestamp_set` `O(T)`. + * # **/ set: AugmentedSubmittable<(now: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic>; }; diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 97b842ed7a..8f14a6cafc 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/metadata", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Helpers to extract information from runtime metadata", "main": "index.js", "publishConfig": { @@ -27,8 +27,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/types": "1.12.0-beta.8", - "@polkadot/types-known": "1.12.0-beta.8", + "@polkadot/types": "1.12.0-beta.9", + "@polkadot/types-known": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "@polkadot/util-crypto": "^2.9.0-beta.1", "bn.js": "^5.1.1" diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 5f57a39f29..4724b2fe2e 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-core", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "keywords": [ @@ -27,9 +27,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.12.0-beta.8", - "@polkadot/rpc-provider": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/metadata": "1.12.0-beta.9", + "@polkadot/rpc-provider": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "memoizee": "^0.4.14", "rxjs": "^6.5.5" diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 1083fd01b3..b876f55568 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-provider", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Transport providers for the API", "main": "index.js", "keywords": [ @@ -27,8 +27,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/metadata": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "@polkadot/util-crypto": "^2.9.0-beta.1", "bn.js": "^5.1.1", diff --git a/packages/typegen/package.json b/packages/typegen/package.json index d37dd53753..b2fc497520 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/typegen", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Type generation scripts", "main": "index.js", "bin": { @@ -36,10 +36,10 @@ "@babel/core": "^7.9.0", "@babel/register": "^7.9.0", "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.12.0-beta.8", - "@polkadot/metadata": "1.12.0-beta.8", - "@polkadot/rpc-provider": "1.12.0-beta.8", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/api": "1.12.0-beta.9", + "@polkadot/metadata": "1.12.0-beta.9", + "@polkadot/rpc-provider": "1.12.0-beta.9", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "websocket": "^1.0.31", "yargs": "^15.3.1" diff --git a/packages/types-known/package.json b/packages/types-known/package.json index 3baa99da34..13ff1d3d8a 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types-known", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "keywords": [ @@ -27,7 +27,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/types": "1.12.0-beta.8", + "@polkadot/types": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "bn.js": "^5.1.1" }, diff --git a/packages/types/package.json b/packages/types/package.json index 01dfea0291..a7a5e1887e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types", - "version": "1.12.0-beta.8", + "version": "1.12.0-beta.9", "description": "Implementation of the Parity codec", "main": "index.js", "keywords": [ @@ -27,7 +27,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.12.0-beta.8", + "@polkadot/metadata": "1.12.0-beta.9", "@polkadot/util": "^2.9.0-beta.1", "@polkadot/util-crypto": "^2.9.0-beta.1", "@types/bn.js": "^4.11.6", diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index f960ada01e..c2bc437846 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -31,7 +31,7 @@ import { AttestedCandidate, AuctionIndex, Bidder, CandidateReceipt, CollatorId, import { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, Fixed128, Fixed64, H160, H256, H512, Hash, Header, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, Moment, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, SignedBlock, StorageData, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, Fixed128, Fixed64, H160, H256, H512, Hash, Header, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import { SchedulePeriod, SchedulePriority, Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import { FullIdentification, IdentificationTuple, Keys, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6 } from '@polkadot/types/interfaces/session'; import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; @@ -223,6 +223,9 @@ declare module '@polkadot/types/types/registry' { LookupTarget: LookupTarget; 'Option': Option; 'Vec': Vec; + ModuleId: ModuleId; + 'Option': Option; + 'Vec': Vec; Moment: Moment; 'Compact': Compact; 'Option': Option; @@ -252,6 +255,9 @@ declare module '@polkadot/types/types/registry' { PhantomData: PhantomData; 'Option': Option; 'Vec': Vec; + RuntimeDbWeight: RuntimeDbWeight; + 'Option': Option; + 'Vec': Vec; SignedBlock: SignedBlock; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index 0a970bf5fc..f209bd352c 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -141,6 +141,9 @@ export interface LookupSource extends Address {} /** @name LookupTarget */ export interface LookupTarget extends AccountId {} +/** @name ModuleId */ +export interface ModuleId extends LockIdentifier {} + /** @name Moment */ export interface Moment extends u64 {} @@ -168,6 +171,12 @@ export interface PhantomData extends Null {} /** @name PreRuntime */ export interface PreRuntime extends ITuple<[ConsensusEngineId, Bytes]> {} +/** @name RuntimeDbWeight */ +export interface RuntimeDbWeight extends Struct { + readonly read: Weight; + readonly write: Weight; +} + /** @name Seal */ export interface Seal extends ITuple<[ConsensusEngineId, Bytes]> {} diff --git a/yarn.lock b/yarn.lock index f531dc7cad..f45ea45c1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2607,25 +2607,25 @@ __metadata: resolution: "@polkadot/api-contract@workspace:packages/api-contract" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.12.0-beta.8 - "@polkadot/rpc-core": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/api": 1.12.0-beta.9 + "@polkadot/rpc-core": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 bn.js: ^5.1.1 rxjs: ^6.5.5 languageName: unknown linkType: soft -"@polkadot/api-derive@1.12.0-beta.8, @polkadot/api-derive@workspace:packages/api-derive": +"@polkadot/api-derive@1.12.0-beta.9, @polkadot/api-derive@workspace:packages/api-derive": version: 0.0.0-use.local resolution: "@polkadot/api-derive@workspace:packages/api-derive" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.12.0-beta.8 + "@polkadot/api": 1.12.0-beta.9 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/rpc-core": 1.12.0-beta.8 - "@polkadot/rpc-provider": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/rpc-core": 1.12.0-beta.9 + "@polkadot/rpc-provider": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@polkadot/util-crypto": ^2.9.0-beta.1 bn.js: ^5.1.1 @@ -2634,18 +2634,18 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/api@1.12.0-beta.8, @polkadot/api@workspace:packages/api": +"@polkadot/api@1.12.0-beta.9, @polkadot/api@workspace:packages/api": version: 0.0.0-use.local resolution: "@polkadot/api@workspace:packages/api" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api-derive": 1.12.0-beta.8 + "@polkadot/api-derive": 1.12.0-beta.9 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/metadata": 1.12.0-beta.8 - "@polkadot/rpc-core": 1.12.0-beta.8 - "@polkadot/rpc-provider": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 - "@polkadot/types-known": 1.12.0-beta.8 + "@polkadot/metadata": 1.12.0-beta.9 + "@polkadot/rpc-core": 1.12.0-beta.9 + "@polkadot/rpc-provider": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 + "@polkadot/types-known": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@polkadot/util-crypto": ^2.9.0-beta.1 bn.js: ^5.1.1 @@ -2752,43 +2752,43 @@ __metadata: languageName: node linkType: hard -"@polkadot/metadata@1.12.0-beta.8, @polkadot/metadata@workspace:packages/metadata": +"@polkadot/metadata@1.12.0-beta.9, @polkadot/metadata@workspace:packages/metadata": version: 0.0.0-use.local resolution: "@polkadot/metadata@workspace:packages/metadata" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/types": 1.12.0-beta.8 - "@polkadot/types-known": 1.12.0-beta.8 + "@polkadot/types": 1.12.0-beta.9 + "@polkadot/types-known": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@polkadot/util-crypto": ^2.9.0-beta.1 bn.js: ^5.1.1 languageName: unknown linkType: soft -"@polkadot/rpc-core@1.12.0-beta.8, @polkadot/rpc-core@workspace:packages/rpc-core": +"@polkadot/rpc-core@1.12.0-beta.9, @polkadot/rpc-core@workspace:packages/rpc-core": version: 0.0.0-use.local resolution: "@polkadot/rpc-core@workspace:packages/rpc-core" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/metadata": 1.12.0-beta.8 - "@polkadot/rpc-provider": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/metadata": 1.12.0-beta.9 + "@polkadot/rpc-provider": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 memoizee: ^0.4.14 rxjs: ^6.5.5 languageName: unknown linkType: soft -"@polkadot/rpc-provider@1.12.0-beta.8, @polkadot/rpc-provider@workspace:packages/rpc-provider": +"@polkadot/rpc-provider@1.12.0-beta.9, @polkadot/rpc-provider@workspace:packages/rpc-provider": version: 0.0.0-use.local resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/metadata": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/metadata": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@polkadot/util-crypto": ^2.9.0-beta.1 bn.js: ^5.1.1 @@ -2816,10 +2816,10 @@ __metadata: "@babel/core": ^7.9.0 "@babel/register": ^7.9.0 "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.12.0-beta.8 - "@polkadot/metadata": 1.12.0-beta.8 - "@polkadot/rpc-provider": 1.12.0-beta.8 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/api": 1.12.0-beta.9 + "@polkadot/metadata": 1.12.0-beta.9 + "@polkadot/rpc-provider": 1.12.0-beta.9 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@types/websocket": ^1.0.0 "@types/yargs": ^15.0.4 @@ -2834,25 +2834,25 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/types-known@1.12.0-beta.8, @polkadot/types-known@workspace:packages/types-known": +"@polkadot/types-known@1.12.0-beta.9, @polkadot/types-known@workspace:packages/types-known": version: 0.0.0-use.local resolution: "@polkadot/types-known@workspace:packages/types-known" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/types": 1.12.0-beta.8 + "@polkadot/types": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@types/bn.js": ^4.11.6 bn.js: ^5.1.1 languageName: unknown linkType: soft -"@polkadot/types@1.12.0-beta.8, @polkadot/types@workspace:packages/types": +"@polkadot/types@1.12.0-beta.9, @polkadot/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@polkadot/types@workspace:packages/types" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.9.0-beta.1 - "@polkadot/metadata": 1.12.0-beta.8 + "@polkadot/metadata": 1.12.0-beta.9 "@polkadot/util": ^2.9.0-beta.1 "@polkadot/util-crypto": ^2.9.0-beta.1 "@types/bn.js": ^4.11.6