Expand description
Nub: the JAR v3 microkernel.
This crate defines the Arch substrate trait and the generic
Kernel over it. The kernel is a general VM that invokes JAVM
programs (see ~/docs/minimum-v3). It is not block-apply
specific — block-apply is layered on top in a separate crate.
§Layering
callers (chain runtime / tests / RPC)
│
jar-apply (block-apply, gas, quota — separate crate, later)
│
nub (uniform Nub handle over backends)
│
┌────────────┼────────────────┐
│ │
nub-arch-local nub-arch-x86
(in-process, (bare-metal guest,
std) no_std + no_main)
│ │
└────────────┬────────────────┘
│
nub-kernel ← this crate
(Arch trait, Kernel<A: Arch>, types)§State
The kernel “owns the state”: the invoking Cap::Instance and
everything reachable from it. Concretely the Arch impl holds
the storage (in-process structures for nub-arch-local,
guest-resident structures for nub-arch-x86); the
Kernel is a thin generic wrapper that delegates to the Arch.
§no_std
This crate is no_std by default with an optional std feature
(currently enabled by default for ergonomics on host targets). The
Hyperlight Arch impl will pull the no_std build path; in-process
consumers use the std build.
Structs§
- Instance
Ref - Opaque, 32-byte handle to an Instance held by an
Arch. - 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.
- Kernel
- The kernel: a thin wrapper over an
Archimpl that owns the state.nubis the microkernel that this represents; callers use it via the uniformNubhandle in thenubcrate, which selects the backend (local interpreter vs hyperlight RPC) at construction time.
Traits§
- Arch
- Low-level CPU/MMU substrate trait. An
Archimpl runs in the same address space as theKernelthat calls it — it owns the kernel’s state and provides the primitives (page mapping, ring transitions, exception handling, …) needed to execute JAVM programs. The skeleton trait only exposesinvokeandstate_root; the substrate-specific primitives that the kernel will eventually drive (map_pages, install_handler, …) are intentionally not part of the public surface yet — they’re encapsulated insideArch::invokefor now.
Type Aliases§
- CapHash
- 32-byte content hash. Same shape as
javm_cap::CapHash; defined here locally so this crate staysno_std. A future unification pass will share the type oncejavm-capbecomesno_std-clean.