Skip to content

Add per-connection Electrum subscription limit - #251

Merged
philippem merged 2 commits into
Blockstream:new-indexfrom
philippem:electrum-subscription-limit
Aug 24, 2026
Merged

Add per-connection Electrum subscription limit#251
philippem merged 2 commits into
Blockstream:new-indexfrom
philippem:electrum-subscription-limit

Conversation

@philippem

Copy link
Copy Markdown
Collaborator

A client can subscribe to unlimited scripthashes on a single Electrum connection, and each tracked subscription costs a history lookup on every new block. Add --electrum-subscription-limit (default 10000, 0 = unlimited) and reject new scripthash_subscribe calls past the cap while still allowing a client to refresh a subscription it already holds.

A client can subscribe to unlimited scripthashes on a single Electrum
connection, and each tracked subscription costs a history lookup on
every new block. Add --electrum-subscription-limit (default 10000, 0
= unlimited) and reject new scripthash_subscribe calls past the cap
while still allowing a client to refresh a subscription it already
holds.
@philippem
philippem requested review from DeviaVir, EddieHouston, FedOken, Randy808 and shesek and removed request for EddieHouston August 24, 2026 15:23
DeviaVir
DeviaVir previously approved these changes Aug 24, 2026
@EddieHouston

Copy link
Copy Markdown
Collaborator

Added simple unit test in 514fe7c verifying that rejected subscriptions map to error code 1; existing tests cover the subscription_allowed() limit behavior.

@EddieHouston EddieHouston left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@philippem
philippem merged commit ed257dd into Blockstream:new-index Aug 24, 2026
6 checks passed
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.

4 participants