Skip to content

Conversation

@AndreiEres
Copy link
Contributor

@AndreiEres AndreiEres commented Dec 4, 2025

Description

Fixes #10443

Adds a latency benchmark for the statement store to measure performance at different message rates. In the original issue, we discussed a messages-per-second approach, but in the benchmark we used a configurable interval that can't be less than latency, as we don't send the next message before we receive the current one. This is sufficient for our current needs; further, the benchmark can be modified to follow the MPS approach.

Additionally, updated people-westend-runtime to mock statement validation.

Integration

No downstream integration changes required.

@AndreiEres AndreiEres added R0-no-crate-publish-required The change does not require any crates to be re-published. T12-benchmarks This PR/Issue is related to benchmarking and weights. labels Dec 5, 2025
@pepoviola pepoviola changed the title statement-store: Add latency bench [DNM] statement-store: Add latency bench Dec 9, 2025
@pepoviola pepoviola marked this pull request as ready for review December 9, 2025 08:42
@pepoviola pepoviola requested review from a team as code owners December 9, 2025 08:42
@AndreiEres AndreiEres changed the title [DNM] statement-store: Add latency bench statement-store: Add latency bench Jan 6, 2026
@AndreiEres
Copy link
Contributor Author

/cmd prdoc --audience node_dev --bump patch

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/20745012459
Failed job name: cargo-clippy

@AndreiEres AndreiEres added T4-runtime_API This PR/Issue is related to runtime APIs. and removed R0-no-crate-publish-required The change does not require any crates to be re-published. labels Jan 6, 2026
@AndreiEres AndreiEres requested a review from alexggh January 6, 2026 17:35
Comment on lines +1156 to +1157
SignatureVerificationResult::Invalid => Err(InvalidStatement::BadProof),
_ => Ok(ValidStatement { max_count: 100_000, max_size: 1_000_000 }),
Copy link
Contributor

Choose a reason for hiding this comment

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

@KarimJedda Do you think it is ok for westend to allow anybody to store a bit amount of statement for westend? or should we protect against it with some faucet or something?

Choose a reason for hiding this comment

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

I'm a fan of making it free until the data tells us we need to introduce a cost. Given it's really just a devnet, let's make it free, unless this could have indirect consequences on how logic gets tested further down the line (ie some code using this assuming things are free etc)

Copy link
Contributor

@s0me0ne-unkn0wn s0me0ne-unkn0wn left a comment

Choose a reason for hiding this comment

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

Looks good! 👍
Left just a couple of nits.

.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_micros() as u64;
let test_run_id = Arc::new(test_run_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use Arc here? It's a primitive u64, it implements Copy, could be used as-is.

let timestamp_micros = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_micros() as u32;
Copy link
Contributor

Choose a reason for hiding this comment

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

The current UNIX timestamp at the time of review is 1 768 486 771; in micros, that is 1 768 486 771 000. 2³² is 4 294 967 296, so this conversion definitely overflows. I have nothing against it if made deliberately, just pointing in case something was missed.

for round in 0..config.num_rounds {
let round_start = std::time::Instant::now();

let send_start = std::time::Instant::now();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let send_start = std::time::Instant::now();
let send_start = round_start;

(A nittest nit, but otherwise they might end up being different and a perfectionist's heart would bleed)

@AndreiEres AndreiEres added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit b583ea2 Jan 15, 2026
253 of 263 checks passed
@AndreiEres AndreiEres deleted the AndreiEres/latency-benchmark branch January 15, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T4-runtime_API This PR/Issue is related to runtime APIs. T12-benchmarks This PR/Issue is related to benchmarking and weights.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

statement-store: Add MPS benchmark

7 participants