-
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
Improve eth-abi decodeParameters error message #3161
Conversation
Just to clarify, I have initially opened #3134 because I was grepping After upgrading to version 1.2.1, I stumble across this issue, but as a runtime error which occurred long after I had upgraded web3. As a result, I had to conduct a rather long investigation before I was able to figure out the cause. So I definitely agree that this would be an API-breaking change for those already using version 1.2.1, and that it should therefore not be changed at any future version 1.x. Side note for readers stumbling across the same problem:
So it could be a solution (or a workaround if you will) for some of you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgewecke We can keep the new error msg in the ABICoder as it is but we have to back-port the fix from the CallContractMethod. I was following several discussions in Geth issues about the correct handling of this case and the overall opinion and also mine was to return null.
@nivida Ok, interesting. Is this a breaking change though? Do you remember where this was discussed at geth so it can be cross-documented here when the change is made? |
Returning
I couldn't find it but I'm pretty sure the last research I've done for the fix in 2.x brought this conclusion up. |
@nivida I agree the error message is not good but changing behavior from throwing an error to not throwing one could be a big difference to someone - it's very hard to anticipate how people rely on this.... To me it seems the safest improvement is to list the known conditions which trigger this. Will add the two other cases you've mentioned. |
Addresses #3134
Also adding a couple small tests / e2e fixtures for 'method.call', because those are missing.
There's discussion in #3134 about whether current error makes sense at all because it mentions OOG in a context where that's unlikely to be a cause. Am very reluctant to change error messages in 1.x because people may be grepping them to handle certain error conditions, so have just appended some more info that might be helpful.