-
Notifications
You must be signed in to change notification settings - Fork 5k
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
BatchRequest assumes JSON RPC requests are returned in order #4250
Comments
An easy fix would be to perform a sort by id at https://github.com/ChainSafe/web3.js/blob/1.x/packages/web3-core-requestmanager/src/batch.js#L51, happy to open a MR to do that if that's the preferred fix. |
Hi there, thank you for bringing this to our attention with so much detail! The team's efforts right now is focused on getting the rewrite ( |
Echoing above from @spacesailor24 , there is no guarantee on when this will be addressed as resources are being used for |
Expected behavior
The response to a batch JSON RPC is not enforced to be in order (according to the spec). Despite most endpoints following this convention, some (e.g. Erigon) do not.
This means that results can be misparsed, or worse, silently corrupted despite the response being valid.
For example if we batched the following calls from G-UNI FLOAT/USDC contract:
getUnderlyingBalances(uint256,uint256)
totalSupply(uint256)
We can receive the response:
Which is valid and should decode to:
Actual behavior
In actuality, the response for
totalSupply
is attempted to be decoded as a tuple.Environment
yarn 1.22.4
The text was updated successfully, but these errors were encountered: