1. Apr 22, 2024
  2. Apr 11, 2024
  3. Apr 08, 2024
    • 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
  4. Apr 04, 2024
  5. Apr 02, 2024
  6. Mar 27, 2024
  7. Mar 25, 2024
  8. Mar 19, 2024
  9. Mar 13, 2024
  10. Mar 01, 2024
    • Andrei Eres's avatar
      subsystem-bench: add regression tests for availability read and write (#3311) · f0e589d7
      Andrei Eres authored
      ### What's been done
      - `subsystem-bench` has been split into two parts: a cli benchmark
      runner and a library.
      - The cli runner is quite simple. It just allows us to run `.yaml` based
      test sequences. Now it should only be used to run benchmarks during
      development.
      - The library is used in the cli runner and in regression tests. Some
      code is changed to make the library independent of the runner.
      - Added first regression tests for availability read and write that
      replicate existing test sequences.
      
      ### How we run regression tests
      - Regression tests are simply rust integration tests without the
      harnesses.
      - They should only be compiled under the `subsystem-benchmarks` feature
      to prevent them from running with other tests.
      - This doesn't work when running tests with `nextest` in CI, so
      additional filters have been added to the `nextest` runs.
      - Each benchmark run takes a different time in the beginning, so we
      "warm up" the tests until their CPU usage differs by only 1%.
      - After the warm-up, we run the benchmarks a few more times and compare
      the average with the exception using a precision.
      
      ### What is still wrong?
      - I haven't managed to set up approval voting tests. The spread of their
      results is too large and can't be narrowed down in a reasonable amount
      of time in the warm-up phase.
      - The tests start an unconfigurable prometheus endpoint inside, which
      causes errors because they use the same 9999 port. I disable it with a
      flag, but I think it's better to extract the endpoint launching outside
      the test, as we already do with `valgrind` and `pyroscope`. But we still
      use `prometheus` inside the tests.
      
      ### Future work
      * https://github.com/paritytech/polkadot-sdk/issues/3528
      * https://github.com/paritytech/polkadot-sdk/issues/3529
      * https://github.com/paritytech/polkadot-sdk/issues/3530
      * https://github.com/paritytech/polkadot-sdk/issues/3531
      
      
      
      ---------
      
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      f0e589d7
  11. Feb 26, 2024
  12. Feb 09, 2024
  13. Jan 11, 2024
  14. Jan 08, 2024
  15. Dec 31, 2023
  16. Dec 18, 2023
  17. Dec 12, 2023
  18. Dec 05, 2023
  19. Nov 29, 2023
  20. Nov 28, 2023
  21. Nov 25, 2023
  22. Nov 22, 2023
  23. Oct 31, 2023
  24. Oct 17, 2023
  25. Oct 11, 2023
  26. Sep 29, 2023
    • Bastian Köcher's avatar
      Remove kusama and polkadot runtime crates (#1731) · bf90cb0b
      Bastian Köcher authored
      This pull request is removing the Kusama and Polkadot runtime crates. As
      still some crates dependent on the runtime crates, this pull request is
      doing some more changes.
      
      - It removes the `hostperfcheck` CLI command. This CLI command could
      compare the current node against the standard hardware by doing some
      checks. Later we added the hardware benchmark feature to Substrate. This
      hardware benchmark is running on every node startup and prints a warning
      if the current node is too slow. This makes this CLI command a duplicate
      that was also depending on the kusama runtime.
      
      - The pull request is removing the emulated integration tests that were
      requiring the Kusama or Polkadot runtime crates.
      bf90cb0b
  27. Sep 22, 2023
  28. Sep 11, 2023
  29. Sep 09, 2023
  30. Sep 07, 2023
  31. Sep 04, 2023
  32. Aug 30, 2023
  33. Aug 29, 2023
  34. Aug 28, 2023
    • Alexander Samusev's avatar
      [ci] Add missing components to CI (#1201) · 6e394f84
      Alexander Samusev authored
      * [ci] Add missing components to CI
      
      * add timestamp
      
      * add pipeline-stopper-artifacts to jobs
      
      * break clippy
      
      * mv definition
      
      * fix clippy
      
      * comment timestamp, rm verbose
      
      * commen cancel
      
      * rm --verbose from build jobs
      
      * disable rusty-cachier before_script
      
      * enable timestamp back
      
      * rollback .gitignore
      
      * rollback .gitignore
      
      * rollback .gitignore
      6e394f84