Skip to content

[DNM] Add statement-latency-bench example#3239

Open
AndreiEres wants to merge 11 commits intomainfrom
ae-statement-latency-bench
Open

[DNM] Add statement-latency-bench example#3239
AndreiEres wants to merge 11 commits intomainfrom
ae-statement-latency-bench

Conversation

@AndreiEres
Copy link
Copy Markdown
Contributor

Summary

  • Smoldot-based Node.js port of polkadot-sdk/substrate/client/statement-store/statement-latency-bench.
  • Each virtual client runs its own smoldot light client (one libp2p peer per client). No --rpc-endpoints; bootnodes go via --bootnodes and are spliced into the chain spec.
  • Full statement codec parity with lib/src/network/codec/statement.rs and sp_statement_store::Statement::encoded: sr25519 proof + priority (ts << 32) | nonce + channel + topic + data.
  • Output lines mirror bench.rs so existing log parsers keep working.
  • Marked DNM — depends on the statement-store example ([DNM] Add statement-store example #3143) being available in the repo and needs end-to-end testing against a real local network.

Test plan

  • Start a local relay + parachain (e.g. polkadot-omni-node with --bootnodes).
  • Extract relay.json and parachain.json (id=parachain, bootnodes set), as in examples/statement-chat/dev.sh.
  • Run a small bench:
    node bench.js \
      --chain-spec ./parachain.json \
      --relay-chain-spec ./relay.json \
      --num-clients 4 --num-rounds 2 --messages-pattern "3:128" \
      --receive-timeout-ms 30000 --interval-ms 5000
    
    Expect Benchmark Finished: rounds_with_any_success=2 total_rounds=2 total_clients=4 and a non-empty Benchmark Results line.
  • Cross-codec check: run a single JS client alongside the Rust bench.rs against the same parachain to confirm statements signed/encoded by JS are accepted by the canonical statement-store implementation.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​polkadot/​util-crypto@​13.5.9401008091100
Addednpm/​@​polkadot/​keyring@​13.5.91001007891100
Addednpm/​@​polkadot/​util@​13.5.9991008091100

View full report

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 8, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant