rpc/jsonrpc: replay originally failed txns in overlay_getLogs when state overrides are present - #23133
Open
lupin012 wants to merge 2 commits into
Open
rpc/jsonrpc: replay originally failed txns in overlay_getLogs when state overrides are present#23133lupin012 wants to merge 2 commits into
lupin012 wants to merge 2 commits into
Conversation
…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
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.
Problem
overlay_getLogsskipped 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.REVERToverridden withLOG0) 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, andApplyMessagehandles 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.