Skip to content

Fix local chain methods over WebSocket - #266

Merged
KirillPamPam merged 3 commits into
drpcorg:mainfrom
GhostStar:fix/ws-local-chain-methods
Jul 28, 2026
Merged

Fix local chain methods over WebSocket#266
KirillPamPam merged 3 commits into
drpcorg:mainfrom
GhostStar:fix/ws-local-chain-methods

Conversation

@GhostStar

Copy link
Copy Markdown
Contributor

Summary

  • handle eth_chainId and net_version before the WebSocket unsubscribe path
  • preserve subscription cancellation behavior for local unsubscribe methods
  • cover both HTTP and WebSocket request contexts in the local processor test

Root cause

Every request received through the WebSocket server has a non-nil subscription context. The local request processor treated every local method with such a context as an unsubscribe request and attempted to read params[0]. Standard parameterless methods such as eth_chainId and net_version therefore failed with value not exists.

Tests

  • go test ./internal/upstreams/flow -run TestLocalRequestProcessor -count=1
  • go test ./internal/upstreams/flow -count=1
  • go test ./... -count=1
  • make build

@mxssl
mxssl requested a review from KirillPamPam July 11, 2026 19:24
@KirillPamPam

Copy link
Copy Markdown
Collaborator

Thanks for the fix!

@KirillPamPam
KirillPamPam merged commit 8c173e2 into drpcorg:main Jul 28, 2026
4 of 5 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.

2 participants