-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
web3-provider: Use an incremental JSONRPC id instead of 42 #337
Comments
That What problem are you experiencing? You mean on the server side you are trying to parse the request? A better solution is to extend and override for a DebugProvider, which performs the console.log. Soon, the WebSocketProvider will be ready, which will update the |
I do mean it adds more distinction server-side. I already debugged the problem I was having, but this is a convenience that I don't see a downside to and arguably more in the spirit of the JSONRPC 2.0 spec. Your call though. Edit:
Is that an actual guarantee? I would have guessed the client-side socket gets reused by default these days. |
This has been changed in
Yes, the implementation for In the future though, the WebSocketProvider (in progress) will re-use the connection, and will of course use a unique ID within a given connection. Closing this issue though, since it no longer uses the hard-coded value of 42. :) |
🎊 |
Re:
ethers.js/src.ts/providers/web3-provider.ts
Line 71 in fa68385
I realize that this mostly works right now, but it's just one more line to add an incremental id and it would help with identifying different messages while trying to debug what's going on.
Something like:
Should do the trick.
The text was updated successfully, but these errors were encountered: