design(zone): back-port portable @endo/zone - #891
Draft
kriscendobot wants to merge 1 commit into
Draft
Conversation
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.
Description
Proposes
@endo/zoneas the portable allocation and collection contract required before@endo/ertpcan use durable state without depending on SwingSet. The design keeps heap allocation in Endo while treating Agoric vat-data and the Endo daemon's formula/SQLite MapStores as host-owned adapters.It responds to the prerequisite requested in #778 (review). The review focus is the boundary: named allocation and
makeOncepreserve collision and upgrade invariants, while the portable package neither adopts@agoric/storenor claims that a heapMapprovides durable-store retention semantics.Security Considerations
Sub-zones preserve a separate label namespace when allocation authority is delegated. Durable adapters, rather than the portable core, enforce their host's storable-value rule and retention guarantees.
Scaling Considerations
The heap implementation is in-memory. The daemon adapter is deliberately gated on its persistent MapStore work, including rank indexing and restart retention, so this design does not conceal durable-store costs behind a generic interface.
Documentation Considerations
The design records the public Zone contract, the rejected direct
@agoric/*dependency, the migration shape for Agoric compatibility, and the tests each host adapter must provide.Testing Considerations
The design specifies heap compatibility tests plus adapter-specific upgrade/restart and weak-retention tests. This documentation-only change was checked with Prettier and its Mermaid diagram parsed successfully.
Compatibility Considerations
The intended surface remains compatible with the useful
@agoric/zoneAPI. Existing Agoric durable-key encoding stays behind its adapter; Endo clients do not construct backend storage keys.Upgrade Considerations
makeOnceand stable category keys are specified so a durable adapter can revive an existing value across an upgrade. The Agoric adapter must prove legacy-key preservation before it re-exports the Endo contract.