Skip to main content

Module kernel_assist

Module kernel_assist 

Source
Expand description

KernelAssist trait: the integration point for kernel-assisted Instances (GasMeter, StorageQuota, YieldCatcher).

Per the v3 spec (README §22 “Kernel-assisted Instances”), certain Cap::Instance values are recognized by their image_hash_chain as kernel-internal. The kernel short-circuits their state access — no bytecode dispatch, no endpoint walk. From userspace, those caps still look like ordinary Cap::Instance values; the special-cased path is invisible.

After the move to the javm_cap::Cap<A> cache model, image / data / file lookups are cache operations rather than KernelAssist hooks — the cache holds the content, the assist holds only the per-block ephemeral kernel state (gas meters, storage quotas, yield catchers, file id allocation).

Structs§

InProcessKernelAssist
In-process, in-memory KernelAssist impl. State lives in plain HashMaps. Used by Stage 3’s tests and as a runnable default before jar-kernel-v3 lands its σ-backed implementation.

Enums§

KernelImage
Identifies which kernel-assisted Image a given image_hash chain refers to. Recognized by the registry’s content-hash lookup.

Traits§

KernelAssist
The integration point for kernel-assisted Instances.

Functions§

kernel_image_hash
Compute the well-known image_hash for a kernel-assisted Image.
recognize_kernel_image
Look up a known kernel-assisted Image by its image_hash chain. Returns None for a hash that doesn’t match any kernel-known Image (the common case — user Images are not kernel-assisted).

Type Aliases§

MeterId
Identifier for a row in the kernel-internal GasMeter table. Chain-chosen, not kernel-assigned (per spec §22).
QuotaId
Identifier for a row in the kernel-internal StorageQuota table.