merge v1 into main (#175)

* Add zombienet config to release (#158)

* Cleanup docs for the release (#160)

* Updated documentation to version 1.7.0
* Updated broken links

* updated docs to v1.10 (#166)

* updated dependencies to v1.10.0 (#165)

* Fixed weights for non-XCM related pallets (#149)

* add remove proxies to filter (#146)

* Fix weights for XCM and Message Queue.  (#153)

* Fix for PriceForSiblingDelivery (#156)

* Fix the FeeManager setting (#159)

* better explanation for constants (#167)

* better explanation for constants

* Removed polkadot launch (#169)

* Removed warnings about experimental code. (#170)

* Attached audit.

* toml sort

* changelog and version bump (#174)

* changelog and version bump

* cargo fmt fix

---------

Co-authored-by: Nikita Khateev <nikita.khateev@openzeppelin.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This commit is contained in:
Özgün Özerk
2024-04-29 11:06:24 +03:00
committed by GitHub
parent 26778e090f
commit 30930edda5
43 changed files with 4318 additions and 1462 deletions
-1
View File
@@ -6,7 +6,6 @@
* Runtime Descriptions
** xref:runtime/xcm_executor.adoc[XCM Executor]
* Pallet Specifications
** xref:pallets/aura_ext.adoc[cumulus_aura_ext]
** xref:pallets/collator-selection.adoc[collator_selection]
** xref:pallets/aura_ext.adoc[cumulus_pallet_aura_ext]
** xref:pallets/parachain-system.adoc[cumulus_pallet_parachain_system]
+7 -5
View File
@@ -4,7 +4,9 @@
= pallet_assets
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/assets/src/lib.rs[{github-icon},role=heading-link]
== Purpose
@@ -17,7 +19,7 @@ The `pallet_assets` module is designed to manage and manipulate custom fungible
** `Admin` - The account that has administrative privileges over an asset, such as: `minting`, `burning`, `freezing`, and `thawing`.
** `Sufficiency` - The amount of an asset that is required to be held in an account in order to perform certain operations, such as: `transfers`, `freezing`, and `thawing`.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/assets/src/lib.rs#L231[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `Balance` -- The balance unit type.
@@ -41,7 +43,7 @@ The `pallet_assets` module is designed to manage and manipulate custom fungible
** `RuntimeEvent` -- The overarching event type.
** `WeightInfo` -- xref:glossary.adoc#weight[Weight] information for extrinsics in this pallet.
== Events link:https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/assets/src/lib.rs#L442[{github-icon},role=heading-link]
== Events
* `Created(asset_id, creator, owner)` -- An asset was created.
* `Issued(asset_id, owner, amount)` -- An asset was issued.
@@ -68,7 +70,7 @@ The `pallet_assets` module is designed to manage and manipulate custom fungible
* `Touched(asset_id, who, depositor)` -- An account `who` was created with a deposit from `depositor`.
* `Blocked(asset_id, who)` -- An account `who` was blocked.
== Errors link:https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/assets/src/lib.rs#L526[{github-icon},role=heading-link]
== Errors
* `BalanceLow` -- Account balance must be greater than or equal to the transfer amount.
* `NoAccount` -- The account to alter does not exist.
@@ -91,7 +93,7 @@ The `pallet_assets` module is designed to manage and manipulate custom fungible
* `NotFrozen` -- The asset should be frozen before the given operation.
* `CallbackFailed` -- Callback action resulted in error.
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/assets/src/lib.rs#L576[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[create]]
@@ -4,7 +4,7 @@
= cumulus_pallet_aura_ext
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Purpose
@@ -13,7 +13,7 @@ This pallet integrates parachains own block production mechanism (for example
- to manage the unincluded blocks from the current slot
- to validate produced block against the relay chain
== Configuration and Integration link:https://github.com/paritytech/polkadot-sdk/tree/release-polkadot-v1.3.0/cumulus/pallets/aura-ext[{github-icon},role=heading-link]
== Configuration and Integration link:https://github.com/paritytech/polkadot-sdk/tree/release-polkadot-v1.10.0/cumulus/pallets/aura-ext[{github-icon},role=heading-link]
There is no special config for this integration and it has no dispatchables, but you need to integrate it with other `parachain-system` crate:
+31 -6
View File
@@ -4,7 +4,9 @@
= pallet_balances
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/balances/src/lib.rs[{github-icon},role=heading-link]
== Purpose
@@ -19,7 +21,7 @@ The Balances pallet provides functions for:
* Managing total issuance.
* Setting and managing xref:glossary.adoc#lock[locks].
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/balances/src/lib.rs#L253[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `RuntimeHoldReason` -- The overarching xref:glossary.adoc#hold[hold] reason.
@@ -32,13 +34,12 @@ The Balances pallet provides functions for:
** `FreezeIdentifier` -- The ID type for freezes.
** `MaxLocks` -- The maximum number of locks that should exist on an account.
** `MaxReserves` -- The maximum number of named reserves that can exist on an account. The use of reserves is deprecated in favor of holds. See `https://github.com/paritytech/substrate/pull/12951/`
** `MaxHolds` -- The maximum number of holds that can exist on an account at any time.
** `MaxFreezes` -- The maximum number of individual freeze locks that can exist on an account at any time.
* Common configs
** `RuntimeEvent` -- The overarching event type.
** `WeightInfo` -- xref:glossary.adoc#weight[Weight] information for extrinsics in this pallet.
== Events link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/balances/src/lib.rs#L339[{github-icon},role=heading-link]
== Events
* `Endowed(account, free_balance)` -- An account was created with some free balance.
* `DustLost(account, amount)` -- An account was removed whose balance was non-zero but below ExistentialDeposit, resulting in an outright loss.
@@ -61,8 +62,9 @@ The Balances pallet provides functions for:
* `Unlocked(who, amount)` -- Some balance was unlocked.
* `Frozen(who, amount)` -- Some balance was frozen.
* `Thawed(who, amount)` -- Some balance was thawed.
* `TotalIssuanceForced(old, new)` -- Total issuance was forcefully changed.
== Errors link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/balances/src/lib.rs#L392[{github-icon},role=heading-link]
== Errors
* `VestingBalance` -- Vesting balance too high to send value.
* `LiquidityRestrictions` -- Account liquidity restrictions prevent withdrawal.
@@ -74,8 +76,10 @@ The Balances pallet provides functions for:
* `TooManyReserves` -- Number of named reserves exceed `MaxReserves`.
* `TooManyHolds` -- Number of holds exceeds `MaxHolds`.
* `TooManyFreezes` -- Number of freezes exceeds `MaxFreezes`.
* `IssuanceDeactivated` -- The issuance cannot be modified since it is already deactivated.
* `DeltaZero` -- The delta cannot be zero.
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/balances/src/lib.rs#L570[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[transfer_allow_death]]
@@ -220,3 +224,24 @@ Set the regular balance of a given account. The caller (origin) must be root.
* `origin: OriginFor<T>` -- caller, must be root.
* `who: AccountIdLookupOf<T>` -- the account for which the balance will be set.
* `new_free: T::Balance` -- the amount of free balance that will be set to the given account.
[.contract-item]
[[force_adjust_total_issuance]]
==== `[.contract-item-name]#++force_adjust_total_issuance++#`
[source,rust]
----
pub fn force_adjust_total_issuance(
origin: OriginFor<T>,
direction: AdjustmentDirection,
#[pallet::compact] delta: T::Balance,
) -> DispatchResult
----
Adjust the total issuance in a saturating way.
Can only be called by root and always needs a positive delta.
**Params:**
* `origin: OriginFor<T>` -- caller, must be root.
* `direction: AdjustmentDirection` -- the direction of issuance change (increase or decrease).
* `delta: T::Balance` -- the amount of free balance that will be set to the given account.
@@ -4,13 +4,15 @@
= collator_selection
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/cumulus/pallets/collator-selection/src/lib.rs[{github-icon},role=heading-link]
== Purpose
This pallet is needed to manage the set of xref:glossary.adoc#collator[collators] for each session and to provision the next session with the actual list of collators.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/collator-selection/src/lib.rs#L118[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `UpdateOrigin` — defines the list of origins that are able to modify the settings of collators (e.g. set and remove list of xref:glossary.adoc#invulnerable[invulnerables], desired xref:glossary.adoc#candidates[candidates], xref:glossary.adoc#candidacy_bond[candidacy bond]). This type should implement the trait `EnsureOrigin`.
@@ -27,7 +29,7 @@ This pallet is needed to manage the set of xref:glossary.adoc#collator[collators
** `Currency`
** `WeightInfo`
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/collator-selection/src/lib.rs#L301[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[set_invulnerables]]
@@ -36,7 +38,7 @@ This pallet is needed to manage the set of xref:glossary.adoc#collator[collators
----
pub fn set_invulnerables(new: Vec<T::AccountId>)
----
Sets a new list of invulnerable collators. The call must be signed and origin of the call must fulfill the EnsureOrigin check.
Sets a new list of invulnerable collators. The call must be signed and origin of the call must fulfill the EnsureOrigin check.
IMPORTANT: This call does not maintain the mutual exclusiveness of candidates and invulnerables lists.
@@ -83,7 +85,7 @@ Set a new maximum possible number of candidates. If it is higher than `Config::M
----
pub fn set_candidacy_bond(max: u32)
----
Set the amount for the deposit to be a candidate for collator.
Set the amount for the deposit to be a candidate for collator.
**Params:**
@@ -186,4 +188,68 @@ Remove an invulnerable from the list. Call must be signed and caller pass `Confi
**Events:**
- `InvulnerableRemoved(account_id)`
- `InvulnerableRemoved(account_id)`
[.contract-item]
[[update_bond]]
==== `[.contract-item-name]#++update_bond++#`
[source,rust]
----
pub fn update_bond(new_deposit: BalanceOf<T>)
----
Update the candidacy bond of origin to the new value.
*Params:*
- `new_deposit: BalanceOf<T>` — new value for the candidacy bond
**Errors:**
- `BadOrigin` — callers origin does not fulfill the `Config::EnsureOrigin` check.
- `DepositTooLow` - new deposit is smaller than required candidacy bond.
- `NotCandidate` - caller's origin is not a candidate
- `IdenticalDeposit` - deposit have not changed
- `InsufficientBalance` — candidate does not have enough funds for deposit for candidacy bond
- `LiquidityRestrictions` — account restrictions (like frozen funds or vesting) prevent from creating a deposit
- `Overflow` — reserved funds overflow the currency type. Should not happen in usual scenarios.
- `InvalidUnreserve` - after the unreserve the number of candidates becomes less than desired.
- `InsertToCandidateListFailed` - candidate list is at maximum capacity. Should not happen in usual scenarios. Chain is misconfigured.
**Events:**
- `CandidateBondUpdated(account_id, deposit)`
[.contract-item]
[[take_candidate_slot]]
==== `[.contract-item-name]#++take_candidate_slot++#`
[source,rust]
----
pub fn take_candidate_slot(
deposit: BalanceOf<T>,
target: T::AccountId,
)
----
Try to replace the target's candidacy by making a bigger candidacy bond.
*Params:*
- `deposit: BalanceOf<T>` — value for the candidacy bond
- `target: T::AccountId` - target candidate to replace
**Errors:**
- `BadOrigin` — callers origin does not fulfill the `Config::EnsureOrigin` check.
- `AlreadyInvulnerable` — caller is already in invulnerable collators list.
- `InsufficientBond` - the deposit is less the candidacy bond or target's deposit.
- `NoAssociatedValidatorId` — caller does not have a session key.
- `ValidatorNotRegistered` — caller session key is not registered.
- `AlreadyCandidate` — caller is already in candidates list.
- `TargetIsNotCandidate` - target is not in candidate list.
- `InsufficientBalance` — candidate does not have enough funds for deposit for candidacy bond
- `LiquidityRestrictions` — account restrictions (like frozen funds or vesting) prevent from creating a deposit
- `Overflow` — reserved funds overflow the currency type. Should not happen in usual scenarios.
**Events:**
- `CandidateReplaced(old, new, deposit)`
@@ -4,13 +4,15 @@
= pallet_message_queue
Branch/Release: `release-polkadot-v{1.3.0}`
Branch/Release: `release-polkadot-v1.10.0`
Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/message-queue/src/lib.rs[{github-icon},role=heading-link]
== Purpose
Flexible FRAME pallet for implementing message queues. This pallet can also initiate message processing using the `MessageProcessor` (see `Config`).
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/message-queue/src/lib.rs#L445[{github-icon},role=heading-link]
== Config
* Pallet-specific configs:
** `MessageProcessor` -- Processor for messages
** `Size` -- Page/heap size type.
@@ -18,12 +20,13 @@ Flexible FRAME pallet for implementing message queues. This pallet can also init
** `QueuePausedQuery` -- Queried by the pallet to check whether a queue can be serviced.
** `HeapSize` -- The size of the page; this also serves as the maximum message size which can be sent.
** `MaxStale` -- The maximum number of stale pages (i.e. of overweight messages) allowed before culling can happen. Once there are more stale pages than this, then historical pages may be dropped, even if they contain unprocessed overweight messages.
** `ServiceWeight` -- The amount of weight (if any) which should be provided to the message queue for servicing enqueued items. This may be legitimately `None` in the case that you will call `ServiceQueues::service_queues` manually.
** `ServiceWeight` -- The amount of weight (if any) which should be provided to the message queue for servicing enqueued items `on_initialize`. This may be legitimately `None` in the case that you will call `ServiceQueues::service_queues` manually or set [`Self::IdleMaxServiceWeight`] to have it run in `on_idle`.
** `IdleMaxServiceWeight` -- The maximum amount of weight (if any) to be used from remaining weight `on_idle` which should be provided to the message queue for servicing enqueued items `on_idle`. Useful for parachains to process messages at the same block they are received. If `None`, it will not call `ServiceQueues::service_queues` in `on_idle`.
* Common configs:
** `RuntimeEvent` -- The overarching event type.
** `WeightInfo` -- Weight information for extrinsics in this pallet.
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/message-queue/src/lib.rs#L594[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[execute_overweight]]
@@ -4,13 +4,15 @@
= pallet_multisig
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code: link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/multisig/src/lib.rs[{github-icon},role=heading-link]
== Purpose
This module enables multi-signature operations in your runtime. It allows multiple signed origins (accounts) to coordinate and dispatch a call. For the call to execute, the threshold number of accounts from the set (signatories) must approve it.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/multisig/src/lib.rs#L135[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `DepositBase` -- The base amount of currency needed to xref:glossary.adoc#reserve[reserve] for creating a multisig execution or to store a dispatch call for later. Recall: The deposit to be made by the account that creates the multisig is: `threshold * DepositFactor + DepositBase`
@@ -23,7 +25,7 @@ This module enables multi-signature operations in your runtime. It allows multip
** `WeightInfo` -- xref:glossary.adoc#weight[Weight] information for extrinsics in this pallet.
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/multisig/src/lib.rs#L254[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[approve_as_multi]]
@@ -4,7 +4,9 @@
= parachain_system
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/cumulus/pallets/parachain-system/src/lib.rs[{github-icon},role=heading-link]
== Purpose
@@ -16,14 +18,13 @@ This pallet is a core element of each parachain. It will:
- Send outgoing messages to relay chain and other parachains
- Build collation info when requested by xref:glossary.adoc#collator[collator]
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/parachain-system/src/lib.rs#L207[{github-icon},role=heading-link]
== Config
* Pallet-specific configs:
** `OnSystemEvent` — a handler that will be called when new xref:glossary.adoc#validation_data[validation data] will be set (once each block). New validation data will also be passed to it. Look to `trait OnSystemEvent` for more details.
** `SelfParaId` — getter for a parachain id of this chain
** `OutboundXcmpMessageSource` — source of outgoing XCMP messages. It is queried in `finalize_block` and later included into collation information
// it was added after 1.3.0. I am leaving it commented for the future updates
// ** `DmpQueue` — a handler for the incoming *downward* messages from relay chain
** `DmpQueue` — a handler for the incoming *downward* messages from relay chain
** `ReservedDmpWeight` — xref:glossary.adoc#weight[weight] reserved for DMP message processing. This config seems to be is not used as the function that processes these messages (`enqueue_inbound_downward_messages`) returns used weight.
** `XcmpMessageHandler` — a handler for the incoming _horizontal_ messages from other parachains
** `ReservedXcmpWeight` — default weight limit for the for the XCMP message processing. May be overriden by storage `ReservedXcmpWeightOverride` . If incoming messages in block will exceed the weight limit, they wont be processed.
@@ -33,7 +34,7 @@ This pallet is a core element of each parachain. It will:
** `RuntimeEvent`
** `WeightInfo`
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/parachain-system/src/lib.rs#L506[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[set_validation_data]]
+5 -3
View File
@@ -4,13 +4,15 @@
= pallet_proxy
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/proxy/src/lib.rs[{github-icon},role=heading-link]
== Purpose
This pallet enables delegation of rights to execute certain call types from one origin to another.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/proxy/src/lib.rs#L107[{github-icon},role=heading-link]
== Config
* Pallet-specific configs:
** `ProxyType` -- a type that describes different variants of xref:glossary.adoc#proxy[proxy]. It must implement `Default` trait and `InstanceFilter<RuntimeCall>` trait.
@@ -26,7 +28,7 @@ This pallet enables delegation of rights to execute certain call types from one
** `RuntimeCall`
** `Currency`
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/proxy/src/lib.rs#L179[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[add_proxy]]
@@ -2,9 +2,11 @@
:highlightjs-languages: rust
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= cumulus_pallet_parachain_system
= pallet_transaction_payment
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/substrate/frame/transaction-payment/src/lib.rs[{github-icon},role=heading-link]
== Purpose
@@ -25,7 +27,7 @@ final_fee = inclusion_fee + tip;
```
The inputs are defined below in the glossary and config sections.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/substrate/frame/pallet-transaction-payment/src/lib.rs#L445[{github-icon},role=heading-link]
== Config
* Pallet-specific handlers:
** `OnChargeTransaction` -- Handler for withdrawing, refunding and depositing the transaction fee. Type must implement the trait `OnChargeTransaction<Self>`.
+167 -7
View File
@@ -4,13 +4,15 @@
= pallet_xcm
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/polkadot/xcm/pallet-xcm/src/lib.rs[{github-icon},role=heading-link]
== Purpose
`pallet-xcm` is responsible for filtering, routing, and executing incoming XCM.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/polkadot/xcm/pallet-xcm/src/lib.rs#L192[{github-icon},role=heading-link]
== Config
* Pallet-specific origins:
** `AdminOrigin` -- The origin that is allowed to call privileged operations on the XCM pallet. Type must implement trait `EnsureOrigin`.
@@ -21,7 +23,6 @@ Branch/Release: `release-polkadot-v1.3.0`
** `RemoteLockConsumerIdentifier` -- The ID type for local consumers of remote locks. The type must implement `Copy`.
* Pallet-specific handlers:
** `OnChargeTransaction` -- Handler for withdrawing, refunding and depositing the transaction fee. Type must implement the trait `OnChargeTransaction<Self>`.
** `Currency` -- Lockable currency used in the pallet. Type must implement the trait `LockableCurrency`.
** `Weigher` -- Measures xref:glossary.adoc#weight[weight] consumed by XCM local execution. Type must implement the trait `WeightBounds`.
** `XcmExecutor` -- Means of executing XCM. Type must implement the trait `ExecuteXcm`.
@@ -44,9 +45,6 @@ Branch/Release: `release-polkadot-v1.3.0`
** `MaxRemoteLockConsumers` -- The maximum number of consumers a single remote lock may have. Type must implement the trait `Get<u32>`.
** `UniversalLocation` -- This chain's Universal Location. Type must implement the trait `Get<InteriorMultiLocation>`.
* Benchmark-only configs:
** `ReachableDest` -- A `MultiLocation` that can be reached via `XcmRouter`. Used only in benchmarks. Type must implement trait `ReachableDest`.
* Common configs:
** `RuntimeEvent`
** `RuntimeCall`
@@ -66,6 +64,15 @@ pub fn send(
message: Box<VersionedXcm<()>>,
)
----
WARNING: DEPRECATED. `send` will be removed after June 2024. Use `send_blob` instead.
* Deprecation explanation:
** `pallet-xcm` has a new pair of extrinsics, `execute_blob` and `send_blob`. These are meant to be used instead of `execute` and `send`, which are now deprecated and will be removed eventually. These new extrinsics just require you to input the encoded XCM.
** There's a new utility in PolkadotJS Apps for encoding XCMs you can use: https://polkadot.js.org/apps/#/utilities/xcm Just pass in the encoded XCM to the new extrinsics and you're done.
** The migration from the old extrinsic to the new is very simple. If you have your message `xcm: VersionedXcm<Call>`, then instead of passing in `Box::new(xcm)` to both `execute` and `send`, you would pass in `xcm.encode().try_into()` and handle the potential error of its encoded length being bigger than `MAX_XCM_ENCODED_SIZE`.
** `pallet-contracts` takes the XCM encoded now as well. It follows the same API as `execute_blob` and `send_blob`.
Send a versioned XCM `message` to the destination `dest`.
The origin must be `SendXcmOrigin` for this call.
@@ -96,6 +103,15 @@ pub fn execute(
max_weight: Weight,
)
----
WARNING: DEPRECATED. `execute` will be removed after June 2024. Use `execute_blob` instead.
* Deprecation explanation:
** `pallet-xcm` has a new pair of extrinsics, `execute_blob` and `send_blob`. These are meant to be used instead of `execute` and `send`, which are now deprecated and will be removed eventually. These new extrinsics just require you to input the encoded XCM.
** There's a new utility in PolkadotJS Apps for encoding XCMs you can use: https://polkadot.js.org/apps/#/utilities/xcm Just pass in the encoded XCM to the new extrinsics and you're done.
** The migration from the old extrinsic to the new is very simple. If you have your message `xcm: VersionedXcm<Call>`, then instead of passing in `Box::new(xcm)` to both `execute` and `send`, you would pass in `xcm.encode().try_into()` and handle the potential error of its encoded length being bigger than `MAX_XCM_ENCODED_SIZE`.
** `pallet-contracts` takes the XCM encoded now as well. It follows the same API as `execute_blob` and `send_blob`.
Execute an XCM message from a local, signed, origin.
The origin must be `ExecuteXcmOrigin` for this call.
@@ -324,10 +340,154 @@ None
None
[.contract-item]
[[transfer_assets]]
==== `[.contract-item-name]#++transfer_assets++#`
[source,rust]
----
pub fn transfer_assets(
origin: OriginFor<T>,
dest: Box<VersionedLocation>,
beneficiary: Box<VersionedLocation>,
assets: Box<VersionedAssets>,
fee_asset_item: u32,
weight_limit: WeightLimit,
)
----
Transfer some assets from the local chain to the destination chain through their local, destination or remote reserve, or through teleports.
**Params:**
- `dest: Box<VersionedLocation>` -- Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain.
- `beneficiary: Box<VersionedLocation>` -- A beneficiary location for the assets in the context of `dest`. Will generally be an `AccountId32` value.
- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the `dest` (and possibly reserve) chains.
- `fee_asset_item: u32` -- The index into `assets` of the item which should be used to pay fees.
- `weight_limit: WeightLimit` -- The remote-side weight limit, if any, for the XCM fee purchase.
**Errors:**
* `BadOrigin` —- origin did not match `ExecuteXcmOrigin`.
* `BadVersion` -- v2/v3 conversion to v4 failed for `assets`, `dest`, or `beneficiary`.
* `TooManyAssets` -- `assets` contain more than `MAX_ASSETS_FOR_TRANSFER = 2` to transfer.
* `Empty` -- can be a number of different errors:
** `fee_asset_item` is not present in `assets`.
** some fungible asset in `assets` has a value of 0.
** fees or asset transfer type was not determined.
* `TooManyReserves` -- there are more than one transfer type for an asset.
* `InvalidAssetUnknownReserve` -- transfer type can not be determined for a given asset.
* `InvalidAssetUnsupportedReserve` -- asset or fees transfer type is remote reserve and asset and fees asset are different.
* `Filtered` -- can be a number of different errors:
** `XcmReserveTransferFilter` filtered the asset.
** `XcmTeleportFilter` filtered the asset
* `CannotReanchor` -- asset can't be reanchored.
* `CannotCheckOutTeleport` -- asset can't be teleported
* `UnweighableMessage` -- prepared XCM message had issues with weighing (i.e. more instructions than the limit).
* `LocalExecutionIncomplete` -- local execution of XCM message have failed.
* `FeesNotMet` -- unable to charge fees. See the error log of any node to see the details.
**Events:**
- `Sent(origin, destination, message, message_id)`
**Deprecated Extrinsics**:
- `teleport_assets` -- Use `limited_teleport_assets` instead.
- `reserve_transfer_assets` -- Use `limited_reserve_transfer_assets` instead.
[.contract-item]
[[claim_assets]]
==== `[.contract-item-name]#++claim_assets++#`
[source,rust]
----
pub fn claim_assets(
origin: OriginFor<T>,
assets: Box<VersionedAssets>,
beneficiary: Box<VersionedLocation>,
) -> DispatchResult
----
**Params:**
- `origin: OriginFor<T>` -- Must be signed.
- `assets: Box<VersionedAssets>` -- The exact assets that were trapped. Use the version to specify what version was the latest when they were trapped.
- `beneficiary: Box<VersionedLocation>` -- A beneficiary location for the assets in the context of `dest`. Will generally be an `AccountId32` value.
**Errors:**
* `BadOrigin` —- origin did not match `ExecuteXcmOrigin`.
* `BadVersion` -- v2/v3 conversion to v4 failed for `assets`, `dest`, or `beneficiary`.
* `UnweighableMessage` -- prepared XCM message had issues with weighing (i.e. more instructions than the limit).
* `LocalExecutionIncomplete` -- local execution of XCM message have failed.
**Events:**
None
[.contract-item]
[[execute_blob]]
==== `[.contract-item-name]#++execute_blob++#`
[source,rust]
----
pub fn execute_blob(
origin: OriginFor<T>,
encoded_message: BoundedVec<u8, MaxXcmEncodedSize>,
max_weight: Weight,
) -> DispatchResultWithPostInfo
----
Execute an XCM from a local, signed, origin.
**Params:**
- `origin: OriginFor<T>` -- Must be signed.
- `encoded_message: BoundedVec<u8, MaxXcmEncodedSize>` -- The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
- `max_weight: Weight` -- 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.
**Errors:**
* `BadOrigin` —- origin did not match `ExecuteXcmOrigin`.
* `BadVersion` -- v2/v3 conversion to v4 failed for `assets`, `dest`, or `beneficiary`.
* `Filtered` -- can be a number of different errors:
* `LocalExecutionIncomplete` -- local execution of XCM message have failed.
* `UnableToDecode` -- unable to decode the XCM.
* `XcmTooLarge` -- XCM encoded length is larger than `MaxXcmEncodedSize`.
**Events:**
- `Attempted(outcome)` -- Indicates whether the `msg` was executed completely or only partially.
[.contract-item]
[[send_blob]]
==== `[.contract-item-name]#++send_blob++#`
[source,rust]
----
pub fn send_blob(
origin: OriginFor<T>,
dest: Box<VersionedLocation>,
encoded_message: BoundedVec<u8, MaxXcmEncodedSize>,
) -> DispatchResult
----
Send an XCM from a local, signed, origin.
**Params:**
- `origin: OriginFor<T>` -- Must be signed.
- `dest: Box<VersionedLocation>` -- The destination, `dest`, will receive this message with a `DescendOrigin` instruction that makes the origin of the message be the origin on this system.
- `encoded_message: BoundedVec<u8, MaxXcmEncodedSize>` -- The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
**Errors:**
* `InvalidOrigin` -- origin did not match `SendXcmOrigin`
* `BadVersion` -- v2/v3 conversion to v4 failed for `assets`, `dest`, or `beneficiary`.
* `UnableToDecode` -- unable to decode the XCM.
* `FeesNotMet` -- unable to charge fees. See the error log of any node to see the details.
* `Unreachable` -- The desired destination was unreachable, generally because there is a no way of routing to it.
* `SendFailure` -- There was some other issue (i.e. not to do with routing) in sending the message. Perhaps a lack of space for buffering the message.
**Events:**
- `Sent(origin, destination, message, message_id)` -- The versioned XCM `message` was sent from the `origin` to the `destination`.
== More Reading
https://wiki.polkadot.network/docs/learn-xcm-usecases[Polkadot Wiki XCM Use Cases]
https://wiki.polkadot.network/docs/learn-xcm-usecases[Polkadot Wiki XCM Use Cases]
@@ -4,13 +4,15 @@
= cumulus_pallet_xcmp_queue
Branch/Release: `release-polkadot-v1.5.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/cumulus/pallets/xcmp-queue/src/lib.rs[{github-icon},role=heading-link]
== Purpose
Responsible for the Queues (both incoming and outgoing) for XCMP messages. This pallet does not actually receive or send messages. Its responsibility is to place the incoming and outgoing XCMP messages in their respective queues and manage these queues.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.5.0/cumulus/pallets/xcmp-queue/src/lib.rs#L112[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `ChannelInfo` -- Configures two functions `get_channel_status` and `get_channel_info` to provide information about channels (`ChannelStatus` and `ChannelInfo`).
@@ -18,13 +20,13 @@ Responsible for the Queues (both incoming and outgoing) for XCMP messages. This
** `XcmpQueue` -- Defines max length of an XCMP message, and how `enqueue_message` should behave.
** `MaxInboundSuspended` -- The maximum number of inbound XCMP channels that can be suspended simultaneously. Any further channel suspensions will fail and messages may get dropped without further notice. Choosing a high value (1000) is okay.
** `ControllerOrigin` -- The origin that is allowed to resume or suspend the XCMP queue.
** `ControllerOriginConverter>` -- The conversion function used to attempt to convert an XCM `xref:glossary.adoc#multilocation[MultiLocation]` origin to a superuser origin. This is used for allowing the superuser's queue to send messages even to paused queues.
** `ControllerOriginConverter` -- The conversion function used to attempt to convert an XCM `xref:glossary.adoc#multilocation[MultiLocation]` origin to a superuser origin. This is used for allowing the superuser's queue to send messages even to paused queues.
** `PriceForSiblingDelivery` -- The price for delivering an XCM to a sibling parachain destination.
* Common configs
** `RuntimeEvent` -- The overarching event type.
** `WeightInfo` -- The xref:glossary.adoc#weight[weight] information of this pallet.
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.5.0/cumulus/pallets/xcmp-queue/src/lib.rs#L150[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[suspend_xcm_execution]]
@@ -4,7 +4,9 @@
= XCM Executor
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/polkadot/xcm/xcm-executor/src/config.rs[{github-icon},role=heading-link]
== Purpose
@@ -14,7 +16,7 @@ Branch/Release: `release-polkadot-v1.3.0`
NOTE: `XcmExecutor` is not a pallet, but rather it is a `struct` type parameterized by a `Config` trait. The inner config is the `trait Config` which parameterizes the outer config `struct XcmExecutor<Config>`. Both the inner and outer configs are configured in the runtime.
== Inner Config link:https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-executor/src/config.rs#L30[{github-icon},role=heading-link]
== Inner Config
The inner `trait Config` used to parameterize `XcmExecutor` has the following associated types.
@@ -31,6 +33,9 @@ The inner `trait Config` used to parameterize `XcmExecutor` has the following as
- `FeeManager` -- Configure the fees. Type must implement the trait `FeeManager`.
- `MessageExporter` -- The method of exporting a message. Type must implement the trait `ExportXcm`.
- `CallDispatcher` -- The call dispatcher used by XCM. Type must implement the trait `CallDispatcher<Self::RuntimeCall>`.
- `HrmpNewChannelOpenRequestHandler` -- Allows optional logic execution for the `HrmpNewChannelOpenRequest` XCM notification.
- `HrmpChannelAcceptedHandler` -- Allows optional logic execution for the `HrmpChannelAccepted` XCM notification.
- `HrmpChannelClosingHandler` -- Allows optional logic execution for the `HrmpChannelClosing` XCM notification.
* Filters:
- `IsReserve` -- Combinations of (Asset, Location) pairs which we trust as reserves. Type must implement the trait `ContainsPair<MultiAsset, MultiLocation>`.
@@ -54,9 +59,10 @@ The inner `trait Config` used to parameterize `XcmExecutor` has the following as
* Common configs:
- `RuntimeCall`
== Outer Config link:https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-executor/src/lib.rs#L58[{github-icon},role=heading-link]
== Outer Config
The outer `struct XcmExecutor<Config>` configures the following fields:
* The outer `struct XcmExecutor<Config>` configures the following fields:
- `holding` -- Assets allowed in the holding register. Type must be `Assets`.
- `holding_limit` -- The maximum number of assets in the holding register. Type must be `usize`.
- `context` -- Type must be `XcmContext`.