{"record":{"id":"6760ffef1056fa2b","repo":"nautechsystems/nautilus_trader","slug":"execution-verification-ledger-is-not-initialized","errorCode":null,"errorMessage":"Execution verification ledger is not initialized","messagePattern":"Execution verification ledger is not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":2537,"sourceCode":"            checkpoint.value.number <= target.number,\n            \"Pre-sign decision header precedes the trusted checkpoint\"\n        );\n        let mut decisions = vec![verification_decision(\n            &checkpoint,\n            Some(checkpoint.value.number),\n            Some(checkpoint.value.number),\n        )];\n        let wallet_address = self.wallet_address.to_string();\n        let position = self\n            .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),","sourceCodeStart":2519,"sourceCodeEnd":2555,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L2519-L2555","documentation":"`verify_decision_ancestry` loads the durable execution verification position (the persisted finalized header tip) from the database for this chain/wallet/manifest. If no row exists, the verification ledger was never initialized, so there is no durable ancestry baseline and the client aborts the pre-sign flow.","triggerScenarios":"Calling the transaction preparation path against a database that has no `execution_verification_position` record for the configured (chain_id, wallet_address, manifest_version, manifest_digest) tuple — first run without running ledger initialization, or a config change (new manifest version/digest, different wallet or chain) that keys a nonexistent ledger entry.","commonSituations":"Fresh deployment where the bootstrap/initialization step was skipped; rotating the deployment manifest version without re-initializing the ledger; pointing the client at the wrong database/chain id; wiping the database while keeping runtime state.","solutions":["Run the ledger initialization/bootstrap step for the configured chain, wallet, and manifest before signing transactions.","Verify the client config (chain_id, wallet_address, manifest_version, manifest_digest) matches an initialized ledger row.","Check the client is connected to the intended database (wrong env: staging vs production).","If the manifest was rotated, initialize the new manifest's ledger position before resuming signing."],"exampleFix":"// before: signing immediately after deploy with a fresh DB\nlet prepared = client.prepare_and_sign(intent).await?; // no ledger row for manifest v2\n// after: initialize first\ninitializer.init_execution_verification_ledger(chain_id, &wallet, \"v2\", &manifest_digest).await?;\nlet prepared = client.prepare_and_sign(intent).await?;","handlingStrategy":"validation","validationCode":"pub async fn ledger_ready(db: &Database, chain_id: i64, wallet: &str, manifest_version: &str, digest: &str) -> anyhow::Result<bool> {\n    Ok(db.load_execution_verification_position(chain_id, wallet, manifest_version, digest).await?.is_some())\n}","typeGuard":null,"tryCatchPattern":"match client.prepare_and_sign(intent).await {\n    Err(e) if e.to_string().contains(\"ledger is not initialized\") => {\n        init_ledger(cfg).await?;\n        client.prepare_and_sign(intent).await\n    }\n    other => other,\n}","preventionTips":["Run ledger initialization as a mandatory startup/deployment step.","Re-initialize whenever manifest_version or manifest_digest changes.","Assert ledger presence in readiness/health checks before enabling signing."],"tags":["blockchain","database","initialization","ledger"],"backgroundTag":"resource-not-found","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"}