Skip to main content

Module fuel

Module fuel 

Source

Constants§

DEFAULT_FUEL
Fuel for a run that asks for fuel instead of a time limit (use fuel, warp fuel <steps>, WARP_FUEL): wasmtime burns about one unit per executed WASM instruction, so this is roughly a hundred billion steps before a run stops with out of fuel after N steps. Counting steps makes calls about four times slower (probes/fast_int/fuel_cost.sh), so only such runs count them.
DEFAULT_TIME_LIMIT
A run stops after this much computing (the CPU time of the thread running it: sleeping and waiting for input don’t count) with out of time, instead of hanging (decision fuel-metering). Change it with WARP_TIME_LIMIT=<seconds>.
FUEL_VARIABLE
Environment variable that asks for fuel, its value the steps (overrides DEFAULT_FUEL)
TIME_LIMIT_VARIABLE
Environment variable that overrides DEFAULT_TIME_LIMIT, in seconds

Functions§

fuel_from_environment
The steps WARP_FUEL gives (underscores allowed: 1_000_000), if it is set to a number
time_limit_from_environment
The time WARP_TIME_LIMIT gives (seconds, fractions allowed), if it is set to a positive number