Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 75 commits into from
Jan 25, 2024

Conversation

sandreim
Copy link
Contributor

@sandreim sandreim commented Jan 17, 2024

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

Screenshot 2024-01-17 at 19 17 44

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@sandreim sandreim added T0-node This PR/Issue is related to the topic “node”. T10-tests This PR/Issue is related to tests. T12-benchmarks This PR/Issue is related to benchmarking and weights. labels Jan 17, 2024
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Copy link
Contributor

@alexggh alexggh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, looks good to me.

polkadot/node/subsystem-bench/Cargo.toml Outdated Show resolved Hide resolved
polkadot/node/subsystem-bench/src/core/environment.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@alindima alindima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, nice work!

polkadot/node/subsystem-bench/src/availability/mod.rs Outdated Show resolved Hide resolved
polkadot/node/subsystem-bench/src/availability/mod.rs Outdated Show resolved Hide resolved
polkadot/node/subsystem-bench/src/availability/mod.rs Outdated Show resolved Hide resolved
Comment on lines +233 to +240
state.backed_candidates.push(
candidate_hashes
.get(&Hash::repeat_byte(block_num as u8))
.expect("just inserted above")
.get(0)
.expect("just inserted above")
.clone(),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could just store the candidate hash in the backed_candidates map.

Copy link
Contributor Author

@sandreim sandreim Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand correctly, but backed_candidates is a vec ( per relay block candidates backed by the node under test) and it stores CandidateReceipt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, in my mind vec is also a map from an integer to smth :D

i am suggesting based on my reading of the code, that we could only store the CandidateHash in the backed_candidates instead of the full receipt and then use the candidate index to fetch the receipt from the candidate_receipt_templates, if that makes sense.

polkadot/node/subsystem-bench/src/availability/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
…reim/availability-write-bench

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5029861

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@sandreim sandreim added this pull request to the merge queue Jan 25, 2024
Merged via the queue into master with commit 47e46d1 Jan 25, 2024
122 of 125 checks passed
@sandreim sandreim deleted the sandreim/availability-write-bench branch January 25, 2024 17:52
github-merge-queue bot pushed a commit that referenced this pull request Jan 29, 2024
#2970 accidentally added a crate twice to the workspace. Now extending
the workspace check to explicitly error then.

I think the check should also be required now.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/what-are-subsystem-benchmarks/8212/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”. T10-tests This PR/Issue is related to tests. T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants