fix: gas and gasUsed in trace root only for ParityTrace #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request is Part 1/2 of fixing the bug where the
gas
andgasUsed
fields in Parity Trace root are incorrect.Part 2/2 paradigmxyz/reth#9761
Related Issues and Pull Requests
Problem
The
gas
andgasUsed
fields in Geth Debug Trace root should be the gas limit and gas used for the entire transaction.However, two fields in Parity Trace root should be the original ones.
Reproducible Example
With the latest version Reth v1.0.3, using
trace_transaction()
to tracethe transaction
0x03128677ee3a9623d20f3c677f423ccc592d126374bf32e331343dd1bdf38b61
From Reth
From Etherscan and QuickNode
Solution for
revm-inspectors
Not modify
gas_limit
andgas_used
in the trace rootThe modification in Step 1 will cause another problem
The
gas
field for Geth Debug Trace root will also be reset (not the gas limitation for the entire transaction).therefore, can define
set_transaction_gas_limit()
andwith_transaction_gas_limit()
for Geth Debug,which is similar to current
set_transaction_gas_used()
andwith_transaction_gas_used()
for Parity.Then, modify the Reth Part:
crates/rpc/rpc/src/trace.rs
andcrates/rpc/rpc/src/debug.rs
to completely fix the bug.Miscellaneous
Actually, I love the current design, but the results are inconsistent with those of others.
When I used
make pr
to test the Reth Part, the issue make pr failed of lockfile reth#9381 still exists for me.I should only skip tests for
lockfile
and test them seperately.