{"record":{"id":"7c6bbcd5e6e7d999","repo":"FuelLabs/fuel-core","slug":"block-not-found-at-height","errorCode":null,"errorMessage":"Block not found at height: {:?}","messagePattern":"Block not found at height: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/service/adapters/compression_adapters.rs","lineNumber":73,"sourceCode":"}\n\nimpl block_source::BlockSource for CompressionBlockDBAdapter {\n    fn subscribe(&self) -> fuel_core_services::stream::BoxStream<SharedImportResult> {\n        self.block_importer.events_shared_result()\n    }\n\n    fn get_block(&self, height: BlockAt) -> anyhow::Result<Block> {\n        let latest_view = self.db.latest_view()?;\n        let height = match height {\n            BlockAt::Genesis => latest_view.genesis_height()?.ok_or_else(|| {\n                anyhow::anyhow!(\"Genesis block not found in the database\")\n            })?,\n            BlockAt::Specific(h) => h.into(),\n        };\n        let block = latest_view\n            .get_sealed_block_by_height(&height)?\n            .map(|sealed_block| sealed_block.entity)\n            .ok_or(anyhow::anyhow!(\"Block not found at height: {:?}\", height))?;\n        Ok(block)\n    }\n}\n\nimpl configuration::CompressionConfigProvider\n    for crate::service::config::DaCompressionConfig\n{\n    fn config(&self, chain_id: ChainId) -> config::CompressionConfig {\n        config::CompressionConfig::new(\n            self.retention_duration,\n            self.starting_height,\n            self.metrics,\n            chain_id,\n        )\n    }\n}\n\nimpl compression_storage::LatestHeight for Database<CompressionDatabase> {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service/adapters/compression_adapters.rs#L55-L91","documentation":"Thrown by CompressionBlockDBAdapter::get_block (crates/fuel-core/src/service/adapters/compression_adapters.rs:73), the BlockSource port of the DA compression service. After resolving the requested BlockAt against the latest on-chain view, get_sealed_block_by_height returned None: no sealed block is stored at that height. Genesis resolution is a separate branch with its own error, so this specifically covers missing blocks at explicit heights.","triggerScenarios":"The compression service calls get_block(BlockAt::Specific(h)) where h is above the latest committed height, inside a pruned range, or in a gap (e.g., after rollback) of Database<OnChain>.","commonSituations":"DaCompressionConfig starting_height set beyond current chain height or beyond retained history; enabling compression on a node that has not synced that far; querying right after the database was rolled back to a lower height.","solutions":["Set the compression starting_height to a height at or below the node's current chain height with unpruned history","Wait until the node has fully synced past starting_height before enabling DA compression","If history was pruned, re-sync the on-chain database or restore it from a full snapshot"],"exampleFix":"// before (config):\n//   da_compression: { starting_height: 1_000_000, .. }   // chain only at 900_000\n// after:\n//   da_compression: { starting_height: 900_000, .. }      // <= latest committed height","handlingStrategy":"validation","validationCode":"fn can_serve(db: &Database<OnChain>, h: u32) -> anyhow::Result<bool> {\n    let view = db.latest_view()?;\n    let latest = view.latest_height().map(u32::from);\n    Ok(matches!(latest, Some(l) if h <= l)\n        && view.get_sealed_block_by_height(&h.into()).is_ok())\n}\n// call before BlockSource::get_block(BlockAt::Specific(h))","typeGuard":"fn is_block_not_found(e: &anyhow::Error) -> bool {\n    e.to_string().starts_with(\"Block not found at height\")\n}","tryCatchPattern":"match block_source.get_block(BlockAt::Specific(h)) {\n    Err(e) if is_block_not_found(&e) => {\n        // height beyond chain/pruned: skip or wait for sync, not a fatal error\n        tracing::warn!(h, \"block not available yet\");\n    }\n    other => other,\n}","preventionTips":["Derive compression starting_height from the node's current latest height, not a hardcoded constant","Gate compression startup on 'synced past starting_height' checks","Monitor pruning policy so heights referenced by compression config stay retained"],"tags":["fuel-core","compression","database","block-height","config"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}