Expand description
Nub: the JAR v3 microkernel substrate — uniform caller-facing handle.
The Nub handle hides the choice of substrate behind a single
publish/invoke surface, generic over a kernel Personality P
(the pluggable semantics layer: what published objects mean, how
invocations resolve a root object). Two backends:
- Local: the personality’s in-process kernel
(
Personality::Local, aLocalKernelimpl). Used for tests, deterministic replay, and any host that doesn’t need real ring-0 isolation. - Hyperlight: ships invocations as RPCs into a bare-metal
guest binary (the personality’s guest crate over the generic
nub-arch-x86kernel lib) running inside a Hyperlight sandbox. The wire protocol is personality-agnostic: opaque bytes + 32-byteObjHashkeys.
Nub itself owns no guest blob and no singleton policy — a
personality entrypoint crate (e.g. rust/javm for JAVM) builds
its guest blob, defines the typed publish surface, and constructs
handles via Nub::new_local / Nub::create_hyperlight.
Re-exports§
pub use personality::LocalKernel;pub use personality::Personality;
Modules§
- personality
- Host-side kernel-personality abstraction.
Structs§
- Instance
Ref - Opaque, 32-byte handle to an Instance held by an
Arch. - Invocation
Result - Invocation result. Both backends produce this shape on completion; rkyv-archived on the wire from the cached path’s response.
- Invoke
Job - Invoke
JobId - Invoke
Options - Per-invocation knobs. Empty for the skeleton; fields will land as the kernel grows (gas budget overrides, quota budget, tracing, reentrancy depth limits, …).
- Invoke
Outcome - Result of a successful invocation. Extensible — fields land as needed (gas remaining, post-invocation cap hash, host-call trace, …). For the skeleton we expose only the JAVM HALT return value and gas used.
- Invoke
Request - Nub
- Uniform handle to the nub microkernel substrate, generic over the kernel personality.
- NubOptions
- Options used when constructing a Hyperlight-backed Nub.
Constants§
- MAX_
HYPERLIGHT_ VCPUS - SCRATCHPAD_
HEAD_ LEN - Bytes of the running Instance’s scratchpad (
slot[0]) region surfaced at the top-level HALT — a fixed-size head of the returned DataCap’s effective content. The guest writes its result into the scratchpad-mapped memory region during the run (CoW into the cap); at top HALT the engine reads the region’s effective bytes back out here, so the host observes the full, uncompressed result without a separate data-flow event.
Type Aliases§
- AbiCap
Hash - 32-byte content hash of a published state object (the legacy name
from when the only personality was the JAVM cap system — matches
nub_kernel::ObjHashand, byte-wise,javm_cap::CapHash; kept as a local alias so this crate stays dependency-free). - CapHash
- Legacy alias for
ObjHashfrom when the only personality was the JAVM capability system. PreferObjHashin new code. - ObjHash
- 32-byte content hash of a published state object. The personality
defines the hash function (JAVM: SSZ
hash_tree_root); nub treats the value as an opaque content-addressed key.