{"record":{"id":"ecfe8b06b8295ff3","repo":"FuelLabs/fuel-core","slug":"historical-execution-is-only-supported-with-rocksd","errorCode":null,"errorMessage":"Historical execution is only supported with RocksDB","messagePattern":"Historical execution is only supported with RocksDB","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/service/sub_services.rs","lineNumber":165,"sourceCode":"    let (preconfirmation_sender, preconfirmation_receiver) =\n        tokio::sync::mpsc::channel(1024);\n    #[cfg(not(feature = \"p2p\"))]\n    let (preconfirmation_sender, _) = tokio::sync::mpsc::channel(1024);\n\n    let genesis_block = on_chain_view\n        .genesis_block()?\n        .unwrap_or(create_genesis_block(config).compress(&chain_id));\n    let last_block_header = on_chain_view\n        .get_current_block()?\n        .map(|block| block.header().clone())\n        .unwrap_or(genesis_block.header().clone());\n\n    let last_height = *last_block_header.height();\n\n    if config.historical_execution\n        && config.combined_db_config.database_type != DbType::RocksDb\n    {\n        return Err(anyhow::anyhow!(\n            \"Historical execution is only supported with RocksDB\"\n        ));\n    }\n\n    #[cfg(feature = \"p2p\")]\n    let p2p_externals = config\n        .p2p\n        .clone()\n        .map(fuel_core_p2p::service::build_shared_state);\n\n    #[cfg(feature = \"p2p\")]\n    let p2p_adapter = {\n        use crate::service::adapters::PeerReportConfig;\n\n        // Hardcoded for now, but left here to be configurable in the future.\n        // TODO: https://github.com/FuelLabs/fuel-core/issues/1340\n        let peer_report_config = PeerReportConfig {\n            successful_block_import: 5.,","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service/sub_services.rs#L147-L183","documentation":"Validated while assembling the node's sub-services: enabling config.historical_execution requires a RocksDB backend because historical (view-at-height) execution relies on RocksDB versioned columns. If combined_db_config.database_type is anything other than DbType::RocksDb (i.e. InMemory), startup fails fast with this error before any service starts.","triggerScenarios":"Building or starting a FuelService with historical_execution: true while combined_db_config.database_type is DbType::InMemory.","commonSituations":"Test harnesses that default to in-memory databases copying production configs with historical queries enabled; refactors toggling historical_execution without adjusting the database config; CI configs diverging from production.","solutions":["Set database_type to DbType::RocksDb (with a db path) in the combined db config when historical_execution is on.","Or disable historical_execution if historical queries are not needed.","In tests that need history, use RocksDB in a per-test temp directory."],"exampleFix":"// before\nlet mut config = Config::local_node();\nconfig.historical_execution = true;\nconfig.combined_db_config.database_type = DbType::InMemory;\n\n// after\nconfig.historical_execution = true;\nconfig.combined_db_config.database_type = DbType::RocksDb;\nconfig.combined_db_config.path = Some(tempdir.path().into());","handlingStrategy":"validation","validationCode":"use fuel_core::service::DbType;\n\nfn assert_db_config_compatible(config: &fuel_core::service::Config) -> anyhow::Result<()> {\n    if config.historical_execution\n        && config.combined_db_config.database_type != DbType::RocksDb\n    {\n        return Err(anyhow::anyhow!(\n            \"historical_execution requires database_type = RocksDb\"\n        ));\n    }\n    Ok(())\n}\n\n// run before fuel_core::service::FuelService::new","typeGuard":"fn supports_historical_execution(db_type: fuel_core::service::DbType) -> bool {\n    matches!(db_type, fuel_core::service::DbType::RocksDb)\n}","tryCatchPattern":"match FuelService::new_node(config).await {\n    Err(e) if e.to_string().contains(\"only supported with RocksDB\") => {\n        // flip database_type to RocksDb with a path, or disable historical_execution\n    }\n    rest => rest,\n}","preventionTips":["Treat historical_execution as a RocksDB-only feature in config templates.","Use per-test tempdir RocksDB in tests that exercise historical queries.","Validate config combinations in CI before starting nodes."],"tags":["config","database","historical","fuel-core","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}