Skip to content

SDK: multi-account pipeline submission#435

Closed
x3c41a wants to merge 6 commits into
ndk/sdk-pipeline-submitterfrom
ndk/sdk-multi-account-pipeline
Closed

SDK: multi-account pipeline submission#435
x3c41a wants to merge 6 commits into
ndk/sdk-pipeline-submitterfrom
ndk/sdk-multi-account-pipeline

Conversation

@x3c41a
Copy link
Copy Markdown
Contributor

@x3c41a x3c41a commented Apr 21, 2026

Multi-account does not beat single-account on Versi

  1. For 500 x 128KB throughput flat at ~5 tx/s; per-user finalization grows 37s → 72s as accounts go 1 → 4.
  2. Fro 1000 * 100KB single-account already hits ~27 tx/s; multi-account does not help.

Benchmark (Versi, 4 RPCs)

1000 × 10 KB (10 MB total, headroom under the 512 tx/block cap)

1000 × 10 KB

Single-account already reaches ~27 tx/s here, well below the 512 tx/block hard cap, which suggests pool / RPC / block-production throughput is the limit rather than nonce contention. Multi-account does not push past it.

500 × 128 KB (62.5 MB, block fully saturated at ~73 tx/block)

500 × 128 KB

x3c41a and others added 2 commits April 21, 2026 16:11
Add pipelineStoreMulti() that splits items across N accounts and runs
one pipelineStore per account concurrently. Each account maintains its
own nonce chain, eliminating single-account pool contention.

- MultiAccountSigner and MultiPipelineResult types
- Round-robin item distribution across accounts
- Aggregated throughput and per-account result reporting
- Stress test --accounts flag for N derived submitters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite pipelineStoreMulti to use a single chainHead subscription
shared across all accounts instead of N independent pipelineStore
instances. The previous approach opened N chainHead subscriptions
which caused WS connection overload on Versi RPC nodes.

Fix authorization nonce collision in stress test: fetch authorizer
nonce once and increment manually for each auth tx, instead of
relying on pool-based system_accountNextIndex between 500ms delays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@x3c41a x3c41a requested a review from karolk91 April 22, 2026 07:28
x3c41a added 4 commits April 25, 2026 20:06
Pipeline now records the first-broadcast timestamp for each item and
the time it appears at best/finalized blocks, exposing inclusion and
finalization latency distributions (count/min/max/mean/p50/p90/p95/p99
plus the raw per-item arrays) in PipelineResult.

pipeline-stress prints the percentile summary, accepts --output-json
to dump the full result, and a small matplotlib script plots
throughput + latency percentiles + per-item CDF from one or more JSON
files.
pipelineStoreMulti now records the same first-broadcast / inclusion /
finalization timestamps that pipelineStore does, on a per-account basis.
Each per-account PipelineResult exposes its own inclusionLatency and
finalizationLatency, and the aggregated MultiPipelineResult exposes
distributions computed over the concatenated samples from every account
(plus the raw arrays for plotting).

Re-ran the original PR scenarios on Versi (4 RPCs, single-broadcast).

500 items × 128 KB:
  accts=1: 1m42s, 4.90 tx/s, 627 KB/s
  accts=2: 1m30s, 5.55 tx/s, 710 KB/s   <- best, 13% over 1-acct
  accts=3: 2m02s, 4.09 tx/s, 523 KB/s
  accts=4: 1m37s, 5.14 tx/s, 658 KB/s

100 items × 128 KB:
  accts=1: 47s, 2.13 tx/s, 273 KB/s
  accts=2: 55s, 1.82 tx/s, 233 KB/s
  accts=3: 39s, 2.58 tx/s, 330 KB/s     <- best
  accts=4: 50s, 2.01 tx/s, 257 KB/s

Inclusion p50 grows roughly linearly with account count (10s → 18s →
30s → 39s at 500x128KB) because all accounts share the same block
budget — multi-account is a way to split nonces, not capacity.
Two-panel layout matching #420: left = finalized throughput
(tx/s + KB/s), right = stacked latency where each colour band shows
the additional time at the next percentile (p50 / p90-p50 / p95-p90 /
p99-p95). Defaults to finalization latency; --latency inclusion
switches to broadcast-to-best-block.
Adds a smaller-payload sweep (1000 × 10 KB across 1/2/3/4 accounts)
where the block has plenty of slack vs the 73 tx/block ceiling at
128 KB. Single-account already reaches ~27 tx/s and multi-account
plateaus or regresses, suggesting the chain itself (block production
or pool throughput) is the cap in our test environment, not nonce
contention.

Drops the 100 x 128 KB plot since it told the same saturation story
as the 500 x 128 KB one.
@x3c41a
Copy link
Copy Markdown
Contributor Author

x3c41a commented Apr 28, 2026

Closing. Multi-account does not beat single-account on Versi

@x3c41a x3c41a closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant