erigon icon indicating copy to clipboard operation
erigon copied to clipboard

trace_ API disagrees with debug_ API

Open s1na opened this issue 4 months ago • 4 comments

Expected behaviour

The call trace from debug_traceTransaction should agree with the call trace from trace_transaction. However we are seeing a difference. Please see also discussion: https://github.com/ethereum/go-ethereum/issues/30593 for more context.

Actual behaviour

debug_traceTransaction

{"jsonrpc":"2.0","id":1,"result":{"from":"0xc13ced137e90bc695cb77288962280516a2f9b8b","gas":"0x30d40","gasUsed":"0x906f","to":"0x897a96deb94291b785faff64088f7202a019f38e","input":"0x9103de440000000000000000000000000000000000000000000000000080949c79f1c2dc","calls":[{"from":"0x897a96deb94291b785faff64088f7202a019f38e","gas":"0x297fb","gasUsed":"0x10e0","to":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","input":"0x0000000000000000000000000000000000000000000000000000000067082fe7","output":"0xb593042853e5fedd7a92fa7607244cbf8825dd63298e52b8286ed61368c4699b","value":"0x0","type":"CALL"},{"from":"0x897a96deb94291b785faff64088f7202a019f38e","gas":"0x8fc","gasUsed":"0x0","to":"0xc13ced137e90bc695cb77288962280516a2f9b8b","input":"0x","value":"0x2386f26fc10000","type":"CALL"}],"value":"0x0","type":"CALL"}}

trace_transaction

{"jsonrpc":"2.0","id":1,"result":[{"action":{"from":"0xc13ced137e90bc695cb77288962280516a2f9b8b","callType":"call","gas":"0x2ba24","input":"0x9103de440000000000000000000000000000000000000000000000000080949c79f1c2dc","to":"0x897a96deb94291b785faff64088f7202a019f38e","value":"0x0"},"blockHash":"0x04ccbbad4bdee79a5f000e30969561b61aa61c5a081f0562dc7722fbbf32b31f","blockNumber":20937412,"result":{"gasUsed":"0x4796","output":"0x"},"subtraces":2,"traceAddress":[],"transactionHash":"0x96dfd56413baf7ee53483d5d6788ea5faa621ee6bb7d4b8808408d1f07f72bf8","transactionPosition":87,"type":"call"},{"action":{"from":"0x897a96deb94291b785faff64088f7202a019f38e","callType":"call","gas":"0x297fb","input":"0x0000000000000000000000000000000000000000000000000000000067082fe7","to":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","value":"0x0"},"blockHash":"0x04ccbbad4bdee79a5f000e30969561b61aa61c5a081f0562dc7722fbbf32b31f","blockNumber":20937412,"error":"Reverted","result":{"gasUsed":"0x89c","output":"0x"},"subtraces":0,"traceAddress":[0],"transactionHash":"0x96dfd56413baf7ee53483d5d6788ea5faa621ee6bb7d4b8808408d1f07f72bf8","transactionPosition":87,"type":"call"},{"action":{"from":"0x897a96deb94291b785faff64088f7202a019f38e","callType":"call","gas":"0x8fc","input":"0x","to":"0xc13ced137e90bc695cb77288962280516a2f9b8b","value":"0x16345785d8a0000"},"blockHash":"0x04ccbbad4bdee79a5f000e30969561b61aa61c5a081f0562dc7722fbbf32b31f","blockNumber":20937412,"result":{"gasUsed":"0x0","output":"0x"},"subtraces":0,"traceAddress":[1],"transactionHash":"0x96dfd56413baf7ee53483d5d6788ea5faa621ee6bb7d4b8808408d1f07f72bf8","transactionPosition":87,"type":"call"}]}

We can see the value of trace[1] in debug_ is reported as 0x2386f26fc10000 whereas in trace_ is reported as 0x16345785d8a0000.

s1na avatar Oct 15 '24 07:10 s1na