Repository navigation
Report no transfer for root calls halted before running - #96
Merged
Merged
Conversation
On Amsterdam, evm2 runs the root frame hooks for a transaction whose runtime gas phase ran out of gas, so the inspector took the value of that call as transferred and rolled back. It never moved.
Merging this PR will release reth-v2.11.0-fh3.1-1
Release notesFixed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Merging this PR releases
reth-v2.11.0-fh3.1-1.Bug
On Amsterdam,
reth-v2.11.0-fh3.1reports a value transfer that never happened. When a transaction's root call sends value and runs out of gas in the EIP-2780 runtime gas phase, the block shows aREASON_TRANSFERdebit of the sender and credit of the recipient inside the failed root call. evm2 halts before the value moves, so go-ethereum reports no transfer.reth-v2.10.0-fh3.1did not report it either.A Sepolia block had 7 such transactions: 3 wei sent to an empty account with a 24000 gas limit, too little for the new-account state gas. The sender's next
REASON_GAS_BUYstarts from the balance before the reported debit.Cause
evm2
66687c18runs the root frame'scall/call_endhooks for a transaction halted in the runtime gas phase (go-ethereum'shaltTopFrame). Inexit_frame, the inspector takes a value transfer the journal never showed as one that happened and was rolled back, unless the call stopped withOutOfFundsorCallTooDeep. The halted frame stops withOutOfGas, so the inspector reported its transfer.Fix
evm2 gives the hooks no sign that the frame was halted.
halted_in_runtime_gas_phaserepeats the two out-of-gas halts of evm2'sethereum::prepare_initial_frame, andexit_frameskips the transfer of a root call that matches either:PrecompileOOG, soOutOfGasmeans the new-account charge failed;code_address == call_target): the delegate access charge failed.The helper's doc comment says it must stay in sync with
prepare_initial_frame. Replacing it with a flag from evm2 on the halted frame needs an upstream evm2 change.Tests
New tests in
inspector/tests/balance.rs:root_call_halted_on_new_account_gas_reports_no_transferandroot_call_halted_on_delegation_access_gas_reports_no_transferfail without the fix.root_call_to_precompile_out_of_gas_reports_the_transferchecks that a value call to an empty precompile that pays the new-account charge and then runs out of gas still reports its transfer.cargo test -p reth-firehose -p reth-firehose-testspasses (84 + 9 tests).Battlefield
reth-dev(Amsterdam): the new test in streamingfast/battlefield-ethereum#48 fails onreth-v2.11.0-fh3.1and passes on this branch. The full suite on this branch has 95 passing, 0 failing and 43 pending,Compare blocksincluded.