[F-2026-17740] - KV indexer path misses derived transactions #17
Merged
Conversation
…nintended state persistence
…ived EVM execution
…or derived transaction lookups
…ack + add tests (F-2026-17740)
Marks them via IsDerivedTx so the RPC backend can rebuild their fields.
Fixes getTransactionByHash/Receipt panic on derived txs (no MsgEthereumTx).
…/kv-index-derived-txs # Conflicts: # rpc/backend/tx_info.go
GetTxByTxIndex reconstructs derived txs (gated by IsDerivedTxByBlockAndIndex) so trace predecessors aren't dropped.
GetTxByEthHash now falls through to tx_search on an indexer miss.
feat: Indexed the derived txs in the kv indexer
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-17740] - KV indexer path misses derived transactions
Issue
The KV indexer only indexes standard
MsgEthereumTxtransactions — EVM executions submitted directly via Ethereum RPC. Derived transactions (EVM calls triggered internally by Cosmos modules such as IBC callbacks, governance, and ERC20 hooks) are never written to the index because they do not appear inblock.Txsand do not carry theExtensionOptionsEthereumTxextension option thatisEthTxrequires.File:
indexer/kv_indexer.goAt query time,
GetTxByEthHashdelegates to the KV indexer when one is configured and treats any error as a hard failure with no fallback:File:
rpc/backend/tx_info.goA working fallback path already exists below the indexer block. It searches Tendermint's event index using the
ethereum_tx.ethereumTxHashattribute, which derived transactions do emit. On nodes without the KV indexer this path resolves derived txs correctly. On nodes with the KV indexer it is structurally unreachable.Impact
eth_getTransactionByHash,eth_getTransactionReceipt, and related APIs when called with a derived transaction hash.Solution
Change the error handling in
GetTxByEthHashandGetTxByEthHashAndMsgIndexso that a KV indexer miss is treated as a cache miss rather than a hard failure. WhenGetByTxHashreturns an error, fall through to the existing Tendermint event-query reconstruction path instead of propagating the error.Behavior after fix
Limitation
The fallback relies on Tendermint's event index. On nodes that prune historical event data, derived transactions older than the pruning window remain unresolvable. A complete fix requires also indexing derived transactions in the KV store during
IndexBlockby scanningtxResults[i].EventsforEventTypeEthereumTxevents carrying aDerivedTxTypemarker — this would give derived txs the same pruning-resistant durability as standard Eth txs.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