Skip to content
Snippets Groups Projects
  1. Feb 27, 2025
  2. Feb 24, 2025
    • 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>
  3. 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 <action@github.com>
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
  4. Nov 06, 2024
  5. May 16, 2024
    • Francisco Aguirre's avatar
      XCM Cookbook (#2633) · 289f5bbf
      Francisco Aguirre authored
      
      # Context
      
      XCM docs are currently an md book hosted with github pages:
      https://paritytech.github.io/xcm-docs/.
      While that's fine, it's not in line with the work being done in the
      polkadot-sdk docs.
      
      # Main addition
      
      This PR aims to fix that by bringing the docs back to this repo.
      This does not have all the information currently present in the mdbook
      xcm-docs but aims to be a good chunk of it and fully replace it over
      time.
      
      I also added the sections `guides` and `cookbook` which will be very
      useful for users wanting to get into XCM.
      For now I only added one example to the cookbook, but have ideas for
      guides and more examples.
      Having this docs be in rust docs is very useful for the cookbook.
      
      # TODO
      
      - [x] Use `FungibleAdapter`
      - [x] Improve and relocate mock message queue
      - [x] Fix license issue. Why does docs/sdk/ not have this problem? (Just
      added the licenses)
      
      # Next steps
      
      - More examples in the cookbook
      - End-to-end XCM guide with zombienet testing
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarjoe petrowski <25483142+joepetrowski@users.noreply.github.com>
  6. Apr 29, 2024
    • Shawn Tabrizi's avatar
      Refactor XCM Simulator Example (#4220) · 4875ea11
      Shawn Tabrizi authored
      
      This PR does a "developer experience" refactor of the XCM Simulator
      Example.
      
      I was looking for existing code / documentation where developers could
      better learn about working with and configuring XCM.
      
      The XCM Simulator was a natural starting point due to the fact that it
      can emulate end to end XCM scenarios, without needing to spawn multiple
      real chains.
      
      However, the XCM Simulator Example was just 3 giant files with a ton of
      configurations, runtime, pallets, and tests mashed together.
      
      This PR breaks down the XCM Simulator Example in a way that I believe is
      more approachable by a new developer who is looking to navigate the
      various components of the end to end example, and modify it themselves.
      
      The basic structure is:
      
      - xcm simulator example
          - lib (tries to only use the xcm simulator macros)
          - tests
          - relay-chain
              - mod (basic runtime that developers should be familiar with)
              - xcm-config
                  - mod (contains the `XcmConfig` type
                  - various files for each custom configuration  
          - parachain
              - mock_msg_queue (custom pallet for simulator example)
              - mod (basic runtime that developers should be familiar with)
              - xcm-config
                  - mod (contains the `XcmConfig` type
                  - various files for each custom configuration
      
      I would like to add more documentation to this too, but I think this is
      a first step to be accepted which will affect how documentation is added
      to the example
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <franciscoaguirreperez@gmail.com>
      Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>