Skip to content

feat(tee): inject per-network registry genesis storage in manifest assemble - #80

Merged
samlaf merged 1 commit into
mainfrom
inject-registry-genesis-storage
Jul 30, 2026
Merged

feat(tee): inject per-network registry genesis storage in manifest assemble#80
samlaf merged 1 commit into
mainfrom
inject-registry-genesis-storage

Conversation

@samlaf

@samlaf samlaf commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Committed genesis files stay policy-free — the accepted admission IDs are a per-network fact. assemble now compiles the network's policy document and writes the report's registry_genesis_storage into its copy of the genesis: wholesale replacement of the registry account's storage, so re-assembly is idempotent and a policy change never leaves stale slots behind. eth.genesis_hash is computed over the injected copy, and write_artifact_set ships it — the manifest commits to the reviewed policy's storage, not to whatever the input happened to carry. This lifts #78's requirement to pre-seed the input genesis from compile output; a policy-free input (like reth's committed dev.json) now assembles directly.

The exact registry gate is unchanged, but its mismatch arms now defend the validate path: assemble satisfies the gate by construction, so a storage mismatch means the shipped artifact set was edited after assembly.

Injection fails closed: a compile report without registry storage (stale admission CLI), a genesis alloc missing the registry account, or the account listed twice under different hex spellings are GateErrors; the alloc key's original spelling is preserved. The same-name reth-genesis.json write in a network dir is deliberate and stable under re-assembly.

Tests cover injection into a policy-free input, wholesale replacement, the manifest committing to the injected copy's hash, stable re-assembly over a shipped artifact set, and the gate arms via post-assembly tampering; write_artifact_set drops its GateContext parameter and ships assemble's bytes.

…semble

Committed genesis files stay policy-free — the accepted admission IDs
are a per-network fact. assemble now compiles the network's policy
document and writes the report's registry_genesis_storage into its copy
of the genesis: wholesale replacement of the registry account's storage,
so re-assembly is idempotent and a policy change never leaves stale
slots behind. eth.genesis_hash is computed over the injected copy, and
write_artifact_set ships it — the manifest commits to the reviewed
policy's storage, not to whatever the input happened to carry. This
lifts #78's requirement to pre-seed the input genesis from compile
output; a policy-free input (like reth's committed dev.json) now
assembles directly.

The exact registry gate is unchanged, but its mismatch arms now defend
the validate path: assemble satisfies the gate by construction, so a
storage mismatch means the shipped artifact set was edited after
assembly.

Injection fails closed: a compile report without registry storage
(stale admission CLI), a genesis alloc missing the registry account, or
the account listed twice under different hex spellings are GateErrors;
the alloc key's original spelling is preserved. The same-name
reth-genesis.json write in a network dir is deliberate and stable under
re-assembly.

Tests cover injection into a policy-free input, wholesale replacement,
the manifest committing to the injected copy's hash, stable
re-assembly over a shipped artifact set, and the gate arms via
post-assembly tampering; write_artifact_set drops its GateContext
parameter and ships assemble's bytes.
@samlaf
samlaf merged commit d9a739a into main Jul 30, 2026
1 check passed
@samlaf
samlaf deleted the inject-registry-genesis-storage branch July 30, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant