Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketProvider in FallbackProvider causes polling #4932

Open
jacobmakarsky opened this issue Jan 24, 2025 · 0 comments
Open

WebSocketProvider in FallbackProvider causes polling #4932

jacobmakarsky opened this issue Jan 24, 2025 · 0 comments
Labels
documentation Documentation related issue.

Comments

@jacobmakarsky
Copy link

Suggestion

When using a WebSocketProvider within a FallbackProvider, any event listeners attached to the FallbackProvider will use polling instead of WebSocket subscriptions. For real-time event subscriptions, create listeners directly on the WebSocketProvider instance instead.

"A WebSocket provider is fully capable as a stateless (making individual RPC calls) provider, so when passed to fallback provider, it simple uses its stateless API. But the value of the WebSocketProvider in general is its statefulness (maintaining an ongoing connection to receive realtime events/updates like eth_subscribe)."

See https://discord.com/channels/717003406484701255/717009571536699571/1332489217665929237 in the ethers discord for further context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related issue.
Projects
None yet
Development

No branches or pull requests

1 participant