{"record":{"id":"830b5763f0ae1d48","repo":"nautechsystems/nautilus_trader","slug":"durable-finalized-header-tip-conflicts-with-indepe","errorCode":null,"errorMessage":"Durable finalized header tip conflicts with independent sources","messagePattern":"Durable finalized header tip conflicts with independent sources","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":2547,"sourceCode":"            .database\n            .load_execution_verification_position(\n                self.chain_id,\n                &wallet_address,\n                &self.manifest_version,\n                &self.manifest_digest,\n            )\n            .await?\n            .ok_or_else(|| anyhow::anyhow!(\"Execution verification ledger is not initialized\"))?;\n        let durable_tip = parse_verified_header(&position.finalized_tip)?;\n        anyhow::ensure!(\n            durable_tip.number >= checkpoint.value.number && durable_tip.number <= target.number,\n            \"Pre-sign decision header does not extend the durable finalized header tip\"\n        );\n        let durable_tip_verification = required_verification(\n            self.verification.verify_block(durable_tip.number).await,\n            \"pre-sign durable finalized tip\",\n        )?;\n        anyhow::ensure!(\n            durable_tip_verification.value == durable_tip,\n            \"Durable finalized header tip conflicts with independent sources\"\n        );\n\n        if durable_tip != checkpoint.value {\n            decisions.push(verification_decision(\n                &durable_tip_verification,\n                Some(durable_tip.number),\n                Some(durable_tip.number),\n            ));\n        }\n        let mut cursor = durable_tip;\n        while cursor.number < target.number {\n            let end = cursor.number.saturating_add(4_096).min(target.number);\n            let start = cursor.number.saturating_add(1);\n            let ancestry = required_verification(\n                self.verification.verify_header_window(cursor, end).await,\n                \"pre-sign decision ancestry\",","sourceCodeStart":2529,"sourceCodeEnd":2565,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L2529-L2565","documentation":"The durable finalized tip persisted in the ledger is independently re-verified against the chain (`verify_block(durable_tip.number)`) and compared for exact equality with the stored header. A mismatch means the durable record disagrees with what the chain (via an independent verification source) reports for that height — a corrupted/incorrect ledger entry or a reorg past the recorded tip — so the client aborts rather than building ancestry on a false baseline.","triggerScenarios":"Calling the pre-sign path when the stored `finalized_tip` header (hash/content) differs from the freshly verified header at the same height — e.g. ledger row written from bad data, a reorg that replaced the finalized tip's block, or cross-chain/wrong-database contamination of the row.","commonSituations":"A deep reorg invalidating what was believed finalized; manual database edits or restores from a different environment; a bug in the tip-parsing/persistence path storing an incorrect header; pointing the client at a different RPC/network than the one the ledger was built from.","solutions":["Investigate the mismatch: compare the stored tip against the chain's canonical block at that height to determine corruption vs reorg.","If corruption is confirmed, re-initialize or repair the execution verification ledger row from verified chain data.","Confirm the client and ledger use the same chain/RPC/network; mismatched endpoints produce contradictory headers.","Treat recurrence as a serious integrity signal — halt signing until the ledger lineage is validated end to end."],"exampleFix":"// before: trusting the stored tip blindly after a DB restore\nlet prepared = client.prepare_and_sign(intent).await?;\n// after: validate the stored tip against the chain before resuming\nverify_ledger_tip_matches_chain(chain_id, &wallet, &manifest_digest).await?;\nlet prepared = client.prepare_and_sign(intent).await?;","handlingStrategy":"validation","validationCode":"pub async fn durable_tip_consistent(ver: &Verification, stored: &VerifiedBlockHeader) -> anyhow::Result<bool> {\n    let live = ver.verify_block(stored.number).await?;\n    Ok(&live.value == stored)\n}","typeGuard":null,"tryCatchPattern":"match prepare().await {\n    Err(e) if e.to_string().contains(\"conflicts with independent sources\") => {\n        halt_signing(\"ledger tip integrity violation — manual investigation required\");\n        Err(e.into())\n    }\n    other => other,\n}","preventionTips":["Never edit or restore verification ledger rows manually across environments.","Confirm client and ledger share the same chain/RPC/network identity.","Alert immediately on any tip mismatch and pause signing until lineage is re-validated."],"tags":["blockchain","ledger-integrity","reorg","consistency-check"],"backgroundTag":"checksum-mismatch","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"}