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
0
time from clocks, which is not ideal compared to an explicit capability error, or to reimplement the entireWasiSnapshotPreview1
myself by forwarding everything except clock functions to the inner implementation, which is also pretty cumbersome.Implementation
I'd probably wrap
system
andmonotonic
fields inWasiClocks
intoOption<...>
.
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
0
time from clocks, which is not ideal compared to an explicit capability error, or to reimplement the entireWasiSnapshotPreview1
myself by forwarding everything except clock functions to the inner implementation, which is also pretty cumbersome.Implementation
I'd probably wrap
system
andmonotonic
fields inWasiClocks
intoOption<...>
.
Last updated: Dec 23 2024 at 12:05 UTC