I run Wasmtime components in an embedding where guest instructions and host work share an execution fuel budget. Guest-to-host lifting consumes hostcall_fuel, but that allowance starts over for each lift and does not reduce Store::get_fuel(). I need repeated conversions to count against the execution budget, including work done before a conversion fails.
I can see two possible approaches:
- Wasmtime could optionally charge Store fuel as lifting consumes its existing allowance, at a configurable price.
- Wasmtime could expose allowance consumption, including partial consumption on errors, and provide reliable points for the embedding to set a limit from remaining fuel before each lift and settle the cost before execution continues. A hook might help, but I am not sure the current hooks cover all those points.
Would you recommend either approach, or a different API for this?
I run Wasmtime components in an embedding where guest instructions and host work share an execution fuel budget. Guest-to-host lifting consumes
hostcall_fuel, but that allowance starts over for each lift and does not reduceStore::get_fuel(). I need repeated conversions to count against the execution budget, including work done before a conversion fails.I can see two possible approaches:
Would you recommend either approach, or a different API for this?