Skip to content

wasmtime CLI has --consume-fuel option but no way to configure amount of fuel available #3779

@fitzgen

Description

@fitzgen

Seems like an oversight on our part.

I'm imagining that we would

  1. Make the default amount of fuel 0 in the CLI
  2. 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:

wasmtime/src/lib.rs

Lines 237 to 239 in 4f01711

/// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are good for new contributors to tackle!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions