{"record":{"id":"4f5dfe5f527332f5","repo":"nautechsystems/nautilus_trader","slug":"verified-finalized-height-regressed-below-the-dura","errorCode":null,"errorMessage":"Verified finalized height regressed below the durable finalized header tip","messagePattern":"Verified finalized height regressed below the durable finalized header tip","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":3451,"sourceCode":"        anyhow::ensure!(\n            durable_tip.number >= checkpoint.number,\n            \"Durable finalized header tip precedes the trusted checkpoint\"\n        );\n        let mut finalized_headers = vec![durable_tip];\n        let durable_tip_verification = required_verification(\n            self.verification.verify_block(durable_tip.number).await,\n            \"finality durable header tip\",\n        )?;\n        anyhow::ensure!(\n            durable_tip_verification.value == durable_tip,\n            \"Durable finalized header tip conflicts with independent sources\"\n        );\n        decisions.push(verification_decision(\n            &durable_tip_verification,\n            Some(durable_tip.number),\n            Some(durable_tip.number),\n        ));\n        anyhow::ensure!(\n            finalized.number >= durable_tip.number,\n            \"Verified finalized height regressed below the durable finalized header tip\"\n        );\n        let mut ancestry_cursor = durable_tip;\n        while ancestry_cursor.number < finalized.number {\n            let end = ancestry_cursor\n                .number\n                .saturating_add(4_096)\n                .min(finalized.number);\n            let start = ancestry_cursor.number.saturating_add(1);\n            let ancestry_verification = required_verification(\n                self.verification\n                    .verify_header_window(ancestry_cursor, end)\n                    .await,\n                \"finality ancestry\",\n            )?;\n            let ancestry = &ancestry_verification.value;\n            ancestry_cursor = *ancestry","sourceCodeStart":3433,"sourceCodeEnd":3469,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L3433-L3469","documentation":"The client fetches the newly verified finalized header for the receipt and requires it to be at or above the durable tip height. If verification reports a finalized height lower than what is already durable, finality has apparently regressed, which is impossible on a healthy chain and indicates a fork, misconfiguration, or corrupt verification source.","triggerScenarios":"During finality verification of a receipt when the finality lookup yields a finalized header whose number < `durable_tip.number` — e.g. after a deep reorg or switching verification providers mid-run.","commonSituations":"Pointing the verification source at a lagging or different-chain endpoint; a catastrophic reorg invalidating previously finalized blocks; mixing ledger state with a fresh provider.","solutions":["Halt processing; do not treat the receipt as finalized.","Confirm the verification endpoint is on the same chain and fully synced.","If a genuine deep reorg occurred, reset the ledger/checkpoint to a common ancestor and re-sync."],"exampleFix":"// before: provider reports finalized=1150 but durable tip=1200\nlet finalized = provider.finalized_header()?;\nanyhow::ensure!(finalized.number >= durable_tip.number, ...);\n// after: guard with provider health check before running finality\nensure_provider_synced_and_same_chain(&provider, &chain_id)?;","handlingStrategy":"validation","validationCode":"let finalized = provider.finalized_header().await?;\nanyhow::ensure!(finalized.number >= ledger_tip_number, \"finality regressed; possible deep reorg\");","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"regressed below the durable\") => {\n        halt_finality_processing();\n        investigate_reorg()?;\n    }\n    other => other,\n}","preventionTips":["Halt on any finality regression; never process receipts through it","Verify provider sync status and chain ID before verification runs","Set up deep-reorg alarms from your infrastructure"],"tags":["finality","reorg","consistency","verification"],"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-14T00:17:10.932Z"}