Skip to content

evm-rpc: skip cumulativeGasUsed check on hedera-mainnet (fix dump crash-loop)#522

Open
elina-chertova wants to merge 1 commit into
masterfrom
alert-fix/qHLvLh-hedera-cumgas
Open

evm-rpc: skip cumulativeGasUsed check on hedera-mainnet (fix dump crash-loop)#522
elina-chertova wants to merge 1 commit into
masterfrom
alert-fix/qHLvLh-hedera-cumgas

Conversation

@elina-chertova

Copy link
Copy Markdown
Contributor

Problem

dump-hedera-mainnet-0 is crash-looping on a fatal assertion at block 97395350, producing two correlated alerts (qHLvLh lead, Ds4EYo follower):

AssertionError: cumulativeGasUsed mismatch at receipt of tx 0x991b618d...
  at Rpc.addReceiptsByBlock (evm/evm-rpc/lib/rpc.js:335)
  actual: 245566, expected: 207589

Root cause

Hedera's eth_getBlockReceipts returns a phantom duplicate receipt — tx 0xe305d666 appears both at its real index 8 (gasUsed=0) and again at a phantom index 12 (gasUsed=37977) that is not in the block's transaction list. Confirmed genuine across three independent providers (linkpool, hashio, thirdweb).

The recent dedup fix (cdf0a60c) correctly drops the phantom by transaction index, restoring the receipt count. But the block's on-chain cumulativeGasUsed (idx14 = 245566) still counts the dropped phantom's 37977 gas. So the checkCumulativeGasUsed running-sum invariant (cumulative == prev + gasUsed) becomes unsatisfiable: 181262 + 26327 = 207589 ≠ 245566 — exactly the crash. The assert propagates uncaught → process crash → crash-loop → both alerts.

Fix

Skip the running-sum checkCumulativeGasUsed on hedera-mainnet (both the by-block and by-tx paths), consistent with the existing isHederaMainnet special-casing. Hedera uses non-standard Hashgraph hashing/receipt semantics, like the already-excluded stable/cronos/bittensor chains.

Tests

  • New regression test in rpc.test.ts using real data from block 97395350 — RED reproduces the exact production crash (207589n vs 245566n), GREEN after the fix.
  • Added hedera fixture to the loader; added hedera to verification.test.ts skips (non-standard roots: transactionsRoot == block hash, all-zeros withdrawalsRoot).
  • Full local CI reproduced green: rush build (tsc) + rush test (vitest) → 156 passed, 31 skipped. Rush change file included.

🤖 Generated during automated alert investigation qHLvLh.

Hedera's eth_getBlockReceipts returns a phantom duplicate receipt (a tx
appearing at an index not present in the block). The duplicate is filtered
out to keep the receipt count consistent, but the block's on-chain
cumulativeGasUsed still accounts for the dropped copy, so the
'cumulative == prev + gasUsed' running-sum assertion can never hold once the
duplicate is removed. The uncaught assert crash-loops the dump process.

Skip the running-sum check on hedera-mainnet (both the by-block and by-tx
paths), consistent with the existing isHederaMainnet special-casing. Adds a
regression test using real data from block 97395350.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant