Skip to content

feat: add configurable RPC concurrency via RPC_CONCURRENCY env var#714

Open
fakedev9999 wants to merge 5 commits into
mainfrom
taehoon/configurable-rpc-concurrency
Open

feat: add configurable RPC concurrency via RPC_CONCURRENCY env var#714
fakedev9999 wants to merge 5 commits into
mainfrom
taehoon/configurable-rpc-concurrency

Conversation

@fakedev9999
Copy link
Copy Markdown
Member

Summary

  • Add RPC_CONCURRENCY environment variable to configure concurrent RPC requests
  • Default value of 10 preserves existing behavior (no regression)
  • Users hitting 429 rate limits can set lower values (e.g., 3-5)

Problem

Users with low-tier RPC plans experience 429 rate limit errors due to hardcoded .buffered(10) and .buffered(15) values throughout the codebase.

Solution

Make RPC concurrency configurable via RPC_CONCURRENCY environment variable while preserving the default behavior for existing users.

Changes

  • utils/host/src/fetcher.rs: Add DEFAULT_RPC_CONCURRENCY constant, get_rpc_concurrency_from_env() helper, and concurrency field to RPCConfig
  • utils/host/src/block_range.rs: Use configurable concurrency
  • validity/src/proposer.rs: Use fetcher's concurrency config
  • scripts/utils/bin/cost_estimator.rs: Use configurable concurrency (2 locations)
  • scripts/utils/bin/gen_sp1_test_artifacts.rs: Use configurable concurrency
  • book/: Document RPC_CONCURRENCY in proposer docs and add troubleshooting section

Usage

# For low-tier RPC plans (free tiers)
export RPC_CONCURRENCY=3

# For basic paid tiers
export RPC_CONCURRENCY=5

# Default (professional tiers) - no change needed
# RPC_CONCURRENCY=10

TODO:
- Manual test/benchmark with low RPC_CONCURRENCY value
- Verify no performance regression with default value

Base automatically changed from taehoon/bump-v3.4.0 to main December 1, 2025 22:10
fakedev9999 added a commit that referenced this pull request Dec 2, 2025
fakedev9999 added a commit that referenced this pull request Feb 25, 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