Skip to content

feat: increase max RPC connections to 1000#6528

Merged
LesnyRumcajs merged 1 commit into
mainfrom
increase-max-default-conns-rpc
Feb 4, 2026
Merged

feat: increase max RPC connections to 1000#6528
LesnyRumcajs merged 1 commit into
mainfrom
increase-max-default-conns-rpc

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Feb 4, 2026

Summary of changes

Changes introduced in this pull request:

  • increased the max connections for RPC server to 1000 after discussing with ChainLove
  • this can be further modified by an env variable
  • this should prevent the server seemingly hanging on new connections

Reference issue to close (if applicable)

Closes #6527

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features

    • Increased maximum RPC server connections to 1000, now configurable via environment variable for flexible deployment configurations.
  • Documentation

    • Added environment variable reference documentation with default and example values for RPC connection configuration.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner February 4, 2026 13:05
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team February 4, 2026 13:05
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 4, 2026

Walkthrough

This PR adds configurable RPC server connection limits via the FOREST_RPC_MAX_CONNECTIONS environment variable, defaulting to 1000. Changes include implementation, documentation, and changelog entries.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md, docs/docs/users/reference/env_variables.md
Added changelog entry and documentation for new FOREST_RPC_MAX_CONNECTIONS environment variable with default value of 1000.
RPC Configuration
src/rpc/mod.rs
Implemented DEFAULT_MAX_CONNECTIONS static that reads from FOREST_RPC_MAX_CONNECTIONS environment variable and applies the limit to RPC server configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

RPC

Suggested reviewers

  • hanabi1224
  • sudo-shashank
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: increasing the maximum RPC connections to 1000, which is the primary focus of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch increase-max-default-conns-rpc

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 56: Update the changelog entry that currently references issue `#6527` so
it references PR `#6528` instead: replace the link text and URL
`[`#6527`](https://github.com/ChainSafe/forest/issues/6527)` with
`[`#6528`](https://github.com/ChainSafe/forest/pull/6528)` in the existing
changelog line that mentions increasing RPC max connections.

In `@src/rpc/mod.rs`:
- Around line 469-476: DEFAULT_MAX_CONNECTIONS currently accepts 0 from
FOREST_RPC_MAX_CONNECTIONS which would disable connections; update the LazyLock
initializer for DEFAULT_MAX_CONNECTIONS so that after parsing the env var you
filter out non‑positive values (e.g., require parsed > 0) and only use the
parsed value when positive, otherwise fall back to the default 1000; refer to
DEFAULT_MAX_CONNECTIONS, the LazyLock::new closure,
env::var("FOREST_RPC_MAX_CONNECTIONS") and the parse handling to locate and
change the logic.

Comment thread CHANGELOG.md
Comment thread src/rpc/mod.rs
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Feb 4, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.32%. Comparing base (5157235) to head (2c6db24).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/rpc/mod.rs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/rpc/mod.rs 80.57% <85.71%> (+0.15%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5157235...2c6db24. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Merged via the queue into main with commit 87d521d Feb 4, 2026
43 of 46 checks passed
@LesnyRumcajs LesnyRumcajs deleted the increase-max-default-conns-rpc branch February 4, 2026 15:15
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.

RPC server hanging on multiple connections

2 participants