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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug_standardTraceBlockToFile returns only inner gas in gasUsed #22699

Open
MysticRyuujin opened this issue Apr 20, 2021 · 6 comments
Open

debug_standardTraceBlockToFile returns only inner gas in gasUsed #22699

MysticRyuujin opened this issue Apr 20, 2021 · 6 comments
Assignees

Comments

@MysticRyuujin
Copy link
Contributor

I'm trying to figure out how to use debug_standardTraceBlockToFile - but this output doesn't make any sense / is wrong. So I don't know if I'm doing it wrong, or it's broken 馃槃

$ curl -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile","params":["0x0627c2e829d606bcf19703d5c9f6967211ec2296f76e51f57124e2fc0e4e075c",{"txHash":"0x36ff2af6044075f1d37b090c6c07779bc7b4f05cdc731ba4fca4107f85e5686c"}],"id":1}' http://localhost:8545

{"jsonrpc":"2.0","id":1,"result":["/tmp/block_0x0627c2e8-250-0x36ff2af6-361212364"]}

$ sudo cat /tmp/block_0x0627c2e8-250-0x36ff2af6-361212364 
{"output":"","gasUsed":"0x0","time":436}

https://etherscan.io/tx/0x36ff2af6044075f1d37b090c6c07779bc7b4f05cdc731ba4fca4107f85e5686c

@MysticRyuujin
Copy link
Contributor Author

Hmm I tried more tx with more stuff going on and they seem to output a lot more, but that one above is just weird. Unfortunately I don't have a Geth archive node to re-try THAT tx with. And I don't know enough to say if its working correctly or not...

@holiman
Copy link
Contributor

holiman commented Apr 20, 2021 via email

@MysticRyuujin
Copy link
Contributor Author

MysticRyuujin commented Apr 20, 2021

Yes, it is, but gas used isn't 0? Or is this just another quirky Ethereum thing because ETH is special? Haha

@holiman
Copy link
Contributor

holiman commented Apr 20, 2021

Myeah, I think the gasUsed, as returned by the tracer, is the actual gas used by execution, excluding the "intrinsic gas" , i.e, the gas cost for the tx itself (21K) plus the cost for the input data, plus the cost for access list, if any.

That behaviour is indeed a bit wonky, so might deserve it's own ticket. Or at least changing the title.

@holiman holiman changed the title Is debug_standardTraceBlockToFile broken? debug_standardTraceBlockToFile returns only inner gas in gasUsed Apr 20, 2021
@MysticRyuujin
Copy link
Contributor Author

MysticRyuujin commented Apr 20, 2021

Thanks Martin.

I'm not looking to break compatibility or anything, I just didn't understand the output in this context, so I'll leave that decision to change the behavior up to y'all.

@rjl493456442
Copy link
Member

Personally I think we should extend the tracer a bit (as well as the tracing spec https://eips.ethereum.org/EIPS/eip-3155) to include the "intrinsic gas". Although "intrinsic gas" is a bit ugly, but it's also a part of the consensus and can be wrong in different major client implementations. And also for better UX it should also be included.

We will discuss it in the next issue triage(tomorrow).

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

No branches or pull requests

5 participants