Allow snapshot-backed `SandboxBuilder` to accept a complete `SandboxConfiguration`

Aperta
#1,862 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start at hyperlight_host::SandboxBuilder::from_snapshot() and the existing SandboxConfiguration handling for fresh sandboxes. Trace which snapshot-owned structural values and restorer-owned settings are applied, then add the proposed configuration input without changing restore semantics. Done means interrupt, crashdump, GDB, and other available non-structural settings come from the supplied configuration.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

S-needs-triage
Problem

Hyperlight-JS stores construction settings in a SandboxConfiguration. Its fresh-sandbox path forwards that configuration to Hyperlight, but its snapshot restoration path discards it and creates a hyperlight_host::SandboxBuilder::from_snapshot() using Hyperlight defaults.

This loses any configured non-structural construction settings available for the current platform and feature set, including interrupt configuration, per-sandbox crashdump enablement, and GDB configuration. These settings cannot be changed after the restored MultiUseSandbox is built.

Hyperlight's snapshot builder exposes per-field methods for these values, so Hyperlight-JS could separately retain and replay every setting. However, that would duplicate Hyperlight's configuration state, require wrapper changes whenever settings are added, and cannot reconstruct fields whose SandboxConfiguration getters are not public.

The snapshot builder should therefore accept a complete SandboxConfiguration. Hyperlight's existing low-level restore semantics should remain unchanged: snapshot-owned heap, scratch, and transport geometry override caller values, while non-structural construction settings come from the restoring host.

Proposed API
let sandbox = SandboxBuilder::from_snapshot(snapshot)
    .sandbox_configuration(config)
    .build()?;

Snapshot-owned structural values are still applied. Other restorer-owned settings should come from the supplied configuration.

Maybe we should split the configuration into 2 different structs to make this cleaner

Lingua principale
Rust
Stelle
4.8k
Fork
223
Merge medio
1g 18h
PR unite (30g)
65

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperlight-dev/hyperlight

Tutte le issue di hyperlight-dev/hyperlight

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.