You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
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.
In actuality, the response for totalSupply is attempted to be decoded as a tuple.
index.js:1 G-UNI USDC/FLOAT:getUnderlyingBalances.call Error: data out-of-bounds (length=32, offset=64, code=BUFFER_OVERRUN, version=abi/5.0.7)
at Logger.makeError (index.ts:213)
at Logger.throwError (index.ts:225)
at Reader._peekBytes (abstract-coder.ts:182)
at Reader.readBytes (abstract-coder.ts:196)
at Reader.readValue (abstract-coder.ts:203)
at NumberCoder.decode (number.ts:44)
at array.ts:108
at Array.forEach (<anonymous>)
at unpack (array.ts:89)
at TupleCoder.decode (tuple.ts:27)
at AbiCoder.decode (abi-coder.ts:113)
at ABICoder.push../node_modules/web3-eth-contract/node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParametersWith (index.js:303)
at ABICoder.push../node_modules/web3-eth-contract/node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParameters (index.js:284)
at push../node_modules/web3-eth-contract/lib/index.js.Contract._decodeMethodReturn (index.js:469)
at batch.js:58
at Array.forEach (<anonymous>)
at batch.js:49
at index.js:186
at XMLHttpRequest.request.onreadystatechange (index.js:98)
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 (4.x branch) done so we have a more straightforward code base to work with. If you are able to get a pull request up for this, we can review it and get it merged in, otherwise we don't have a guarantee on when this issue will be addressed
Echoing above from @spacesailor24 , there is no guarantee on when this will be addressed as resources are being used for 4.x branch to help better address issues such as this. We will push to get someone to check #4274 when possible.
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: