FuelLabs/fuel-core · error

The total base asset amount used by the transaction is too b

Error message

The total base asset amount used by the transaction is too big

What it means

cover_fee sums the base-asset amounts of all existing inputs owned by the fee payer to know how much gas budget is available. The sum is accumulated with checked_add; the error fires if that total overflows u64, i.e. the fee payer's inputs alone total more than the max u64 base-asset value.

Source

Thrown at crates/fuel-core/src/schema/tx/assemble_tx.rs:928

        let mut total_base_asset = 0u64;

        for input in self.tx.inputs() {
            if input_is_spendable_as_fee(input) {
                let Some(amount) = input.amount() else {
                    continue
                };
                let Some(asset_id) = input.asset_id(&base_asset_id) else {
                    continue
                };
                let Some(owner) = input.input_owner() else {
                    continue
                };

                if asset_id == &base_asset_id && &fee_payer_account.owner() == owner {
                    total_base_asset =
                        total_base_asset.checked_add(amount).ok_or_else(|| {
                            anyhow::anyhow!(
                        "The total base asset amount used by the transaction is too big"
                    )
                        })?;
                }
            }
        }

        loop {
            let max_gas = self.tx.max_gas(&gas_costs, &fee_params);
            let max_gas_with_reserve = max_gas.saturating_add(self.arguments.reserve_gas);

            let final_gas = max_gas_with_reserve.min(max_gas_per_tx);
            let final_fee =
                gas_to_fee(final_gas, self.arguments.gas_price, gas_price_factor);
            let final_fee = u64::try_from(final_fee)
                .map_err(|_| {
                    anyhow::anyhow!("The final fee is too big to fit into `u64`")
                })?

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Split the transaction so any single tx's base-asset input total stays far below u64::MAX
  2. On test chains, mint realistic amounts instead of near-u64::MAX values
  3. Treat as an invariant breach if inputs look sane and report upstream
Defensive patterns

Strategy: try-catch

Validate before calling

// sanity cap on any single assembly's base-asset input total
const total = feePayerBaseInputs.reduce((a, c) => a + c.amount, 0n);
if (total > 2n ** 63n) throw new Error('base-asset input total suspiciously large; split the tx');

Try / catch

catch (e) { if (/total base asset amount used by the transaction is too big/.test(e.message)) { /* split the tx; on test chains mint realistic amounts */ } else throw e; }

Prevention

When it happens

Trigger: A transaction whose fee-payer-owned base-asset inputs sum above u64::MAX (or overflow mid-accumulation). Practically requires intentionally constructed near-u64::MAX coin amounts.

Common situations: Test chains minting gigantic coin amounts; merging many intentionally huge coins in one tx; not seen with real economic values.

Related errors


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