{"record":{"id":"8ed2bf61ef98615a","repo":"linera-io/linera-protocol","slug":"tx-index-tx-index-not-found-in-block-receipts","errorCode":null,"errorMessage":"tx_index {tx_index} not found in block receipts","messagePattern":"tx_index (.+?) not found in block receipts","errorType":"exception","errorClass":"ProofError","httpStatus":null,"severity":"error","filePath":"linera-bridge/src/proof/gen.rs","lineNumber":166,"sourceCode":"        //    Convert RPC logs → primitives logs so Encodable2718 is available.\n        //    OpReceiptEnvelope handles both standard types and OP deposit (0x7e).\n        let canonical_receipts: Vec<(u64, Vec<u8>)> = all_receipts\n            .into_iter()\n            .enumerate()\n            .map(|(idx, r)| {\n                let consensus_receipt = r.inner.inner.map_logs(|log| log.inner);\n                let encoded = consensus_receipt.encoded_2718();\n                (idx as u64, encoded)\n            })\n            .collect();\n\n        // 5. Build receipt trie and generate proof\n        let receipt_rlp = canonical_receipts\n            .iter()\n            .find(|(idx, _)| *idx == tx_index)\n            .map(|(_, rlp)| rlp.clone())\n            .ok_or_else(|| {\n                ProofError::Permanent(anyhow::anyhow!(\n                    \"tx_index {tx_index} not found in block receipts\"\n                ))\n            })?;\n\n        let (receipts_root, proof_nodes) =\n            crate::proof::build_receipt_proof(&canonical_receipts, tx_index);\n\n        // Sanity check: computed receipts root matches block header\n        if receipts_root != block.header.inner.receipts_root {\n            return Err(ProofError::Permanent(anyhow::anyhow!(\n                \"receipts root mismatch: computed {receipts_root}, \\\n                 header says {}. Receipt encoding may be incorrect.\",\n                block.header.inner.receipts_root\n            )));\n        }\n\n        // Find all DepositInitiated log indices from the canonical receipt\n        let logs =","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/proof/gen.rs#L148-L184","documentation":"The receipt's transaction_index has no matching entry in the enumerated block receipts. Classified ProofError::Permanent. The two RPC responses (eth_getTransactionReceipt and eth_getBlockReceipts) are mutually inconsistent — different backing nodes behind a load balancer, a reorg between the calls, or an indexing bug on the provider.","triggerScenarios":"Calling generate_deposit_proof while the RPC cluster serves the two answers from nodes at different heights; a reorg replacing the block between the receipt and receipts fetch; a provider whose receipts endpoint is buggy for the block.","commonSituations":"Load-balanced public RPCs during block production; unstable providers around reorg-heavy periods; automation retrying quickly without pinning to one endpoint.","solutions":["Retry against a single consistent RPC endpoint (a dedicated/archive node)","Verify the tx index and block on an explorer to confirm which response was wrong","If reproducible on one provider, switch providers or report the inconsistency"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Err(ProofError::Permanent(e)) if e.to_string().contains(\"tx_index\") => {\n    // inconsistent RPC data: retry once against a single dedicated endpoint;\n    // persist the failure with tx_hash and block for diagnostics\n}","preventionTips":["Use one pinned RPC endpoint for the whole proof pipeline instead of load-balanced pools","Avoid generating proofs during heavy reorg periods","Log tx_index, block number, and provider identity when this fires to identify the bad endpoint"],"tags":["evm","rpc","receipts","consistency","bridge","permanent"],"backgroundTag":"inconsistent-rpc-data","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}