Expand description
Image: the smallest unit of program specification.
An Image is content-addressed (its image_id is the hash of
its serialized content). An Instance’s image_hash is the
cumulative chain hash tracking the lineage of set_image /
host_derive_spawn extensions from genesis.
genesis (host_derive_spawn from no source):
image_hash = hash(image)
after set_image(new):
image_hash = hash(prev_chain || hash(new))
after host_derive_spawn(new, cnode) by a spawner:
spawned.image_hash = hash(spawner.image_hash || hash(new))
after MGMT_COPY of a Cap::Instance:
copy.image_hash = source.image_hash (preserved)This module provides the pure data structures + the chain-hash
computations. Image content hashing is done by serializing the
Image canonically and feeding the bytes to H::hash; we provide
a simple deterministic encoder here so the v3 implementation
has one canonical form.
Structs§
- Endpoint
Def - Endpoint definition: entry PC + register conventions.
- Image
- Image: the program spec (code, endpoints, memory layout, slot declarations, pinned ro caps).
- Initial
Data Cap - Initial
Cap::Datacontent for a non-pinned mutable slot. Used at standalone (root) Instance bootstrap to seed the cnode. A parented Instance receives its slots from the spawner and ignores this field. - Memory
Mapping - One mapped region. The kernel resolves
sourceat instance start, reads the bytes from the resultingCap::Data, and lays them at[start, start + size)in the address space. Whether the region is RO or RW is derived from whethersource.target()is inImage.pinned_slots.
Enums§
- Pinned
Cap - Pinned slot content. Only content-addressed cap kinds can be
pinned (Data or Image).
Cap::Databytes are inlined in the Image; a future optimisation can add a hash-only variant for content that lives in σ.data_payloads.
Functions§
- chain_
extend - Extend an image-hash chain with a new image:
result = H(prev_chain || image_content_hash(new_image)). - chain_
genesis - Genesis image-hash chain: a freshly-derived Instance (with no
prior chain) has
image_hash = image_content_hash. - image_
content_ hash - Content hash of an Image: SSZ
hash_tree_root(SHA-256 merkleization of the derived SSZ container). The canonical encoding/merkleization is defined byImage’sssz-deriveimpl.