{"record":{"id":"4cc464c9fd351d45","repo":"linera-io/linera-protocol","slug":"block-not-found-for-hash-block-hash","errorCode":null,"errorMessage":"block not found for hash {block_hash}","messagePattern":"block not found for hash (.+?)","errorType":"exception","errorClass":"ProofError","httpStatus":null,"severity":"warning","filePath":"linera-bridge/src/proof/gen.rs","lineNumber":120,"sourceCode":"                    \"transaction receipt not found for {tx_hash}\"\n                ))\n            })?;\n\n        let block_hash = receipt.inner.block_hash.ok_or_else(|| {\n            ProofError::Transient(anyhow::anyhow!(\"receipt missing block_hash (pending tx?)\"))\n        })?;\n        let tx_index = receipt.inner.transaction_index.ok_or_else(|| {\n            ProofError::Transient(anyhow::anyhow!(\"receipt missing transaction_index\"))\n        })?;\n\n        // 2. Get full block → header RLP\n        let block = self\n            .provider\n            .get_block_by_hash(block_hash)\n            .await\n            .map_err(|e| ProofError::Transient(e.into()))?\n            .ok_or_else(|| {\n                ProofError::Transient(anyhow::anyhow!(\"block not found for hash {block_hash}\"))\n            })?;\n\n        let mut block_header_rlp = Vec::new();\n        block.header.inner.encode(&mut block_header_rlp);\n\n        // Sanity check: header RLP hashes to the expected block hash\n        let computed_hash = alloy_primitives::keccak256(&block_header_rlp);\n        if computed_hash != block_hash {\n            return Err(ProofError::Permanent(anyhow::anyhow!(\n                \"header RLP hash mismatch: computed {computed_hash}, expected {block_hash}. \\\n                 This may indicate the RPC returned non-standard header fields.\"\n            )));\n        }\n\n        // 3. Get all block receipts\n        let all_receipts = self\n            .provider\n            .get_block_receipts(block.header.number.into())","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/proof/gen.rs#L102-L138","documentation":"eth_getBlockByHash returned null for the block hash taken from the receipt. Classified ProofError::Transient. The RPC node does not know this block: most commonly the block was pruned (node keeps limited history), is on a reorged-out branch, or the node is not synced to that height.","triggerScenarios":"Calling generate_deposit_proof for an older deposit against a pruned node (public/free Base endpoints often keep only recent blocks); a reorg between fetching the receipt and fetching the block; an archive gap on a load-balanced cluster.","commonSituations":"Free or default RPC endpoints with short block-history retention; batch-processing historical deposits; RPC providers that route eth_getBlockByHash to nodes with different prunes.","solutions":["Use an archive or full-history RPC endpoint that serves the deposit's block","Generate proofs for recent transactions before they age out of the node's history","Retry once to rule out transient routing; if consistently null, the history is pruned","Verify the block hash on an explorer and compare with the block number the RPC can serve"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Preflight: check the RPC can serve the block for this receipt.\nlet receipt = provider.get_transaction_receipt(tx_hash).await?.expect(\"mined\");\nlet bh = receipt.inner.block_hash.expect(\"confirmed\");\nif provider.get_block_by_hash(bh).await.ok().flatten().is_none() {\n    // history pruned: switch to an archive RPC before generating proofs\n}","typeGuard":null,"tryCatchPattern":"Err(ProofError::Transient(e)) if e.to_string().contains(\"block not found\") => {\n    // once retried: if still failing, history is pruned — move to an archive endpoint\n}","preventionTips":["Use archive/full-history RPC endpoints for deposit proof generation","Process deposits while they are recent, before history pruning windows expire","Monitor for this error to detect when your RPC's retention is too short"],"tags":["evm","rpc","block","pruned-node","bridge","transient"],"backgroundTag":"pruned-block-history","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}