Skip to content

Commit

Permalink
feat: ⏫ upgrade to Polkadot SDK v1.13.0 (#216)
Browse files Browse the repository at this point in the history
* refactor: 🎨 moved runtime apis into their own file

* fix: ⬆️ fix upgrade to polkadot-sdk v1.10.0

* fix: 🐛 add removed runtime api `get_worst_case_scenario_slashable_amount`

* fix: 🐛 add missing generic in storage providers runtime api

* chore: 🏷️ run typegen

* style: 🚨 run cargo fmt

* fix: 🎨 fix cargo clippy

* fix: 🚑 fix mocked relay chain randomness

* style: 🚨 run cargo fmt

* chore: 🚨 temporary remove unused import (until v1.13.0)

* fix: 🩹 update `query_earliest_file_volunteer_tick` runtime api

* fix: 🚑 fix issues with merge from main

* style: 🚨 run cargo fmt

* feat: 📦 initial update to polkadot sdk v1.11.0

* feat: ⬆️ finish upgrade to polkadot sdk v1.11.0

* chore: 🏷️ run typegen

* chore: 🏷️ run typegen

* fix: ✅ fix node tests after rebenchmark of balances pallet in v1.11.0

* feat: ⬆️ update to Polkadot SDK v1.12.0

* feat: ⬆️ update to Polkadot SDK v1.13.0

* fix: ⬆️ finish upgrading to Polkadot SDK v1.13.0

* fix: 🐛 add missing imports (and run typegen)

* fix: ⬇️ rollback polkadotjs api dependencies

* chore: 🏷️ rerun pnpm typegen

* fix: 🚨 format and lint

* fix: 🚨 remove trailing whitespace

* Update runtime/src/configs/mod.rs

Co-authored-by: Facundo Farall <[email protected]>

* Update mod.rs

* chore: 🏷️ run typegen

---------

Co-authored-by: Facundo Farall <[email protected]>
  • Loading branch information
TDemeco and ffarall authored Oct 7, 2024
1 parent 41c24ec commit 6076d78
Show file tree
Hide file tree
Showing 43 changed files with 2,398 additions and 2,173 deletions.
2,549 changes: 1,176 additions & 1,373 deletions Cargo.lock

Large diffs are not rendered by default.

209 changes: 103 additions & 106 deletions Cargo.toml

Large diffs are not rendered by default.

223 changes: 120 additions & 103 deletions api-augment/dist/interfaces/lookup.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api-augment/dist/interfaces/lookup.js.map

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-consts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,17 @@ declare module "@polkadot/api-base/types/consts" {
[key: string]: Codec;
};
xcmpQueue: {
/**
* Maximal number of outbound XCMP channels that can have messages queued at the same time.
*
* If this is reached, then no further messages can be sent to channels that do not yet
* have a message queued. This should be set to the expected maximum of outbound channels
* which is determined by [`Self::ChannelInfo`]. It is important to set this large enough,
* since otherwise the congestion control protocol will not work as intended and messages
* may be dropped. This value increases the PoV and should therefore not be picked too
* high. Governance needs to pay attention to not open more channels than this value.
**/
maxActiveOutboundChannels: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of inbound XCMP channels that can be suspended simultaneously.
*
Expand All @@ -534,6 +545,14 @@ declare module "@polkadot/api-base/types/consts" {
* [`InboundXcmpSuspended`] still applies at that scale.
**/
maxInboundSuspended: u32 & AugmentedConst<ApiType>;
/**
* The maximal page size for HRMP message pages.
*
* A lower limit can be set dynamically, but this is the hard-limit for the PoV worst case
* benchmarking. The limit for the size of a message is slightly below this, since some
* overhead is incurred for encoding the format.
**/
maxPageSize: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
Expand Down
8 changes: 8 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,14 @@ declare module "@polkadot/api-base/types/errors" {
* Setting the queue config failed since one of its values was invalid.
**/
BadQueueConfig: AugmentedError<ApiType>;
/**
* The message is too big.
**/
TooBig: AugmentedError<ApiType>;
/**
* There are too many active outbound channels.
**/
TooManyActiveOutboundChannels: AugmentedError<ApiType>;
/**
* Generic error
**/
Expand Down
26 changes: 26 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import type {
SpRuntimeDigest,
SpTrieStorageProof,
SpWeightsWeightV2Weight,
StagingXcmV4Instruction,
StorageHubRuntimeConfigsRuntimeParamsRuntimeParametersKey,
StorageHubRuntimeConfigsRuntimeParamsRuntimeParametersValue,
StorageHubRuntimeRuntimeHoldReason,
Expand Down Expand Up @@ -1172,6 +1173,20 @@ declare module "@polkadot/api-base/types/storage" {
**/
queryCounter: AugmentedQuery<ApiType, () => Observable<u64>, []> &
QueryableStorageEntry<ApiType, []>;
/**
* If [`ShouldRecordXcm`] is set to true, then the last XCM program executed locally
* will be stored here.
* Runtime APIs can fetch the XCM that was executed by accessing this value.
*
* Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]
* implementation in the XCM executor configuration.
**/
recordedXcm: AugmentedQuery<
ApiType,
() => Observable<Option<Vec<StagingXcmV4Instruction>>>,
[]
> &
QueryableStorageEntry<ApiType, []>;
/**
* Fungible assets which we know are locked on a remote chain.
**/
Expand Down Expand Up @@ -1200,6 +1215,17 @@ declare module "@polkadot/api-base/types/storage" {
**/
safeXcmVersion: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> &
QueryableStorageEntry<ApiType, []>;
/**
* Whether or not incoming XCMs (both executed locally and received) should be recorded.
* Only one XCM program will be recorded at a time.
* This is meant to be used in runtime APIs, and it's advised it stays false
* for all other use cases, so as to not degrade regular performance.
*
* Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]
* implementation in the XCM executor configuration.
**/
shouldRecordXcm: AugmentedQuery<ApiType, () => Observable<bool>, []> &
QueryableStorageEntry<ApiType, []>;
/**
* The Latest versions that we know various locations support.
**/
Expand Down
70 changes: 68 additions & 2 deletions api-augment/dist/types/interfaces/augment-api-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@polkadot/api-base/types/calls";
import type { ApiTypes, AugmentedCall, DecoratedCallBase } from "@polkadot/api-base/types";
import type { Bytes, Null, Option, Result, Vec, bool, u32 } from "@polkadot/types-codec";
import type { Bytes, Null, Option, Result, Vec, bool, u128, u32 } from "@polkadot/types-codec";
import type { AnyNumber, IMethod, ITuple } from "@polkadot/types-codec/types";
import type { CheckInherentsResult, InherentData } from "@polkadot/types/interfaces/blockbuilder";
import type { BlockHash } from "@polkadot/types/interfaces/chain";
Expand All @@ -23,11 +23,14 @@ import type {
KeyTypeId,
Slot,
SlotDuration,
Weight
Weight,
WeightV2
} from "@polkadot/types/interfaces/runtime";
import type { RuntimeVersion } from "@polkadot/types/interfaces/state";
import type { ApplyExtrinsicResult, Key } from "@polkadot/types/interfaces/system";
import type { TransactionSource, TransactionValidity } from "@polkadot/types/interfaces/txqueue";
import type { XcmPaymentApiError } from "@polkadot/types/interfaces/xcmPaymentApi";
import type { XcmVersionedAssetId, XcmVersionedXcm } from "@polkadot/types/lookup";
import type { IExtrinsic, Observable } from "@polkadot/types/types";
import type {
BackupStorageProvider,
Expand Down Expand Up @@ -659,5 +662,68 @@ declare module "@polkadot/api-base/types/calls" {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x6ff52ee858e6c5bd/1 */
xcmPaymentApi: {
/**
* The API to query acceptable payment assets
**/
queryAcceptablePaymentAssets: AugmentedCall<
ApiType,
(
version: u32 | AnyNumber | Uint8Array
) => Observable<Result<Vec<XcmVersionedAssetId>, XcmPaymentApiError>>
>;
/**
*
**/
queryWeightToAssetFee: AugmentedCall<
ApiType,
(
weight:
| WeightV2
| {
refTime?: any;
proofSize?: any;
}
| string
| Uint8Array,
asset:
| XcmVersionedAssetId
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array
) => Observable<Result<u128, XcmPaymentApiError>>
>;
/**
*
**/
queryXcmWeight: AugmentedCall<
ApiType,
(
message:
| XcmVersionedXcm
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array
) => Observable<Result<WeightV2, XcmPaymentApiError>>
>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
}
}
16 changes: 16 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-tx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ export type __SubmittableExtrinsicFunction<ApiType extends ApiTypes> =
declare module "@polkadot/api-base/types/submittable" {
interface AugmentedSubmittables<ApiType extends ApiTypes> {
balances: {
/**
* Burn the specified liquid free balance from the origin account.
*
* If the origin's account ends up below the existential deposit as a result
* of the burn and `keep_alive` is false, the account will be reaped.
*
* Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,
* this `burn` operation will reduce total issuance by the amount _burned_.
**/
burn: AugmentedSubmittable<
(
value: Compact<u128> | AnyNumber | Uint8Array,
keepAlive: bool | boolean | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Compact<u128>, bool]
>;
/**
* Adjust the total issuance in a saturating way.
*
Expand Down
Loading

0 comments on commit 6076d78

Please sign in to comment.