{"record":{"id":"03065ee09dd3cf2c","repo":"nautechsystems/nautilus_trader","slug":"retained-execution-intent-has-multiple-current","errorCode":null,"errorMessage":"Retained execution intent {} has multiple current hashes","messagePattern":"Retained execution intent (.+?) has multiple current hashes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":5353,"sourceCode":"        for intent in &snapshot.intents {\n            anyhow::ensure!(\n                intent.chain_id == self.chain.chain_id\n                    && intent.wallet_address == self.config.wallet_address,\n                \"Retained execution intent belongs to another signer\"\n            );\n            let purpose = TransactionPurpose::parse(&intent.purpose).ok_or_else(|| {\n                anyhow::anyhow!(\"Retained execution intent has an unsupported purpose\")\n            })?;\n            let hashes = hashes_by_intent\n                .get(&intent.id)\n                .map(Vec::as_slice)\n                .unwrap_or_default();\n            let current = hashes\n                .iter()\n                .copied()\n                .filter(|hash| hash.current)\n                .collect::<Vec<_>>();\n            anyhow::ensure!(\n                current.len() <= 1,\n                \"Retained execution intent {} has multiple current hashes\",\n                intent.id\n            );\n            let current = current.first().copied();\n            let mut authenticated = HashMap::new();\n\n            for hash in hashes {\n                if hash.payload_expected {\n                    let raw = open_execution_payload(\n                        self.payload_keys\n                            .as_deref()\n                            .expect(\"Postgres execution requires payload keys\"),\n                        self.payload_policy(),\n                        intent,\n                        hash,\n                        \"verification migration\",\n                    )?;","sourceCodeStart":5335,"sourceCodeEnd":5371,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L5335-L5371","documentation":"For each retained intent, the client collects hashes flagged as current; exactly one hash may be the current transaction for an intent. Multiple current hashes mean the persisted state is ambiguous (e.g. a replacement was recorded without clearing the previous hash), so recovery aborts with the intent ID in the message.","triggerScenarios":"Recovering execution state where snapshot.intents[i] has two or more associated transaction hashes with hash.current == true.","commonSituations":"A crash mid-replacement (new hash written before old one was marked non-current) with non-atomic persistence; concurrent writers replacing the same intent; store corruption.","solutions":["Stop writers, inspect the snapshot for the offending intent ID, and mark all but the latest hash as non-current (verify on-chain which tx is actually live)","Reset/rebuild the execution snapshot if the intent is already finalized on-chain","Make hash-replacement persistence atomic (single transaction deactivating the old and activating the new)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"fn current_hashes_unambiguous(snapshot: &ExecutionSnapshot, hashes_by_intent: &HashMap<Uuid, Vec<HashRecord>>) -> Result<(), String> {\n    for intent in &snapshot.intents {\n        let n = hashes_by_intent.get(&intent.id).map(|h| h.iter().filter(|x| x.current).count()).unwrap_or(0);\n        if n > 1 { return Err(format!(\"intent {} has {n} current hashes\", intent.id)); }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match client.start_with_snapshot(snapshot) {\n    Err(e) if e.to_string().contains(\"multiple current hashes\") => { /* reconcile with chain, mark only the live tx current, retry */ }\n    other => other?,\n}","preventionTips":["Persist hash replacement (deactivate old + activate new) atomically","Ensure single-writer access to the execution store","Reconcile current-hash flags with on-chain nonce/status during recovery"],"tags":["state-corruption","recovery","nonce","signer","durable-state"],"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"}