1. Oct 23, 2023
  2. Oct 21, 2023
  3. Oct 20, 2023
    • Bastian Köcher's avatar
      `xcm`: Change `TypeInfo::path` to not include `staging` (#1948) · f3bf5c1a
      Bastian Köcher authored
      The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
      crates.io as someone as squatted `xcm`. The problem with this rename is
      that the `TypeInfo` includes the crate name which ultimately lands in
      the metadata. The metadata is consumed by downstream users like
      `polkadot-js` or people building on top of `polkadot-js`. These people
      are using the entire `path` to find the type in the type registry. Thus,
      their code would break as the type path would now be [`staging_xcm`,
      `VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
      fixes this by renaming the path segment `staging_xcm` to `xcm`.
      
      This requires: https://github.com/paritytech/scale-info/pull/197
      
      
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      f3bf5c1a
  4. Oct 19, 2023
    • Bastian Köcher's avatar
      Do not force collators to update after enabling async backing (#1920) · b967ba53
      Bastian Köcher authored
      The validators are checking if async backing is enabled by checking the
      version of the runtime api. If the runtime api is upgraded by a runtime
      upgrade, the validators start to also enable the async backing logic.
      However, just because async backing is enabled, it doesn't mean that all
      collators and parachain runtimes have upgraded. This pull request fixes
      an issue about advertising collations to the relay chain when it has
      async backing enabled, but the collator is still using the old
      networking protocol. The implementation is actually backwards compatible
      as we can not expect that everyone directly upgrades. However, the
      collation advertisement logic was requiring V2 networking messages after
      async backing was enabled, which was wrong. This is now fixed by this
      pull request.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/1923
      
      
      
      ---------
      
      Co-authored-by: default avatareskimor <[email protected]>
      b967ba53
  5. Oct 18, 2023
    • Bulat Saifullin's avatar
      Update kusama/polkadot bootnodes (#1895) · 3e980219
      Bulat Saifullin authored
      closes: https://github.com/paritytech/devops/issues/2090
      
      ## Changes
      1. Updated the list of bootnodes.
      2. Merged the Connect node and bootnode into a single node.
      3. Decreased the number of nodes.
      4. Updated the DNS name.
      
      ## Description
      The initial 8 bootnodes were planned to be replaced by community
      bootnodes, the community node was added but we did not bother to reduce
      the Parity managed bootnodes. Fixing it now.
      3e980219
    • Keith Yeung's avatar
      Introduce XcmFeesToAccount fee manager (#1234) · 3dece311
      Keith Yeung authored
      
      
      Combination of paritytech/polkadot#7005, its addon PR
      paritytech/polkadot#7585 and its companion paritytech/cumulus#2433.
      
      This PR introduces a new XcmFeesToAccount struct which implements the
      `FeeManager` trait, and assigns this struct as the `FeeManager` in the
      XCM config for all runtimes.
      
      The struct simply deposits all fees handled by the XCM executor to a
      specified account. In all runtimes, the specified account is configured
      as the treasury account.
      
      XCM __delivery__ fees are now being introduced (unless the root origin
      is sending a message to a system parachain on behalf of the originating
      chain).
      
      # Note for reviewers
      
      Most file changes are tests that had to be modified to account for the
      new fees.
      Main changes are in:
      - cumulus/pallets/xcmp-queue/src/lib.rs <- To make it track the delivery
      fees exponential factor
      - polkadot/xcm/xcm-builder/src/fee_handling.rs <- Added. Has the
      FeeManager implementation
      - All runtime xcm_config files <- To add the FeeManager to the XCM
      configuration
      
      # Important note
      
      After this change, instructions that create and send a new XCM (Query*,
      Report*, ExportMessage, InitiateReserveWithdraw, InitiateTeleport,
      DepositReserveAsset, TransferReserveAsset, LockAsset and RequestUnlock)
      will require the corresponding origin account in the origin register to
      pay for transport delivery fees, and the onward message will fail to be
      sent if the origin account does not have the required amount. This
      delivery fee is on top of what we already collect as tx fees in
      pallet-xcm and XCM BuyExecution fees!
      
      Wallet UIs that want to expose the new delivery fee can do so using the
      formula:
      
      ```
      delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
      ```
      
      where the delivery fee factor can be obtained from the corresponding
      pallet based on which transport you are using (UMP, HRMP or bridges),
      the base fee is a constant, the encoded message length from the message
      itself and the per byte fee is the same as the configured per byte fee
      for txs (i.e. `TransactionByteFee`).
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarGiles Cope <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      3dece311
    • joe petrowski's avatar
      Add Runtime Missing Crate Descriptions (#1909) · d3ea69b7
      joe petrowski authored
      Adds descriptions needed for publishing to crates.io.
      d3ea69b7
    • Serban Iorga's avatar
      Start BEEFY client by default for Polkadot nodes (#1913) · 6c39bb4a
      Serban Iorga authored
      Fellowship companion:
      https://github.com/polkadot-fellows/runtimes/pull/65
      
      This starts the BEEFY client by default for Polkadot nodes.
      
      Governance/sudo call is later required to enable/start consensus.
      
      Part of https://github.com/paritytech/parity-bridges-common/issues/2420
      6c39bb4a
    • Adrian Catangiu's avatar
      cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add... · 8b3905d2
      Adrian Catangiu authored
      
      cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add asset-bridging support to it (#1215)
      
      This commit adds Rococo Asset Hub dedicated runtime so we can test new
      features here, before merging them in Kusama Asset Hub.
      Also adds one such feature: asset transfer over bridge (Rococo AssetHub
      <> Wococo AssetHub)
      
      - clone `asset-hub-kusama-runtime` -> `asset-hub-rococo-runtime`
      - make it use Rococo primitives, names, assets, constants, etc
      - add asset-transfer-over-bridge support to Rococo AssetHub <> Wococo
      AssetHub
      
      Fixes #1128
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      8b3905d2
  6. Oct 17, 2023
  7. Oct 16, 2023
  8. Oct 15, 2023
  9. Oct 14, 2023
    • Julian Eager's avatar
      Discard `Executor` (#1855) · 9f7656df
      Julian Eager authored
      
      
      closes #622 
      
      Pros:
      * simpler interface, just functions:
      `create_runtime_from_artifact_bytes()` and `execute_artifact()`
      
      Cons:
      * extra overhead of constructing executor semantics each time
      
      I could make it a combination of
      * `create_runtime_config(params)` (such that we could clone the
      constructed semantics)
      * `create_runtime(blob, config)`
      * `execute_artifact(blob, config, params)`
      
      Not sure if it's worth it though.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      9f7656df
  10. Oct 13, 2023
  11. Oct 12, 2023
  12. Oct 11, 2023
  13. Oct 10, 2023
    • Bulat Saifullin's avatar
      Update testnet bootnode dns name (#1712) · 373b8ac7
      Bulat Saifullin authored
      # Description
      Update the DNS name of bootnodes to unify the deployment. 
      
      Each bootnode have 3 port exposed: `30333, 30334, 443`. Before, we had
      different DNS names for `30333, 30334` and `443` ports. It may confuse
      people and give the impression that it is two different nodes. Fixing it
      by using a single domain for all
      373b8ac7
    • Oliver Tale-Yazdi's avatar
      [FRAME] Warn on unchecked weight witness (#1818) · 64877492
      Oliver Tale-Yazdi authored
      Adds a warning to FRAME pallets when a function argument that starts
      with `_` is used in the weight formula.
      This is in most cases an error since the weight witness needs to be
      checked.
      
      Example:
      
      ```rust
      #[pallet::call_index(0)]
      #[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]
      pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
      	Ok(().into())
      }
      ```
      
      Produces this warning:
      
      ```pre
      warning: use of deprecated constant `pallet::warnings::UncheckedWeightWitness_0::_w`: 
                       It is deprecated to not check weight witness data.
                       Please instead ensure that all witness data for weight calculation is checked before usage.
               
                       For more info see:
                           <https://github.com/paritytech/polkadot-sdk/pull/1818>
         --> substrate/frame/system/src/lib.rs:424:40
          |
      424 |         pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
          |                                              ^^^^^^^
          |
          = note: `#[warn(deprecated)]` on by default
      ```
      
      Can be suppressed like this, since in this case it is legit:
      
      ```rust
      #[pallet::call_index(0)]
      #[pallet::weight(T::SystemWeightInfo::remark(remark.len() as u32))]
      pub fn remark(_origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
      	let _ = remark; // We dont need to check the weight witness.
      	Ok(().into())
      }
      ```
      
      Changes:
      - Add warning on uncheded weight witness
      - Respect `subkeys` limit in `System::kill_prefix`
      - Fix HRMP pallet and other warnings
      - Update`proc_macro_warning` dependency
      - Delete random folder `substrate/src/src` 🙈
      
       
      - Adding Prdoc
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      64877492
    • Branislav Kontur's avatar
      [xcm] Use `Weight::MAX` for `reserve_asset_deposited`,... · e3c97e48
      Branislav Kontur authored
      [xcm] Use `Weight::MAX` for `reserve_asset_deposited`, `receive_teleported_asset` benchmarks (#1726)
      
      # Description
      
      ## Summary
      
      Previously, the `pallet_xcm::do_reserve_transfer_assets` and
      `pallet_xcm::do_teleport_assets` functions relied on weight estimation
      for remote chain execution, which was based on guesswork derived from
      the local chain. This approach led to complications for runtimes that
      did not provide or support specific [XCM
      configurations](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/polkadot/xcm/xcm-executor/src/config.rs#L43-L47)
      for `IsReserve` or `IsTeleporter`. Consequently, such runtimes had to
      resort to implementing hard-coded weights for XCM instructions like
      `reserve_asset_deposited` or `receive_teleported_asset` to support
      extrinsics such as `pallet_xcm::reserve_transfer_assets` and
      `pallet_xcm::teleport_assets`, which depended on remote weight
      estimation.
      
      The issue of remote weight estimation was addressed and resolved by
      [Pull Request
      #1645](https://github.com/paritytech/polkadot-sdk/pull/1645), which
      removed the need for remote weight estimation.
      
      ## Solution
      
      As a continuation of this improvement, the current PR proposes further
      cleanup by removing unnecessary hard-coded values and rectifying
      benchmark results with `Weight::MAX` that previously used
      `T::BlockWeights::get().max_block` as an override for unsupported XCM
      instructions like `ReserveAssetDeposited` and `ReceiveTeleportedAsset`.
      
      
      ## Questions
      
      - [x] Can we remove now also `Hardcoded till the XCM pallet is fixed`
      for `deposit_asset`? E.g. for AssetHubKusama
      [here](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs#L129-L134)
      - [x] Are comments like
      [this](https://github.com/paritytech/polkadot-sdk/blob/7cbe0c76ef8fd2aabf9f07de0156941ce3ed44b0/polkadot/runtime/kusama/src/weights/xcm/mod.rs#L94)
      `// Kusama doesn't support ReserveAssetDeposited, so this benchmark has
      a default weight` still relevant? Shouldnt be removed/changed?
      
      
      ## TODO
      
      - [x] `bench bot` regenerate xcm weights for all runtimes
      - [x] remove hard-coded stuff from system parachain weight files
      - [ ] when merged, open `polkadot-fellow/runtimes` PR
      
      ## References
      
      Fixes #1132
      Closes #1132
      Old polkadot repo [PR](https://github.com/paritytech/polkadot/pull/7546)
      
      ---------
      
      Co-authored-by: command-bot <>
      e3c97e48
  14. Oct 07, 2023
    • Muharem Ismailov's avatar
      Treasury spends various asset kinds (#1333) · cb944dc5
      Muharem Ismailov authored
      
      
      ### Summary 
      
      This PR introduces new dispatchables to the treasury pallet, allowing
      spends of various asset types. The enhanced features of the treasury
      pallet, in conjunction with the asset-rate pallet, are set up and
      enabled for Westend and Rococo.
      
      ### Westend and Rococo runtimes.
      
      Polkadot/Kusams/Rococo Treasury can accept proposals for `spends` of
      various asset kinds by specifying the asset's location and ID.
      
      #### Treasury Instance New Dispatchables:
      - `spend(AssetKind, AssetBalance, Beneficiary, Option<ValidFrom>)` -
      propose and approve a spend;
      - `payout(SpendIndex)` - payout an approved spend or retry a failed
      payout
      - `check_payment(SpendIndex)` - check the status of a payout;
      - `void_spend(SpendIndex)` - void previously approved spend;
      > existing spend dispatchable renamed to spend_local
      
      in this context, the `AssetKind` parameter contains the asset's location
      and it's corresponding `asset_id`, for example:
      `USDT` on `AssetHub`,
      ``` rust
      location = MultiLocation(0, X1(Parachain(1000)))
      asset_id = MultiLocation(0, X2(PalletInstance(50), GeneralIndex(1984)))
      ```
      
      the `Beneficiary` parameter is a `MultiLocation` in the context of the
      asset's location, for example
      ``` rust
      // the Fellowship salary pallet's location / account
      FellowshipSalaryPallet = MultiLocation(1, X2(Parachain(1001), PalletInstance(64)))
      // or custom `AccountId`
      Alice = MultiLocation(0, AccountId32(network: None, id: [1,...]))
      ```
      
      the `AssetBalance` represents the amount of the `AssetKind` to be
      transferred to the `Beneficiary`. For permission checks, the asset
      amount is converted to the native amount and compared against the
      maximum spendable amount determined by the commanding spend origin.
      
      the `spend` dispatchable allows for batching spends with different
      `ValidFrom` arguments, enabling milestone-based spending. If the
      expectations tied to an approved spend are not met, it is possible to
      void the spend later using the `void_spend` dispatchable.
      
      Asset Rate Pallet provides the conversion rate from the `AssetKind` to
      the native balance.
      
      #### Asset Rate Instance Dispatchables:
      - `create(AssetKind, Rate)` - initialize a conversion rate to the native
      balance for the given asset
      - `update(AssetKind, Rate)` - update the conversion rate to the native
      balance for the given asset
      - `remove(AssetKind)` - remove an existing conversion rate to the native
      balance for the given asset
      
      the pallet's dispatchables can be executed by the Root or Treasurer
      origins.
      
      ### Treasury Pallet
      
      Treasury Pallet can accept proposals for `spends` of various asset kinds
      and pay them out through the implementation of the `Pay` trait.
      
      New Dispatchables:
      - `spend(Config::AssetKind, AssetBalance, Config::Beneficiary,
      Option<ValidFrom>)` - propose and approve a spend;
      - `payout(SpendIndex)` - payout an approved spend or retry a failed
      payout;
      - `check_payment(SpendIndex)` - check the status of a payout;
      - `void_spend(SpendIndex)` - void previously approved spend;
      > existing spend dispatchable renamed to spend_local
      
      The parameters' types of the `spend` dispatchable exposed via the
      pallet's `Config` and allows to propose and accept a spend of a certain
      amount.
      
      An approved spend can be claimed via the `payout` within the
      `Config::SpendPeriod`. Clients provide an implementation of the `Pay`
      trait which can pay an asset of the `AssetKind` to the `Beneficiary` in
      `AssetBalance` units.
      
      The implementation of the Pay trait might not have an immediate final
      payment status, for example if implemented over `XCM` and the actual
      transfer happens on a remote chain.
      
      The `check_status` dispatchable can be executed to update the spend's
      payment state and retry the `payout` if the payment has failed.
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: command-bot <>
      cb944dc5
  15. Oct 06, 2023
  16. Oct 05, 2023
  17. Oct 04, 2023