FuelLabs/fuel-core · error · anyhow::Error

message da_height cannot be greater than genesis da block he

Error message

message da_height cannot be greater than genesis da block height

What it means

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.

Source

Thrown at crates/fuel-core/src/service/genesis/importer/on_chain.rs:319

        .storage::<ContractsRawCode>()
        .replace(&contract_id, contract)?
        .is_some()
    {
        return Err(anyhow!("Contract code should not exist"));
    }

    Ok(())
}

fn init_da_message(
    transaction: &mut StorageTransaction<&mut GenesisDatabase>,
    msg: TableEntry<Messages>,
    da_height: DaBlockHeight,
) -> anyhow::Result<()> {
    let message: Message = msg.value;

    if message.da_height() > da_height {
        return Err(anyhow!(
            "message da_height cannot be greater than genesis da block height"
        ));
    }

    if transaction
        .storage::<Messages>()
        .replace(message.id(), &message)?
        .is_some()
    {
        return Err(anyhow!("Message should not exist"));
    }

    Ok(())
}

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Raise the chain config's da_block_height to at least the maximum message da_height in the snapshot.
  2. Or remove or re-date the offending messages so their da_height is at or below the genesis da_block_height.
  3. Re-derive the message list from the DA source at the declared height.

Example fix

// before: message references a DA block beyond genesis
// chain_config: "da_block_height": 4000
"messages": [ { "sender": "0x...", "recipient": "0x...", "nonce": "0x1", "da_height": 5000, ... } ]

// after: align heights — either
// chain_config: "da_block_height": 5000
// or "da_height": 4000 on the message
Defensive patterns

Strategy: validation

Validate before calling

fn validate_message_da_heights(
    messages: &[fuel_core::chain_config::MessageConfig],
    genesis_da_height: u64,
) -> Result<(), String> {
    for m in messages {
        if m.da_height.as_u64() > genesis_da_height {
            return Err(format!(
                "message nonce {:?} da_height {} above genesis da_block_height {}",
                m.nonce,
                m.da_height.as_u64(),
                genesis_da_height
            ));
        }
    }
    Ok(())
}

Try / catch

match importer.run().await {
    Err(e) if e.to_string().contains("da_height cannot be greater") => {
        // raise da_block_height in config or re-date the messages; not retryable as-is
    }
    rest => rest,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of FuelLabs/fuel-core@b9d4d170da (2026-08-16). Data as JSON: /api/errors/77d681a9d46251f8. Report an issue: GitHub.