feat(rpc): cap subscriptions per websocket connection - #4023
Conversation
|
Claude finished @NazariiDenha's task in 6m 18s —— View job Review complete
Summary: The core mechanism is sound — Important:
Nit:
No correctness bugs, races, or resource leaks found otherwise. I was unable to execute |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/ws-rpc-gate #4023 +/- ##
====================================================
- Coverage 79.22% 79.21% -0.02%
====================================================
Files 465 465
Lines 35815 35854 +39
====================================================
+ Hits 28374 28401 +27
- Misses 7432 7444 +12
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
603c5e7 to
139e07c
Compare
|
Claude finished @NazariiDenha's task in 4m 53s —— View job Review complete
Summary: This update fixes both items from my previous pass — the PR is clean now, no inline comments.
I re-verified the core mechanism on the current diff: Nits (non-blocking):
I couldn't run |
139e07c to
3d52998
Compare
|
Claude finished @NazariiDenha's task in 4m 12s —— View job Review complete
Summary: No new changes since the last two review passes on this PR — the diff against
No blockers or new issues found. No inline comments needed. Nits (still open, non-blocking, carried over from the prior review):
I could not run |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Type
Enhancement
Description
Add flags
rpc-max-ws-connectionsandrpc-max-subscriptions.Cap maximum concurrent WebSocket connections using semaphores.
Restrict active subscriptions per WebSocket connection.
Introduce
ErrTooManySubscriptionsto reject excess subscriptions.File Walkthrough
2 files
Add CLI flags for websocket connection and subscription limitsAdd websocket limits to Config and HTTP service instantiation6 files
Update config tests with new websocket limit defaultsMock SubscriptionSlots in test connections and uncapped transportsAdd tests for websocket connection and subscription limitsTest subscription limit enforcement for v10 RPC handlerMock SubscriptionSlots in v8 fake test connectionMock SubscriptionSlots in v9 fake test connection6 files
Define SubscriptionSlots interface and integrate into connectionImplement websocket connection semaphore and per-connectionsubscription trackingPass max websocket connections and subscriptions to handlerEnforce subscription limit upon new v10 RPC subscription requestsEnforce subscription limit upon new v8 RPC subscription requestsEnforce subscription limit upon new v9 RPC subscription requests1 files
Introduce ErrTooManySubscriptions RPC error code