{"record":{"id":"e858b42e07f9462c","repo":"nautechsystems/nautilus_trader","slug":"pool-state-header-changed-before-signing","errorCode":null,"errorMessage":"Pool state header changed before signing","messagePattern":"Pool state header changed before signing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":2693,"sourceCode":"            }\n        }\n    }\n\n    async fn verify_swap_anchors_before_sign(\n        &self,\n        anchors: &SwapQuoteAnchors,\n    ) -> anyhow::Result<Vec<ExecutionVerificationDecision>> {\n        let checkpoint = required_verification(\n            self.verification.verify_checkpoint().await,\n            \"pre-sign checkpoint reread\",\n        )?;\n        let watermark = required_verification(\n            self.verification\n                .verify_block(anchors.watermark.number)\n                .await,\n            \"pre-sign profiler watermark reread\",\n        )?;\n        anyhow::ensure!(\n            watermark.value == anchors.watermark,\n            \"Pool state header changed before signing\"\n        );\n        let ancestry = required_verification(\n            self.verification\n                .verify_header_window(watermark.value, anchors.state.number)\n                .await,\n            \"pre-sign profiler ancestry reread\",\n        )?;\n\n        if let Some(last) = ancestry.value.last() {\n            anyhow::ensure!(\n                *last == anchors.state,\n                \"Swap decision header changed in the pre-sign ancestry reread\"\n            );\n        } else {\n            anyhow::ensure!(\n                watermark.value == anchors.state,","sourceCodeStart":2675,"sourceCodeEnd":2711,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L2675-L2711","documentation":"Pre-sign anchor re-verification: the profiler watermark block re-read at signing time differs from the one the swap quote was anchored to, meaning pool state advanced (or reorged) and the quote is stale.","triggerScenarios":"Thrown at crates/adapters/blockchain/src/execution/client.rs:2693 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Abort and retry the swap with refreshed anchors","Ensure the signing step happens promptly after quoting"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}