1. Apr 24, 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. Feb 08, 2024
  5. Jan 29, 2024
  6. Jan 10, 2024
    • Nazar Mokrynskyi's avatar
      Improve storage monitor API (#2899) · af2e30e3
      Nazar Mokrynskyi authored
      This removes the need to unnecessarily provide a very specific data
      structure `DatabaseSource` and removes huge `sc-client-db` dependency
      from storage monitor. It is now possible to use storage monitor with any
      path.
      
      P.S. I still strongly dislike that it pulls `clap` dependency for such a
      small feature, but many other crates do as well, so nothing special
      here.
      af2e30e3
  7. Dec 27, 2023
  8. Dec 05, 2023
  9. Nov 28, 2023
  10. Oct 24, 2023
  11. Oct 18, 2023
  12. Sep 29, 2023
    • Sebastian Kunert's avatar
      9485b0b4
    • 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
  13. Sep 19, 2023
    • Bastian Köcher's avatar
      Remove Polkadot & Kusama native runtime (#1304) · 6079b6dd
      Bastian Köcher authored
      This pull request removes the Polkadot and Kusama native runtime from
      the polkadot node. This brings some implications with it:
      
      There are no more kusama/polkadot-dev chain specs available. We will
      need to write some tooling in the fellowship repo to provide them
      easily.
      
      The try-runtime job for polkadot & kusama is not available anymore as we
      don't have the dev chain specs anymore.
      
      Certain benchmarking commands will also not work until we migrate them
      to use a runtime api.
      
      Some crates in utils are still depending on the polkadot/kusama native
      runtime that will also need to be fixed.
      
      Port of: https://github.com/paritytech/polkadot/pull/7467
      6079b6dd
  14. Sep 12, 2023
  15. Aug 25, 2023
  16. Aug 22, 2023
  17. Aug 17, 2023
  18. Aug 15, 2023
    • Adrian Catangiu's avatar
      Revert "companion for 14754: cli: move no-beefy flag to sc-cli (#7600)" (#7613) · 022a3b97
      Adrian Catangiu authored
      * Revert "companion for 14754: cli: move no-beefy flag to sc-cli (#7600)"
      
      This reverts commit 26adab4f.
      
      * update lockfile for {"substrate"}
      
      * fix merge damage
      
      ---------
      
      Co-authored-by: parity-processbot <>
      022a3b97
    • Bastian Köcher's avatar
      Remove superflous parameter `overseer_enable_anyways` and make parachain node... · cf3271fe
      Bastian Köcher authored
      Remove superflous parameter `overseer_enable_anyways` and make parachain node type more explicit (#7617)
      
      * Remove superflous parameter `overseer_enable_anyways`
      
      We don't need this flag, as we don't need the overseer enabled when the
      node isn't a collator or validator.
      
      * Rename `IsCollator` to `IsParachainNode`
      
      `IsParachainNode` is more expressive and also encapsulates the state of
      the parachain node being a full node. Some functionality like the
      overseer needs to run always when the node runs alongside a parachain
      node. The parachain node needs the overseer to e.g. recover PoVs. Other
      things like candidate validation or pvf checking are only required for
      when the node is running as validator.
      
      * FMT
      
      * Fix CI
      cf3271fe
  19. Aug 14, 2023
  20. Aug 11, 2023
  21. Jul 31, 2023
    • Marcin S.'s avatar
      98.6% OF DEVELOPERS CANNOT REVIEW THIS PR! [read more...] (#7337) · 85b06f18
      Marcin S. authored
      
      
      * [WIP] PVF: Split out worker binaries
      
      * Address compilation problems and re-design a bit
      
      * Reorganize once more, fix tests
      
      * Reformat with new nightly to make `cargo fmt` test happy
      
      * Address `clippy` warnings
      
      * Add temporary trace to debug zombienet tests
      
      * Fix zombienet node upgrade test
      
      * Fix malus and its CI
      
      * Fix building worker binaries with malus
      
      * More fixes for malus
      
      * Remove unneeded cli subcommands
      
      * Support placing auxiliary binaries to `/usr/libexec`
      
      * Fix spelling
      
      * Spelling
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * Implement review comments (mostly nits)
      
      * Fix worker node version flag
      
      * Rework getting the worker paths
      
      * Address a couple of review comments
      
      * Minor restructuring
      
      * Fix CI error
      
      * Add tests for worker binaries detection
      
      * Improve tests; try to fix CI
      
      * Move workers module into separate file
      
      * Try to fix failing test and workers not printing latest version
      
      - Tests were not finding the worker binaries
      - Workers were not being rebuilt when the version changed
      - Made some errors easier to read
      
      * Make a bunch of fixes
      
      * Rebuild nodes on version change
      
      * Fix more issues
      
      * Fix tests
      
      * Pass node version from node into dependencies to avoid recompiles
      
      - [X] get version in CLI
      - [X] pass it in to service
      - [X] pass version along to PVF
      - [X] remove rerun from service
      - [X] add rerun to CLI
      
      - [X] don’t rerun pvf/worker’s (these should be built by nodes which have rerun enabled)
      
      * Some more improvements for smoother tests
      
      - [X] Fix tests
      - [X] Make puppet workers pass None for version and remove rerun
      - [X] Make test collators self-contained
      
      * Add back rerun to PVF workers
      
      * Move worker binaries into files in cli crate
      
      As a final optimization I've separated out each worker binary from its own crate
      into the CLI crate. Before, the worker bin shared a crate with the worker lib,
      so when the binaries got recompiled so did the libs and everything transitively
      depending on the libs. This commit fixes this regression that was causing
      recompiles after every commit.
      
      * Fix bug (was passing worker version for node version)
      
      * Move workers out of cli into root src/bin/ dir
      
      - [X] Pass in node version from top-level (polkadot)
      - [X] Add build.rs with rerun-git-head to root dir
      
      * Add some sanity checks for workers to dockerfiles
      
      * Update malus
      
        + [X] Make it self-contained
        + [X] Undo multiple binary changes
      
      * Try to fix clippy errors
      
      * Address `cargo run` issue
      
      - [X] Add default-run for polkadot
      - [X] Add note about installation to error
      
      * Update readme (installation instructions)
      
      * Allow disabling external workers for local/testing setups
      
        + [X] cli flag to enable single-binary mode
        + [X] Add message to error
      
      * Revert unnecessary Cargo.lock changes
      
      * Remove unnecessary build scripts from collators
      
      * Add back missing malus commands (should fix failing ZN job)
      
      * Some minor fixes
      
      * Update Cargo.lock
      
      * Fix some build errors
      
      * Undo self-contained binaries; cli flag to disable version check
      
        + [X] Remove --dont-run-external-workers
        + [X] Add --disable-worker-version-check
        + [X] Remove PVF subcommands
        + [X] Redo malus changes
      
      * Try to fix failing job and add some docs for local tests
      
      ---------
      
      Co-authored-by: default avatarDmitry Sinyavin <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: parity-processbot <>
      85b06f18
  22. Jul 18, 2023
    • Michal Kucharczyk's avatar
      `chain-spec`: `polkadot_staging_testnet` config removed (#7509) · b15a5697
      Michal Kucharczyk authored
      * chain-spec: polkadot_staging_testnet config removed
      
      The config has empty initial authority test. It is unusable.
      
      ```
      $ polkadot export-blocks --chain polkadot-staging --from=0 --to=0
      ...
      Thread 'main' panicked at 'Empty validator set for session 0 in genesis block!',
      /home/miszka/.cargo/git/checkouts/substrate-7e08433d4c370a21/c446786/frame/session/src/lib.rs:463
      ```
      
      * warning fix
      b15a5697
  23. Jul 05, 2023
  24. Jul 04, 2023
    • Bastian Köcher's avatar
      Do not depend on native runtimes for `RuntimeApi` (#7451) · e53d15aa
      Bastian Köcher authored
      * Implement runtime apis for fake runtime
      
      These runtime api implementations are only used to make the compiler
      think that we have implemented all required runtime apis. They will not
      be called as we switch the executor to `WasmExecutor`. In the near
      future we will not require these fake implementations anymore after
      Substrate has shifted away from this compile time requirement.
      
      This brings us the advantage that the `polkadot-service` doesn't need to
      depend on the runtimes for getting the `RuntimeApi` type.
      
      It also removes around 1min of build time on my machine ;)
      
      * Fix warning
      
      * FMT
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Use more descriptive id
      
      * Fix warnings
      
      * Adapt path
      
      * Fix 🙈
      
      ---------
      
      Co-authored-by: command-bot <>
      e53d15aa
  25. Jun 29, 2023
  26. May 26, 2023
    • Adrian Catangiu's avatar
      cli: enable BEEFY by default on test networks (#7293) · 035b2486
      Adrian Catangiu authored
      
      
      We consider BEEFY mature enough to run by default on all nodes
      for test networks (Rococo/Wococo/Versi).
      
      Right now, most nodes are not running it since it's opt-in using
      --beefy flag. Switch to an opt-out model for test networks.
      
      Replace --beefy flag from CLI with --no-beefy and have BEEFY
      client start by default on test networks.
      
      Signed-off-by: default avataracatangiu <[email protected]>
      035b2486
  27. May 25, 2023
    • Marcin S.'s avatar
      PVF: Refactor workers into separate crates, remove host dependency (#7253) · 8782dde4
      Marcin S. authored
      * PVF: Refactor workers into separate crates, remove host dependency
      
      * Fix compile error
      
      * Remove some leftover code
      
      * Fix compile errors
      
      * Update Cargo.lock
      
      * Remove worker main.rs files
      
      I accidentally copied these from the other PR. This PR isn't intended to
      introduce standalone workers yet.
      
      * Address review comments
      
      * cargo fmt
      
      * Update a couple of comments
      
      * Update log targets
      8782dde4
  28. May 12, 2023
    • Anton's avatar
      [Substrate Companion] Upgrade to libp2p 0.51.3 (#7000) · 147a8235
      Anton authored
      * upgrade js-sys to 0.3.61
      
      * update wasm-bindgen-futures
      
      * update once_cell
      
      * update either
      
      * update futures
      
      * update pyroscope to 0.5.3
      
      * use the new pyroscope API
      
      * add missing imports
      
      * readme is incorrect
      
      * add shutdown
      
      * fix shutdown
      
      * remove mut
      
      * remove mut 2
      
      * redo updates
      
      * update zeroize
      
      * update lockfile for {"substrate"}
      
      * update lockfile for {"substrate", "cumulus"}
      
      * redo updates
      
      * restart CI
      
      ---------
      
      Co-authored-by: parity-processbot <>
      147a8235
  29. Apr 21, 2023
    • Marcin S.'s avatar
      PVF: Move PVF workers into separate crate (#7101) · e277f95b
      Marcin S. authored
      * Move PVF workers into separate crate
      
      * Fix indentation
      
      * Fix compilation errors
      
      * Fix more compilation errors
      
      * Rename `worker.rs` files, make host interface to worker more clear
      
      * Fix more compilation errors
      
      * Fix more compilation errors
      
      * Add link to issue
      
      * Address review comments
      
      * Update comment
      e277f95b
  30. Apr 08, 2023
  31. Mar 29, 2023
    • s0me0ne-unkn0wn's avatar
      Check spawned worker version vs node version before PVF preparation (#6861) · 55b4aceb
      s0me0ne-unkn0wn authored
      
      
      * Check spawned worker version vs node version before PVF preparation
      
      * Address discussions
      
      * Propagate errors and shutdown preparation and execution pipelines properly
      
      * Add logs; Fix execution worker checks
      
      * Revert "Propagate errors and shutdown preparation and execution pipelines properly"
      
      This reverts commit b96cc3160ff58db5ff001d8ca0bfea9bd4bdd0f2.
      
      * Don't try to shut down; report the condition and exit worker
      
      * Get rid of `VersionMismatch` preparation error
      
      * Merge master
      
      * Add docs; Fix tests
      
      * Update Cargo.lock
      
      * Kill again, but only the main node process
      
      * Move unsafe code to a common safe function
      
      * Fix libc dependency error on MacOS
      
      * pvf spawning: Add some logging, add a small integration test
      
      * Minor fixes
      
      * Restart CI
      
      ---------
      
      Co-authored-by: default avatarMarcin S <[email protected]>
      55b4aceb
  32. Feb 20, 2023
  33. Feb 07, 2023
  34. Jan 27, 2023
  35. Jan 21, 2023
  36. Dec 20, 2022
    • Michal Kucharczyk's avatar
      BlockId removal: refactor: HeaderBackend::header (#6418) · fcc26d42
      Michal Kucharczyk authored
      * BlockId removal: refactor: HeaderBackend::header
      
      It changes the arguments of:
      - `HeaderBackend::header`,
      - `Client::header`
      
      methods from: `BlockId<Block>` to: `Block::Hash`
      
      This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
      
      * missed fixes
      
      * BlockId removal: refactor: HeaderBackend::expect_header
      
      It changes the arguments of `HeaderBackend::expect_header` method from: `BlockId<Block>` to: `Block::Hash`
      
      * update lockfile for {"substrate"}
      
      * misspell fixed
      
      Co-authored-by: parity-processbot <>
      fcc26d42