1. Apr 19, 2024
  2. Apr 18, 2024
  3. Apr 17, 2024
    • Muharem Ismailov's avatar
      Asset Conversion: Pool Touch Call (#3251) · 305d311d
      Muharem Ismailov authored
      Introduce `touch` call designed to address operational prerequisites
      before providing liquidity to a pool.
      
      This function ensures that essential requirements, such as the presence
      of the pool's accounts, are fulfilled. It is particularly beneficial in
      scenarios where a pool creator removes the pool's accounts without
      providing liquidity.
      
      ---------
      
      Co-authored-by: command-bot <>
      305d311d
    • PG Herveou's avatar
      Contracts: Refactor test builder (#4158) · aa78fe21
      PG Herveou authored
      - Moved `substrate/frame/contracts/src/tests/builder.rs` into a pub
      test_utils module, so we can use that in the
      `pallet-contracts-mock-network` tests
      - Refactor xcm tests to use XCM builders, and simplify the use case for
      xcm-send
      aa78fe21
    • Oliver Tale-Yazdi's avatar
      Fix nostd build of several crates (#4060) · 7a2c9d4a
      Oliver Tale-Yazdi authored
      Preparation for https://github.com/paritytech/polkadot-sdk/pull/3935
      
      Changes:
      - Add some `default-features = false` for the case that a crate and that
      dependency both support nostd builds.
      - Shuffle files around of some benchmarking-only crates. These
      conditionally disabled the `cfg_attr` for nostd and pulled in libstd.
      Example [here](https://github.com/ggwpez/zepter/pull/95
      
      ). The actual
      logic is moved into a `inner.rs` to preserve nostd capability of the
      crate in case the benchmarking feature is disabled.
      - Add some `use sp_std::vec` where needed.
      - Remove some `optional = true` in cases where it was not optional.
      - Removed one superfluous `cfg_attr(not(feature = "std"), no_std..`.
      
      All in all this should be logical no-op.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      7a2c9d4a
    • thiolliere's avatar
      Improve doc for pallet macro and config macro (#4146) · ca7c01c8
      thiolliere authored
      Improve doc:
      
      * the pallet macro is actually referring to 2 places, for the module and
      for the struct placeholder but doesn't really clarify it (I should have
      named the latter just `pallet_struct` or something but it is a bit late)
      
      * The doc of `with_default` is a bit confusing too IMO.
      
      CC @Kianenigma
      
      
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      ca7c01c8
    • Muharem Ismailov's avatar
      Asset Conversion: Pool Account ID derivation with additional Pallet ID seed (#3250) · 4e10d3b0
      Muharem Ismailov authored
      Introduce `PalletId` as an additional seed parameter for pool's account
      id derivation.
      
      The PR also introduces the `pallet_asset_conversion_ops` pallet with a
      call to migrate a given pool to thew new account. Additionally
      `fungibles::lifetime::ResetTeam` and `fungible::lifetime::Refund`
      traits, to facilitate the migration of pools.
      
      ---------
      
      Co-authored-by: command-bot <>
      4e10d3b0
    • Sergej Sakac's avatar
      XCM coretime region transfers (#3455) · e6f3106d
      Sergej Sakac authored
      This PR introduces changes enabling the transfer of coretime regions via
      XCM.
      
      TL;DR: There are two primary issues that are resolved in this PR:
      
      1. The `mint` and `burn` functions were not implemented for coretime
      regions. These operations are essential for moving assets to and from
      the XCM holding register.
      2. The transfer of non-fungible assets through XCM was previously
      disallowed. This was due to incorrectly benchmarking non-fungible asset
      transfers via XCM, which led to assigning it a weight of `Weight::Max`,
      effectively preventing its execution.
      
      ### `mint_into` and `burn` implementation
      
      This PR addresses the issue with cross-chain transferring regions back
      to the Coretime chain. Remote reserve transfers are performed by
      withdrawing and depositing the asset to and from the holding registry.
      This requires the asset to support burning and minting functionality.
      
      This PR adds burning and minting; however, they work a bit differently
      than usual so that the associated region record is not lost when
      burning. Instead of removing all the data, burning will set the owner of
      the region to `None`, and when minting it back, it will set it to an
      actual value. So, when cross-chain transferring, withdrawing into the
      registry will remove the region from its original owner, and when
      depositing it from the registry, it will set its owner to another
      account
      
      This was originally implemented in this PR: #3455, however we decided to
      move all of it to this single PR
      (https://github.com/paritytech/polkadot-sdk/pull/3455#discussion_r1547324892)
      
      ### Fixes made in this PR
      
      - Update the `XcmReserveTransferFilter` on coretime chain since it is
      meant as a reserve chain for coretime regions.
      - Update the XCM benchmark to use `AssetTransactor` instead of assuming
      `pallet-balances` for fungible transfers.
      - Update the XCM benchmark to properly measure weight consumption for
      nonfungible reserve asset transfers. ATM reserve transfers via the
      extrinsic do not work since the weight for it is set to `Weight::max()`.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/865
      
      
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      e6f3106d
  4. Apr 16, 2024
  5. Apr 15, 2024
  6. Apr 13, 2024
  7. Apr 12, 2024
  8. Apr 10, 2024
  9. Apr 09, 2024
  10. Apr 08, 2024
    • Léa Narzis's avatar
    • Oliver Tale-Yazdi's avatar
      [FRAME] Runtime Omni Bencher (#3512) · 9543d314
      Oliver Tale-Yazdi authored
      This MR contains two major changes and some maintenance cleanup.  
      
      ## 1. Free Standing Pallet Benchmark Runner
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/3045, depends
      on your runtime exposing the `GenesisBuilderApi` (like
      https://github.com/paritytech/polkadot-sdk/pull/1492).
      
      Introduces a new binary crate: `frame-omni-bencher`.  
      It allows to directly benchmark a WASM blob - without needing a node or
      chain spec.
      
      This makes it much easier to generate pallet weights and should allow us
      to remove bloaty code from the node.
      It should work for all FRAME runtimes that dont use 3rd party host calls
      or non `BlakeTwo256` block hashing (basically all polkadot parachains
      should work).
      
      It is 100% backwards compatible with the old CLI args, when the `v1`
      compatibility command is used. This is done to allow for forwards
      compatible addition of new commands.
      
      ### Example (full example in the Rust docs)
      
      Installing the CLI:
      ```sh
      cargo install --locked --path substrate/utils/frame/omni-bencher
      frame-omni-bencher --help
      ```
      
      Building the Westend runtime:
      ```sh
      cargo build -p westend-runtime --release --features runtime-benchmarks
      ```
      
      Benchmarking the runtime:
      ```sh
      frame-omni-bencher v1 benchmark pallet --runtime target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm --all
      ```
      
      ## 2. Building the Benchmark Genesis State in the Runtime
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/2664
      
      This adds `--runtime` and `--genesis-builder=none|runtime|spec`
      arguments to the `benchmark pallet` command to make it possible to
      generate the genesis storage by the runtime. This can be used with both
      the node and the freestanding benchmark runners. It utilizes the new
      `GenesisBuilder` RA and depends on having
      https://github.com/paritytech/polkadot-sdk/pull/3412
      
       deployed.
      
      ## 3. Simpler args for `PalletCmd::run`
      
      You can do three things here to integrate the changes into your node:
      - nothing: old code keeps working as before but emits a deprecated
      warning
      - delete: remove the pallet benchmarking code from your node and use the
      omni-bencher instead
      - patch: apply the patch below and keep using as currently. This emits a
      deprecated warning at runtime, since it uses the old way to generate a
      genesis state, but is the smallest change.
      
      ```patch
      runner.sync_run(|config| cmd
      -    .run::<HashingFor<Block>, ReclaimHostFunctions>(config)
      +    .run_with_spec::<HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec))
      )
      ```
      
      ## 4. Maintenance Change
      - `pallet-nis` get a `BenchmarkSetup` config item to prepare its
      counterparty asset.
      - Add percent progress print when running benchmarks.
      - Dont immediately exit on benchmark error but try to run as many as
      possible and print errors last.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      9543d314
    • HongKuang's avatar
      Fix some typos (#4018) · bd4471b4
      HongKuang authored
      
      
      Signed-off-by: default avatarhongkuang <[email protected]>
      bd4471b4
  11. Apr 06, 2024
  12. Apr 05, 2024
  13. Apr 04, 2024