{"record":{"id":"24b4a1dcbc7156c5","repo":"nautechsystems/nautilus_trader","slug":"canonical-nonce-advanced-without-an-authenticated","errorCode":null,"errorMessage":"Canonical nonce advanced without an authenticated signer transaction in the canonical range","messagePattern":"Canonical nonce advanced without an authenticated signer transaction in the canonical range","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":3193,"sourceCode":"                wallet_address: &wallet_address,\n                nonce,\n                finalized_cursor: finalized_cursor.as_ref(),\n                matched_transaction_hash: matched_hash.as_deref(),\n                manifest_version: &self.manifest_version,\n                manifest_digest: &self.manifest_digest,\n                provider_ids: &self.provider_ids,\n                operator_ids: &self.operator_ids,\n                failure_domain_ids: &self.failure_domain_ids,\n                decisions: &decisions,\n            })\n            .await?;\n\n        if let Some(e) = mismatch {\n            return Err(e);\n        }\n\n        if matched.is_none() && end == head.number {\n            anyhow::bail!(\n                \"Canonical nonce advanced without an authenticated signer transaction in the canonical range\"\n            );\n        }\n        Ok(matched)\n    }\n\n    async fn persist_rebroadcast_decisions(\n        &self,\n        intent_id: i64,\n        nonce: u64,\n        decisions: &[ExecutionVerificationDecision],\n    ) -> anyhow::Result<()> {\n        let wallet_address = self.wallet_address.to_string();\n        self.database\n            .record_execution_verification_batch(&ExecutionVerificationBatch {\n                intent_id,\n                chain_id: self.chain_id,\n                wallet_address: &wallet_address,","sourceCodeStart":3175,"sourceCodeEnd":3211,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L3175-L3211","documentation":"The client tracks the signer account's nonce against the chain's canonical head. This error is thrown when the canonical nonce has advanced to a value higher than what this client last authenticated, yet no transaction signed by this signer was found within the canonical block range it inspected. It is a safety check against nonce drift — the account moved without a locally-verifiable cause, so the client refuses to proceed with stale nonce assumptions.","triggerScenarios":"Calling transaction submission or nonce-verification paths (the function returning the matched canonical nonce) when: the signer sent transactions from another client/wallet, a transaction was replaced or reorged out of the canonical range, or the local nonce cache is behind the chain head with no authenticated tx found between the tracked range and head.number.","commonSituations":"Shared signing key used by multiple services or bots; manual transfers from the same hot wallet; a chain reorg removing the tx that justified the nonce bump; running a second instance of the trader against the same key; provider switching between endpoints with divergent views of the head.","solutions":["Pause submissions for this signer and re-sync the nonce from the chain before resuming","Audit for other processes or wallets using the same signer key and stop the contention","Wait for the canonical range to include the missing signer transaction, or wait for chain head to stabilize after a reorg","Restart the client so the nonce cache is rebuilt from the current canonical state"],"exampleFix":"// before: resubmitting immediately after nonce error\nsubmit_trade(plan).await?;\n// after: resync nonce and confirm no external signer activity\nlet nonce = client.fetch_account_nonce(signer).await?;\nclient.reset_cached_nonce(signer, nonce).await?;\nsubmit_trade(plan).await?;","handlingStrategy":"retry","validationCode":"let chain_nonce = client.fetch_account_nonce(signer).await?;\nassert_eq!(chain_nonce, client.cached_nonce(signer), \"nonce drifted; resync before submitting\");","typeGuard":null,"tryCatchPattern":"match res {\n    Err(e) if e.to_string().contains(\"Canonical nonce advanced\") => {\n        client.resync_nonce(signer).await?;\n        retry_later();\n    }\n    other => other?,\n}","preventionTips":["Use a dedicated signer key per client instance","Never send funds from the trading hot wallet manually","Monitor nonce drift with an alert on external nonce changes","Resync the nonce from chain before each submission batch"],"tags":["blockchain","nonce","consistency","ethereum"],"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"}