Skip to content
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

Extend transaction revert handling for eth.sendSignedTransaction #3345

Closed
nivida opened this issue Jan 28, 2020 · 7 comments · Fixed by #3420
Closed

Extend transaction revert handling for eth.sendSignedTransaction #3345

nivida opened this issue Jan 28, 2020 · 7 comments · Fixed by #3420
Labels
1.x 1.0 related issues Enhancement Includes improvements or optimizations

Comments

@nivida
Copy link
Contributor

nivida commented Jan 28, 2020

Expected behavior

eth.sendSignedTransaction should return the revert reason string as expected.

Actual behavior

eth.sendSignedTransaction does get executed but the signed transaction doesn't get decoded to get the revert reason string as expected.

Steps to reproduce the behavior

  1. call eth.sendSignedTransaction and the revert instruction opcode does get called.

Versions

web3.js: latest

@nivida nivida added Enhancement Includes improvements or optimizations 1.x 1.0 related issues labels Jan 28, 2020
@nivida
Copy link
Contributor Author

nivida commented Jan 28, 2020

@gorgos As mentioned in the answer I gave you (comment) is this the issue to track the process of this enhancement. Feel free to propose the related PR.

@AnthonyAkentiev
Copy link

@nivida Hi Samuel. Please help... Lost 12 hours debugging this...
I've tried everything, but still can't get the revert reason.

I've tried web3@1.2.8's way to get it:

  1. i've set web3.eth.handleRevert = true;
  2. but the revert reason is still 'false' - in this line https://github.com/ethereum/web3.js/blob/1.x/packages/web3-core-method/src/index.js#L465

My code is here - https://gist.github.com/AnthonyAkentiev/e8cd38328769284c110626b9e4a1379b

i've also tried this script -> https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a
i've also tried this script -> https://gist.github.com/KentonPrescott/e5e38da3b9c3c94ef7f233076e1ea64b#file-debuggingrevert-js

but nothing helped :-((((
We are using geth@1.9.12 node, maybe the reason is GETH not providing us with revert reason?

Thank you very much!

@ryanio
Copy link
Collaborator

ryanio commented Jun 5, 2020

@AnthonyAkentiev ah sorry to hear that! our ci is working with geth 1.9.13 so it should be working for you with 1.9.12. see here:
https://github.com/ethereum/web3.js/blob/1.x/test/e2e.method.signing.js#L316

[Edited link for sendSignedTransaction test -cg]

can you confirm you are on 1.9.12 and not stable? there is a tracking issue for 1.9.14 with #3520

@AnthonyAkentiev
Copy link

AnthonyAkentiev commented Jun 8, 2020

@ryanio Thx for quick answer! Really appreciate it.
Oh, i double checked and our current version is '1.9.14-stable-6d74d1e5', should we use 1.9.12 to get 'reason' working?

@cgewecke
Copy link
Collaborator

cgewecke commented Jun 8, 2020

@AnthonyAkentiev Yes, revert with reason only works up with geth up until 1.9.13.

1.9.14 introduced a bug which they just fixed today at go-ethereum 21083. When that's published we'll be able to restore reason fetching in the next patch release here.

@AnthonyAkentiev
Copy link

@cgewecke thx. checked current stable 1.9.15 and it worked!

@cgewecke
Copy link
Collaborator

cgewecke commented Jun 8, 2020

Side-note for anyone else running into this... it looks like there will need to be code changes here to get the revert reason working again per the existing API for geth 1.9.15.

PR #3571 should resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Enhancement Includes improvements or optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants