Fix: Add some simple limits to Electrum RPC by default#146
Open
Fix: Add some simple limits to Electrum RPC by default#146
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces default resource limits for the Electrum RPC server (request line size, per-connection subscription count, and concurrent client connections) and wires them through configuration/launch scripts to reduce abuse and accidental overload.
Changes:
- Add new CLI/config options:
--electrum-max-line-size,--electrum-max-subscriptions,--electrum-max-clients. - Enforce per-connection subscription limits and a global max-client limit in the Electrum server.
- Update the
startscript to pass the new limits (with higher overrides for specific hosts/networks).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
start |
Passes new Electrum limit flags with defaults and host-based overrides. |
src/electrum/server.rs |
Implements max request line size enforcement, per-client subscription cap, and max concurrent client connections. |
src/config.rs |
Adds config fields and clap args/defaults for the new Electrum limits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wonder if the defaults should be set low or maybe a little higher.
Either way I have set fairly high limits for the start script.