-
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
Cannot decode receipt log data #3671
Comments
Maybe this issue is related: Consensys/abi-decoder#56 |
Any ideas? |
It's a sample code to regenerate the error:
|
hey sorry this slipped my radar... Thanks for the code snippet. We were going to get a release going this monday, but let me try and squeeze a fix for this before then! |
Chainsafe is maintaining web3.js?!?!? You guys are everywhere! |
I dont think this is an issue with web3.js, looks like its the decoder. i'll close this for now, please re-open if anything changes |
I did a hack to make the decoder work
We use the web3 decoding api, we have used it for years but it has problem for about 10 days. We doubt new version of geth is responsible for such error. |
Also fetching past events is another place throws error!
The error message is:
|
Also check to make sure you're not reusing a WebSocket provider per this issue as that can cause an expected response element to be undefined. |
Not familiar with the notation being used (jquery?) - the er looks like |
We found the error root cause, |
Particularly this comment shows the error concisely: |
I've added support in ethers 5.0.12 for supporting legacy Solidity 0.4 external event data. I believe web3 depends on the abi package directly, in which case web3 should upgrade to For more details, please see ethers-io/ethers.js#891. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Expected behavior
We were using _decodeEventABI from web3-eth-contract package to decode receipt log data and it had been working for long time. But it's not working as expected for few days! I tried another library abi-decoder which uses web3-eth-abi library under the hood and it has the same problem.
Actual behavior
The decode function produces this error message on decoding data:
(node:55476) UnhandledPromiseRejectionWarning: Error: data out-of-bounds (length=164, offset=192, code=BUFFER_OVERRUN, version=abi/5.0.0-beta.153)
Finally I modified the log data and filled it with zero value except the part I needed and the code workes as before.
It's the code that has modified, if you remove the part that modifies the log.data the error appears
https://github.com/Giveth/feathers-giveth/blob/b164131e588f640a8bd83136ad6c867fb7b6733b/scripts/utils/getHomeTxHash.js#L27-L55
This is the smart contract code and abi: https://rinkeby.etherscan.io/address/0xff9cd5140e79377feb23f6dfaf1f8b558c0fe621#code
And we tried to decode the log data of this transaction: https://rinkeby.etherscan.io/tx/0xa20e3db910d95a5a23692eef523bd6e98152d4759782e6097d3f6eaccf17ff46
Environment
Node v8.17.0
Web3 1.2.11
OS Linux and MacOS
The text was updated successfully, but these errors were encountered: