feat: Indexed the derived txs in the kv indexer#21
Merged
Conversation
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.
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.
Description
Indexes derived EVM txs (internal executions emitted only as events, no embedded
MsgEthereumTx) in the KV indexer and makes them safely servable over JSON-RPC.indexer/kv_indexer.go—IndexBlocknow indexes derived txs by hash andblock-index, sharing the block's eth-tx counter so it stays aligned with the emitted
txIndex([F-2026-17745] Derived transactions share a constant txIndex value #18). Writes a derived marker (IsDerivedTx) in the same batch.rpc/backend/tx_info.go— on a KV-indexer hit,GetTxByEthHashrebuilds the tx'sTxResultAdditionalFieldsfrom block events when the marker says derived. Without this,getTransactionByHash/getTransactionReceiptpanic on derived txs(
interface conversion: *MsgSend, not *MsgEthereumTx);TraceTransactionerrored.The marker gate keeps standard-tx lookups cheap (one key read, no event reparse).
types/indexer.go— addsIsDerivedTxto theEVMTxIndexerinterface.This is the KV-indexer serving path (Option 1) complementing the
tx_searchfallbackalready on this branch (Option 2) — together they serve derived txs even when CometBFT
tx_indexis disabled butjson-rpc.enable-indexeris on.Review notes
derivedTxAdditionalFieldsintx_info.goandindexDerivedTxsinkv_indexer.go.indexer(hash/index resolution + marker) andrpc/backend(
getTransactionByHash/Receiptderived serving, with the panic reproduced pre-fix).Closes: F-2026-17740