Skip to content

Commit

Permalink
feat: ⏫ upgrade to Polkadot SDK v1.11.0 (#212)
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

* fix: 🩹 fix merge from main
  • Loading branch information
TDemeco authored Oct 4, 2024
1 parent f347a67 commit 8806cc2
Show file tree
Hide file tree
Showing 39 changed files with 3,084 additions and 2,658 deletions.
3,763 changes: 1,939 additions & 1,824 deletions Cargo.lock

Large diffs are not rendered by default.

201 changes: 101 additions & 100 deletions Cargo.toml

Large diffs are not rendered by default.

148 changes: 85 additions & 63 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.

13 changes: 0 additions & 13 deletions api-augment/dist/types/interfaces/augment-api-errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,6 @@ declare module "@polkadot/api-base/types/errors" {
* The unlock operation cannot succeed because there are still consumers of the lock.
**/
InUse: AugmentedError<ApiType>;
/**
* Invalid non-concrete asset.
**/
InvalidAssetNotConcrete: AugmentedError<ApiType>;
/**
* Invalid asset, reserve chain could not be determined for it.
**/
Expand Down Expand Up @@ -842,10 +838,6 @@ declare module "@polkadot/api-base/types/errors" {
* Too many assets with different reserve locations have been attempted for transfer.
**/
TooManyReserves: AugmentedError<ApiType>;
/**
* Could not decode XCM.
**/
UnableToDecode: AugmentedError<ApiType>;
/**
* The desired destination was unreachable, generally because there is a no way of routing
* to it.
Expand All @@ -855,11 +847,6 @@ declare module "@polkadot/api-base/types/errors" {
* The message's weight could not be determined.
**/
UnweighableMessage: AugmentedError<ApiType>;
/**
* XCM encoded length is too large.
* Returned when an XCM encoded length is larger than `MaxXcmEncodedSize`.
**/
XcmTooLarge: AugmentedError<ApiType>;
/**
* Generic error
**/
Expand Down
215 changes: 156 additions & 59 deletions api-augment/dist/types/interfaces/augment-api-tx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ import type {
SpRuntimeMultiSignature,
SpTrieStorageProofCompactProof,
SpWeightsWeightV2Weight,
StagingXcmExecutorAssetTransferTransferType,
StagingXcmV4Location,
StorageHubRuntimeConfigsRuntimeParamsRuntimeParameters,
StorageHubRuntimeSessionKeys,
XcmV3WeightLimit,
XcmVersionedAssetId,
XcmVersionedAssets,
XcmVersionedLocation,
XcmVersionedXcm
Expand Down Expand Up @@ -2548,9 +2550,6 @@ declare module "@polkadot/api-base/types/submittable" {
* No more than `max_weight` will be used in its attempted execution. If this is less than
* the maximum amount of weight that the message could take to be executed, then no
* execution attempt will be made.
*
* WARNING: DEPRECATED. `execute` will be removed after June 2024. Use `execute_blob`
* instead.
**/
execute: AugmentedSubmittable<
(
Expand Down Expand Up @@ -2578,32 +2577,6 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedXcm, SpWeightsWeightV2Weight]
>;
/**
* Execute an XCM from a local, signed, origin.
*
* An event is deposited indicating whether the message could be executed completely
* or only partially.
*
* No more than `max_weight` will be used in its attempted execution. If this is less than
* the maximum amount of weight that the message could take to be executed, then no
* execution attempt will be made.
*
* The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
**/
executeBlob: AugmentedSubmittable<
(
encodedMessage: Bytes | string | Uint8Array,
maxWeight:
| SpWeightsWeightV2Weight
| {
refTime?: any;
proofSize?: any;
}
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Bytes, SpWeightsWeightV2Weight]
>;
/**
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
Expand Down Expand Up @@ -2938,9 +2911,6 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, XcmVersionedLocation, XcmVersionedAssets, u32]
>;
/**
* WARNING: DEPRECATED. `send` will be removed after June 2024. Use `send_blob` instead.
**/
send: AugmentedSubmittable<
(
dest:
Expand Down Expand Up @@ -2972,33 +2942,6 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, XcmVersionedXcm]
>;
/**
* Send an XCM from a local, signed, origin.
*
* The destination, `dest`, will receive this message with a `DescendOrigin` instruction
* that makes the origin of the message be the origin on this system.
*
* The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
**/
sendBlob: AugmentedSubmittable<
(
dest:
| XcmVersionedLocation
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
encodedMessage: Bytes | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, Bytes]
>;
/**
* Teleport some assets from the local chain to some destination chain.
*
Expand Down Expand Up @@ -3154,6 +3097,160 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, XcmVersionedLocation, XcmVersionedAssets, u32, XcmV3WeightLimit]
>;
/**
* Transfer assets from the local chain to the destination chain using explicit transfer
* types for assets and fees.
*
* `assets` must have same reserve location or may be teleportable to `dest`. Caller must
* provide the `assets_transfer_type` to be used for `assets`:
* - `TransferType::LocalReserve`: transfer assets to sovereign account of destination
* chain and forward a notification XCM to `dest` to mint and deposit reserve-based
* assets to `beneficiary`.
* - `TransferType::DestinationReserve`: burn local assets and forward a notification to
* `dest` chain to withdraw the reserve assets from this chain's sovereign account and
* deposit them to `beneficiary`.
* - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`
* chain to move reserves from this chain's SA to `dest` chain's SA, and forward another
* XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically
* the remote `reserve` is Asset Hub.
* - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to
* mint/teleport assets and deposit them to `beneficiary`.
*
* On the destination chain, as well as any intermediary hops, `BuyExecution` is used to
* buy execution using transferred `assets` identified by `remote_fees_id`.
* Make sure enough of the specified `remote_fees_id` asset is included in the given list
* of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight
* is needed than `weight_limit`, then the operation will fail and the sent assets may be
* at risk.
*
* `remote_fees_id` may use different transfer type than rest of `assets` and can be
* specified through `fees_transfer_type`.
*
* The caller needs to specify what should happen to the transferred assets once they reach
* the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which
* contains the instructions to execute on `dest` as a final step.
* This is usually as simple as:
* `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,
* but could be something more exotic like sending the `assets` even further.
*
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `[Parent,
* Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from
* relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from
* parachain across a bridge to another ecosystem destination.
* - `assets`: The assets to be withdrawn. This should include the assets used to pay the
* fee on the `dest` (and possibly reserve) chains.
* - `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`.
* - `remote_fees_id`: One of the included `assets` to be be used to pay fees.
* - `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets.
* - `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the
* transfer, which also determines what happens to the assets on the destination chain.
* - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
**/
transferAssetsUsingTypeAndThen: AugmentedSubmittable<
(
dest:
| XcmVersionedLocation
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
assets:
| XcmVersionedAssets
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
assetsTransferType:
| StagingXcmExecutorAssetTransferTransferType
| {
Teleport: any;
}
| {
LocalReserve: any;
}
| {
DestinationReserve: any;
}
| {
RemoteReserve: any;
}
| string
| Uint8Array,
remoteFeesId:
| XcmVersionedAssetId
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
feesTransferType:
| StagingXcmExecutorAssetTransferTransferType
| {
Teleport: any;
}
| {
LocalReserve: any;
}
| {
DestinationReserve: any;
}
| {
RemoteReserve: any;
}
| string
| Uint8Array,
customXcmOnDest:
| XcmVersionedXcm
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
weightLimit:
| XcmV3WeightLimit
| {
Unlimited: any;
}
| {
Limited: any;
}
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[
XcmVersionedLocation,
XcmVersionedAssets,
StagingXcmExecutorAssetTransferTransferType,
XcmVersionedAssetId,
StagingXcmExecutorAssetTransferTransferType,
XcmVersionedXcm,
XcmV3WeightLimit
]
>;
/**
* Generic tx
**/
Expand Down
Loading

0 comments on commit 8806cc2

Please sign in to comment.