{"record":{"id":"a78d0587474fe67a","repo":"linera-io/linera-protocol","slug":"invalid-tx-hash","errorCode":null,"errorMessage":"invalid tx hash: {}","messagePattern":"invalid tx hash: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-bridge/src/main.rs","lineNumber":253,"sourceCode":"            self.max_retries,\n            self.sqlite_path.as_deref(),\n            self.evm_poll_interval_ms\n                .map(std::time::Duration::from_millis),\n            self.max_log_block_range,\n        ))\n        .await\n    }\n}\n\nimpl GenerateDepositProofOptions {\n    async fn run(&self) -> Result<()> {\n        use alloy_primitives::B256;\n        use linera_bridge::proof::gen::{DepositProofClient, HttpDepositProofClient};\n\n        let tx_hash: B256 = self\n            .tx_hash\n            .parse()\n            .map_err(|_| anyhow::anyhow!(\"invalid tx hash: {}\", self.tx_hash))?;\n\n        eprintln!(\"Generating deposit proof for tx {}...\", self.tx_hash);\n\n        let client = HttpDepositProofClient::new(&self.rpc_url)?;\n        let proof = client.generate_deposit_proof(tx_hash).await?;\n\n        let result = serde_json::json!({\n            \"block_header_rlp\": alloy_primitives::hex::encode_prefixed(&proof.block_header_rlp),\n            \"receipt_rlp\": alloy_primitives::hex::encode_prefixed(&proof.receipt_rlp),\n            \"proof_nodes\": proof.proof_nodes.iter()\n                .map(alloy_primitives::hex::encode_prefixed)\n                .collect::<Vec<_>>(),\n            \"tx_index\": proof.tx_index,\n            \"log_indices\": proof.log_indices,\n        });\n\n        let json_str = serde_json::to_string_pretty(&result)?;\n        eprintln!(\"Writing deposit proof to {:?}\", self.output);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/main.rs#L235-L271","documentation":"The linera-bridge 'generate-deposit-proof' CLI parses the --tx-hash argument with B256::from_str, which requires a 32-byte hex value (64 hex chars, optionally 0x-prefixed). Any other shape fails and is reported with this message including the offending input.","triggerScenarios":"Running the CLI with a truncated hash (e.g. '0x7f3a'), non-hex characters, embedded whitespace from shell quoting, a block hash instead of a transaction hash, or a hash copied with an ellipsis from an explorer page.","commonSituations":"Copy-pasting from block explorers that abbreviate hashes; passing the wrong kind of hash (block vs transaction); trailing newline or spaces in scripts/CI variables; hashes from a different chain format.","solutions":["Pass the full 66-character 0x-prefixed transaction hash (0x + 64 hex chars)","Trim whitespace/newlines from the variable before invoking the CLI","Verify the hash on a block explorer for the same network and copy the full transaction hash"],"exampleFix":"# before: truncated / wrong-length hash\n--tx-hash 0x7f3a9d\n\n# after: full 32-byte transaction hash\n--tx-hash 0x7f3a9d2b...full 64 hex chars...","handlingStrategy":"validation","validationCode":"fn valid_tx_hash(s: &str) -> bool {\n    let h = s.trim().strip_prefix(\"0x\").unwrap_or(s.trim());\n    h.len() == 64 && h.bytes().all(|b| b.is_ascii_hexdigit())\n}","typeGuard":"fn parse_tx_hash(s: &str) -> Option<B256> {\n    s.trim().parse().ok()\n}","tryCatchPattern":null,"preventionTips":["Validate 0x + 64 hex in scripts before invoking the CLI","Trim whitespace/newlines from hash variables in CI pipelines","Copy full transaction hashes from explorers, never abbreviated ones"],"tags":["cli","evm","hex","transaction-hash","bridge"],"backgroundTag":"invalid-transaction-hash","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}