Skip to content

feat(loadtest): add --send-rpc-url and --rate-limit-ramp-duration - #993

Merged
praetoriansentry merged 2 commits into
mainfrom
feat/loadtest-send-rpc-url
Aug 20, 2026
Merged

feat(loadtest): add --send-rpc-url and --rate-limit-ramp-duration#993
praetoriansentry merged 2 commits into
mainfrom
feat/loadtest-send-rpc-url

Conversation

@praetoriansentry

Copy link
Copy Markdown
Member

Description

Two additions to polycli loadtest:

--send-rpc-url — a secondary RPC endpoint used only to broadcast transactions (eth_sendRawTransaction, or eth_sendRawTransactionPrivate when combined with --private-txs). All other calls — gas estimation, chain ID, nonces, receipts, block polling, and account funding — stay on --rpc-url. This supports:

  • Private mempool endpoints that only accept eth_sendRawTransactionPrivate.
  • Gossip-only broadcasters (e.g. light clients on the p2p network) that can broadcast transactions but have no chain state to answer other queries.

The send endpoint gets its own HTTP connection pool (sized 2×concurrency, same as the primary) so broadcasts don't contend with read traffic, and falls back to the primary client when the flag is unset. Like --private-txs, it is limited to the modes that broadcast explicitly (transaction, blob, contract-call, recall) and rejected at config validation for the binding-based modes.

--rate-limit-ramp-duration — linearly ramps the rate limit from max(1% of --rate-limit, 1 TPS) up to the full --rate-limit over the given duration (e.g. 3m), then holds steady. Useful for warming up a network gradually instead of starting at full load. Mutually exclusive with --adaptive-rate-limit, which controls the same limiter based on txpool feedback.

No breaking changes; both flags are opt-in and default to current behavior.

Jira / Linear Tickets

  • N/A

Testing

  • make build, go vet, shadow, golangci-lint (0 issues), go test -race ./loadtest/...
  • New config validation unit tests: --send-rpc-url / --private-txs mode allowlist, URL validation, ramp duration bounds and mutual exclusion with adaptive rate limiting
  • Live traffic-split verification against anvil with a method-logging proxy as the send endpoint: a 5-tx run produced exactly 5 eth_sendRawTransaction calls on the send endpoint and nothing else; with --private-txs, only eth_sendRawTransactionPrivate. Reads (gas, chain ID, nonces) all went to the primary RPC.
  • Live ramp verification against anvil: --rate-limit 300 --rate-limit-ramp-duration 6s starts at 3 TPS and climbs linearly (52 → 102 → 151 → 201 → 250) to 300, then the ramp goroutine exits.
  • Regression run without either flag behaves as before; docs regenerated via docutil

🤖 Generated with Claude Code

praetoriansentry and others added 2 commits August 19, 2026 13:56
Add a secondary RPC endpoint used exclusively to broadcast transactions
(eth_sendRawTransaction, or eth_sendRawTransactionPrivate when combined
with --private-txs). All other calls (gas estimation, chain ID, nonces,
receipts, block polling, account funding) stay on --rpc-url.

This supports private mempool endpoints that only accept
eth_sendRawTransactionPrivate, and gossip-only broadcasters (e.g. light
clients on the p2p network) that have no chain state.

The send endpoint gets its own HTTP connection pool sized like the
primary's, and falls back to the primary client when the flag is unset.
Like --private-txs, the flag is limited to the modes that broadcast
explicitly: transaction, blob, contract-call, and recall.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Linearly ramp the rate limit from max(1% of --rate-limit, 1 TPS) to its
full value over the given duration (e.g. 3m), then hold steady. Useful
for warming up a network gradually instead of starting at full load.

Mutually exclusive with --adaptive-rate-limit, which controls the same
limiter based on txpool feedback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@praetoriansentry
praetoriansentry requested a review from a team August 20, 2026 12:56
@praetoriansentry
praetoriansentry merged commit 6bbb40d into main Aug 20, 2026
25 of 26 checks passed
@praetoriansentry
praetoriansentry deleted the feat/loadtest-send-rpc-url branch August 20, 2026 13:00
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.

2 participants