Understanding fees on Fuel

Hi, have a few questions to help me understand fees on Fuel:

  1. I see opcodes have their associated gas costs resulting from benchmarks (I can’t link github, so there’s a space before the .com): https://github .com/FuelLabs/fuel-vm/blob/master/fuel-vm/src/gas/default_gas_costs.rs#L4 – are these opcode costs generally accurate or can I expect these to change very dramatically soon? (Asking because last time I dug into gas, it was before any benchmarking was done and I was told to ignore gas for the time being)

  2. How does the fee structure work, specifically wrt the DA costs of writing to Ethereum L1? Optimism and Arbitrum take very different approaches to how to cover both L2 costs and L1 DA costs. For example, the gas limit on Optimism just considers the gas costs from L2 gas usage, whereas on Arbitrum their fancy 2d fee model means the gas limit of a tx includes L2 and L1 costs and therefore changes a lot with L1 gas price fluctuations. How does Fuel charge both L2 and L1 fees?

  3. Generally, do the same concepts from the Ethereum gas world translate? E.g. some intrinsic gas for each tx, gas cost per byte of calldata in the tx, the gas limit must cover these intrinsic & calldata costs as well as L2 opcode costs, single gas price that generally doesn’t depend on what the tx does (i.e. no fancy gas pricing for high demand state like Solana), etc?


btw this is a dupe of Understanding gas & L1 DA costs (which was originally removed by the automoderator)

  1. Those opcodes prices will likely update with each testnet release. For example, in beta-3 we didn’t have contract state merkleization implemented yet so those opcodes will likely increase in cost for beta-4. There are also a lot of optimizations left to do in the client as we’ve been largely focused on delivering features and protocol spec updates, so some of the costs may decrease because of that.

  2. This is still an open area of research as we haven’t integrated a layer DA for Fuelv2 yet. It could likely vary based on the DA layers we use as well. Some areas that could be more complex to cost out would be the witness section of transactions. As witnesses could be prunable after L1 finality on Fuel, but would not be prunable on the DA side.

  3. Generally yes. Although there are likely to be more variable factors in the base cost to cover things like using a different signature for each coin/message input on a transaction. We currently don’t plan to have dynamic pricing for hot state access either. Our primary focus right now is ensuring that gas costs correctly correspond to our desired execution time on reference hardware (i.e. min specs for a fuel node), and there are likely some more changes coming.

1 Like