Skip to content

fix(rpc): reduce default limits to prevent resource exhaustion#140

Closed
rswanson wants to merge 1 commit intomainfrom
feat/tune-rpc-defaults
Closed

fix(rpc): reduce default limits to prevent resource exhaustion#140
rswanson wants to merge 1 commit intomainfrom
feat/tune-rpc-defaults

Conversation

@rswanson
Copy link
Copy Markdown
Member

Summary

  • Reduce max_blocks_per_filter default from 10,000 to 2,000
  • Reduce max_tracing_requests default from 25 to 10

Context

Under moderate load, wide eth_getLogs queries (up to 10,000 blocks) monopolize database connections for extended periods, especially with the streaming path that issues one query per block. Combined with the cold storage write-drain behavior (all reads must complete before each write), a few large log queries can stall the entire RPC server.

Similarly, tracing/debug requests are CPU and memory intensive. 25 concurrent tracing requests can saturate the blocking thread pool and compete with state queries for resources.

Both limits remain overridable via SIGNET_RPC_MAX_BLOCKS_PER_FILTER and SIGNET_RPC_MAX_TRACING_REQUESTS environment variables for deployments that need the higher limits.

Test plan

  • cargo +nightly fmt -- --check
  • cargo clippy -p signet-rpc --all-targets
  • cargo t -p signet-rpc (35 tests + 6 doctests pass)

🤖 Generated with Claude Code

Lower max_blocks_per_filter from 10,000 to 2,000 and
max_tracing_requests from 25 to 10. Under moderate load, wide
getLogs queries and concurrent tracing requests monopolize database
connections and block other RPC traffic.

Both limits remain overridable via SIGNET_RPC_MAX_BLOCKS_PER_FILTER
and SIGNET_RPC_MAX_TRACING_REQUESTS environment variables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rswanson rswanson requested a review from a team as a code owner April 16, 2026 12:42
@rswanson
Copy link
Copy Markdown
Member Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@Evalir
Copy link
Copy Markdown
Member

Evalir commented Apr 16, 2026

ok with testing this for now, but we should adjust this later

@prestwich
Copy link
Copy Markdown
Member

the streaming path that issues one query per block

which path is this?

@rswanson
Copy link
Copy Markdown
Member Author

holding off on this pending some other tests first, if rpc perf is still bad we can explore this. setting to draft

@rswanson rswanson marked this pull request as draft April 16, 2026 16:30
@rswanson
Copy link
Copy Markdown
Member Author

going to close this for now, other fixes have been sufficient.

@rswanson rswanson closed this Apr 17, 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.

3 participants