FuelLabs/fuel-vm

Use `max_fee` policy to charge user

MitchTurner opened this issue · 4 comments

Use `max_fee` policy to charge user

This was on the Miro board, but I'm not sure what it means :P

The current codebase converts max_gas into max_fee and deducts this amount from available balances.
image

It was okay to do because gas_price was statically defined by the transaction itself. But in a new module, since the base gas price is dynamic, the max_fee based on the max_gas is dynamic too. Instead of using this dynamic value, we need to use max_fee defined by the user in the policies if it is available.

Are we keeping script_gas_limit? I'm still confused about the relationship between gas limit and max_fee.

yes we need to keep script_gas_limit as a way for users to budget how much of their fee goes into script execution vs witness data etc