Expand description
JAVM engine entrypoint: the javm-cap kernel personality on the nub substrate.
Nub is THE handle callers (chain runtime, tests, benches, RPC,
jar-apply) use to invoke JAVM. It wraps the generic
nub::Nub substrate handle and layers the JAVM-typed surface on
top: publish caller-built javm_cap::Caps (Nub::put_cap /
Nub::put_cap_with_hash) and invoke published Cap::Instances
by content hash (Nub::invoke_cached).
Two backends, one surface:
Nub::local— the in-process PVM2 (RISC-V) interpreter (JavmLocal, the JAVMnub::LocalKernel). Used for tests, deterministic replay, and any host that doesn’t need real ring-0 isolation.Nub::hyperlight— the process-wide Hyperlight singleton running thejavm-guest-x86guest blob (in-kernel JIT). This crate owns the blob (built bybuild.rs) and the singleton policy; the sandbox mechanics live in the generic substrate (nub::Nub::create_hyperlight).
Structs§
- 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
Request - Javm
- The JAVM kernel personality: javm-cap object semantics (rkyv-coded
Caps, SSZ content hashing) withJavmLocalas the in-process kernel. - Javm
Local - The JAVM Local-backend kernel: cap directory + interpreter wiring.
- Nub
- Uniform handle to the JAVM engine — a newtype over the generic
nub::Nubsubstrate handle with the JAVM-typed publish surface. - 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. - Hyperlight
NubGuard - Compatibility alias for tests/benches that name the returned
Hyperlight singleton borrow.
Nubis a cloneable handle; synchronization lives inside the handle. - 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.