{"record":{"id":"b8c1d45205357e49","repo":"FuelLabs/fuel-core","slug":"gas-price-database-height-gas-price-chain-height","errorCode":null,"errorMessage":"gas-price database height({gas_price_chain_height}) is less than target height({target_block_height})","messagePattern":"gas-price database height\\((.+?)\\) is less than target height\\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/combined_database.rs","lineNumber":540,"sourceCode":"\n            if on_chain_height < target_block_height {\n                return Err(anyhow::anyhow!(\n                    \"on-chain database height({on_chain_height}) \\\n                    is less than target height({target_block_height})\"\n                ));\n            }\n\n            if off_chain_height < target_block_height {\n                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","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/combined_database.rs#L522-L558","documentation":"rollback_to also aligns the gas-price database. Its height is Optional (a fresh gas-price DB with None is acceptable), but if Some(height) and that height is below target_block_height, rollback cannot proceed — the gas-price DB would need to move forward, which rollback never does.","triggerScenarios":"rollback_to where the gas-price database has recorded a height lower than the target — e.g., gas-price service started later/stopped earlier than the chain, or a gas-price DB restored from an older snapshot.","commonSituations":"Gas-price updater disabled or crashed for a period leaving its DB behind; partial snapshot restores; version upgrades that reset gas-price history.","solutions":["Allow the gas-price service to catch up (run the node until the gas-price DB reaches chain height), then retry the rollback.","If the gas-price history is disposable, remove the gas-price database so its height is None (allowed) and let it rebuild.","Use a target no greater than the gas-price DB height when that history must be preserved."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if let Some(gas_height) = combined_db.gas_price().latest_height_from_metadata()? {\n    if target_block_height > gas_height {\n        anyhow::bail!(\"target {} above gas-price height {}\", target_block_height, gas_height);\n    }\n}\n// None is acceptable: a fresh gas-price DB may have no height","typeGuard":null,"tryCatchPattern":"match combined_db.rollback_to(target, &mut shutdown) {\n    Ok(()) => Ok(()),\n    Err(e) if e.to_string().contains(\"gas-price database height\") => {\n        // either wait for the gas-price service to catch up, or drop its (optional) history\n        if gas_history_disposable() { drop_gas_price_db_and_retry() } else { wait_and_retry() }\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Keep the gas-price service enabled and healthy so its DB tracks chain height.","Remember gas-price height is Optional: a None DB is fine, a stale Some(height) is not.","Include the gas-price DB in consistent snapshot restores."],"tags":["database","rollback","gas-price","height-mismatch","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}