{"record":{"id":"e7176653a3d8a8ec","repo":"nautechsystems/nautilus_trader","slug":"released-terminal-intent-status-conflicts-with-its","errorCode":null,"errorMessage":"Released terminal intent status conflicts with its verified receipt","messagePattern":"Released terminal intent status conflicts with its verified receipt","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":5583,"sourceCode":"                    self.chain.chain_id,\n                    &self\n                        .config\n                        .verification\n                        .as_ref()\n                        .expect(\"verification config validated\")\n                        .deployment_manifest,\n                    trace_purpose,\n                )\n                .await?,\n            );\n            let terminal_status = if receipt.status {\n                TransactionStatus::Finalized\n            } else {\n                TransactionStatus::Reverted\n            };\n\n            if !intent.active {\n                anyhow::ensure!(\n                    intent.status == terminal_status.as_str(),\n                    \"Released terminal intent status conflicts with its verified receipt\"\n                );\n            }\n            records.push(ExecutionVerificationMigrationRecord {\n                intent_id: intent.id,\n                nonce: Some(nonce),\n                transaction_hash: Some(current.transaction_hash.clone()),\n                terminal_status: Some(terminal_status),\n                block_number: Some(receipt.block_number),\n                block_hash: Some(receipt.block_hash.to_string()),\n                receipt_success: Some(receipt.status),\n                gas_used: Some(receipt.gas_used),\n                effective_gas_price: Some(receipt.effective_gas_price.to_string()),\n                recover_prepared: false,\n                decisions,\n            });\n        }","sourceCodeStart":5565,"sourceCodeEnd":5601,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L5565-L5601","documentation":"When releasing a terminal intent during migration, the client derives the expected status (Finalized or Reverted) from the verified receipt and ensures the persisted intent status matches it. This prevents publishing a released intent whose recorded status disagrees with the on-chain outcome, which would corrupt downstream state machines.","triggerScenarios":"Migrating/releasing an inactive (terminal) intent whose stored status string is not exactly \"finalized\" or \"reverted\" as implied by its verified receipt's execution outcome.","commonSituations":"Statuses written by an older client version using different status strings; a crash between receipt confirmation and status update; manual edits or partial writes to the durable intent store; deserialized records from another chain where the outcome differed.","solutions":["Inspect the durable intent record and update its status to match the verified receipt outcome (finalized/reverted)","Re-derive intent statuses from receipts via the migration repair path instead of trusting stored status","Check for schema/version drift between the writer that stored the status and this migration code","Exclude or quarantine the conflicting intent so it is re-processed after the migration completes"],"exampleFix":"// before\nintent.status = \"success\"\n// after (must equal the receipt-derived terminal status)\nintent.status = TransactionStatus::Finalized.as_str() // \"finalized\"","handlingStrategy":"validation","validationCode":"// before releasing, confirm status matches the receipt-derived terminal status\nlet expected = if receipt_success { \"finalized\" } else { \"reverted\" };\nassert_eq!(intent.status, expected, \"intent status must match verified receipt\");","typeGuard":"fn is_consistent_terminal_intent(intent: &Intent, receipt: &Receipt) -> bool {\n    !intent.active && intent.status == terminal_status_from(receipt)\n}","tryCatchPattern":"match release_intent(&intent).await {\n    Err(e) if e.to_string().contains(\"status conflicts with its verified receipt\") => {\n        reconcile_intent_status_from_receipt(&intent.id).await?; // repair and retry\n    }\n    Err(e) => return Err(e),\n    Ok(_) => Ok(()),\n}","preventionTips":["Always derive intent status from the receipt in the same transaction that stores the receipt","Keep status enum strings consistent across client versions (avoid ad-hoc strings like \"success\")","Handle crashes between receipt confirmation and status update with a reconciliation pass","Validate persisted intents at startup before releasing"],"tags":["blockchain","state-consistency","migration"],"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"}