hyperlight-dev / hyperlight-dev/hyperlight

Unify sandbox types: initialize directly from snapshot and introduce HostFunctionRegistry

オープン
#1,402 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
lifecycle/confirmed
主要言語
Rust
スター
4.7k
フォーク
208
平均マージ
1日 7時間
マージ済み PR(30日)
47

説明

With #1392 adding `Registerable` to `MultiUseSandbox`, the split between `UninitializedSandbox` and `MultiUseSandbox` is increasingly hard to justify. Two changes could simplify the API:

- **Move initialization into snapshot loading**: Today, loading from a snapshot still goes through `UninitializedSandbox::from_snapshot() → evolve() → MultiUseSandbox`. If the snapshot path handled init directly and produced a `Sandbox` (or `MultiUseSandbox`) in one step, the two-phase flow could collapse and the uninitialized state becomes an internal detail rather than a user-facing type.
- **Introduce a `HostFunctionRegistry`**: Instead of registering host functions directly on the sandbox (as #1392 does today via the `Registerable` trait), a standalone registry object could be built up front and validated against the signatures the snapshot expects before the sandbox is created. This gives early type-checking and cleaner separation of concerns, replacing the current `Registerable` trait approach. (Note: internally a `FunctionRegistry` already exists — this would promote and reshape it into a public-facing API.)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。