FuelLabs/fuel-core · error

Failed to get registry root: {}

Error message

Failed to get registry root: {}

What it means

With the fault-proving feature enabled, compressing a block finalizes by reading the registry root from the registry storage; any storage failure there is wrapped as 'Failed to get registry root: {e}' (crates/compression/src/compress.rs:99). The wrapped {e} is the real cause — a registry/database read error. Compression of the block itself already succeeded; only the integrity-root fetch failed.

Source

Thrown at crates/compression/src/compress.rs:99

{
    let target = block.transactions_vec();

    let mut prepare_ctx = PrepareCtx {
        config,
        timestamp: block.header().time(),
        db: &mut db,
        accessed_keys: Default::default(),
    };
    let _ = target.compress_with(&mut prepare_ctx).await?;

    let mut ctx = prepare_ctx.into_compression_context()?;
    let transactions = target.compress_with(&mut ctx).await?;
    let registrations: RegistrationsPerTable = ctx.finalize()?;

    #[cfg(feature = "fault-proving")]
    let registry_root = db
        .registry_root()
        .map_err(|e| anyhow::anyhow!("Failed to get registry root: {}", e))?;

    Ok(VersionedCompressedBlock::new(
        block.header(),
        registrations,
        transactions,
        #[cfg(feature = "fault-proving")]
        registry_root,
    ))
}

/// Preparation pass through the block to collect all keys accessed during compression.
/// Returns dummy values. The resulting "compressed block" should be discarded.
struct PrepareCtx<'a, D> {
    config: &'a Config,
    /// Current timestamp
    timestamp: Tai64,
    /// Database handle
    db: D,

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Inspect the wrapped {e} (error chain / source) — it names the actual storage failure.
  2. Ensure the registry DB is opened and owned by a single process and not concurrently mutated.
  3. Align the fault-proving feature flag across every binary in the compression/decompression pipeline.
  4. If the storage is corrupted, rebuild/re-sync the registry state instead of retrying compression.
Defensive patterns

Strategy: try-catch

Try / catch

match block.compress(&mut db).await {
    Err(e) if e.to_string().contains("Failed to get registry root") => {
        // inspect the error chain for the underlying storage failure; do not blind-retry
        return Err(e.context("registry storage failure after compression"));
    }
    r => r?,
}

Prevention

When it happens

Trigger: Compressing a block into a VersionedCompressedBlock with fault-proving enabled, when registry_root() on the registry DB errors (IO error, corrupted storage, closed DB handle).

Common situations: RocksDB/registry storage corruption or a DB handle shared across processes; fault-proving enabled in one component but not another; registry state snapshot inconsistent with the live DB.

Related errors


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