-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
Bug Description
In rpc/backend/comet_to_eth.go, ReceiptsFromCometBlock casts TxResult.EthTxIndex directly to uint without resolving the -1 sentinel value:
TransactionIndex: uint(txResult.EthTxIndex), // #nosec G115When EthTxIndex == -1 (meaning "not yet determined by indexer"), int32(-1) wraps to uint64(18446744073709551615).
Reproduction
- Run a cosmos/evm chain and submit EVM transactions during fast block production
- If the indexer hasn't assigned
EthTxIndexyet, it is stored as-1 - Call
eth_getTransactionReceiptfor that transaction - The
transactionIndexfield in the receipt is0xffffffffffffffffinstead of the correct index
Impact
- All viem/wagmi clients throw
IntegerOutOfRangeErrorwhen receiving this receipt waitForTransactionhangs indefinitely because the receipt is unparseable- Affects any chain running cosmos/evm with active transaction throughput
- PR fix: wrong TransactionIndex in receipt #723/fix: wrong TransactionIndex in receipt #806 fixed TransactionIndex to use
EthTxIndexinstead of loop index, but did not handle the-1sentinel case
Expected Behavior
The -1 sentinel should be resolved to the correct transaction index (the loop counter), matching the existing fallback pattern in tx_info.go:68-76:
if txResult.EthTxIndex == -1 {
txResult.EthTxIndex = int32(i)
}Proposed Fix
Add sentinel resolution before the uint cast in ReceiptsFromCometBlock, matching the pattern already used in GetTransactionByHash.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels