Seems like an oversight on our part.
I'm imagining that we would
- Make the default amount of fuel
0 in the CLI
- Add a
--add-fuel <N> option to add N fuel to the store
I think (1) miiiiight be slightly controversial? As an alternative, we would have a --set-fuel <N> option, instead of --add-fuel <N>, and then we would have to ensure that the store gets exactly N fuel rather than adding N additional fuel to it. This is a little bit of a divergence from the Config methods, so I prefer the former, but I'm open either way.
In any case, this should be a pretty easy thing to implement for anyone looking to dive into the Wasmtime code base for the first time. The changes would need to be made around here:
|
/// Executing wasm code will consume fuel, limiting its execution. |
|
#[structopt(long)] |
|
consume_fuel: bool, |
|
config.consume_fuel(self.consume_fuel); |
See https://docs.wasmtime.dev/contributing.html for contributing details.
Seems like an oversight on our part.
I'm imagining that we would
0in the CLI--add-fuel <N>option to addNfuel to the storeI think (1) miiiiight be slightly controversial? As an alternative, we would have a
--set-fuel <N>option, instead of--add-fuel <N>, and then we would have to ensure that the store gets exactlyNfuel rather than addingNadditional fuel to it. This is a little bit of a divergence from theConfigmethods, so I prefer the former, but I'm open either way.In any case, this should be a pretty easy thing to implement for anyone looking to dive into the Wasmtime code base for the first time. The changes would need to be made around here:
wasmtime/src/lib.rs
Lines 237 to 239 in 4f01711
wasmtime/src/lib.rs
Line 331 in 4f01711
See https://docs.wasmtime.dev/contributing.html for contributing details.