✨ feat(server): add WebSocket JSON-RPC transport with eth_subscribe support - #2084
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: b8b4030 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
013f2e1 to
b8b4030
Compare
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Blocking WebSocket findings:
The subscription/filter cleanup happy paths and filter draining tests pass. The larger duplication with #2080 should still be factored into one connection-scoped subscription helper so ownership, draining, syncing, and error handling do not continue to diverge. |
Motivation
@tevm/serverserved HTTP only —createHttpHandlerandcreateServer, no WebSocket anywhere. That gap is the reason viem's test suite must keep Anvil around for itswebSocket()transport suites: Anvil serves ws and http on the same port, and Tevm could not.The hard half was already built —
packages/actions/src/eth/ethSubscribeHandler.jsimplementseth_subscribe. What was missing was a transport to expose it.What this adds
createWebSocketServer— JSON-RPC over WebSocket, served on the same port as HTTP.eth_subscribe/eth_unsubscribewired so subscriptions actually push notifications to connected clients.tevmpackage.Testing
packages/server/src/createWebSocketServer.spec.ts— 5/5 passing, verified locally:No mocking, per the repo's testing conventions.
Note on CI
This branch is based on
main, which is currently red for an unrelated reason (ERR_PNPM_OUTDATED_LOCKFILEfrom the unpinned zevm workspace checkout). #2083 fixes that; once it lands this needs a rebase for a clean signal.🤖 Generated with Smithers multi-agent orchestration