Skip to content

feat: add upstream-level subscription topic filtering#805

Closed
tonatoz wants to merge 3 commits intomasterfrom
feature/disable-subscription-topics
Closed

feat: add upstream-level subscription topic filtering#805
tonatoz wants to merge 3 commits intomasterfrom
feature/disable-subscription-topics

Conversation

@tonatoz
Copy link
Copy Markdown
Contributor

@tonatoz tonatoz commented Mar 18, 2026

Summary

  • Add subscriptions.disabled config option at the upstream level (UpstreamsConfig.Upstream) to disable specific subscription topics
  • Disabled topics are aggregated (union) across all upstreams in a multistream
  • Filtering applied in both getAvailableTopics() and subscribe() — covers all subscription paths

Coverage Matrix

Path How it's blocked
gRPC (dproxy → dshackle) Guard in NativeSubscribe.start() via getAvailableTopics()
WS proxy (client → dshackle) Check in EthereumEgressSubscription.subscribe()
Describe (client info) Topic removed from getAvailableTopics()
tryProxySubscribe (dshackle cascade) Guard in start() before proxying

Config example

cluster:
  upstreams:
    - id: local
      chain: ethereum
      subscriptions:
        disabled:
          - newPendingTransactions
          - drpc_pendingTransactions

Allows operators to disable specific eth_subscribe topics (e.g.
newPendingTransactions) per proxy route while keeping others (newHeads,
logs) available.

Config example:
  proxy:
    routes:
      - id: eth
        blockchain: ethereum
        subscriptions:
          disabled:
            - newPendingTransactions
            - drpc_pendingTransactions

When a client subscribes to a disabled topic, the server returns a
JSON-RPC error -32601 instead of starting the subscription.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tonatoz tonatoz force-pushed the feature/disable-subscription-topics branch from d14be79 to 3ce902c Compare March 18, 2026 13:29
Move subscription filtering from proxy level to upstream level so it
covers all subscription paths: gRPC (NativeSubscribe), WebSocket proxy,
Describe, and cascading dshackle-to-dshackle subscriptions.

Config example:
  cluster:
    upstreams:
      - id: local
        chain: ethereum
        subscriptions:
          disabled:
            - newPendingTransactions
            - drpc_pendingTransactions

Disabled topics are aggregated (union) across all upstreams in a
multistream. The filter applies in both getAvailableTopics() (blocks
gRPC guard + Describe) and subscribe() (blocks WS proxy path).

Reverts the previous proxy-level approach as it only covered the
WebSocket proxy path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tonatoz tonatoz changed the title feat: add per-route subscription filtering for WebSocket proxy feat: add upstream-level subscription topic filtering Mar 18, 2026
Pass emptySet() for the new disabledSubscriptions parameter when
constructing GenericUpstream directly from Groovy test code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tonatoz tonatoz closed this Mar 19, 2026
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.

1 participant