{"record":{"id":"978aadf510e37df7","repo":"FuelLabs/fuel-core","slug":"compression-database-height-compression-db-height","errorCode":null,"errorMessage":"compression database height({compression_db_height}) is less than target height({target_block_height})","messagePattern":"compression database height\\((.+?)\\) is less than target height\\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/combined_database.rs","lineNumber":549,"sourceCode":"                return Err(anyhow::anyhow!(\n                    \"off-chain database height({off_chain_height}) \\\n                    is less than target height({target_block_height})\"\n                ));\n            }\n\n            if let Some(gas_price_chain_height) = gas_price_chain_height\n                && gas_price_chain_height < target_block_height\n            {\n                return Err(anyhow::anyhow!(\n                    \"gas-price database height({gas_price_chain_height}) \\\n                    is less than target height({target_block_height})\"\n                ));\n            }\n\n            if let Some(compression_db_height) = compression_db_height\n                && compression_db_height < target_block_height\n            {\n                return Err(anyhow::anyhow!(\n                    \"compression database height({compression_db_height}) \\\n                    is less than target height({target_block_height})\"\n                ));\n            }\n\n            if on_chain_height > target_block_height {\n                self.on_chain().rollback_last_block()?;\n            }\n\n            if off_chain_height > target_block_height {\n                self.off_chain().rollback_last_block()?;\n            }\n\n            if let Some(gas_price_chain_height) = gas_price_chain_height\n                && gas_price_chain_height > target_block_height\n            {\n                self.gas_price().rollback_last_block()?;\n            }","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/combined_database.rs#L531-L567","documentation":"The compression database variant of the height guard in rollback_to: its height is Optional (None is fine), but a recorded height below target_block_height aborts the rollback because the compression DB cannot be advanced by a rollback. This keeps compressed-state history consistent with the chain height being rolled back to.","triggerScenarios":"rollback_to with target_block_height above the compression database's recorded height — compression registry/state stopped being written before the target, or the compression DB was restored from an older snapshot than the rest.","commonSituations":"Compression feature enabled mid-chain or disabled for a period; partial snapshot restore omitting newer compression data; compression writer failures going unnoticed while the chain advanced.","solutions":["Run the node until the compression DB records heights up to the chain height, then retry the rollback.","Pick a target_block_height no greater than the compression DB height if that history must be kept.","If compression history is rebuildable, clear the compression database and let it re-initialize (height None is permitted)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if let Some(comp_height) = combined_db.compression().latest_height_from_metadata()? {\n    if target_block_height > comp_height {\n        anyhow::bail!(\"target {} above compression DB height {}\", target_block_height, comp_height);\n    }\n}","typeGuard":null,"tryCatchPattern":"match combined_db.rollback_to(target, &mut shutdown) {\n    Ok(()) => Ok(()),\n    Err(e) if e.to_string().contains(\"compression database height\") => {\n        // let compression writer catch up, or cap the target at its height\n        let cap = combined_db.compression().latest_height_from_metadata()?.unwrap_or(target);\n        combined_db.rollback_to(target.min(cap), &mut shutdown)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Don't toggle the compression feature on an existing chain mid-height without re-baselining its DB.","Watch compression writer errors: silent failures leave its height stale.","Compression height is Optional — prefer wiping and rebuilding over rolling back a lagging DB."],"tags":["database","rollback","compression","height-mismatch","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}