Skip to content

Fix: Add some simple limits to Electrum RPC by default#146

Open
junderw wants to merge 1 commit intomempoolfrom
junderw/electrum-limits
Open

Fix: Add some simple limits to Electrum RPC by default#146
junderw wants to merge 1 commit intomempoolfrom
junderw/electrum-limits

Conversation

@junderw
Copy link
Copy Markdown
Member

@junderw junderw commented May 4, 2026

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 start script 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.

Comment thread src/electrum/server.rs
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