Skip to content

rpc/jsonrpc: replay originally failed txns in overlay_getLogs when state overrides are present - #23133

Open
lupin012 wants to merge 2 commits into
mainfrom
lupin012/overlay_getlogs_replay_failed_txns
Open

rpc/jsonrpc: replay originally failed txns in overlay_getLogs when state overrides are present#23133
lupin012 wants to merge 2 commits into
mainfrom
lupin012/overlay_getlogs_replay_failed_txns

Conversation

@lupin012

@lupin012 lupin012 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Problem

overlay_getLogs skipped originally failed non-creation transactions during replay, using the canonical receipt as skip condition. With state overrides that receipt no longer predicts the outcome: a transaction that fails under the original code but succeeds under the override (e.g. REVERT overridden with LOG0) was silently omitted from the results.

Closes #23117

Fix

When the request carries state overrides, failed transactions are re-executed instead of skipped. Logs of replays that still fail are discarded by the existing res.Failed() check, and ApplyMessage handles the sender nonce.

The skip is kept for the no-override path on purpose: replay raises the gas limit to the gas cap, so an originally out-of-gas transaction could flip to success and emit spurious logs.

Tests

  • TestOverlayGetLogsReplaysFailedTxWithCodeOverride — reproduces the issue (red before the fix, green after).
  • TestOverlayGetLogsSkipsFailedTxWithoutOverrides — pins the no-override skip, including nonce accounting; verified by mutation.

…ate overrides are present

overlay_getLogs used the canonical receipt as a skip condition during block
replay: originally failed non-creation txns were never re-executed, only their
sender nonce was bumped. With state overrides the original outcome no longer
predicts the replay outcome, so a txn that failed under the original code but
succeeds under the override (e.g. REVERT code overridden with LOG0) was
silently omitted from the results.

Failed txns are now re-executed when the request carries state overrides. The
skip is kept for the no-override path on purpose: replay raises each txn's gas
limit to the gas cap, so re-executing an originally out-of-gas txn could flip
it to success and emit spurious logs. Logs of replays that still fail are
discarded by the existing res.Failed() check, and ApplyMessage handles the
sender nonce, so the manual bump is only needed on the skip path.

Closes #23117
@lupin012
lupin012 requested a review from yperbasis as a code owner August 9, 2026 19:52
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.

overlay_getLogs skips originally failed transactions before replaying code overrides

1 participant