RReverser opened issue #6004:
Feature
Allow to easily disable clocks when constructing a
WasiCtx.Benefit
This is useful for execution in deterministic environments where modules aren't allowed access to any non-deterministic sources, such as random data generation or system time.
Disabling random data generation (or, rather, substituting with pre-seeded source) is already easy in wasmtime, but it seems that the only ways to disable clocks is to either return a
0time from clocks, which is not ideal compared to an explicit capability error, or to reimplement the entireWasiSnapshotPreview1myself by forwarding everything except clock functions to the inner implementation, which is also pretty cumbersome.Implementation
I'd probably wrap
systemandmonotonicfields inWasiClocksintoOption<...>.
pchickey commented on issue #6004:
The requirements and implementation step sound good to me. I don't think any of our team has spare bandwidth to work on this right now but we'd be be happy to accept a PR.
pchickey edited a comment on issue #6004:
The requirements and implementation idea sound good to me. I don't think any of our team has spare bandwidth to work on this right now but we'd be be happy to accept a PR.
RReverser commented on issue #6004:
Thanks for the quick feedback. Sounds good, working on it.
pchickey closed issue #6004:
Feature
Allow to easily disable clocks when constructing a
WasiCtx.Benefit
This is useful for execution in deterministic environments where modules aren't allowed access to any non-deterministic sources, such as random data generation or system time.
Disabling random data generation (or, rather, substituting with pre-seeded source) is already easy in wasmtime, but it seems that the only ways to disable clocks is to either return a
0time from clocks, which is not ideal compared to an explicit capability error, or to reimplement the entireWasiSnapshotPreview1myself by forwarding everything except clock functions to the inner implementation, which is also pretty cumbersome.Implementation
I'd probably wrap
systemandmonotonicfields inWasiClocksintoOption<...>.
Last updated: Dec 13 2025 at 19:03 UTC