-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport #5466 into `stable2407` (cc @ggwpez). <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
- Loading branch information
1 parent
6e4f07c
commit 38945d0
Showing
7 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
crates: | ||
- bump: patch | ||
name: frame-omni-bencher | ||
- bump: patch | ||
name: frame-benchmarking-cli | ||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
Changes: | ||
- Set default level to `Info` again. Seems like a dependency update set it to something higher. | ||
- Fix docs to not use `--locked` since we rely on dependency bumps via cargo. | ||
- Add README with rust docs. | ||
- Fix bug where the node ignored `--heap-pages` argument. | ||
title: frame-omni-bencher maintenance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Polkadot Omni Benchmarking CLI | ||
|
||
The Polkadot Omni benchmarker allows to benchmark the extrinsics of any Polkadot runtime. It is | ||
meant to replace the current manual integration of the `benchmark pallet` into every parachain node. | ||
This reduces duplicate code and makes maintenance for builders easier. The CLI is currently only | ||
able to benchmark extrinsics. In the future it is planned to extend this to some other areas. | ||
|
||
General FRAME runtimes could also be used with this benchmarker, as long as they don't utilize any | ||
host functions that are not part of the Polkadot host specification. | ||
|
||
## Installation | ||
|
||
Directly via crates.io: | ||
|
||
```sh | ||
cargo install frame-omni-bencher --profile=production | ||
``` | ||
|
||
from GitHub: | ||
|
||
```sh | ||
cargo install --git https://github.com/paritytech/polkadot-sdk frame-omni-bencher --profile=production | ||
``` | ||
|
||
or locally from the sources: | ||
|
||
```sh | ||
cargo install --path substrate/utils/frame/omni-bencher --profile=production | ||
``` | ||
|
||
Check the installed version and print the docs: | ||
|
||
```sh | ||
frame-omni-bencher --help | ||
``` | ||
|
||
## Usage | ||
|
||
First we need to ensure that there is a runtime available. As example we will build the Westend | ||
runtime: | ||
|
||
```sh | ||
cargo build -p westend-runtime --profile production --features runtime-benchmarks | ||
``` | ||
|
||
Now as an example, we benchmark the `balances` pallet: | ||
|
||
```sh | ||
frame-omni-bencher v1 benchmark pallet \ | ||
--runtime target/release/wbuild/westend-runtime/westend-runtime.compact.compressed.wasm \ | ||
--pallet "pallet_balances" --extrinsic "" | ||
``` | ||
|
||
The `--steps`, `--repeat`, `--heap-pages` and `--wasm-execution` arguments have sane defaults and do | ||
not need be passed explicitly anymore. | ||
|
||
## Backwards Compatibility | ||
|
||
The exposed pallet sub-command is identical as the node-integrated CLI. The only difference is that | ||
it needs to be prefixed with a `v1` to ensure drop-in compatibility. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters