evm-rpc: don't crash dump on Stable 0x3f transaction type (stable-testnet writer stall)#503
Open
elina-chertova wants to merge 1 commit into
Open
evm-rpc: don't crash dump on Stable 0x3f transaction type (stable-testnet writer stall)#503elina-chertova wants to merge 1 commit into
elina-chertova wants to merge 1 commit into
Conversation
Stable chain (chainId 988 mainnet / 2201 testnet) emits a custom 0x3f transaction type that encodeTransaction/serializeTransaction cannot RLP-encode, so they throw unexpectedCase(0x3f). With --verify-tx-root (and --verify-tx-sender) enabled the evm-dump process crashes on any block containing such a tx and crash-loops on it forever, stalling the writer. Mirror the existing Polygon PIP-74 (0x7f) handling: for Stable, skip transactions-root verification for blocks containing a 0x3f tx (trust the block's own transactionsRoot, which is identical across independent providers) and skip sender recovery for 0x3f txs.
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.
Cause (proven)
dump-stable-testnet-0(imagesubsquid/evm-dump:cf85ec9c, which is currentmasterHEAD) is in a crash-loop: 51 restarts in 26h, deterministically stuck at block 57807799. Production stack trace from the crashed container:The dump runs with
--verify-tx-root(and--verify-tx-sender). Block 57807799 contains a transaction of type0x3f(a Stable-chain–specific type).encodeTransaction/serializeTransactiononly handle known EIP-2718 types andthrow unexpectedCase(tx.type)for0x3f. That throw is fatal → the process crashes → it re-reads the same block on restart → crash-loop. The raw dump never advances past 57807799, so the parquet writer (ingest-stable-testnet-0) has no new data andsqd_last_block_totalgoes flat →stable-testnet_Writer_Short_Stall.Cross-check (rule: anomaly must be confirmed against a different node implementation)
eth_getBlockByNumber(57807799, true)against two independent providers — Stable's own RPC (ar-partners-rpc-testnet.stable.xyz) and Alchemy (stable-testnet.g.alchemy.com) — return the identical block: same hash0xa4d188…, sametransactionsRoot 0x8b9d82ba…, and the same tx idx 1type 0x3ffrom0xf5a637…with a real signature (r/s non-zero). So0x3fis a legitimate Stable transaction type, not provider corruption — and the chain's owntransactionsRoot(which we cannot reproduce without the0x3fencoding spec) is consensus data we can trust. This is why swapping the RPC provider (open infra PR #571) does not fix it: Alchemy serves the exact same block.Fix
Mirror the existing Polygon PIP-74 (
0x7f) handling already incalculateTransactionsRoot:calculateTransactionsRoot: forisStable, if a block contains a0x3ftx, return the block's owntransactionsRoot(skip recomputation we can't perform).recoverTxSender: forisStable, skip sender recovery for0x3ftxs (returnsundefined;mapBlockalreadycontinues on a null sender).This stops the fatality so a known-good but unencodable tx type can no longer crash-loop the dump, while still verifying every other block. It covers both
stable-testnet(2201) andstable-mainnet(988), which shareisStable.After merge, the
evm-dumpimage must be rebuilt and theevm-archivedump for stable-testnet bumped to it.Falsification
If the dump still crash-loops after deploying an image built from this commit — e.g. it crashes on a different unhandled tx type, or in receipts-root/logs-bloom rather than tx-root/tx-sender — then this fix is insufficient and the offending type must be inspected. Also: if a future cross-check showed the two providers disagreeing on
transactionsRootfor such a block, trusting the block's root would be wrong and the data would need provider escalation instead.