Skip to content
  1. Mar 14, 2025
  2. Mar 13, 2025
  3. Mar 12, 2025
  4. Mar 11, 2025
  5. Mar 10, 2025
  6. Mar 06, 2025
    • Raymond Cheung's avatar
      Ensure Logs Are Captured for Assertions and Printed During Tests (#7769) · ce5f89c6
      Raymond Cheung authored
      This PR enhances **`test_log_capture`**, ensuring logs are **captured
      for assertions** and **printed to the console** during test execution.
      
      ## **Motivation**  
      
      - Partially addresses #6119 and #6125, to improves developer **tracing
      and debugging** in XCM-related tests.
      - Builds on #7594, improving **log visibility** while maintaining test
      **log capture capabilities**.
      - While writing tests for #7234, I noticed this function was missing.
      This PR adds it to streamline log handling in unit tests.
      
      ## **Changes**  
      
      - Ensures logs up to `TRACE` level are **captured** (for assertions) and
      **printed** (for visibility).
      - Refines documentation to clearly specify **when to use** each
      function.
      - **Removes ANSI escape codes** from captured logs to ensure clean,
      readable assertions.
      
      ## **When to Use?**  
      
      | Usage | Captures Logs? | Prints Logs? | Example |
      
      |----------------------------------------------|-----------------|--------------|-----------------------------------------------|
      | `init_log_capture(LevelFilter::INFO, false)` |  Yes |  No | Capture
      logs for assertions without printing. |
      | `init_log_capture(LevelFilter::TRACE, true)` |  Yes |  Yes | Capture
      logs and print them in test output. |
      | `sp_tracing::init_for_tests()` |  No | 
      
       Yes | Print logs to the
      console without capturing. |
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      ce5f89c6
  7. Mar 05, 2025
  8. Feb 28, 2025
    • Serban Iorga's avatar
      Derive `DecodeWithMemTracking` for `Block` (#7655) · c11b1f85
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/7360
      
      This PR adds `DecodeWithMemTracking` as a trait bound for `Header`,
      `Block` and `TransactionExtension` and
      derives it for all the types that implement these traits in
      `polkadot-sdk`.
      c11b1f85
  9. Feb 27, 2025
  10. Feb 24, 2025
    • Francisco Aguirre's avatar
      XCM: Process PayFees only once (#7641) · 46139cd6
      Francisco Aguirre authored
      
      
      The `PayFees` instruction should only ever be used once. If it's used
      more than once, it's just a noop.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      46139cd6
    • Daniel Shiposha's avatar
      Fix DryRunApi client-facing XCM versions (#7438) · 963f0d73
      Daniel Shiposha authored
      
      
      # Description
      
      Fixes #7413
      
      ## Integration
      
      This PR updates the `DryRunApi`. The signature of the `dry_run_call` is
      changed, and the XCM version of the return values of `dry_run_xcm` now
      follows the version of the input XCM program.
      
      ## Review Notes
      
      * **The `DryRunApi` is modified**
      * **Added the `Router::clear_messages` to `dry_run_xcm` common
      implementation**
      * **Fixed the xcmp-queue's Router's clear_messages: channels details'
      first_index and last_index are reset when clearing**
      * **The MIN_XCM_VERSION is added**
      * The common implementation in the `pallet-xcm` is modified accordingly
      * The `DryRunApi` tests are modified to account for testing old XCM
      versions
      * The implementation from the `pallet-xcm` is used where it was not used
      (including the `DryRunApi` tests)
      * All the runtime implementations are modified according to the Runtime
      API change
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      963f0d73
    • Raymond Cheung's avatar
      Enhance XCM Debugging with Log Capture in Unit Tests (#7594) · d189f9e7
      Raymond Cheung authored
      
      
      # Description
      
      This PR introduces a lightweight log-capturing mechanism for XCM unit
      tests, simplifying debugging by enabling structured log assertions. It
      partially addresses #6119 and #6125, offering an optional way to verify
      logs in tests while remaining unobtrusive in normal execution.
      
      # Key Changes
      
      * [x] Introduces a log capture utility in `sp_tracing`.
      * [x] Adds XCM test examples demonstrating how and when to use log
      capturing.
      
      # Review Notes:
      
      * The log capture mechanism is opt-in and does not affect existing tests
      unless explicitly used.
      * The implementation is minimal and does not add complexity to existing
      test setups.
      * It provides a structured alternative to
      [`sp_tracing::init_for_tests()`](https://paritytech.github.io/polkadot-sdk/master/sp_tracing/fn.init_for_tests.html)
      for log verification in automated tests.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      d189f9e7
  11. Feb 21, 2025
  12. Feb 20, 2025
    • Alexander Theißen's avatar
      Update to Rust stable 1.84.1 (#7625) · e2d3da61
      Alexander Theißen authored
      
      
      Ref https://github.com/paritytech/ci_cd/issues/1107
      
      We mainly need that so that we can finally compile the `pallet_revive`
      fixtures on stable. I did my best to keep the commits focused on one
      thing to make review easier.
      
      All the changes are needed because rustc introduced more warnings or is
      more strict about existing ones. Most of the stuff could just be fixed
      and the commits should be pretty self explanatory. However, there are a
      few this that are notable:
      
      ## `non_local_definitions `
      
      A lot of runtimes to write `impl` blocks inside functions. This makes
      sense to reduce the amount of conditional compilation. I guess I could
      have moved them into a module instead. But I think allowing it here
      makes sense to avoid the code churn.
      
      ## `unexpected_cfgs`
      
      The FRAME macros emit code that references various features like `std`,
      `runtime-benchmarks` or `try-runtime`. If a create that uses those
      macros does not have those features we get this warning. Those were
      mostly when defining a `mock` runtime. I opted for silencing the warning
      in this case rather than adding not needed features.
      
      For the benchmarking ui tests I opted for adding the `runtime-benchmark`
      feature to the `Cargo.toml`.
      
      ## Failing UI test
      
      I am bumping the `trybuild` version and regenerating the ui tests. The
      old version seems to be incompatible. This requires us to pass
      `deny_warnings` in `CARGO_ENCODED_RUSTFLAGS` as `RUSTFLAGS` is ignored
      in the new version.
      
      ## Removing toolchain file from the pallet revive fixtures
      
      This is no longer needed since the latest stable will compile them fine
      using the `RUSTC_BOOTSTRAP=1`.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      e2d3da61
  13. Feb 19, 2025
    • Serban Iorga's avatar
      Derive `DecodeWithMemTracking` for bridge and xcm pallets (#7620) · 0c258c66
      Serban Iorga authored
      Just deriving `DecodeWithMemTracking` for the types used by the bridge,
      snowbridge and xcm pallets
      0c258c66
    • Branislav Kontur's avatar
      XCM: Deny barrier checks for nested XCMs with specific instructions to be... · bd7cf119
      Branislav Kontur authored
      
      XCM: Deny barrier checks for nested XCMs with specific instructions to be executed on the local chain (#7200)
      
      Resolves (partially):
      https://github.com/paritytech/polkadot-sdk/issues/7148
      Depends on: https://github.com/paritytech/polkadot-sdk/pull/7169
      
      # Description
      
      This PR addresses partially #7148 (Problem 2) and ensures the proper
      checking of nested local instructions. It introduces a new barrier -
      `DenyRecursively` - to provide more refined control over instruction
      denial. The main change is the replacement of `DenyThenTry<Deny, Allow>`
      with `DenyThenTry<DenyRecursively<Deny>, Allow>` which handles both
      top-level and nested local instructions by applying allow condition
      after denial.
      
      For context and additional information, please refer to [_Problem 2 -
      Barrier vs nested XCM
      validation_](https://github.com/paritytech/polkadot-sdk/issues/7148).
      
      # TODO
      - [x] Evaluate PoC, more details at #7351:
          - **DenyNestedXcmInstructions**: Keep it as it is and be explicit:
              1. Name the Deny barriers for the top level.
      2. Name the Deny barrier for nested with `DenyInstructionsWithXcm`.
      - **DenyThenTry<DenyInstructionsWithXcm<Deny>, Allow>**: Alternatively,
      hard-code those three instructions in `DenyThenTry`, so we wouldn’t need
      `DenyInstructionsWithXcm`. However, this approach wouldn’t be as
      general.
      - **DenyInstructionsWithXcmFor**: Another possibility is to check
      `DenyInstructionsWithXcm::Inner` for the actual `message`, so we don’t
      need duplication for top-level and nested (not sure, maybe be explicit
      is good thing) - see _Problem2 - example_. Instead of this:
         ```
        DenyThenTry<
                      (
                                     // Deny for top level XCM program 
                                     DenyReserveTransferToRelayChain,
      // Dedicated barrier for nested XCM programs
                                     DenyInstructionsWithXcmFor<
      // Repeat all Deny filters here
      DenyReserveTransferToRelayChain,
                                      >
                      ),
         ```
        we could just use:
         ```
        DenyThenTry<
                      (
                                     // Dedicated barrier for XCM programs
                                     DenyInstructionsWithXcmFor<
      // Add all `Deny` filters here
      DenyReserveTransferToRelayChain,
                                                      ...
                                      >
                      ),
         ```
      - [POC
      Evaluation](https://github.com/paritytech/polkadot-sdk/pull/7200#discussion_r1939288792)
      - [x] Consider better name `DenyInstructionsWithXcm` =>
      `DenyRecursively`, more details at
      [here](https://github.com/paritytech/polkadot-sdk/pull/7200#discussion_r1958588973)
      - [x] Clean-up and docs
      - [x] Merge https://github.com/paritytech/polkadot-sdk/pull/7169 or
      rebase this branch on the top of `yrong:fix-for-deny-then-try`
      - [x] Set for the runtimes where we use `DenyThenTry<Deny, Allow>` =>
      `DenyThenTry<DenyRecursively<Deny>, Allow>`
      - [ ] Schedule sec.audit
      
      ---------
      
      Co-authored-by: default avatarRaymond Cheung <[email protected]>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarron <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarClara van Staden <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      bd7cf119
  14. Feb 18, 2025
    • Francisco Aguirre's avatar
      Fix issue with InitiateTransfer and UnpaidExecution (#7423) · c4b41457
      Francisco Aguirre authored
      
      
      Fix issue where setting the `remote_fees` field of `InitiateTransfer` to
      `None` could lead to unintended bypassing of fees in certain conditions.
      
      Changes made to fix this:
      - `remote_fees: None` now results in the `UnpaidExecution` instruction
      being appended *after* the origin altering instruction, be it
      `AliasOrigin` or `ClearOrigin`. This means `preserve_origin: true` must
      be set if you want to have any chance of not paying for fees.
      - The `AliasOrigin` instruction is not appended if the executor is
      called with the root location (`Here`) since it would alias to itself.
      Although this self-aliasing could be done, it needs the ecosystem to add
      a new aliasing instruction, so we just skip it.
      - Tweaked the `AllowExplicitUnpaidExecutionFrom` barrier to allow
      receiving assets (via teleport or reserve asset transfer) and altering
      the origin before actually using `UnpaidExecution`. This is to allow
      unpaid teleports to work with `InitiateTransfer`.
      - For this, the barrier now executes origin altering instructions and
      keeps track of the modified origin. It then checks if this final origin
      has enough permissions to not pay for fees. In order to follow the
      `AliasOrigin` instruction it now takes a new generic `Aliasers` that
      should be set to the XCM config item of the same name. This new generic
      has a default value of `()`, effectively disallowing the use of
      `AliasOrigin`.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      c4b41457
  15. Feb 17, 2025
  16. Feb 10, 2025
    • Dhiraj Sah's avatar
      transfer function Preservation is changed to Expendable (#7243) · f96da6f3
      Dhiraj Sah authored
      # Description
      
      Fixes #7039
      
      The Preservation of transfer method of fungible and fungibles adapters
      is changed from Preserve to Expendable. So the behavior of the
      TransferAsset will be consistent with the WithdrawAsset function, as in
      [fungible](https://github.com/paritytech/polkadot-sdk/blob/f3ab3854
      
      /polkadot/xcm/xcm-builder/src/fungible_adapter.rs#L217)
      and [fungibles](https://github.com/paritytech/polkadot-sdk/issues/url)
      adapter.
      
      This pull request includes changes to the `fungible_adapter.rs` and
      `fungibles_adapter.rs` files in the `polkadot/xcm/xcm-builder`
      directory. The main change involves modifying the transfer method to use
      the `Expendable` strategy instead of the `Preserve` strategy.
      
      Changes to transfer strategy:
      
      *
      [`polkadot/xcm/xcm-builder/src/fungible_adapter.rs`](diffhunk://#diff-6ebd77385441f2c8b023c480e818a01c4b43ae892c73ca30144cd64ee960bd66L67-R67):
      Changed the transfer method to use `Expendable` instead of `Preserve`.
      *
      [`polkadot/xcm/xcm-builder/src/fungibles_adapter.rs`](diffhunk://#diff-82221429de4c4c88be3d2976ece6475ef4fa56a32abc70290911bd47191f8e17L61-R61):
      Changed the transfer method to use `Expendable` instead of `Preserve`.
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      f96da6f3
  17. Feb 07, 2025
    • Przemek Rzad's avatar
      Ensure license headers match the Cargo manifest licenses (#5776) · 3726493d
      Przemek Rzad authored
      
      
      - Closes https://github.com/paritytech/license-scanner/issues/44
      - Silent because only comments are changed in the crates.
      
      ## What's inside
      
      First, we change the file traversal mechanism from shell globbing to
      walking through files which happens inside the `license-scanner` - so it
      has knowledge about directory structure and can correlate files with
      corresponding Cargo manifest.
      
      Next, added `MIT-0` and `Unlicense` to the allowed list of licenses.
      `Unlicense` appears only once across {Substrate,Cumulus,Polkadot} - in
      `penpal-runtime`.
      
      Finally, updated headers in files that do not match the corresponding
      manifest license.
      
      ---------
      
      Co-authored-by: Yuri Volkov's avatarcornholio <[email protected]>
      3726493d
  18. Jan 30, 2025
    • Jeeyong Um's avatar
      Replace derivative dependency with derive-where (#7324) · 0d644ca0
      Jeeyong Um authored
      
      
      # Description
      
      Close #7122.
      
      This PR replaces the unmaintained `derivative` dependency with
      `derive-where`.
      
      ## Integration
      
      This PR doesn't change the public interfaces.
      
      ## Review Notes
      
      The `derivative` crate, previously used to derive basic traits for
      structs with generics or enums, is no longer actively maintained. It has
      been replaced with the `derive-where` crate, which offers a more
      straightforward syntax while providing the same features as
      `derivative`.
      
      ---------
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      0d644ca0
  19. Jan 27, 2025
    • Ron's avatar
      xcm: fix for DenyThenTry Barrier (#7169) · b30aa319
      Ron authored
      
      
      Resolves (partially):
      https://github.com/paritytech/polkadot-sdk/issues/7148 (see _Problem 1 -
      `ShouldExecute` tuple implementation and `Deny` filter tuple_)
      
      This PR changes the behavior of `DenyThenTry` from the pattern
      `DenyIfAllMatch` to `DenyIfAnyMatch` for the tuple.
      
      I would expect the latter is the right behavior so make the fix in
      place, but we can also add a dedicated Impl with the legacy one
      untouched.
      
      ## TODO
      - [x] add unit-test for `DenyReserveTransferToRelayChain`
      - [x] add test and investigate/check `DenyThenTry` as discussed
      [here](https://github.com/paritytech/polkadot-sdk/pull/6838#discussion_r1914553990)
      and update documentation if needed
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarClara van Staden <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      b30aa319
  20. Jan 26, 2025
  21. Jan 23, 2025
    • Branislav Kontur's avatar
      Bridges small nits/improvements (#7307) · 085da479
      Branislav Kontur authored
      This PR contains small fixes identified during work on the larger PR:
      https://github.com/paritytech/polkadot-sdk/issues/6906.
      
      ---------
      
      Co-authored-by: command-bot <>
      085da479
    • runcomet's avatar
      Balances: Configurable Number of Genesis Accounts with Specified Balances for Benchmarking (#6267) · 04847d51
      runcomet authored
      
      
      # Derived Dev Accounts
      
      Resolves https://github.com/paritytech/polkadot-sdk/issues/6040
      
      ## Description
      This update introduces support for creating an arbitrary number of
      developer accounts at the genesis block based on a specified derivation
      path. This functionality is gated by the runtime-benchmarks feature,
      ensuring it is only enabled during benchmarking scenarios.
      
      ### Key Features
      - Arbitrary Dev Accounts at Genesis: Developers can now specify any
      number of accounts to be generated at genesis using a hard derivation
      path.
      
      - Default Derivation Path: If no derivation path is provided (i.e., when
      `Option<dev_accounts: (..., None)>` is set to `Some` at genesis), the
      system will default to the path `//Sender//{}`.
      
      - No Impact on Total Token Issuance: Developer accounts are excluded
      from the total issuance of the token supply at genesis, ensuring they do
      not affect the overall balance or token distribution.
      
      polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      04847d51
  22. Jan 17, 2025
    • thiolliere's avatar
      Make frame crate not use the feature experimental (#7177) · 4b2febe1
      thiolliere authored
      We already use it for lots of pallet.
      
      Keeping it feature gated by experimental means we lose the information
      of which pallet was using experimental before the migration to frame
      crate usage.
      
      We can consider `polkadot-sdk-frame` crate unstable but let's not use
      the feature `experimental`.
      
      ---------
      
      Co-authored-by: command-bot <>
      4b2febe1
  23. Jan 13, 2025
    • Branislav Kontur's avatar
      xcm: Fixes for `UnpaidLocalExporter` (#7126) · 2f7cf417
      Branislav Kontur authored
      ## Description
      
      This PR deprecates `UnpaidLocalExporter` in favor of the new
      `LocalExporter`. First, the name is misleading, as it can be used in
      both paid and unpaid scenarios. Second, it contains a hard-coded channel
      0, whereas `LocalExporter` uses the same algorithm as `xcm-exporter`.
      
      ## Future Improvements  
      
      Remove the `channel` argument and slightly modify the
      `ExportXcm::validate` signature as part of [this
      issue](https://github.com/orgs/paritytech/projects/145/views/8?pane=issue&itemId=84899273).
      
      ---------
      
      Co-authored-by: command-bot <>
      2f7cf417
  24. Jan 05, 2025
    • thiolliere's avatar
      Implement cumulus StorageWeightReclaim as wrapping transaction extension +... · 63c73bf6
      thiolliere authored
      Implement cumulus StorageWeightReclaim as wrapping transaction extension + frame system ReclaimWeight (#6140)
      
      (rebasing of https://github.com/paritytech/polkadot-sdk/pull/5234)
      
      ## Issues:
      
      * Transaction extensions have weights and refund weight. So the
      reclaiming of unused weight must happen last in the transaction
      extension pipeline. Currently it is inside `CheckWeight`.
      * cumulus storage weight reclaim transaction extension misses the proof
      size of logic happening prior to itself.
      
      ## Done:
      
      * a new storage `ExtrinsicWeightReclaimed` in frame-system. Any logic
      which attempts to do some reclaim must use this storage to avoid double
      reclaim.
      * a new function `reclaim_weight` in frame-system pallet: info and post
      info in arguments, read the already reclaimed weight, calculate the new
      unused weight from info and post info. do the more accurate reclaim if
      higher.
      * `CheckWeight` is unchanged and still reclaim the weight in post
      dispatch
      * `ReclaimWeight` is a new transaction extension in frame system. For
      s...
      63c73bf6
  25. Dec 20, 2024
    • Xavier Lau's avatar
      Reorder dependencies' keys (#6967) · a843d15e
      Xavier Lau authored
      
      
      It doesn't make sense to only reorder the features array.
      
      For example:
      
      This makes it hard for me to compare the dependencies and features,
      especially some crates have a really really long dependencies list.
      ```toml​
      [dependencies]
      c = "*"
      a = "*"
      b = "*"
      
      [features]
      std = [
        "a",
        "b",
        "c",
      ]
      ```
      
      This makes my life easier.
      ```toml​
      [dependencies]
      a = "*"
      b = "*"
      c = "*"
      
      [features]
      std = [
        "a",
        "b",
        "c",
      ]
      ```
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: command-bot <>
      a843d15e
  26. Dec 18, 2024
  27. Dec 12, 2024
  28. Dec 11, 2024
    • Francisco Aguirre's avatar
      Add aliasers to westend chains (#6814) · 48c6574b
      Francisco Aguirre authored
      
      
      `InitiateTransfer`, the new instruction introduced in XCMv5, allows
      preserving the origin after a cross-chain transfer via the usage of the
      `AliasOrigin` instruction. The receiving chain needs to be configured to
      allow such this instruction to have its intended effect and not just
      throw an error.
      
      In this PR, I add the alias rules specified in the [RFC for origin
      preservation](https://github.com/polkadot-fellows/RFCs/blob/main/text/0122-alias-origin-on-asset-transfers.md)
      to westend chains so we can test these scenarios in the testnet.
      
      The new scenarios include:
      - Sending a cross-chain transfer from one system chain to another and
      doing a Transact on the same message (1 hop)
      - Sending a reserve asset transfer from one chain to another going
      through asset hub and doing Transact on the same message (2 hops)
      
      The updated chains are:
      - Relay: added `AliasChildLocation`
      - Collectives: added `AliasChildLocation` and
      `AliasOriginRootUsingFilter<AssetHubLocation, Everything>`
      - People: added `AliasChildLocation` and
      `AliasOriginRootUsingFilter<AssetHubLocation, Everything>`
      - Coretime: added `AliasChildLocation` and
      `AliasOriginRootUsingFilter<AssetHubLocation, Everything>`
      
      AssetHub already has `AliasChildLocation` and doesn't need the other
      config item.
      BridgeHub is not intended to be used by end users so I didn't add any
      config item.
      Only added `AliasChildOrigin` to the relay since we intend for it to be
      used less.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      Co-authored-by: command-bot <>
      48c6574b
  29. Dec 10, 2024
    • Ron's avatar
      XCMv5: Fix for compatibility with V4 (#6503) · fe4846f5
      Ron authored
      ## Description
      
      Our smoke tests transfer `WETH` from Sepolia to Westend-AssetHub breaks,
      try to reregister `WETH` on AH but fails as following:
      
      
      https://bridgehub-westend.subscan.io/xcm_message/westend-4796d6b3600aca32ef63b9953acf6a456cfd2fbe
      
      https://assethub-westend.subscan.io/extrinsic/9731267-0?event=9731267-2
      
      The reason is that the transact call encoded on BH to register the asset
      
      https://github.com/paritytech/polkadot-sdk/blob/a77940ba
      
      /bridges/snowbridge/primitives/router/src/inbound/mod.rs#L282-L289
      ```
      0x3500020209079edaa8020300fff9976782d46cc05630d1f6ebab18b2324d6b1400ce796ae65569a670d0c1cc1ac12515a3ce21b5fbf729d63d7b289baad070139d01000000000000000000000000000000
      ```
      
      the `asset_id` which is the xcm location can't be decoded on AH in V5
      
      Issue initial post in
      https://matrix.to/#/!qUtSTcfMJzBdPmpFKa:parity.io/$RNMAxIIOKGtBAqkgwiFuQf4eNaYpmOK-Pfw4d6vv1aU?via=parity.io&via=matrix.org&via=web3.foundation
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      fe4846f5
    • Branislav Kontur's avatar
      3fb99c0b
  30. Dec 09, 2024
    • Adrian Catangiu's avatar
      xcm-executor: take transport fee from transferred assets if necessary (#4834) · e79fd2bb
      Adrian Catangiu authored
      
      
      # Description
      
      Sending XCM messages to other chains requires paying a "transport fee".
      This can be paid either:
      - from `origin` local account if `jit_withdraw = true`,
      - taken from Holding register otherwise.
      
      This currently works for following hops/scenarios:
      1. On destination no transport fee needed (only sending costs, not
      receiving),
      2. Local/originating chain: just set JIT=true and fee will be paid from
      signed account,
      3. Intermediary hops - only if intermediary is acting as reserve between
      two untrusted chains (aka only for `DepositReserveAsset` instruction) -
      this was fixed in https://github.com/paritytech/polkadot-sdk/pull/3142
      
      But now we're seeing more complex asset transfers that are mixing
      reserve transfers with teleports depending on the involved chains.
      
      # Example
      
      E.g. transferring DOT between Relay and parachain, but through AH (using
      AH instead of the Relay chain as parachain's DOT reserve).
      
      In the `Parachain --1--> AssetHub --2--> Relay` scenario, DOT has to be
      reserve-withdrawn in leg `1`, then teleported in leg `2`.
      On the intermediary hop (AssetHub), `InitiateTeleport` fails to send
      onward message because of missing transport fees. We also can't rely on
      `jit_withdraw` because the original origin is lost on the way, and even
      if it weren't we can't rely on the user having funded accounts on each
      hop along the way.
      
      # Solution/Changes
      
      - Charge the transport fee in the executor from the transferred assets
      (if available),
      - Only charge from transferred assets if JIT_WITHDRAW was not set,
      - Only charge from transferred assets if unless using XCMv5 `PayFees`
      where we do not have this problem.
      
      # Testing
      
      Added regression tests in emulated transfers.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/4832
      Fixes https://github.com/paritytech/polkadot-sdk/issues/6637
      
      ---------
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      e79fd2bb
  31. Dec 08, 2024
  32. Dec 05, 2024
    • Francisco Aguirre's avatar
      Added fallback_max_weight to Transact for sending messages to V4 chains (#6643) · f31c70aa
      Francisco Aguirre authored
      
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/6585
      
      Removing the `require_weight_at_most` parameter in V5 Transact had only
      one problem. Converting a message from V5 to V4 to send to chains that
      didn't upgrade yet. The conversion would not know what weight to give to
      the Transact, since V4 and below require it.
      
      To fix this, I added back the weight in the form of an `Option<Weight>`
      called `fallback_max_weight`. This can be set to `None` if you don't
      intend to deal with a chain that hasn't upgraded yet. If you set it to
      `Some(_)`, the behaviour is the same. The plan is to totally remove this
      in V6 since there will be a good conversion path from V6 to V5.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      f31c70aa