Skip to main content

Crate javm

Crate javm 

Source
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 JAVM nub::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 the javm-guest-x86 guest blob (in-kernel JIT). This crate owns the blob (built by build.rs) and the singleton policy; the sandbox mechanics live in the generic substrate (nub::Nub::create_hyperlight).

Structs§

InvocationResult
Invocation result. Both backends produce this shape on completion; rkyv-archived on the wire from the cached path’s response.
InvokeJob
InvokeJobId
InvokeRequest
Javm
The JAVM kernel personality: javm-cap object semantics (rkyv-coded Caps, SSZ content hashing) with JavmLocal as the in-process kernel.
JavmLocal
The JAVM Local-backend kernel: cap directory + interpreter wiring.
Nub
Uniform handle to the JAVM engine — a newtype over the generic nub::Nub substrate 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§

AbiCapHash
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::ObjHash and, byte-wise, javm_cap::CapHash; kept as a local alias so this crate stays dependency-free).
CapHash
Legacy alias for ObjHash from when the only personality was the JAVM capability system. Prefer ObjHash in new code.
HyperlightNubGuard
Compatibility alias for tests/benches that name the returned Hyperlight singleton borrow. Nub is 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.