Repository navigation
Conversation
Keep asserted layer digests separate from computed or verified hashes. Ordinary load/save avoids rehashing trusted memory, while checked_save continues to verify and repair content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Add load_overlay and checked_load_overlay methods that require a declared whole-snapshot base and reuse matching immutable layers. Persist snapshot IDs and inherit provenance through capture and compaction without retaining unused layers or adding memory-manager bookkeeping. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
jprendes
requested review from
andreiltd,
danbugs,
dblnz,
devigned,
jsturtevant,
ludfjig,
simongdavies,
squillace and
syntactically
as code owners
November 26, 2026 12:29
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Newly saved configs break compatibility with existing v6 readers, which reject the added provenance fields despite the unchanged media type and ABI.
3 open issues
What changed in this PR
This PR adds provenance-validated snapshot overlay loading to Hyperlight’s host snapshot APIs. Descendants can reuse immutable memory layers from a caller-authorized base while supplying their complete saved state.
Changes:
- Add ordinary and checked overlay loaders with provenance, digest, and geometry checks.
- Persist snapshot identities and ancestry through capture and compaction.
- Reuse declared digests on ordinary saves, with tests and documentation for verification and trust requirements.
| File | Description |
|---|---|
src/hyperlight_host/src/sandbox/snapshot/mod.rs |
Inherit base provenance during capture. |
src/hyperlight_host/src/sandbox/snapshot/memory/mod.rs |
Store snapshot IDs, ancestors, and declared digests. |
src/hyperlight_host/src/sandbox/snapshot/memory/backing.rs |
Expose backing snapshot memory for provenance inheritance. |
src/hyperlight_host/src/sandbox/snapshot/file/mod.rs |
Implement overlay loading and declared-digest reuse. |
src/hyperlight_host/src/sandbox/snapshot/file/config.rs |
Serialize and validate provenance fields. |
src/hyperlight_host/src/sandbox/snapshot/file_tests.rs |
Cover provenance, layer sharing, verification, and legacy loading. |
src/hyperlight_host/src/sandbox/snapshot/compact.rs |
Preserve ancestry and record explicit compaction bases. |
docs/snapshot-oci-format.md |
Describe overlay semantics and trust requirements. |
CHANGELOG.md |
Document the public APIs and save behavior. |
Review effort: Balanced
Comment on lines
+216
to
+219
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub(super) snapshot_id: Option<String>, | ||
| #[serde(default, skip_serializing_if = "Vec::is_empty")] | ||
| pub(super) bases: Vec<String>, |
Comment on lines
+719
to
+721
| .iter() | ||
| .map(ToString::to_string) | ||
| .collect(), |
Comment on lines
+184
to
+188
| for id in base.bases.iter().copied().chain(std::iter::once(base.id)) { | ||
| if id != self.id && !self.bases.contains(&id) { | ||
| self.bases.push(id); | ||
| } | ||
| } |
Emit config v7 with explicit loader dispatch and require its snapshot ID. Keep strict v6 loading without provenance, update schema and ABI tripwires, and cover legacy and mislabeled layouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Clear base provenance when compacting without a base. With a base, replace target ancestry with that base inherited list and ID. Copy the validated ordered list directly instead of quadratic membership scans, and cover config-limit recovery and repeated checkpoint cycles. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Add explicit, provenance-validated loading of snapshot descendants while reusing immutable memory layers from a caller-authorized base.
Atomic commits
Semantics and trust
Validation
Review follow-ups
compact(None)clears provenance.compact(Some(base))replaces the target's history with the selected base's inherited list plus its ID. This provides an explicit reset while retaining a caller-selected base, rather than silently imposing an ancestry cap.