{"record":{"id":"000fa76b6d14b3b8","repo":"nautechsystems/nautilus_trader","slug":"persisted-transaction-row-references-intent-ex","errorCode":null,"errorMessage":"Persisted transaction row references intent {}, expected {}","messagePattern":"Persisted transaction row references intent (.+?), expected (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1195,"sourceCode":"        let hashes = database.get_execution_transaction_hashes(intent.id).await?;\n        let current = current_execution_hash(intent.id, &hashes)?;\n        let tx_hash = B256::from_str(&current.transaction_hash).with_context(|| {\n            format!(\n                \"Execution intent {} has invalid transaction hash {}\",\n                intent.id, current.transaction_hash\n            )\n        })?;\n        let policy = PayloadPolicy {\n            chain_id: self.chain.chain_id,\n            signer: self.wallet_address,\n            gas_limit: self.config.gas_limit,\n            max_fee_per_gas: self.config.max_fee_per_gas_wei,\n        };\n        let mut authenticated_payloads = HashMap::new();\n        let mut current_payload = None;\n\n        for hash in &hashes {\n            anyhow::ensure!(\n                hash.intent_id == intent.id,\n                \"Persisted transaction row references intent {}, expected {}\",\n                hash.intent_id,\n                intent.id\n            );\n            anyhow::ensure!(\n                hash.chain_id == self.chain.chain_id,\n                \"Persisted transaction row chain ID {} does not match configured chain ID {}\",\n                hash.chain_id,\n                self.chain.chain_id\n            );\n\n            if !hash.payload_expected {\n                anyhow::ensure!(\n                    hash.raw_transaction.is_none() && hash.sealed_transaction.is_none(),\n                    \"Replacement transaction {} unexpectedly retains signed bytes\",\n                    hash.transaction_hash\n                );","sourceCodeStart":1177,"sourceCodeEnd":1213,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1177-L1213","documentation":"A persisted transaction row (transaction hash record) references a different intent id than the active intent being reconciled. This is an internal consistency check on the database join between intents and their transactions.","triggerScenarios":"connect() -> reconcile_unresolved_execution(): iterating hashes from get_execution_transaction_hashes(intent.id), a row's hash.intent_id != intent.id.","commonSituations":"Corrupted or manually edited database; buggy writer associating transactions with the wrong intent; concurrent writers reusing rows.","solutions":["Inspect the execution transactions table and fix or remove rows whose intent_id is inconsistent","Re-derive transactions for the intent from a clean state (let the client re-sign)","Audit the code path that inserts transaction rows to ensure intent_id is always set from the active intent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let hashes = database.get_execution_transaction_hashes(intent.id).await?;\nif hashes.iter().any(|h| h.intent_id != intent.id) {\n    // repair or purge inconsistent rows before recovery\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce foreign keys between transactions and intents","Never reuse transaction rows across intents","Audit any tooling that writes to the execution tables"],"tags":["blockchain","database","consistency","recovery"],"backgroundTag":"internal-invariant-violation","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"}