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

debug_traceTransaction no longer return the revert reason under 'returnValue' #21082

Closed
ilyalesokhin-starkware opened this issue May 14, 2020 · 5 comments · Fixed by #21083 or #21195
Closed

Comments

@ilyalesokhin-starkware
Copy link

ilyalesokhin-starkware commented May 14, 2020

1.9.14 no longer return the revert reason under 'returnValue',
The last state returned by debug_traceTransaction is the same in both 1.9.14 and 1.9.13
AttributeDict({'pc': 1811,
'op': 'REVERT',
'gas': 976204,
'gasCost': 3,
'depth': 1,
'stack': ['00000000000000000000000000000000000000000000000000000000a9059cbb',
'00000000000000000000000000000000000000000000000000000000000000cf',
'0000000000000000000000000002851146112cef5d360033758c470689b72ea7',
'0000000000000000000000000000000000000000000000000000000000000011',
'0000000000000000000000000000000000000000000000000000000000000000',
'000000000000000000000000000000000000000000000000000000000000026c',
'0000000000000000000000000002851146112cef5d360033758c470689b72ea7',
'0000000000000000000000000002851146112cef5d360033758c470689b72ea7',
'0000000000000000000000000000000000000000000000000000000000000011',
'0000000000000000000000000000000000000000000000000000000000000000',
'0000000000000000000000000000000000000000000000000000000000000000',
'0000000000000000000000000000000000000000000000000000000000000084',
'0000000000000000000000000000000000000000000000000000000000000080'],
'memory': ['0000000000000000000000000002851146112cef5d360033758c470689b72ea7',
'0000000000000000000000000000000000000000000000000000000000000000',
'0000000000000000000000000000000000000000000000000000000000000080',
'0000000000000000000000000000000000000000000000000000000000000000',
'08c379a000000000000000000000000000000000000000000000000000000000',
'0000002000000000000000000000000000000000000000000000000000000000',
'0000002645524332303a207472616e7366657220616d6f756e74206578636565',
'64732062616c616e636500000000000000000000000000000000000000000000',
'0000000000000000000000000000000000000000000000000000000000000000'],
'storage': AttributeDict({})})]})

but returnValue in 1.9.14 is empty.

System information

Geth version: 1.9.14
OS & Version: Linux

Expected behaviour (1.9.13 and earlier versions)

w3.manager.request_blocking('debug_traceTransaction', [tx_hash])['returnValue']
Out[64]: '08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002645524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63650000000000000000000000000000000000000000000000000000'

Actual behaviour (1.9.14)

w3.manager.request_blocking('debug_traceTransaction', [tx_hash])['returnValue']
Out[65]: ''

Steps to reproduce the behaviour

Run a transaction with a failing assert.
call debug_traceTransaction and inspect the returnValue.

@cgewecke
Copy link

The reason data is also no longer being returned when running eth_call on methods which revert with a reason. (It's common for libraries like Web3.js to obtain the reason by replaying failed transactions as calls and decoding the return data.)

For code that executes require(false, "this is a revert reason...") the responses are:

1.9.13

{
 "jsonrpc": "2.0",
 "id": 1000,
 "result": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a7468697320697320612072657665727420726561736f6e2e2e2e000000000000"
}

1.9.14

{
 "jsonrpc": "2.0",
 "id": 1000,
 "result": "0x"
}

Have made a reproduction case for this difference at:

https://github.com/cgewecke/geth-revert-reason-repro

@MariusVanDerWijden
Copy link
Member

Yep that is a regression, probably introduced by #20830. However since we have 20830 in place, we can add error reasons rather easy now. This PR will add revert reasons to eth_call: #21083

@holiman
Copy link
Contributor

holiman commented May 15, 2020

it would be great if we could have some end-to-end test of these endpoints, which runs on travis...

@ilyalesokhin-starkware
Copy link
Author

w3.manager.request_blocking('debug_traceTransaction', [tx_hash])['returnValue'] is still empty in 1.9.15.

How should I extract the revert reason?

@MariusVanDerWijden
Copy link
Member

hey @ilyalesokhin-starkware thanks for checking this again. It seems that my pr did not fix this issue unfortunately. But I know where to look and will provide the revert reason for debug_traceTransaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants