Skip to content

Emit reverted value-transfer balance changes for precompile calls - #18

Merged
sduchesneau merged 2 commits into
firehose/2.xfrom
fix/precompile-reverted-value-transfer-balance-changes
Jul 9, 2026
Merged

Emit reverted value-transfer balance changes for precompile calls#18
sduchesneau merged 2 commits into
firehose/2.xfrom
fix/precompile-reverted-value-transfer-balance-changes

Conversation

@sduchesneau

Copy link
Copy Markdown

A tx sending value to a precompile that then runs out of gas reverts the
transfer. revm truncates the BalanceTransfer journal entry on rollback
before call_end's journal walk runs, and precompiles never step, so both
balance changes were dropped — geth reports them.

Capture the non-self transfer at call-enter in pending_value_transfer,
cleared by process_journal_changes once the journal entry is emitted
(stepping or successful no-step callee). If it survives to call_end the
call reverted, so re-emit it synthetically from the post-rollback (=
pre-transfer) balances, unless the call aborted before the transfer
(OutOfFunds / CallTooDeep).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

A tx sending value to a precompile that then runs out of gas reverts the
transfer. revm truncates the BalanceTransfer journal entry on rollback
before call_end's journal walk runs, and precompiles never step, so both
balance changes were dropped — geth reports them.

Capture the non-self transfer at call-enter in pending_value_transfer,
cleared by process_journal_changes once the journal entry is emitted
(stepping or successful no-step callee). If it survives to call_end the
call reverted, so re-emit it synthetically from the post-rollback (=
pre-transfer) balances, unless the call aborted before the transfer
(OutOfFunds / CallTooDeep).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sduchesneau
sduchesneau requested a review from UlysseCorbeil July 8, 2026 18:18

@UlysseCorbeil UlysseCorbeil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…e-reverted-value-transfer-balance-changes

# Conflicts:
#	crates/firehose/src/inspector.rs
@sduchesneau
sduchesneau merged commit 73f9271 into firehose/2.x Jul 9, 2026
4 checks passed
@sduchesneau
sduchesneau deleted the fix/precompile-reverted-value-transfer-balance-changes branch July 9, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants