Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Update from master #103

Merged
merged 190 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
ce1c9a4
parachain-system: Do not take `self` for `last_relay_block_number` (#…
bkchr Dec 15, 2023
ddd5434
fix zombienet test (#2719)
pepoviola Dec 15, 2023
ffb2125
[NPoS] Remove better solution threshold for unsigned submissions (#2694)
Ank4n Dec 15, 2023
e5b2ada
`chain-spec-builder`: Improve output path example (#2693)
liamaharon Dec 16, 2023
64d52f2
Publicly expose inaccessible `pallet_uniques` state (#2727)
Szegoo Dec 16, 2023
a250652
Bump async-trait from 0.1.73 to 0.1.74 (#2730)
dependabot[bot] Dec 18, 2023
d941784
Relaxed clippy fixes/nits (#2661)
bkontur Dec 18, 2023
792e374
Bridges subtree update (#2736)
bkontur Dec 18, 2023
ebe2aad
BEEFY: expect_validator_set() small fix (#2737)
serban300 Dec 18, 2023
f93f461
[ci] Fix node-bench-regression-guard job (#2732)
alvicsam Dec 18, 2023
526c81b
subsystem benchmarks: add cpu profiling (#2734)
AndreiEres Dec 19, 2023
657fc2a
Bump dyn-clone from 1.0.13 to 1.0.16 (#2748)
dependabot[bot] Dec 19, 2023
81156d0
Bump actions/setup-node from 4.0.0 to 4.0.1 (#2746)
dependabot[bot] Dec 19, 2023
0b74812
`UnionOf` types for merged `fungible` and `fungibles` implementations…
muharem Dec 19, 2023
166ae5a
[NFTs] Fix consumers issue (#2653)
jsidorenko Dec 19, 2023
2e70dd3
Rococo/Westend Coretime Runtime
joepetrowski Dec 19, 2023
d192401
Ref docs: runtime vs contracts (#2609)
juangirini Dec 19, 2023
7c79741
SDK docs ref cli (#2741)
juangirini Dec 19, 2023
84d6342
pallet-uniques/nfts: Small optimizations (#2754)
bkchr Dec 19, 2023
5ce0451
pallet-asset-conversion: Swap Credit (#1677)
muharem Dec 19, 2023
8efaabd
Add srtool GHA (#2755)
EgorPopelyaev Dec 19, 2023
421af26
Update schnorrkel to 0.11.4 (#2524)
andresilva Dec 19, 2023
c9f9b4b
Fix bridges scripts to test Rococo <> Westend bridge locally (#2752)
svyatonik Dec 20, 2023
d32f66f
Bump chrono from 0.4.27 to 0.4.31 (#2761)
dependabot[bot] Dec 20, 2023
4f832ea
pallet-asset-conversion: Decoupling Native Currency Dependancy (#2031)
muharem Dec 20, 2023
b51904d
use a single source for simple-mermaid dependency (#2760)
andresilva Dec 20, 2023
280aa0b
Add Authorize Upgrade Pattern to Frame System (#2682)
joepetrowski Dec 20, 2023
d68868f
Fix clippy lints behind feature gates and add new CI step all feature…
seadanda Dec 20, 2023
d84e135
Fix Coretime Master (#2765)
joepetrowski Dec 20, 2023
9f5221c
Cleanup bridges tests: with-grandpa-chain case (#2763)
svyatonik Dec 21, 2023
18d53db
Adds Snowbridge to Rococo runtime (#2522)
claravanstaden Dec 21, 2023
69434d9
Coretime Feature branch (relay chain) (#1694)
eskimor Dec 21, 2023
9475973
Cleanup bridges tests: with-parachain case (#2772)
svyatonik Dec 21, 2023
32c047a
Bump AH and BH runtime versions (#2775)
al3mart Dec 21, 2023
8d459d9
Try to set `beacon-spec-mainnet` as default on runtime and not binary…
bkontur Dec 22, 2023
46dd4b8
frame-support: Print key as hex for corrupted state (#2779)
bkchr Dec 22, 2023
96bec7a
pallet-sudo: Accept `Root` origin as valid sudo (#2783)
bkchr Dec 22, 2023
d7ca2cb
Update Safe Call Filters (#2786)
joepetrowski Dec 22, 2023
0686cf1
Bump unsafe-libyaml from 0.2.9 to 0.2.10 (#2776)
dependabot[bot] Dec 22, 2023
b62df69
Final nits for bridge-hub-test-utils (#2788)
svyatonik Dec 22, 2023
0ce506e
incrementing sufficient accounts references with saturating_add for s…
0xmenna Dec 22, 2023
4c0e0e0
fix overflow in `balance_to_point` conversion (#2706)
SCJangra Dec 22, 2023
ecbbb5a
Rococo & Westend People Chain (#2281)
joepetrowski Dec 22, 2023
753967a
Coretime: Use `Superuser` for sending the transact calls (#2793)
bkchr Dec 22, 2023
8acd630
Improve `TryDecodeEntireState` output (#2724)
liamaharon Dec 23, 2023
b4c8166
Remove rustdocs allowances (#2797)
juangirini Dec 24, 2023
ac14d36
Update rust docs link in README.md (#2794)
muddlebee Dec 25, 2023
56849c3
Fix typo in comments (#2807)
cuteolaf Dec 26, 2023
7070b65
xcm: Improve debuggability (#2799)
bkchr Dec 26, 2023
dcbc36a
Saner weights + lease calcuation fix. (#2778)
eskimor Dec 27, 2023
5c0b8e0
BEEFY: Support compatibility with Warp Sync - Allow Warp Sync for Val…
serban300 Dec 27, 2023
201ec44
Fix slot_duration divide by zero panic in rococo-parachain runtime (#…
Sophia-Gold Dec 28, 2023
00cb41b
Bump the known_good_semver group with 2 updates (#2810)
dependabot[bot] Dec 28, 2023
a813e4d
Remove unused pallet-contracts-primitives (#2806)
jasl Dec 28, 2023
ae14e6d
Broker pallet: fix interlacing (#2811)
Szegoo Dec 29, 2023
45f4d9a
Development Environment Advice Reference Doc (#2759)
liamaharon Dec 29, 2023
8bf5a1c
PVF: ensure job processes are cleaned up, add tests (#2643)
mrcnski Dec 29, 2023
9a27b53
core-fellowship: allow infinite demotion period (#2828)
andresilva Dec 31, 2023
1dd1a16
Extract PartialComponents into a type alias (#2767)
gilescope Jan 1, 2024
909c1e4
malus: use spawn_blocking (#2804)
ordian Jan 2, 2024
d842966
Implement only sending one notification at a time as per RFC 56 (#2813)
tomaka Jan 2, 2024
cad9479
Finish up polkadot doc (#2798)
juangirini Jan 2, 2024
73942e0
Bump chevdor/srtool-actions from 0.9.1 to 0.9.2 (#2840)
dependabot[bot] Jan 3, 2024
ac7352e
Upgrade @polkadot/api and @polkadot/util package version to latest (#…
svyatonik Jan 3, 2024
88e7b49
Bump the known_good_semver group with 4 updates (#2845)
dependabot[bot] Jan 4, 2024
924089f
Fix vote weights of ranked members in the Society pallet (#2758)
laurogripa Jan 4, 2024
5b9e69d
Remove `dotgraph` feature (#2848)
bkchr Jan 4, 2024
b0a8746
malus: add new variant SupportDisabled (#2835)
ordian Jan 4, 2024
6f9b1f6
Remove kusama and polkadot SP constants from parachains-common (#2666)
seadanda Jan 4, 2024
f82c297
Contracts build risc-v fixtures (#2554)
pgherveou Jan 4, 2024
99290fd
Bump webpki from 0.22.0 to 0.22.4 (#2849)
dependabot[bot] Jan 4, 2024
e07476e
Update missing worker binaries error (#2853)
mrcnski Jan 4, 2024
19de1c9
proposer: return optional block (#2834)
rphmeier Jan 4, 2024
1c95310
`fungible::Unbalanced::decrease_balance`: Handle `precision` properly…
bkchr Jan 5, 2024
cea7024
Fix clippy warnings (#2861)
tdimitrov Jan 5, 2024
930c151
`cumulus-primitives-parachain-inherent`: Split into two crates (#2803)
bkchr Jan 5, 2024
2e4b899
Kitchensink chain: Add BEEFY support (#2856)
serban300 Jan 6, 2024
204fe7f
Bump the known_good_semver group with 4 updates (#2865)
dependabot[bot] Jan 7, 2024
745c02c
pallet-contracts-fixtures: Only build RISCV when the feature is enabl…
bkchr Jan 7, 2024
8232749
Bump proc-macro-crate from 2.0.1 to 3.0.0 (#2876)
dependabot[bot] Jan 8, 2024
a97a6f2
rpc: add `rpc v2 chainSpec` to polkadot (#2859)
niklasad1 Jan 8, 2024
dbff87c
Return latest known relay chain block number in `on_initialize` etc (…
bkchr Jan 8, 2024
5daef5d
Contracts rename riscv-experimental and enable ci tests (#2879)
pgherveou Jan 8, 2024
1914775
Make `simple-mermaid` optional (#2878)
bkchr Jan 8, 2024
4fdab49
Coretime Zombienet test (#2867)
bkchr Jan 8, 2024
a02b534
backport to master: Handling of disabled validators in backing subsys…
ordian Jan 8, 2024
0ff3f4d
dispute-coordinator: disabling in participation (#2637)
ordian Jan 9, 2024
d288c81
pallet-core-fellowship: import an unimported member on approve (#2883)
muharem Jan 9, 2024
06fa111
Contracts: Bump polkavm (#2884)
pgherveou Jan 9, 2024
69e2ae6
[ci] Revert reference to ci image (#2890)
alvicsam Jan 9, 2024
3811629
Snowbridge Rococo deployment updates (#2792)
claravanstaden Jan 9, 2024
14f4900
Bump the known_good_semver group with 1 update (#2881)
dependabot[bot] Jan 9, 2024
9d80735
Bump aquamarine from 0.3.2 to 0.4.0 (#2882)
dependabot[bot] Jan 9, 2024
49cea35
Remove bounds from `PrevalidateAttests` struct definition (#2886)
ggwpez Jan 9, 2024
ce4e549
Bump lycheeverse/lychee-action (#2875)
dependabot[bot] Jan 10, 2024
01ea45c
Fix deps for local docs build for Rust `1.75.0` (#2896)
nuke-web3 Jan 10, 2024
a419532
statement-distribution: validator disabling (#1841)
ordian Jan 10, 2024
d1f678c
Unique Usernames in Identity Pallet (#2651)
joepetrowski Jan 10, 2024
ccd5555
Bump parking_lot from 0.11.2 to 0.12.1 (#2901)
dependabot[bot] Jan 10, 2024
a56ad80
Bump trybuild from 1.0.83 to 1.0.88 (#2902)
dependabot[bot] Jan 10, 2024
af2e30e
Improve storage monitor API (#2899)
nazar-pc Jan 10, 2024
f2a750e
add fallback request for req-response protocols (#2771)
alindima Jan 10, 2024
6a80c10
PVF: Remove artifact persistence across restarts (#2895)
mrcnski Jan 10, 2024
bab0348
Update Snowbridge versions and prep for publishing (#2894)
claravanstaden Jan 10, 2024
c8112e2
frame-support: sp-runtime dependency updated (serde) (#2907)
michalkucharczyk Jan 11, 2024
578960f
Warp sync zombienet tests: add basic BEEFY checks (#2854)
serban300 Jan 11, 2024
f270b08
Move Cors data structure into reachable place (#2898)
nazar-pc Jan 11, 2024
fc749fa
Fix coretime migration (#2905)
antonva Jan 11, 2024
2bdf5dc
[ci] Remove unused jobs (#2502)
alvicsam Jan 11, 2024
c93f5ab
Cumulus test service cleanup (#2887)
skunert Jan 11, 2024
c45732d
Bump Swatinem/rust-cache from 2.7.1 to 2.7.2 (#2909)
dependabot[bot] Jan 11, 2024
c4380d6
Bump indexmap from 1.9.3 to 2.0.0 (#2911)
dependabot[bot] Jan 12, 2024
f7306d3
Add More HRMP Channel Opening Tests (#2915)
joepetrowski Jan 12, 2024
868788a
Kitchensink: Fix pallet_mmr config (#2919)
serban300 Jan 12, 2024
6579d6c
Bump actions/cache from 3.3.2 to 3.3.3 (#2918)
dependabot[bot] Jan 12, 2024
5ed0a75
Run bridges zombienet tests on CI (#2439)
svyatonik Jan 12, 2024
5208bed
Extract warp sync strategy from `ChainSync` (#2467)
dmitry-markin Jan 12, 2024
c421b87
Bump zombienet version `v1.3.91` (#2912)
pepoviola Jan 12, 2024
bd80dcf
Contracts: Translate .wat fixtures to rust (#2654)
pgherveou Jan 12, 2024
38a0ac0
Upgrade aquamarine to v0.5.0, v0.4.0 has yanked (#2921)
jasl Jan 13, 2024
127b9be
wasm-builder: bump toml from 0.8.2 to 0.8.8; replace ansi_term (#2914)
maksimryndin Jan 13, 2024
e879c48
Warp sync zombienet tests: update DB snapshot (#2928)
serban300 Jan 15, 2024
46090ff
Unbalanced and Balanced fungible conformance tests, and fungible fixe…
liamaharon Jan 15, 2024
53bcbb1
archive: Implement archive_unstable_storage (#1846)
lexnv Jan 15, 2024
ac30340
Bump the known_good_semver group with 1 update (#2926)
dependabot[bot] Jan 15, 2024
36a8318
Add missing crates to the workspace (#2932)
ggwpez Jan 15, 2024
f2fbba3
Contracts: stabilize sr25519 (#2920)
pgherveou Jan 15, 2024
0c166ae
Bump lycheeverse/lychee-action (#2900)
dependabot[bot] Jan 15, 2024
1c2db17
Some random fixes (#2936)
bkchr Jan 16, 2024
4c4963a
Bump Swatinem/rust-cache from 2.7.2 to 2.7.3 (#2925)
dependabot[bot] Jan 16, 2024
2cb39f8
XCM WeightTrader: Swap Fee Asset for Native Asset (#1845)
muharem Jan 16, 2024
a42a47f
Bump rococo relay and coretime-rococo to 1.6 (#2913)
seadanda Jan 16, 2024
05cfb02
CI check features (#1708)
aurexav Jan 16, 2024
82c057e
Bump walkdir from 2.3.3 to 2.4.0 (#2910)
dependabot[bot] Jan 16, 2024
ec7bfae
subsystem-bench: cache misses profiling (#2893)
AndreiEres Jan 16, 2024
8428f67
XCMv4 (#1230)
franciscoaguirre Jan 16, 2024
33d533e
Bump futures-util from 0.3.28 to 0.3.30 (#2952)
dependabot[bot] Jan 17, 2024
c01dbeb
Revert "pallet-core-fellowship: import an unimported member on approv…
joepetrowski Jan 17, 2024
8b28031
Add `Storage` to `PolkadotXcm` for People Chains (#2959)
NachoPal Jan 17, 2024
c1c0e62
contracts: Update to Polkavm 0.5 (#2945)
athei Jan 17, 2024
f80cfc2
[Backport] Version bumps from 1.6.0 release (#2965)
EgorPopelyaev Jan 17, 2024
f574868
Rococo Identity Migration Part 2 + Bug Fix (#2946)
joepetrowski Jan 18, 2024
f895409
Filter votes from disabled validators in `BackedCandidates` in proces…
tdimitrov Jan 18, 2024
d6c0f15
Fix typo in traits.rs (#2971)
smoelius Jan 18, 2024
38205bf
Downgrade logging to `debug` (#2980)
bkchr Jan 18, 2024
1113fce
Bump the known_good_semver group with 1 update (#2953)
dependabot[bot] Jan 18, 2024
9a8ef49
Fix typos (#2983)
cristiantroy Jan 18, 2024
13f2342
Bump prost from 0.11.9 to 0.12.3 (#2976)
dependabot[bot] Jan 18, 2024
dcc7652
Westend/Rococo Asset Hub: pay xcm fees with sufficient assets (#2978)
muharem Jan 18, 2024
0e124a0
pallet-contracts: Fix compilation on latest nightly (#2986)
bkchr Jan 18, 2024
b469960
approval-distribution: downgrade errors to debug (#2989)
sandreim Jan 18, 2024
f9bbe7d
contracts: Update weights (#2969)
Robbepop Jan 18, 2024
b4b523c
Fix contracts compilation with `CARGO_TARGET_DIR` set (#2927)
nazar-pc Jan 18, 2024
87927bb
`GenesisBuilder`: `arbitrary_precision` feature enabled for `serde_js…
michalkucharczyk Jan 18, 2024
9db9211
More tests and checks confirming that `ledger.controller` is always c…
gpestana Jan 18, 2024
697c2c3
Update `translate` to use `defensive!` (#2985)
liamaharon Jan 19, 2024
47a3faa
Pvf thiserror (#2958)
maksimryndin Jan 19, 2024
66b2fa2
Bump libc from 0.2.149 to 0.2.152 (#2994)
dependabot[bot] Jan 19, 2024
50a2e28
Enable cross-chain NFT transfers on asset-hub (#2796)
Szegoo Jan 19, 2024
2e9b440
Contract fixtures tests: fixe nightly version (#3000)
ggwpez Jan 19, 2024
320b528
Update bridges subtree (#2996)
serban300 Jan 19, 2024
e02c520
Update Wasm benchmarks (#2957)
Robbepop Jan 19, 2024
4fb2a55
Make `Slot` and `SlotDuration` transparent (#2999)
nazar-pc Jan 19, 2024
f2336d3
better debugging for accountid32 in debug build (#2990)
pgherveou Jan 19, 2024
84ff0a9
Bump h2 from 0.3.21 to 0.3.24 (#3004)
dependabot[bot] Jan 19, 2024
3b7a8c7
Adding `try_state` hook for Tips pallet (#1871)
Doordashcon Jan 20, 2024
a5370fb
Bump comfy-table from 7.0.1 to 7.1.0 (#2993)
dependabot[bot] Jan 20, 2024
caa987d
Adder Parachain: Accept output file argument to `export-genesis-*` su…
JoshOrndorff Jan 20, 2024
21ef949
Use clone instead of fork on pvf (#2477)
jpserrat Jan 21, 2024
d37a456
Make candidate validation bounded again (#2125)
s0me0ne-unkn0wn Jan 21, 2024
757ae37
Switch All `construct_runtime`s to New Syntax (#2979)
joepetrowski Jan 22, 2024
e2caa81
Review: Remove audit rules (#3010)
bkchr Jan 22, 2024
d53534c
Enable async backing on asset-hub-rococo (#2826)
mrcnski Jan 22, 2024
deb72f4
sc-informant: Respect `--disable-log-color` (#3009)
bkchr Jan 22, 2024
10be8a3
Bump memmap2 from 0.5.10 to 0.9.3 (#3012)
dependabot[bot] Jan 22, 2024
c83ccda
Adds missing feature flags in UI Test update script (#3015)
codekitz Jan 22, 2024
ac7f057
Merge branch 'master' into update-from-master-22-jan
Jan 22, 2024
7f3563d
remove snowbridge in polkadot-sdk
Jan 22, 2024
9ad79b4
fix merge damage
Jan 22, 2024
88ee98f
merge damage
Jan 22, 2024
6391978
merge damage
Jan 22, 2024
3029280
Implement wrapping of EPM types (#1633)
wirednkod Jan 22, 2024
bbfff66
Bump wasm-instrument from 0.3.0 to 0.4.0 (#1294)
dependabot[bot] Jan 22, 2024
37ce47a
Merge branch 'master' into update-from-master-22-jan
Jan 22, 2024
95ff9b2
approval-voting: Move verbose log from debug to tracing (#3019)
alexggh Jan 22, 2024
4c10fd2
Move cryptographic hashing procedures to crypto folder. (#2306)
davxy Jan 22, 2024
5290031
fix imports
Jan 23, 2024
785883f
fix test
Jan 23, 2024
9117a24
Merge branch 'master' into update-from-master-22-jan
Jan 23, 2024
3ad3a9c
update lock file
Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
subsystem benchmarks: add cpu profiling (paritytech#2734)
Ready-to-merge version of
paritytech#2601

- Added optional CPU profiling
- Updated instructions how to set up Prometheus, Pyroscope and Graphana
- Added a flamegraph dashboard
<img width="1470" alt="image"
src="https://github.com/paritytech/polkadot-sdk/assets/27277055/c8f3b33d-3c01-4ec0-ac34-72d52325b6e6">

---------

Co-authored-by: ordian <[email protected]>
  • Loading branch information
AndreiEres and ordian authored Dec 19, 2023
commit 526c81b138220dbff9c847508d3db32e33145bdd
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions polkadot/node/subsystem-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ serde = "1.0.192"
serde_yaml = "0.9"
paste = "1.0.14"
orchestra = { version = "0.3.3", default-features = false, features = ["futures_channel"] }
pyroscope = "0.5.7"
pyroscope_pprofrs = "0.2.7"

[features]
default = []
87 changes: 57 additions & 30 deletions polkadot/node/subsystem-bench/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Subsystem benchmark client

Run parachain consensus stress and performance tests on your development machine.
Run parachain consensus stress and performance tests on your development machine.

## Motivation

Expand All @@ -26,17 +26,26 @@ The output binary will be placed in `target/testnet/subsystem-bench`.

### Test metrics

Subsystem, CPU usage and network metrics are exposed via a prometheus endpoint during the test execution.
Subsystem, CPU usage and network metrics are exposed via a prometheus endpoint during the test execution.
A small subset of these collected metrics are displayed in the CLI, but for an in depth analysys of the test results,
a local Grafana/Prometheus stack is needed.

### Run Prometheus, Pyroscope and Graphana in Docker

If docker is not usable, then follow the next sections to manually install Prometheus, Pyroscope and Graphana on your machine.

```bash
cd polkadot/node/subsystem-bench/docker
docker compose up
```

### Install Prometheus

Please follow the [official installation guide](https://prometheus.io/docs/prometheus/latest/installation/) for your
platform/OS.

After succesfully installing and starting up Prometheus, we need to alter it's configuration such that it
will scrape the benchmark prometheus endpoint `127.0.0.1:9999`. Please check the prometheus official documentation
will scrape the benchmark prometheus endpoint `127.0.0.1:9999`. Please check the prometheus official documentation
regarding the location of `prometheus.yml`. On MacOS for example the full path `/opt/homebrew/etc/prometheus.yml`

prometheus.yml:
Expand All @@ -57,13 +66,29 @@ scrape_configs:

To complete this step restart Prometheus server such that it picks up the new configuration.

### Install and setup Grafana
### Install Pyroscope

To collect CPU profiling data, you must be running the Pyroscope server.
Follow the [installation guide](https://grafana.com/docs/pyroscope/latest/get-started/)
relevant to your operating system.

### Install Grafana

Follow the [installation guide](https://grafana.com/docs/grafana/latest/setup-grafana/installation/) relevant
to your operating system.

Once you have the installation up and running, configure the local Prometheus as a data source by following
[this guide](https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/)
### Setup Grafana

Once you have the installation up and running, configure the local Prometheus and Pyroscope (if needed)
as data sources by following these guides:

- [Prometheus](https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/)
- [Pyroscope](https://grafana.com/docs/grafana/latest/datasources/grafana-pyroscope/)

If you are running the servers in Docker, use the following URLs:

- Prometheus `http://prometheus:9090/`
- Pyroscope `http://pyroscope:4040/`

#### Import dashboards

Expand All @@ -86,26 +111,29 @@ Commands:
```

Note: `test-sequence` is a special test objective that wraps up an arbitrary number of test objectives. It is tipically
used to run a suite of tests defined in a `yaml` file like in this [example](examples/availability_read.yaml).
used to run a suite of tests defined in a `yaml` file like in this [example](examples/availability_read.yaml).

### Standard test options

```
Options:
--network <NETWORK> The type of network to be emulated [default: ideal] [possible values:
ideal, healthy, degraded]
--n-cores <N_CORES> Number of cores to fetch availability for [default: 100]
--n-validators <N_VALIDATORS> Number of validators to fetch chunks from [default: 500]
--min-pov-size <MIN_POV_SIZE> The minimum pov size in KiB [default: 5120]
--max-pov-size <MAX_POV_SIZE> The maximum pov size bytes [default: 5120]
-n, --num-blocks <NUM_BLOCKS> The number of blocks the test is going to run [default: 1]
-p, --peer-bandwidth <PEER_BANDWIDTH> The bandwidth of simulated remote peers in KiB
-b, --bandwidth <BANDWIDTH> The bandwidth of our simulated node in KiB
--peer-error <PEER_ERROR> Simulated conection error ratio [0-100]
--peer-min-latency <PEER_MIN_LATENCY> Minimum remote peer latency in milliseconds [0-5000]
--peer-max-latency <PEER_MAX_LATENCY> Maximum remote peer latency in milliseconds [0-5000]
-h, --help Print help
-V, --version Print version
--network <NETWORK> The type of network to be emulated [default: ideal] [possible values:
ideal, healthy, degraded]
--n-cores <N_CORES> Number of cores to fetch availability for [default: 100]
--n-validators <N_VALIDATORS> Number of validators to fetch chunks from [default: 500]
--min-pov-size <MIN_POV_SIZE> The minimum pov size in KiB [default: 5120]
--max-pov-size <MAX_POV_SIZE> The maximum pov size bytes [default: 5120]
-n, --num-blocks <NUM_BLOCKS> The number of blocks the test is going to run [default: 1]
-p, --peer-bandwidth <PEER_BANDWIDTH> The bandwidth of simulated remote peers in KiB
-b, --bandwidth <BANDWIDTH> The bandwidth of our simulated node in KiB
--peer-error <PEER_ERROR> Simulated conection error ratio [0-100]
--peer-min-latency <PEER_MIN_LATENCY> Minimum remote peer latency in milliseconds [0-5000]
--peer-max-latency <PEER_MAX_LATENCY> Maximum remote peer latency in milliseconds [0-5000]
--profile Enable CPU Profiling with Pyroscope
--pyroscope-url <PYROSCOPE_URL> Pyroscope Server URL [default: http://localhost:4040]
--pyroscope-sample-rate <PYROSCOPE_SAMPLE_RATE> Pyroscope Sample Rate [default: 113]
-h, --help Print help
-V, --version Print version
```

These apply to all test objectives, except `test-sequence` which relies on the values being specified in a file.
Expand All @@ -123,8 +151,8 @@ Benchmark availability recovery strategies
Usage: subsystem-bench data-availability-read [OPTIONS]

Options:
-f, --fetch-from-backers Turbo boost AD Read by fetching the full availability datafrom backers first. Saves CPU
as we don't need to re-construct from chunks. Tipically this is only faster if nodes
-f, --fetch-from-backers Turbo boost AD Read by fetching the full availability datafrom backers first. Saves CPU
as we don't need to re-construct from chunks. Tipically this is only faster if nodes
have enough bandwidth
-h, --help Print help
```
Expand Down Expand Up @@ -152,8 +180,8 @@ Let's run an availabilty read test which will recover availability for 10 cores
node validator network.

```
target/testnet/subsystem-bench --n-cores 10 data-availability-read
[2023-11-28T09:01:59Z INFO subsystem_bench::core::display] n_validators = 500, n_cores = 10, pov_size = 5120 - 5120,
target/testnet/subsystem-bench --n-cores 10 data-availability-read
[2023-11-28T09:01:59Z INFO subsystem_bench::core::display] n_validators = 500, n_cores = 10, pov_size = 5120 - 5120,
error = 0, latency = None
[2023-11-28T09:01:59Z INFO subsystem-bench::availability] Generating template candidate index=0 pov_size=5242880
[2023-11-28T09:01:59Z INFO subsystem-bench::availability] Created test environment.
Expand All @@ -167,8 +195,8 @@ node validator network.
[2023-11-28T09:02:07Z INFO subsystem_bench::availability] All blocks processed in 6001ms
[2023-11-28T09:02:07Z INFO subsystem_bench::availability] Throughput: 51200 KiB/block
[2023-11-28T09:02:07Z INFO subsystem_bench::availability] Block time: 6001 ms
[2023-11-28T09:02:07Z INFO subsystem_bench::availability]
[2023-11-28T09:02:07Z INFO subsystem_bench::availability]

Total received from network: 66 MiB
Total sent to network: 58 KiB
Total subsystem CPU usage 4.16s
Expand All @@ -192,8 +220,7 @@ view the test progress in real time by accessing [this link](http://localhost:30

Now run
`target/testnet/subsystem-bench test-sequence --path polkadot/node/subsystem-bench/examples/availability_read.yaml`
and view the metrics in real time and spot differences between different `n_valiator` values.

and view the metrics in real time and spot differences between different `n_validators` values.
## Create new test objectives

This tool is intended to make it easy to write new test objectives that focus individual subsystems,
Expand Down
35 changes: 35 additions & 0 deletions polkadot/node/subsystem-bench/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
grafana:
image: grafana/grafana-enterprise:latest
container_name: grafana
restart: always
networks:
- subsystem-bench
ports:
- "3000:3000"

prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
networks:
- subsystem-bench
volumes:
- ./prometheus:/etc/prometheus
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "9090:9090"
- "9999:9999"

pyroscope:
container_name: pyroscope
image: grafana/pyroscope:latest
restart: always
networks:
- subsystem-bench
ports:
- "4040:4040"

networks:
subsystem-bench:
11 changes: 11 additions & 0 deletions polkadot/node/subsystem-bench/docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
global:
scrape_interval: 5s

scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "subsystem-bench"
scrape_interval: 0s500ms
static_configs:
- targets: ['host.docker.internal:9999']
70 changes: 70 additions & 0 deletions polkadot/node/subsystem-bench/grafana/cpu-profiling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "bc3bc04f-85f9-464b-8ae3-fbe0949063f6"
},
"gridPos": {
"h": 18,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"targets": [
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "bc3bc04f-85f9-464b-8ae3-fbe0949063f6"
},
"groupBy": [],
"labelSelector": "{service_name=\"subsystem-bench\"}",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"queryType": "profile",
"refId": "A"
}
],
"title": "CPU Profiling",
"type": "flamegraph"
}
],
"refresh": "",
"schemaVersion": 38,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "CPU Profiling",
"uid": "c31191d5-fe2b-49e2-8b1c-1451f31d1628",
"version": 1,
"weekStart": ""
}
29 changes: 29 additions & 0 deletions polkadot/node/subsystem-bench/src/subsystem-bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
//! CI regression testing.
use clap::Parser;
use color_eyre::eyre;
use pyroscope::PyroscopeAgent;
use pyroscope_pprofrs::{pprof_backend, PprofConfig};

use colored::Colorize;
use std::{path::Path, time::Duration};
Expand Down Expand Up @@ -76,12 +78,34 @@ struct BenchCli {
/// Maximum remote peer latency in milliseconds [0-5000].
pub peer_max_latency: Option<u64>,

#[clap(long, default_value_t = false)]
/// Enable CPU Profiling with Pyroscope
pub profile: bool,

#[clap(long, requires = "profile", default_value_t = String::from("http://localhost:4040"))]
/// Pyroscope Server URL
pub pyroscope_url: String,

#[clap(long, requires = "profile", default_value_t = 113)]
/// Pyroscope Sample Rate
pub pyroscope_sample_rate: u32,

#[command(subcommand)]
pub objective: cli::TestObjective,
}

impl BenchCli {
fn launch(self) -> eyre::Result<()> {
let agent_running = if self.profile {
let agent = PyroscopeAgent::builder(self.pyroscope_url.as_str(), "subsystem-bench")
.backend(pprof_backend(PprofConfig::new().sample_rate(self.pyroscope_sample_rate)))
.build()?;

Some(agent.start()?)
} else {
None
};

let configuration = self.standard_configuration;
let mut test_config = match self.objective {
TestObjective::TestSequence(options) => {
Expand Down Expand Up @@ -165,6 +189,11 @@ impl BenchCli {
env.runtime()
.block_on(availability::benchmark_availability_read(&mut env, state));

if let Some(agent_running) = agent_running {
let agent_ready = agent_running.stop()?;
agent_ready.shutdown();
}

Ok(())
}
}
Expand Down