{"record":{"id":"bcb7481cf90cccfb","repo":"nautechsystems/nautilus_trader","slug":"unowned-replacement-hash-retains-signed-bytes","errorCode":null,"errorMessage":"Unowned replacement hash retains signed bytes","messagePattern":"Unowned replacement hash retains signed bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":5374,"sourceCode":"                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                    )?;\n                    authenticated.insert(hash.id, raw);\n                } else {\n                    anyhow::ensure!(\n                        hash.raw_transaction.is_none() && hash.sealed_transaction.is_none(),\n                        \"Unowned replacement hash retains signed bytes\"\n                    );\n                }\n            }\n\n            if let Some(nonce) = intent.nonce {\n                anyhow::ensure!(\n                    nonce_owners.insert(nonce, intent.id).is_none(),\n                    \"Retained execution history has duplicate signer nonce ownership\"\n                );\n            }\n\n            let base_decision = verification_decision(\n                nonce_verification,\n                Some(finalized.number),\n                Some(finalized.number),\n            );","sourceCodeStart":5356,"sourceCodeEnd":5392,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L5356-L5392","documentation":"When replaying retained hashes, a replacement hash that the current client cannot authenticate as its own (not owned by this signer) must carry no signed bytes (raw_transaction / sealed_transaction). This error is thrown if an unowned replacement hash still stores signed transaction bytes, which would be a security risk — signed bytes for another owner should never be retained or replayed.","triggerScenarios":"Recovery encounters hash.current intent whose owner check fails (verification migration path not taken) while hash.raw_transaction or hash.sealed_transaction is Some.","commonSituations":"Snapshot copied from another deployment/wallet that includes signed raw transactions; a version that persisted signed bytes for replacement hashes before this ownership rule existed; store corruption or tampering.","solutions":["Purge the offending snapshot (or strip raw_transaction/sealed_transaction from unowned hashes) and rebuild execution state","Upgrade/downgrade to the client version that authored the snapshot so ownership verification can authenticate the hashes","Never share durable execution stores between wallets; keep signed bytes encrypted and scoped per signer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn no_signed_bytes_on_unowned(hashes: &[HashRecord], wallet: Address) -> bool {\n    hashes.iter().filter(|h| !owned_by(h, wallet))\n        .all(|h| h.raw_transaction.is_none() && h.sealed_transaction.is_none())\n}","typeGuard":null,"tryCatchPattern":"match client.start_with_snapshot(snapshot) {\n    Err(e) if e.to_string().contains(\"retains signed bytes\") => { /* quarantine store, strip signed bytes from unowned hashes, rebuild */ }\n    other => other?,\n}","preventionTips":["Never share execution stores across wallets","Encrypt and scope signed transaction bytes to a single signer","Run snapshot integrity checks (ownership + signed-bytes policy) before loading"],"tags":["security","signed-transaction","ownership","recovery","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"}