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

trace_ API disagrees with debug_ API #12318

Open
s1na opened this issue Oct 15, 2024 · 4 comments
Open

trace_ API disagrees with debug_ API #12318

s1na opened this issue Oct 15, 2024 · 4 comments
Assignees
Labels
imp1 High importance

Comments

@s1na
Copy link
Contributor

s1na commented Oct 15, 2024

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: ethereum/go-ethereum#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
Copy link
Contributor Author

s1na commented Oct 15, 2024

Same with the state change tracer (using trace_replayTransaction). It is also reporting a higher state diff than it should. So when transaction is being replayed for some reason a higher value is being transferred than it should.

@shohamc1
Copy link
Member

Hi, do you have any details on your setup? What version of Erigon are you running, are you running Erigon or rpcdaemon (if rpcdaemon, with or without datadir?), and your startup flags.

@s1na
Copy link
Contributor Author

s1na commented Oct 25, 2024

I'm guessing it is a similar issue to this: paradigmxyz/reth#11845. Basically in one of the endpoints the beacon root system call isn't applied prior to tracing.

@samcm
Copy link

samcm commented Oct 25, 2024

Hi, do you have any details on your setup? What version of Erigon are you running, are you running Erigon or rpcdaemon (if rpcdaemon, with or without datadir?), and your startup flags.

Hey @shohamc1 👋

Details of that Erigon node:

  • Version: thorax/erigon:2.60.8
  • We are using rpcdaemon, with --datadir
  • rpcdaemon args:
    • rpcdaemon --datadir=/data --private.api.addr=127.0.0.1:9090 --txpool.api.addr=127.0.0.1:9090 --http.addr=0.0.0.0 --http.port=8545 --http.vhosts=* --ws --metrics --metrics.addr=0.0.0.0 --metrics.port=6061 --http.api=eth,erigon,web3,net,debug,trace,txpool
  • erigon args:
    • erigon --datadir=/data --nat=extip:$EXTERNAL_IP --port=$EXTERNAL_PORT --http=false --private.api.addr=127.0.0.1:9090 --authrpc.jwtsecret=/data/jwt.hex --authrpc.addr=0.0.0.0 --authrpc.port=8551 --authrpc.vhosts=* --ws --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --chain=mainnet --http.vhosts=* --http.api=admin,debug,eth,net,trace,txpool,web3,rpc,erigon --rpc.returndata.limit=1000000

@VBulikov VBulikov added the imp1 High importance label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imp1 High importance
Projects
None yet
Development

No branches or pull requests

5 participants