Add subsystem benchmarks for availability-distribution and biftield-distribution (availability write) (#2970)

Introduce a new test objective : `DataAvailabilityWrite`.

The new benchmark measures the network and cpu usage of
`availability-distribution`, `biftield-distribution` and
`availability-store` subsystems from the perspective of a validator node
during the process when candidates are made available.

Additionally I refactored the networking emulation to support bandwidth
acounting and limits of incoming and outgoing requests.

Screenshot of succesful run


<img width="1293" alt="Screenshot 2024-01-17 at 19 17 44"
src="https://github.com/paritytech/polkadot-sdk/assets/54316454/fde11280-e25b-4dc3-9dc9-d4b9752f9b7a">

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
Andrei Sandu
2024-01-25 19:02:24 +02:00
committed by GitHub
parent 73fd8cd717
commit 47e46d178b
22 changed files with 1967 additions and 801 deletions
+14 -4
View File
@@ -22,12 +22,16 @@ polkadot-node-subsystem-types = { path = "../subsystem-types" }
polkadot-node-primitives = { path = "../primitives" }
polkadot-primitives = { path = "../../primitives" }
polkadot-node-network-protocol = { path = "../network/protocol" }
polkadot-availability-recovery = { path = "../network/availability-recovery", features = ["subsystem-benchmarks"] }
polkadot-availability-recovery = { path = "../network/availability-recovery", features=["subsystem-benchmarks"]}
polkadot-availability-distribution = { path = "../network/availability-distribution"}
polkadot-node-core-av-store = { path = "../core/av-store"}
polkadot-node-core-chain-api = { path = "../core/chain-api"}
polkadot-availability-bitfield-distribution = { path = "../network/bitfield-distribution"}
color-eyre = { version = "0.6.1", default-features = false }
polkadot-overseer = { path = "../overseer" }
polkadot-overseer = { path = "../overseer" }
colored = "2.0.4"
assert_matches = "1.5"
async-trait = "0.1.74"
async-trait = "0.1.57"
sp-keystore = { path = "../../../substrate/primitives/keystore" }
sc-keystore = { path = "../../../substrate/client/keystore" }
sp-core = { path = "../../../substrate/primitives/core" }
@@ -39,7 +43,12 @@ polkadot-erasure-coding = { package = "polkadot-erasure-coding", path = "../../e
log = "0.4.17"
env_logger = "0.9.0"
rand = "0.8.5"
parity-scale-codec = { version = "3.6.1", features = ["derive", "std"] }
# `rand` only supports uniform distribution, we need normal distribution for latency.
rand_distr = "0.4.3"
bitvec="1.0.1"
kvdb-memorydb = "0.13.0"
parity-scale-codec = { version = "3.6.1", features = ["std", "derive"] }
tokio = "1.24.2"
clap-num = "1.0.2"
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
@@ -47,6 +56,7 @@ sp-keyring = { path = "../../../substrate/primitives/keyring" }
sp-application-crypto = { path = "../../../substrate/primitives/application-crypto" }
sc-network = { path = "../../../substrate/client/network" }
sc-service = { path = "../../../substrate/client/service" }
sp-consensus = { path = "../../../substrate/primitives/consensus/common" }
polkadot-node-metrics = { path = "../metrics" }
itertools = "0.11.0"
polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" }