You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently FuelConsumptionMode::Lazy leads to pre-checking if enough fuel is available for a full memory.grow or table.grow operation, even though it is clear that this operation will fail and thus won't be expensive at all.
We implemented this to be conservative.
However, this led us to requiring the FuelConsumptionMode::Eager in order to properly estimate required fuel for Wasm blob execution since with FuelConsumptionMode::Lazy the returned estimated fuel would be lower than what the same mode needed for execution with pre-checking.
The idea now is to remove pre-checking fuel for full execution and instead have an O(1) check to see whether the memory or table can actually grow and only afterwards charge for the full amount and do the operation assuming success.
This way we can remove the FuelConsumptionMode::Eager and thus FuelConsumptionMode entirely since FuelConsumptionMode::Lazy (which will become the default behavior) can handle both execution as well as fuel estimation.
Note: Pre-checking applies to all affected instructions, namely:
memory.{grow, copy, fill}
data.init
table.{grow, copy, fill}
elem.init
The text was updated successfully, but these errors were encountered:
Currently
FuelConsumptionMode::Lazy
leads to pre-checking if enough fuel is available for a fullmemory.grow
ortable.grow
operation, even though it is clear that this operation will fail and thus won't be expensive at all.We implemented this to be conservative.
However, this led us to requiring the
FuelConsumptionMode::Eager
in order to properly estimate required fuel for Wasm blob execution since withFuelConsumptionMode::Lazy
the returned estimated fuel would be lower than what the same mode needed for execution with pre-checking.The idea now is to remove pre-checking fuel for full execution and instead have an O(1) check to see whether the
memory
ortable
can actually grow and only afterwards charge for the full amount and do the operation assuming success.This way we can remove the
FuelConsumptionMode::Eager
and thusFuelConsumptionMode
entirely sinceFuelConsumptionMode::Lazy
(which will become the default behavior) can handle both execution as well as fuel estimation.Note: Pre-checking applies to all affected instructions, namely:
memory.{grow, copy, fill}
data.init
table.{grow, copy, fill}
elem.init
The text was updated successfully, but these errors were encountered: