fix(evm): fall back to tx.gasPrice when receipt omits effectiveGasPrice (Cronos)#18
Merged
Merged
Conversation
Ethermint/Cosmos-EVM forks (e.g. Cronos Mainnet) return receipts without an effectiveGasPrice field. BigInt(undefined) then throws inside the EVM token transfer extractor, and because the throw propagates up through tokenTransfers(), it drops the entire block — yielding zero rows for every Cronos block that contains transactions. Fall back to the transaction's gasPrice (then 0) so the gas-fee math is safe. Backward-compatible: the fallback only triggers when effectiveGasPrice is absent, which previously threw. Verified against live Cronos blocks (0 rows -> full extraction).
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
Mesh reported missing data on their Cronos Mainnet dev pipeline — chains served by Alchemy/QuickNode worked, Cronos produced nothing.
Root cause is in the EVM token-transfer extractor. Cronos (an Ethermint/Cosmos-EVM fork) returns transaction receipts without an
effectiveGasPricefield. The extractor does:BigInt(undefined)throws, and since the throw propagates up throughtokenTransfers(), it drops the entire block — every Cronos block containing transactions yields zero rows. That's the "missing data," and it's exactly why Alchemy/QuickNode chains were unaffected (they populateeffectiveGasPrice).Fix
Fall back to the transaction's
gasPrice(then0) so the gas-fee math can't throw:Backward-compatible — the fallback only triggers when
effectiveGasPriceis absent (which previously threw), so no behavior change for any chain that already works. Likely also fixes other Ethermint-style chains (Evmos/Kava/Canto/etc.).Verification
Ran the customer's transform verbatim against live Cronos blocks via
jiti.indexing.co:TypeError: Cannot convert undefined to a BigIntatevm.ts:27→ 0 rows🤖 Generated with Claude Code