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

Missing tx_pointer on mint transaction

Error message

Missing tx_pointer on mint transaction

What it means

tx_from_proto_tx requires the tx_pointer sub-message on a Mint transaction; prost yields None when the field is absent and the code maps that to Error::Serialization. fuel-core's Mint transaction always carries a TxPointer, so the decode of the transaction and block fails.

Source

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

                        e
                    ))
                })?;

            let create_tx = FuelTransaction::create(
                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(),

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Debug-print the failing ProtoTransaction::Mint to confirm tx_pointer (and input_contract/output_contract) presence.
  2. Fix the encoder to always set tx_pointer on mint transactions.
  3. Pre-validate mint sub-messages before decoding and reject with position context.
  4. Re-fetch the block from a compatible peer.

Example fix

// before
let tx_pointer_proto = proto_mint.tx_pointer.as_ref().ok_or_else(|| {
    Error::Serialization(anyhow!("Missing tx_pointer on mint transaction"))
})?;

// after: pre-validate all mint sub-messages
if proto_mint.tx_pointer.is_none()
    || proto_mint.input_contract.is_none()
    || proto_mint.output_contract.is_none()
{
    return Err(Error::Serialization(anyhow::anyhow!(
        "mint transaction missing tx_pointer/input_contract/output_contract"
    )));
}
Defensive patterns

Strategy: type-guard

Validate before calling

fn mint_tx_complete(mint: &ProtoMint) -> bool {
    mint.tx_pointer.is_some()
        && mint.input_contract.is_some()
        && mint.output_contract.is_some()
}

Type guard

fn mint_tx_decodable(mint: &ProtoMint) -> bool {
    mint.tx_pointer.is_some()
        && mint.input_contract.is_some()
        && mint.output_contract.is_some()
}

Try / catch

match tx_from_proto_tx(t) {
    Ok(tx) => txs.push(tx),
    Err(Error::Serialization(ctx)) if ctx.to_string().contains("mint transaction") => {
        tracing::warn!(?t, "rejecting incomplete Mint transaction");
        return Err(Error::Serialization(ctx));
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Decoding a proto block where a Mint transaction omitted its tx_pointer - an encoder that skips the field, schema drift between versions, or truncated data.

Common situations: Version skew between fuel-core releases; third-party or hand-built producers; fixtures that populate only some Mint fields.

Related errors


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