{"record":{"id":"26b5390359f51fa4","repo":"nautechsystems/nautilus_trader","slug":"receipt-verification-is-locally-invalid-for-transa","errorCode":null,"errorMessage":"Receipt verification is locally invalid for transaction {tx_hash}","messagePattern":"Receipt verification is locally invalid for transaction (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":3367,"sourceCode":"                    }\n                }\n                VerificationOutcome::Retryable(_) => {\n                    continue;\n                }\n                VerificationOutcome::Disagreement(_) => {\n                    return Ok(InclusionOutcome::Pending(format!(\n                        \"Receipt verification disagreed for transaction {tx_hash}; the intent stays occupied for reconciliation\"\n                    )));\n                }\n                VerificationOutcome::Unavailable(_) => {\n                    log::warn!(\n                        \"Finality poll {}/{} for transaction {tx_hash} was unavailable\",\n                        attempt + 1,\n                        self.receipt_max_polls\n                    );\n                }\n                VerificationOutcome::LocallyInvalid(_) => {\n                    anyhow::bail!(\n                        \"Receipt verification is locally invalid for transaction {tx_hash}\"\n                    );\n                }\n            }\n        }\n\n        self.database\n            .record_execution_status(\n                prepared.intent_id,\n                &tx_hash.to_string(),\n                TransactionStatus::Dropped,\n                None,\n                None,\n                None,\n                None,\n                None,\n            )\n            .await?;","sourceCodeStart":3349,"sourceCodeEnd":3385,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L3349-L3385","documentation":"During receipt-based finality polling, the verification layer returned VerificationOutcome::LocallyInvalid for the transaction, meaning the fetched receipt contradicts locally-held expectations (e.g. receipt fields disagree with the signed transaction or local record). The client bails out rather than treating the tx as confirmed.","triggerScenarios":"Polling a transaction receipt to finality when the returned receipt fails local validation — wrong status, mismatched block/hash versus the signed tx, or a receipt from a different transaction than tx_hash under an unreliable provider.","commonSituations":"Misbehaving or misconfigured RPC endpoint returning inconsistent receipts; tx was replayed/replaced (same hash on a forked chain); querying the wrong network/chain ID so the hash resolves to an unrelated receipt.","solutions":["Verify the RPC endpoint and chain ID match the intended network","Re-fetch the receipt manually and compare block number, status, and hash against the signed transaction","Switch to a trusted/redundant RPC provider","Re-check whether the tx was replaced (e.g. by a same-nonce resubmission) and restart finality tracking for the new tx"],"exampleFix":"// before: single flaky endpoint\nlet client = ExecutionClient::new(rpc_url);\n// after: validated endpoint with matching chain id\nassert_eq!(client.chain_id().await?, expected_chain_id);\nlet client = ExecutionClient::new(verified_rpc_url);","handlingStrategy":"retry","validationCode":"let receipt = rpc.get_receipt(tx_hash).await?;\nassert_eq!(receipt.transaction_hash, tx_hash, \"receipt does not match requested tx hash\");","typeGuard":null,"tryCatchPattern":"match res {\n    Err(e) if e.to_string().contains(\"locally invalid\") => {\n        switch_to_backup_rpc();\n        reverify_receipt(tx_hash)?;\n    }\n    other => other?,\n}","preventionTips":["Pin RPC endpoints to the correct chain ID and verify at startup","Use redundant providers with receipt cross-checking","Track replaced transactions (same nonce) and restart finality tracking","Compare receipt fields against the signed tx before trusting them"],"tags":["blockchain","receipt","verification","ethereum"],"backgroundTag":"checksum-mismatch","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}