1. Apr 24, 2024
  2. Mar 27, 2024
  3. Mar 01, 2024
  4. Dec 06, 2023
    • Adrian Catangiu's avatar
      pallet-xcm: add new flexible `transfer_assets()` call/extrinsic (#2388) · e7651cf4
      Adrian Catangiu authored
      # Motivation (+testing)
      
      ### Enable easy `ForeignAssets` transfers using `pallet-xcm` 
      
      We had just previously added capabilities to teleport fees during
      reserve-based transfers, but what about reserve-transferring fees when
      needing to teleport some non-fee asset?
      
      This PR aligns everything under either explicit reserve-transfer,
      explicit teleport, or this new flexible `transfer_assets()` which can
      mix and match as needed with fewer artificial constraints imposed to the
      user.
      
      This will enable, for example, a (non-system) parachain to teleport
      their `ForeignAssets` assets to AssetHub while using DOT to pay fees.
      (the assets are teleported - as foreign assets should from their owner
      chain - while DOT used for fees can only be reserve-based transferred
      between said parachain and AssetHub).
      
      Added `xcm-emulator` tests for this scenario ^.
      
      # Description
      
      Reverts `(limited_)reserve_transfer_assets` to only allow reserve-based
      transfers for all `assets` including fees.
      
      Similarly `(limited_)teleport_assets` only allows teleports for all
      `assets` including fees.
          
      For complex combinations of asset transfers where assets and fees may
      have different reserves or different reserve/teleport trust
      configurations, users can use the newly added `transfer_assets()`
      extrinsic which is more flexible in allowing more complex scenarios.
      
      `assets` (excluding `fees`) must have same reserve location or otherwise
      be teleportable to `dest`.
      No limitations imposed on `fees`.
      
      - for local reserve: transfer assets to sovereign account of destination
      chain and forward a notification XCM to `dest` to mint and deposit
      reserve-based assets to `beneficiary`.
      - for destination reserve: 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`.
      - for remote 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`.
      - for teleports: burn local assets and forward XCM to `dest` chain to
      mint/teleport assets and deposit them to `beneficiary`.
      
      ## Review notes
      
      Only around 500 lines are prod code (see `pallet_xcm/src/lib.rs`), the
      rest of the PR is new tests and improving existing tests.
      
      ---------
      
      Co-authored-by: command-bot <>
      e7651cf4
  5. Nov 10, 2023
    • PG Herveou's avatar
      Contracts: Add XCM traits to interface with contracts (#2086) · 6b7be115
      PG Herveou authored
      We are introducing a new set of `XcmController` traits (final name yet
      to be determined).
      These traits are implemented by `pallet-xcm` and allows other pallets,
      such as `pallet_contracts`, to rely on these traits instead of tight
      coupling them to `pallet-xcm`.
      
      Using only the existing Xcm traits would mean duplicating the logic from
      `pallet-xcm` in these other pallets, which we aim to avoid. Our
      objective is to ensure that when these APIs are called from
      `pallet-contracts`, they produce the exact same outcomes as if called
      directly from `pallet-xcm`.
      
      The other benefits is that we can also expose return values to
      `pallet-contracts` instead of just calling `pallet-xcm` dispatchable and
      getting a `DispatchResult` back.
      
      See traits integration in this PR
      https://github.com/paritytech/polkadot-sdk/pull/1248
      
      , where the traits
      are used as follow to define and implement `pallet-contracts` Config.
      ```rs
      // Contracts config:
      pub trait Config: frame_system::Config {
        // ...
      
        /// A type that exposes XCM APIs, allowing contracts to interact with other parachains, and
        /// execute XCM programs.
        type Xcm: xcm_executor::traits::Controller<
      	  OriginFor<Self>,
      	  <Self as frame_system::Config>::RuntimeCall,
      	  BlockNumberFor<Self>,
        >;
      }
      
      // implementation
      impl pallet_contracts::Config for Runtime {
              // ...
      
      	type Xcm = pallet_xcm::Pallet<Self>;
      }
      ```
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: command-bot <>
      6b7be115
  6. Oct 18, 2023
  7. Aug 30, 2023
  8. Aug 01, 2023
    • Oleg Plakida's avatar
      Update weights with VM runners (#2712) · fc83800e
      Oleg Plakida authored
      
      
      * paritytech/ci-cd#697: Update weights with VM runners
      
       - Update weights using VM instances
       - Change runner tag for weights ci job to weights-vm
      
      * ".git/.scripts/commands/bench/bench.sh" all
      
      * ".git/.scripts/commands/bench-all/bench-all.sh" --target_dir=cumulus
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      fc83800e
  9. Jun 08, 2023
  10. Jun 02, 2023
    • joe petrowski's avatar
      Rename Statemint to Asset Hub (#2633) · 60075495
      joe petrowski authored
      
      
      * change dir names
      
      * cargo toml updates
      
      * fix crate imports for build
      
      * change chain spec names and PR review rule
      
      * update cli to accept asset-hub
      
      * find/replace benchmark commands
      
      * integration tests
      
      * bridges docs
      
      * more integration tests
      
      * AuraId
      
      * other statemint tidying
      
      * rename statemint mod
      
      * chain spec mod
      
      * rename e2e test dirs
      
      * one more Runtime::Statemine
      
      * benchmark westmint
      
      * rename chain spec name and id
      
      * rename chain spec files
      
      * more tidying in scripts/docs/tests
      
      * rename old dir if exists
      
      * Force people to manually do the move.
      
      (Safer as there could be additional considerations with their setup)
      
      * review touchups
      
      * more renaming
      
      * Update polkadot-parachain/src/command.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * better error message
      
      * do not break on-chain spec_name
      
      * log info message that path has been renamed
      
      * better penpal docs
      
      ---------
      
      Co-authored-by: default avatargilescope <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: parity-processbot <>
      60075495
  11. May 11, 2023
  12. Apr 27, 2023
    • Keith Yeung's avatar
      Companion for paritytech/polkadot#7098 (#2469) · b441d05d
      Keith Yeung authored
      * Companion for paritytech/polkadot#7098
      
      * Fixes
      
      * Add missing benchmarked function
      
      * Fix typo
      
      * update lockfile for {"polkadot", "substrate"}
      
      ---------
      
      Co-authored-by: parity-processbot <>
      b441d05d
  13. Apr 04, 2023
  14. Mar 03, 2023
  15. Feb 23, 2023
  16. Jan 17, 2023
    • Gavin Wood's avatar
      XCM v3 Companion (#697) · 3a459e8f
      Gavin Wood authored
      * Fixes
      
      * Undiener
      
      * Undiener
      
      * Undiener
      
      * Lockfile
      
      * Changes for send returning hash
      
      * Include message ID as params to execute_xcm
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Companion fixes
      
      * Formatting
      
      * Fixes
      
      * Formatting
      
      * Bump
      
      * Bump
      
      * Fixes
      
      * Formatting
      
      * Make the price of UMP/XCMP message sending configurable
      
      * cargo fmt
      
      * Remove InvertLocation
      
      * Formatting
      
      * Use ConstantPrice from polkadot-runtime-common
      
      * Fix naming
      
      * cargo fmt
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Add CallDispatcher
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Remove unused import
      
      * Remove unused import
      
      * XCMv3 fixes (#1710)
      
      * Fixes XCMv3 related
      Fixes XCMv3 (removed query_holding)
      Fixes XCMv3 - should use _depositable_count?
      Fixes XCMv3 - removed TrustedReserve
      Fixes - missing weights for statemine/statemint/westmint
      [DO-NOT-CHERRY-PICK] tmp return query_holding to aviod conficts to master
      Fixes - missing functions for pallet_xcm_benchmarks::generic::Config
      Fixes for XCMv3 benchmarking
      Fix xcm - removed query_holding
      
      * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmarks::generic
      
      * Fix imports
      
      * Avoid consuming XCM message for NotApplicable scenario (#1787)
      
      * Avoid consuming message for NotApplicable scenario
      
      * Avoid consuming message for NotApplicable scenario tests
      
      * Add 10 message processing limit to DMP queue
      
      * Add 10 message limit to XCMP queue
      
      * Always increment the message_processed count whenever a message is processed
      
      * Fix formatting
      
      * Set an upper limit to the overweight message DMP queue
      
      * Add upper limit to XCMP overweight message queue
      
      * Fix for missing weight for `fn unpaid_execution()`
      
      * Fix - usage of `messages_processed`
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * cargo fmt
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Remove unused import
      
      * Fixes for gav-xcm-v3 (#1835)
      
      * Fix for FungiblesAdapter - trait changes: Contains -> AssetChecking
      
      * Fix for missing weight for `fn unpaid_execution()`
      
      * Used NonLocalMint for all NonZeroIssuance
      
      * Fix
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fix tests
      
      * Fixes
      
      * Add SafeCallFilter
      
      * Add missing config items
      
      * Add TODO
      
      * Use () as the PriceForParentDelivery
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Update transact_origin to transact_origin_and_runtime_call
      
      * Add ReachableDest config item to XCM pallet
      
      * Update SafeCallFilter to allow remark_with_event in runtime benchmarks
      
      * cargo fmt
      
      * Update substrate
      
      * Fix worst_case_holding
      
      * Fix DMQ queue unit tests
      
      * Remove unused label
      
      * cargo fmt
      
      * Actually process incoming XCMs
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes - return back Weightless
      
      * Added measured benchmarks for `pallet_xcm` (#1968)
      
      * Fix
      
      Fix
      
      Fix
      
      * Fix
      
      * Fixes for transact benchmark
      
      * Fixes add pallet_xcm to benchmarks
      
      * Revert remark_with_event
      
      * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::generic
      
      * Fixes
      
      * TMP
      
      * Fix for reserve_asset_deposited
      
      * ".git/.scripts/bench-bot.sh" pallet statemine assets pallet_xcm
      
      * Fix
      
      * ".git/.scripts/bench-bot.sh" pallet statemint assets pallet_xcm
      
      * Fix
      
      * ".git/.scripts/bench-bot.sh" pallet westmint assets pallet_xcm
      
      * Fix westmint
      
      * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::generic
      
      * Fix
      
      * ".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" pallet collectives-polkadot collectives pallet_xcm
      
      * Fix for collectives
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-rococo bridge-hubs pallet_xcm
      
      * Fixes for bridge-hubs
      
      * Fixes - return back Weightless
      
      * Fix - removed MigrateToTrackInactive for contracts-rococo
      
      Co-authored-by: command-bot <>
      
      * cargo fmt
      
      * Fix benchmarks
      
      * Bko gav xcm v3 (#1993)
      
      * Fix
      
      * ".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmarks::fungible
      
      * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::fungible
      
      * ".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmarks::fungible
      
      * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" pallet statemine assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet westmint assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet statemint assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet collectives-polkadot collectives pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-rococo bridge-hubs pallet_xcm
      
      Co-authored-by: command-bot <>
      
      * Change AllowUnpaidExecutionFrom to be explicit
      
      * xcm-v3 benchmarks, weights, fixes for bridge-hubs (#2035)
      
      * Dumy weights to get compile
      
      * Change UniversalLocation according to https://github.com/paritytech/polkadot/pull/4097
      
       (Location Inversion Removed)
      
      * Fix bridge-hubs weights
      
      * ".git/.scripts/bench-bot.sh" pallet statemine assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet statemint assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet collectives-polkadot collectives pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet westmint assets pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" xcm bridge-hub-kusama bridge-hubs pallet_xcm_benchmarks::generic
      
      * ".git/.scripts/bench-bot.sh" xcm bridge-hub-kusama bridge-hubs pallet_xcm_benchmarks::fungible
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" pallet bridge-hub-rococo bridge-hubs pallet_xcm
      
      * ".git/.scripts/bench-bot.sh" xcm bridge-hub-rococo bridge-hubs pallet_xcm_benchmarks::fungible
      
      * ".git/.scripts/bench-bot.sh" xcm bridge-hub-rococo bridge-hubs pallet_xcm_benchmarks::generic
      
      * Change NetworkId to Option<NetworkId>
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Add event for showing the hash of an UMP sent message (#1228)
      
      * Add UpwardMessageSent event in parachain-system
      
      * additional fixes
      
      * Message Id
      
      * Fix errors from merge
      
      * fmt
      
      * more fmt
      
      * Remove todo
      
      * more formatting
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Fixes
      
      * Allow explicit unpaid executions from the relay chains for system parachains (#2060)
      
      * Allow explicit unpaid executions from the relay chains for system parachains
      
      * Put origin-filtering barriers into WithComputedOrigin
      
      * Use ConstU32<8>
      
      * Small nits
      
      * formatting
      
      * cargo fmt
      
      * Allow receiving XCMs from any relay chain plurality
      
      * Fixes
      
      * update lockfile for {"polkadot", "substrate"}
      
      * Update polkadot
      
      * Add runtime-benchmarks feature
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatargirazoki <[email protected]>
      Co-authored-by: parity-processbot <>
      3a459e8f