{"record":{"id":"2228fad5dd2956ae","repo":"nautechsystems/nautilus_trader","slug":"finality-status-conflicts-with-the-verified-transa","errorCode":null,"errorMessage":"Finality status conflicts with the verified transaction receipt","messagePattern":"Finality status conflicts with the verified transaction receipt","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":3531,"sourceCode":"            ),\n        ]);\n        Ok(Some(StableFinality {\n            decisions,\n            inclusion_header: durable_verified_header(&canonical_again),\n            finalized_headers: finalized_headers\n                .iter()\n                .map(durable_verified_header)\n                .collect(),\n        }))\n    }\n\n    async fn commit_verified_finality(\n        &self,\n        included: &IncludedTransaction,\n        status: TransactionStatus,\n        verified_postconditions: &[ExecutionVerificationDecision],\n    ) -> anyhow::Result<()> {\n        anyhow::ensure!(\n            matches!(\n                status,\n                TransactionStatus::Finalized | TransactionStatus::Reverted\n            ) && included.receipt.status == (status == TransactionStatus::Finalized),\n            \"Finality status conflicts with the verified transaction receipt\"\n        );\n        let mut decisions = included.finality.decisions.clone();\n        decisions.extend_from_slice(verified_postconditions);\n        let wallet_address = self.wallet_address.to_string();\n        let transaction_hash = included.tx_hash.to_string();\n        let block_hash = included.receipt.block_hash.to_string();\n        let effective_gas_price = included.receipt.effective_gas_price.to_string();\n        self.database\n            .record_execution_finality_verified(&ExecutionFinalityTransition {\n                intent_id: included.intent_id,\n                chain_id: self.chain_id,\n                wallet_address: &wallet_address,\n                nonce: included.nonce,","sourceCodeStart":3513,"sourceCodeEnd":3549,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L3513-L3549","documentation":"Before committing a verified finality outcome, `commit_verified_finality` requires the status to be Finalized or Reverted AND to agree with the receipt's execution status stored on `included.receipt` (true == finalized/success, false == reverted). A mismatch between the finality status and the on-chain receipt means the outcome cannot be committed consistently.","triggerScenarios":"Calling finality handling with a status like Pending/Confirmed instead of Finalized|Reverted, or reporting Finalized for a transaction whose receipt `status == false` (reverted), or Reverted for a successful receipt.","commonSituations":"Upstream adapter mapping receipt status incorrectly; race where status was fetched before the transaction's terminal state; mixing status enums from different provider versions.","solutions":["Re-fetch the transaction receipt and recompute the status from `receipt.status` before committing.","Ensure the status mapping only produces Finalized/Reverted for terminal receipts.","Verify the receipt is from the canonical, finalized block before deriving status."],"exampleFix":"// before: status guessed from logs\nlet status = if logs.is_empty() { TransactionStatus::Reverted } else { TransactionStatus::Finalized };\n// after: derive from receipt\nlet status = if included.receipt.status { TransactionStatus::Finalized } else { TransactionStatus::Reverted };","handlingStrategy":"type-guard","validationCode":"let valid = matches!(status, TransactionStatus::Finalized | TransactionStatus::Reverted)\n    && included.receipt.status == (status == TransactionStatus::Finalized);\nanyhow::ensure!(valid, \"status does not match receipt\");","typeGuard":"fn is_terminal_status_agreeing_with_receipt(status: &TransactionStatus, receipt_status: bool) -> bool {\n    matches!(status, TransactionStatus::Finalized | TransactionStatus::Reverted)\n        && receipt_status == (*status == TransactionStatus::Finalized)\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"conflicts with the verified transaction receipt\") => {\n        refetch_receipt_and_recompute_status(included).await\n    }\n    other => other,\n}","preventionTips":["Derive status from receipt.status, never from heuristics","Only classify Finalized/Reverted after the block itself is finalized","Re-fetch receipts if status was observed before terminal state"],"tags":["finality","receipt","status-mapping","consistency"],"backgroundTag":"invalid-state-transition","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"}