FuelLabs / fuel-core

Rust full node implementation of the Fuel v2 protocol.
Other
57.95k stars 2.79k forks source link

Make DA/Exec fee rewards be proportional rather than calculated exactly #2243

Closed MitchTurner closed 1 month ago

MitchTurner commented 1 month ago

Currently we use the block gas to calculate the DA fee from the L2 Block information. This works fine if you have full amounts, but with the introduction of conversion between Gwei and Wei for the values used on L2, we are losing information about how the gas price is calculated (we don't know how all the individual txs were rounded, etc).

Instead, we are going to just use a ratio of the total fee.

e.g. if the DA gas price is 5 an the Exec gas price is 10, then the ratio of DA to Exec is 1/3.

So to calculate the DA reward for a given block, instead of isolating the actual value calculated from the DA portion of the gas price, we are just going to take 1/3 of the total fee.

This is less precise, but it has the added benefit of taking fees from the entire block when the fees for the individual txs would have been too small to register.