{"record":{"id":"77d681a9d46251f8","repo":"FuelLabs/fuel-core","slug":"message-da-height-cannot-be-greater-than-genesis-d","errorCode":null,"errorMessage":"message da_height cannot be greater than genesis da block height","messagePattern":"message da_height cannot be greater than genesis da block height","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/service/genesis/importer/on_chain.rs","lineNumber":319,"sourceCode":"        .storage::<ContractsRawCode>()\n        .replace(&contract_id, contract)?\n        .is_some()\n    {\n        return Err(anyhow!(\"Contract code should not exist\"));\n    }\n\n    Ok(())\n}\n\nfn init_da_message(\n    transaction: &mut StorageTransaction<&mut GenesisDatabase>,\n    msg: TableEntry<Messages>,\n    da_height: DaBlockHeight,\n) -> anyhow::Result<()> {\n    let message: Message = msg.value;\n\n    if message.da_height() > da_height {\n        return Err(anyhow!(\n            \"message da_height cannot be greater than genesis da block height\"\n        ));\n    }\n\n    if transaction\n        .storage::<Messages>()\n        .replace(message.id(), &message)?\n        .is_some()\n    {\n        return Err(anyhow!(\"Message should not exist\"));\n    }\n\n    Ok(())\n}\n","sourceCodeStart":301,"sourceCodeEnd":334,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service/genesis/importer/on_chain.rs#L301-L334","documentation":"init_da_message validates each message from the genesis state: message.da_height() (the DA block at which the message becomes spendable) must not exceed the da_block_height passed in from the chain config. A message referencing a DA block in the future cannot exist at genesis, so the import fails.","triggerScenarios":"Genesis messages whose da_height is greater than the config's da_block_height — for example a snapshot taken against DA height 5000 while the genesis config declares da_block_height 4000.","commonSituations":"Building a test-network genesis from bridge message logs with a misconfigured da_block_height; mixing messages imported at different DA epochs; hand-crafted messages for local chains with a large default da_height.","solutions":["Raise the chain config's da_block_height to at least the maximum message da_height in the snapshot.","Or remove or re-date the offending messages so their da_height is at or below the genesis da_block_height.","Re-derive the message list from the DA source at the declared height."],"exampleFix":"// before: message references a DA block beyond genesis\n// chain_config: \"da_block_height\": 4000\n\"messages\": [ { \"sender\": \"0x...\", \"recipient\": \"0x...\", \"nonce\": \"0x1\", \"da_height\": 5000, ... } ]\n\n// after: align heights — either\n// chain_config: \"da_block_height\": 5000\n// or \"da_height\": 4000 on the message","handlingStrategy":"validation","validationCode":"fn validate_message_da_heights(\n    messages: &[fuel_core::chain_config::MessageConfig],\n    genesis_da_height: u64,\n) -> Result<(), String> {\n    for m in messages {\n        if m.da_height.as_u64() > genesis_da_height {\n            return Err(format!(\n                \"message nonce {:?} da_height {} above genesis da_block_height {}\",\n                m.nonce,\n                m.da_height.as_u64(),\n                genesis_da_height\n            ));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match importer.run().await {\n    Err(e) if e.to_string().contains(\"da_height cannot be greater\") => {\n        // raise da_block_height in config or re-date the messages; not retryable as-is\n    }\n    rest => rest,\n}","preventionTips":["Set the chain config's da_block_height to the DA height the snapshot was taken at.","Add a pre-import check: max(message.da_height) <= genesis da_block_height.","Regenerate message lists from the DA source at the declared height."],"tags":["genesis","messages","da-height","validation","fuel-core","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}