We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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_traceBlockByHash
Geth version: Geth 1.10.24 CL client & version: prysm:3.1.1 OS & Version: Linux Commit hash : 1.10.24 release branch
Geth 1.10.24
When using debug_traceBlockByHash with callTracer I expect the gasUsed to be the gasUsed by the transaction. (https://geth.ethereum.org/docs/dapp/builtin-tracers#calltracer) documentation
callTracer
gasUsed
i.e. on Goerli Testnet
Goerli Testnet
curl --request POST \ --url http://127.0.0.1:8546/ \ --header 'content-type: application/json' \ --data '{"method":"debug_traceBlockByHash","params":["0x436ec05f6768296d48150241a1217000f2d7a4cfd8e36803150f2d5219ebab7b", { "tracer": "callTracer" }], "jsonrpc":"2.0", "id": 0}'
(https://goerli.etherscan.io/tx/0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a) is an example
It outputs the wrong gasUsed. For that specific txn: gas used is: 0x24ca6 Out put is:
0x24ca6
{ "result": { "type": "CALL", "from": "0x7afe817effeaffd965f6336137c027a15dbde4c7", "to": "0x120b1b0a44d680524419f76e1a41976b6ea0add5", "value": "0x11c37937e080000", "gas": "0x46790", "gasUsed": "0x24ca6", "input": "0xcf11d58d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", "output": "0x", "calls": [ { "type": "CALL", "from": "0x120b1b0a44d680524419f76e1a41976b6ea0add5", "to": "0x727b51b3cebe69eaabdcfd5a2db0c521ba308112", "value": "0x11c37937e080000", "gas": "0x8fc", "gasUsed": "0x0", "input": "0x", "output": "0x" } ] } }
if you run eth_getTransactionReceipt on the same tx hash: 0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a gas used is: 0x2a006
eth_getTransactionReceipt
0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a
0x2a006
{ "jsonrpc": "2.0", "id": 0, "result": { "blockHash": "0x8b973f65653ba08a81fe728ede379cc748ae5ee959b8925ef637a35162bdb0ca", "blockNumber": "0x764710", "contractAddress": null, "cumulativeGasUsed": "0x2f20e", "effectiveGasPrice": "0x113abe6400", "from": "0x7afe817effeaffd965f6336137c027a15dbde4c7", "gasUsed": "0x2a006", "logs": [ { "address": "0x120b1b0a44d680524419f76e1a41976b6ea0add5", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000007afe817effeaffd965f6336137c027a15dbde4c7", "0x000000000000000000000000000000000000000000000000000000000000002b" ], "data": "0x", "blockNumber": "0x764710", "transactionHash": "0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a", "transactionIndex": "0x1", "blockHash": "0x8b973f65653ba08a81fe728ede379cc748ae5ee959b8925ef637a35162bdb0ca", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000800008000000000000000000000000000000000000000000000000020000000000000000000800000000000000080000000010002000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000002000000100000000000000000000000000000000000000000000020000000000000000000000008000000000000000000000000000000000000000002", "status": "0x1", "to": "0x120b1b0a44d680524419f76e1a41976b6ea0add5", "transactionHash": "0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a", "transactionIndex": "0x1", "type": "0x2" } }
0x436ec05f6768296d48150241a1217000f2d7a4cfd8e36803150f2d5219ebab7b
{"method":"debug_traceBlockByHash","params":["0x436ec05f6768296d48150241a1217000f2d7a4cfd8e36803150f2d5219ebab7b", { "tracer": "callTracer" }], "jsonrpc":"2.0", "id": 0}
"gasUsed": "0x24ca6",
curl --request POST \ --url http://0.0.0.0:8546/ \ --header 'Authorization: Bearer 0xc9cdf7d459216ebd1218521b7df4946f28bf547d6d97effb6e79ab1550ca2dd3' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc" : "2.0", "method" : "eth_getTransactionReceipt", "params" : ["0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a"], "id" : 0 } '
the gas used is different.
[backtrace]
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered:
I also verified this on mainnet. Same issue.
Sorry, something went wrong.
I can reproduce the issue, thanks for reporting. Will look into it.
s1na
Successfully merging a pull request may close this issue.
System information
Geth version:
Geth 1.10.24
CL client & version: prysm:3.1.1
OS & Version: Linux
Commit hash : 1.10.24 release branch
Expected behaviour
When using
debug_traceBlockByHash
withcallTracer
I expect thegasUsed
to be thegasUsed
by the transaction. (https://geth.ethereum.org/docs/dapp/builtin-tracers#calltracer) documentationi.e. on
Goerli Testnet
(https://goerli.etherscan.io/tx/0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a) is an example
Actual behaviour
It outputs the wrong gasUsed. For that specific txn: gas used is:
0x24ca6
Out put is:
if you run
eth_getTransactionReceipt
on the same tx hash:0x5bd8217569235b62252bc5c5063d1e6e9ee9e450ae7370c2d9c349ca1692ef8a
gas used is:
0x2a006
Steps to reproduce the behaviour
0x436ec05f6768296d48150241a1217000f2d7a4cfd8e36803150f2d5219ebab7b
the gas used is different.
Backtrace
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered: