{"record":{"id":"3a650d5d2251d7bd","repo":"linera-io/linera-protocol","slug":"receipts-root-mismatch-computed-receipts-root","errorCode":null,"errorMessage":"receipts root mismatch: computed {receipts_root}, header says {}. Receipt encoding may be incorrect.","messagePattern":"receipts root mismatch: computed (.+?), header says (.+?)\\. Receipt encoding may be incorrect\\.","errorType":"exception","errorClass":"ProofError","httpStatus":null,"severity":"critical","filePath":"linera-bridge/src/proof/gen.rs","lineNumber":176,"sourceCode":"            .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 =\n            crate::proof::decode_receipt_logs(&receipt_rlp).map_err(ProofError::Permanent)?;\n        let log_indices = crate::proof::find_deposit_log_indices(&logs);\n        if log_indices.is_empty() {\n            return Err(ProofError::Permanent(anyhow::anyhow!(\n                \"no DepositInitiated event found in receipt for tx {tx_hash}\"\n            )));\n        }\n\n        Ok(DepositProof {\n            block_header_rlp,","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/proof/gen.rs#L158-L194","documentation":"A permanent integrity check: the receipts trie rebuilt locally from the RPC's receipts must root exactly at block.header.receipts_root. A mismatch means the canonical EIP-2718 re-encoding of receipts is wrong for at least one receipt in the block (e.g. transaction-type envelope handling, OP deposit type 0x7e) or the RPC returned altered receipts. The generated proof would not verify on-chain, so generation aborts.","triggerScenarios":"A block containing a transaction type whose receipt envelope is encoded differently than this crate's OpReceiptEnvelope path expects; RPC providers returning receipts with adjusted fields; alloy/op-alloy version drift in encoded_2718 behavior.","commonSituations":"New or unusual transaction types landing on the chain after this code was written; upgraded RPC backends normalizing receipts; running against a non-OP chain while the client assumes Optimism receipt types.","solutions":["Try a different RPC provider to rule out receipt tampering/normalization","Check that the chain matches the client's network type (Optimism/Base with 0x7e deposit receipts)","Compare the failing block's receipts against a reference node and identify which receipt type mis-encodes","Update alloy/op-alloy and linera-bridge — receipt encoding fixes land there"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Err(ProofError::Permanent(e)) if e.to_string().contains(\"receipts root mismatch\") => {\n    // encoding integrity failure: fall back to another provider to rule out receipt tampering;\n    // if reproducible, halt processing for this chain and escalate — proofs would not verify\n}","preventionTips":["Update linera-bridge/alloy/op-alloy when new transaction types appear on the chain","Run the crate's fixture tests (e.g. Base mainnet receipt proof) after dependency upgrades","Treat this as a stop-the-line integrity failure, never a retryable hiccup"],"tags":["evm","rlp","merkle-trie","receipts","bridge","permanent","integrity"],"backgroundTag":"merkle-root-mismatch","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}