Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 48 additions & 77 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ readme = "README.md"

[workspace.dependencies]
# Keep the host and guest on the same release for transport compatibility.
hyperlight-guest-bin = { version = "0.18.0", features = ["libc"] }
hyperlight-host = { version = "0.18.0", default-features = false }
hyperlight-common = { version = "0.18.0", default-features = false }
hyperlight-guest = { version = "0.18.0" }
hyperlight-guest-bin = { version = "0.19.0", features = ["libc"] }
hyperlight-host = { version = "0.19.0", default-features = false }
hyperlight-common = { version = "0.19.0", default-features = false }
hyperlight-guest = { version = "0.19.0" }

hyperlight-js = { version = "0.5.0", path = "src/hyperlight-js" }
hyperlight-js-runtime = { version = "0.5.0", path = "src/hyperlight-js-runtime" }
Expand Down
1 change: 1 addition & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ run-examples target=default-target features="": (build target)
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example run_handler echo
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example run_handler fibonacci
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example run_handler regex
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example user_modules
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F function_call_metrics," + features } }} --example metrics
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example metrics
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {'--features guest-call-stats,monitor-wall-clock,monitor-cpu-time'} else if features=="no-default-features" {"--no-default-features -F guest-call-stats,monitor-wall-clock,monitor-cpu-time" } else {"--no-default-features -F guest-call-stats,monitor-wall-clock,monitor-cpu-time," + features } }} --example execution_stats
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ To run the tests, run:
just test
```

Use `just test-all` to also run monitor and Node.js binding tests.

## Guest Memory

`SandboxBuilder::with_guest_scratch_size(bytes)` controls the shared
writable-memory budget for the guest heap, stack, transport pools, page tables,
and copy-on-write pages. The default and minimum are 5 MiB; smaller requests
are clamped to that minimum.
Increase scratch for allocation-heavy handlers or larger transport pools. This
budget is not a JavaScript-only heap limit or a total host-process memory limit.

Exhaustion aborts the guest with `GuestAborted(MallocFailed, ...)` and poisons the
sandbox. Restore a snapshot or build a replacement before executing again.
Node.js uses `SandboxBuilder.setScratchSize(bytes)` and reports `ERR_GUEST_ABORT`.

## Running the examples

### run_handler example
Expand Down
2 changes: 1 addition & 1 deletion docs/persistent-snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ snapshot. TypeScript types the result as `JSSandbox | LoadedJSSandbox`. Narrow i
with `instanceof`.

Configure process-local host resources on the builder before calling `build()`.
A snapshot's memory layout overrides heap, scratch, and transport settings.
A snapshot's memory layout overrides scratch and transport settings.

`Snapshot::checked_load()` in Rust and `Snapshot.checkedLoad()` in Node check
every OCI blob against its recorded digest. `Snapshot::load()` and
Expand Down
Loading
Loading