{"record":{"id":"3b584610cc714f62","repo":"FuelLabs/fuel-core","slug":"the-total-base-asset-amount-used-by-the-transactio","errorCode":null,"errorMessage":"The total base asset amount used by the transaction is too big","messagePattern":"The total base asset amount used by the transaction is too big","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/schema/tx/assemble_tx.rs","lineNumber":928,"sourceCode":"\n        let mut total_base_asset = 0u64;\n\n        for input in self.tx.inputs() {\n            if input_is_spendable_as_fee(input) {\n                let Some(amount) = input.amount() else {\n                    continue\n                };\n                let Some(asset_id) = input.asset_id(&base_asset_id) else {\n                    continue\n                };\n                let Some(owner) = input.input_owner() else {\n                    continue\n                };\n\n                if asset_id == &base_asset_id && &fee_payer_account.owner() == owner {\n                    total_base_asset =\n                        total_base_asset.checked_add(amount).ok_or_else(|| {\n                            anyhow::anyhow!(\n                        \"The total base asset amount used by the transaction is too big\"\n                    )\n                        })?;\n                }\n            }\n        }\n\n        loop {\n            let max_gas = self.tx.max_gas(&gas_costs, &fee_params);\n            let max_gas_with_reserve = max_gas.saturating_add(self.arguments.reserve_gas);\n\n            let final_gas = max_gas_with_reserve.min(max_gas_per_tx);\n            let final_fee =\n                gas_to_fee(final_gas, self.arguments.gas_price, gas_price_factor);\n            let final_fee = u64::try_from(final_fee)\n                .map_err(|_| {\n                    anyhow::anyhow!(\"The final fee is too big to fit into `u64`\")\n                })?","sourceCodeStart":910,"sourceCodeEnd":946,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/schema/tx/assemble_tx.rs#L910-L946","documentation":"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.","triggerScenarios":"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.","commonSituations":"Test chains minting gigantic coin amounts; merging many intentionally huge coins in one tx; not seen with real economic values.","solutions":["Split the transaction so any single tx's base-asset input total stays far below u64::MAX","On test chains, mint realistic amounts instead of near-u64::MAX values","Treat as an invariant breach if inputs look sane and report upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// sanity cap on any single assembly's base-asset input total\nconst total = feePayerBaseInputs.reduce((a, c) => a + c.amount, 0n);\nif (total > 2n ** 63n) throw new Error('base-asset input total suspiciously large; split the tx');","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Never construct coins near u64::MAX, even on dev chains","Validate minted amounts in your test fixtures"],"tags":["fee","overflow","base-asset","unreachable","assemble-tx"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}