Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CLI-args): Drop static variable in caching accessor
Accessor function `proving_capability` in `cli_args::Args` uses a `OnceLock` to avoid estimating the current machine's proving capability twice. Previously, the `OnceLock` object was stored in a static variable defined locally in the function. As a result, all instances of struct `Args` gave the same result when this function is called -- even when the `Args` objects were created with different values for `tx_proving_capability`. The solution is to store the `OnceLock` on the `Args` struct properly. The new field, `tx_proving_capability_cache` is armed with the `#[clap(skip)]` annotation so that clap does not confuse it for a real CLI argument. This commit also adds a test case that verifies the diagnosis (by failing) and the solution (by passing).
- Loading branch information