{"record":{"id":"11a4f19b27fb7811","repo":"nautechsystems/nautilus_trader","slug":"empty-profiler-ancestry-does-not-end-at-the-decisi","errorCode":null,"errorMessage":"Empty profiler ancestry does not end at the decision header","messagePattern":"Empty profiler ancestry does not end at the decision header","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":4004,"sourceCode":"            verification,\n        )\n        .await?;\n    }\n\n    let ancestry = verified_value(\n        verification\n            .verify_header_window(canonical_block, head.number)\n            .await,\n        \"profiler-to-decision ancestry\",\n    )?;\n\n    if let Some(last) = ancestry.last() {\n        anyhow::ensure!(\n            *last == head,\n            \"Swap decision header conflicts with profiler ancestry\"\n        );\n    } else {\n        anyhow::ensure!(\n            canonical_block == head,\n            \"Empty profiler ancestry does not end at the decision header\"\n        );\n    }\n    verified_value(\n        verification\n            .verify_deployment_manifest(manifest, head.number)\n            .await,\n        \"swap deployment manifest\",\n    )?;\n    let quote_contract = validate_manifest_pool(plan, manifest)?;\n    let quote_kind = match plan.order.order_side() {\n        OrderSide::Sell => SwapQuoteKind::ExactInput(quantity_to_raw_amount(\n            plan.order.quantity(),\n            plan.pool.get_base_token().decimals,\n        )?),\n        OrderSide::Buy => SwapQuoteKind::ExactOutput(quantity_to_raw_amount(\n            plan.order.quantity(),","sourceCodeStart":3986,"sourceCodeEnd":4022,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L3986-L4022","documentation":"When verify_header_window returns an empty ancestry, the library falls back to requiring that the canonical block itself equals the decision head — meaning the profiler watermark block is the decision block. If neither the ancestry's last element nor the canonical block matches the head, the decision header cannot be justified from the profiler anchor, so execution aborts.","triggerScenarios":"verify_header_window(canonical_block, head.number) returns an empty Vec while canonical_block != head — e.g. the verifier declined to produce a window for the requested range, leaving no chain of headers connecting the profiler block to the decision head.","commonSituations":"Verifier misconfiguration (window too small, unsupported range) returning empty windows; canonical/head fetched from different sources or times; head advanced past profiler block with the verifier failing to return ancestry; profiler watermark equal to head but canonical data refreshed in between.","solutions":["Refresh the profiler so the watermark block is close to the current head, then revalidate.","Fix verifier configuration so verify_header_window returns the actual header window instead of an empty list.","Ensure canonical block and head come from the same verified source in the same attempt.","Retry after transient RPC issues; verify the endpoint serves consistent header data."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let ancestry = verification.verify_header_window(canonical_block, head.number).await?;\nlet ok = ancestry.last().map_or(false, |l| *l == head) || canonical_block == head;\nif !ok {\n    anyhow::bail!(\"decision header not justified by profiler anchor\");\n}","typeGuard":"fn ancestry_justifies_head(ancestry: &[Block], canonical: &Block, head: &Block) -> bool {\n    ancestry.last().map_or(false, |l| l == head) || canonical == head\n}","tryCatchPattern":null,"preventionTips":["Keep the profiler watermark close to head so a header window always exists.","Configure the verifier to return non-empty windows for the execution range.","Fetch canonical block and head in the same verification attempt."],"tags":["blockchain","consistency-check","verifier","empty-result"],"backgroundTag":"empty-result-set","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"}