[F-2026-17775] - Inconsistent log reporting for failed derived transactions across JSON-RPC endpoints#19
Merged
Conversation
…nintended state persistence
…ived EVM execution
…or derived transaction lookups
…ounter for derived EVM executions
…ch GetTransactionLogs semantics
…drop broken event change (F-2026-17775)
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.
[F-2026-17775] - Inconsistent log reporting for failed derived transactions across JSON-RPC endpoints
Problem
When a derived EVM transaction fails (EVM reverts but the Cosmos transaction succeeds — a scenario enabled by the inbound handler swallowing EVM errors), two RPC endpoints behaved inconsistently:
GetTransactionLogs— already returnednilfor failed transactions via an explicitres.Failedguard. Correct.GetTransactionReceipt— unconditionally calledTxLogsFromEventsand included anyEventTypeTxLogevents found in the block results, regardless of the EVM execution outcome.Because the pre-fix
DerivedEVMCallWithDataemittedEventTypeTxLogevents even for reverted executions ("ghost logs"),GetTransactionReceiptwould return non-empty logs for a transaction whose EVM outcome was a revert. This misrepresents the transaction to clients and breaks EVM semantics (failed transactions must yield no logs).Root Cause
The failure had two contributing layers:
x/vm/keeper/call_evm.go):EventTypeTxLogwas emitted unconditionally, including for reverted derived transactions (fixed separately inbloom-block-issue.md).rpc/backend/tx_info.go):GetTransactionReceiptdid not consultres.Failedbefore parsing logs from block-result events. If ghost log events existed in the block results, they were silently included in the receipt.Fix
Execution layer (defense-in-depth,
bloom-block-issue.md)EventTypeTxLogemission and bloom/log-size updates inDerivedEVMCallWithDataare now gated on!res.Failed(), so ghost log events are never written for reverted executions.RPC layer (
rpc/backend/tx_info.go)GetTransactionReceiptnow checksres.Failedbefore callingTxLogsFromEvents:Integration tests (
rpc/backend/tx_info_test.go)TestFailedTxLogsConsistencycovers three scenarios for a failed EVM transaction (EVM reverted, Cosmos tx succeeded) whose block results contain ghostEventTypeTxLogevents:GetTransactionLogsreturnsnil— early return onres.Failed, no RPC calls needed.GetTransactionReceiptreturns empty logs — ghost events in block results are ignored;receipt["logs"]is[][]*ethtypes.Log{}.GetTransactionLogsreturnsnilandGetTransactionReceiptreturns empty logs for the same transaction.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranch