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

Missing input_contract on mint transaction

Error message

Missing input_contract on mint transaction

What it means

Thrown while converting a protobuf-encoded Mint transaction into the fuel-core Mint type. The Mint variant requires a contract input; the proto message arrived with the optional input_contract field unset (None). The convertor refuses to guess and fails with Error::Serialization, aborting the whole transaction (and typically the block) conversion.

Source

Thrown at crates/services/block_aggregator_api/src/blocks/old_block_source/convertor_adapter/proto_to_fuel_conversions.rs:677

                bytecode_witness_index,
                policies,
                salt,
                storage_slots,
                inputs,
                outputs,
                witnesses,
            );

            Ok(FuelTransaction::Create(create_tx))
        }
        ProtoTransactionVariant::Mint(proto_mint) => {
            let tx_pointer_proto = proto_mint.tx_pointer.as_ref().ok_or_else(|| {
                Error::Serialization(anyhow!("Missing tx_pointer on mint transaction"))
            })?;
            let tx_pointer = tx_pointer_from_proto(tx_pointer_proto)?;
            let input_contract_proto =
                proto_mint.input_contract.as_ref().ok_or_else(|| {
                    Error::Serialization(anyhow!(
                        "Missing input_contract on mint transaction"
                    ))
                })?;
            let input_contract = contract_input_from_proto(input_contract_proto)?;
            let output_contract_proto =
                proto_mint.output_contract.as_ref().ok_or_else(|| {
                    Error::Serialization(anyhow!(
                        "Missing output_contract on mint transaction"
                    ))
                })?;
            let output_contract = contract_output_from_proto(output_contract_proto)?;
            let mint_asset_id = fuel_core_types::fuel_types::AssetId::try_from(
                proto_mint.mint_asset_id.as_slice(),
            )
            .map_err(|e| Error::Serialization(anyhow!(e)))?;

            let mint_tx = FuelTransaction::mint(
                tx_pointer,

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Regenerate or replay the mint transaction with input_contract populated (producer side) and resend the block
  2. Check proto/schema version alignment between the block source and this crate (protobuf_types.rs) and upgrade the mismatched side
  3. If old data must be read, migrate/re-encode it with a tool that fills a default contract input before conversion
  4. Add a pre-conversion validation pass that rejects/skips mint transactions missing input_contract so one bad tx does not abort the block

Example fix

// before (producer, Rust prost build)
let mint = ProtoMint { tx_pointer: Some(tp), mint_amount: 1000, ..Default::default() }; // input_contract: None

// after
let mint = ProtoMint {
    tx_pointer: Some(tp),
    input_contract: Some(proto_contract_input),
    output_contract: Some(proto_contract_output),
    mint_amount: 1000,
    ..Default::default()
};
Defensive patterns

Strategy: validation

Validate before calling

fn mint_tx_is_complete(proto_tx: &ProtoTransaction) -> bool {
    matches!(proto_tx.variant.as_deref(), Some(ProtoTransactionVariant::Mint(m))
        if m.input_contract.is_some())
}

Type guard

fn has_input_contract(m: &ProtoMint) -> bool { m.input_contract.is_some() }

Try / catch

match convert_transaction(&proto_tx) {
    Ok(tx) => use_tx(tx),
    Err(e) if e.to_string().contains("Missing input_contract on mint") => {
        quarantine_block(block_id, e); // do not abort the whole ingest
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Decoding a ProtoTransactionVariant::Mint message whose input_contract oneof/optional field was never set by the producer. Happens when the peer or stored data was serialized by an older/different proto schema that omitted mint contract fields, or when a hand-built/test proto message skipped it.

Common situations: Version skew between the node that produced the proto block data and this aggregator's proto definitions; importing archived blocks encoded before Mint gained input_contract; test fixtures built from partial protos.

Related errors


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