forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add subsystem benchmarks for
availability-distribution
and `biftiel…
…d-distribution` (availability write) (paritytech#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>
- Loading branch information
Showing
22 changed files
with
1,965 additions
and
799 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
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
36 changes: 12 additions & 24 deletions
36
polkadot/node/subsystem-bench/examples/availability_read.yaml
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 |
---|---|---|
@@ -1,57 +1,45 @@ | ||
TestConfiguration: | ||
# Test 1 | ||
- objective: !DataAvailabilityRead | ||
fetch_from_backers: false | ||
fetch_from_backers: true | ||
n_validators: 300 | ||
n_cores: 20 | ||
min_pov_size: 5120 | ||
max_pov_size: 5120 | ||
peer_bandwidth: 52428800 | ||
bandwidth: 52428800 | ||
latency: | ||
min_latency: | ||
secs: 0 | ||
nanos: 1000000 | ||
max_latency: | ||
secs: 0 | ||
nanos: 100000000 | ||
error: 3 | ||
mean_latency_ms: 100 | ||
std_dev: 1 | ||
num_blocks: 3 | ||
connectivity: 90 | ||
|
||
# Test 2 | ||
- objective: !DataAvailabilityRead | ||
fetch_from_backers: false | ||
fetch_from_backers: true | ||
n_validators: 500 | ||
n_cores: 20 | ||
min_pov_size: 5120 | ||
max_pov_size: 5120 | ||
peer_bandwidth: 52428800 | ||
bandwidth: 52428800 | ||
latency: | ||
min_latency: | ||
secs: 0 | ||
nanos: 1000000 | ||
max_latency: | ||
secs: 0 | ||
nanos: 100000000 | ||
error: 3 | ||
mean_latency_ms: 100 | ||
std_dev: 1 | ||
num_blocks: 3 | ||
connectivity: 90 | ||
|
||
# Test 3 | ||
- objective: !DataAvailabilityRead | ||
fetch_from_backers: false | ||
fetch_from_backers: true | ||
n_validators: 1000 | ||
n_cores: 20 | ||
min_pov_size: 5120 | ||
max_pov_size: 5120 | ||
peer_bandwidth: 52428800 | ||
bandwidth: 52428800 | ||
latency: | ||
min_latency: | ||
secs: 0 | ||
nanos: 1000000 | ||
max_latency: | ||
secs: 0 | ||
nanos: 100000000 | ||
error: 3 | ||
mean_latency_ms: 100 | ||
std_dev: 1 | ||
num_blocks: 3 | ||
connectivity: 90 |
15 changes: 15 additions & 0 deletions
15
polkadot/node/subsystem-bench/examples/availability_write.yaml
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,15 @@ | ||
TestConfiguration: | ||
# Test 1kV, 200 cores, max Pov | ||
- objective: DataAvailabilityWrite | ||
n_validators: 1000 | ||
n_cores: 200 | ||
max_validators_per_core: 5 | ||
min_pov_size: 5120 | ||
max_pov_size: 5120 | ||
peer_bandwidth: 52428800 | ||
bandwidth: 52428800 | ||
latency: | ||
mean_latency_ms: 30 | ||
std_dev: 2.0 | ||
connectivity: 75 | ||
num_blocks: 3 |
57 changes: 57 additions & 0 deletions
57
polkadot/node/subsystem-bench/src/availability/av_store_helpers.rs
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,57 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
use super::*; | ||
|
||
use polkadot_node_metrics::metrics::Metrics; | ||
|
||
use polkadot_node_core_av_store::Config; | ||
use polkadot_node_subsystem_util::database::Database; | ||
|
||
use polkadot_node_core_av_store::AvailabilityStoreSubsystem; | ||
|
||
mod columns { | ||
pub const DATA: u32 = 0; | ||
pub const META: u32 = 1; | ||
pub const NUM_COLUMNS: u32 = 2; | ||
} | ||
|
||
const TEST_CONFIG: Config = Config { col_data: columns::DATA, col_meta: columns::META }; | ||
|
||
struct DumbOracle; | ||
|
||
impl sp_consensus::SyncOracle for DumbOracle { | ||
fn is_major_syncing(&self) -> bool { | ||
false | ||
} | ||
|
||
fn is_offline(&self) -> bool { | ||
unimplemented!("oh no!") | ||
} | ||
} | ||
|
||
pub fn new_av_store(dependencies: &TestEnvironmentDependencies) -> AvailabilityStoreSubsystem { | ||
let metrics = Metrics::try_register(&dependencies.registry).unwrap(); | ||
|
||
AvailabilityStoreSubsystem::new(test_store(), TEST_CONFIG, Box::new(DumbOracle), metrics) | ||
} | ||
|
||
fn test_store() -> Arc<dyn Database> { | ||
let db = kvdb_memorydb::create(columns::NUM_COLUMNS); | ||
let db = | ||
polkadot_node_subsystem_util::database::kvdb_impl::DbAdapter::new(db, &[columns::META]); | ||
Arc::new(db) | ||
} |
Oops, something went wrong.