Skip to content

feat: allow zero teeImageHash in dev multiproof mode#344

Merged
robriks merged 2 commits into
l3-changesfrom
markusosterlund/priv-1982-align-contracts-deploy-config-allow-zero-teeimagehash-in-dev
Jun 16, 2026
Merged

feat: allow zero teeImageHash in dev multiproof mode#344
robriks merged 2 commits into
l3-changesfrom
markusosterlund/priv-1982-align-contracts-deploy-config-allow-zero-teeimagehash-in-dev

Conversation

@robriks

@robriks robriks commented Jun 16, 2026

Copy link
Copy Markdown

Summary

  • Set teeImageHash to zero in local-tee.json, matching nitro-enclave local mode's B256::ZERO default (no real PCR0 measurement in dev)
  • Move the teeImageHash != bytes32(0) require in _assertValidMultiproofInput into the production-only branch, so dev multiproof deployments can use a zero image hash

Context

This is PR 1 in a 5-PR sequence (PRIV-1982) to stand up a fully functional L3 appchain devnet running in dev multiproof mode.

The end goal is just devnet up-l3 bringing up the full multiproof stack automatically — L1 anvil, L3 sequencer/batcher, nitro-local TEE prover, proposer (creating + auto-resolving games), and challenger (bond lifecycle) — with deposits and withdrawals working end-to-end.

Why this PR is needed

The on-chain AggregateVerifier recomputes the TEE journal using CONFIG_HASH and TEE_IMAGE_HASH (both set at deploy time from deploy config values). The enclave computes the same values and signs them into the journal. These must match exactly, or every proof verification fails.

teeImageHash: In local mode (no real AWS Nitro enclave), tee_image_hash = B256::ZERO. The full verification chain works with zero: enclave signs journal with zero → AggregateVerifier recomputes with zero → DevTEEProverRegistry.addDevSigner(signer, 0) registers with zero → TEEVerifier checks signerImageHash[signer] == imageId0 == 0 ✓. The only blocker was _assertValidMultiproofInput requiring non-zero teeImageHash unconditionally — this PR moves that check into the production branch.

multiproofConfigHash: Left as a non-zero placeholder (0x00...01) in local-tee.json. The config hash is chain-specific — it's keccak256(PerChainConfig::marshal_binary()) which includes chain ID, genesis hashes, and contract addresses. Since local-tee.json deploys to an ephemeral Anvil chain (L2 chain 901), no pre-computed hash is correct. The real devnet's config hash (for chain 84538453) will be set in the base repo deploy config template (PR3), either hardcoded or computed dynamically once joe/fetch-rollup-config merges.

What this unblocks

With the zero teeImageHash allowed in dev mode, the subsequent PRs can wire everything together:

  • PR 2 (base): Proposer --direct-prover-rpc flag to talk directly to nitro-local, plus auto-resolve after game creation
  • PR 3 (base): Devnet deploy config template parameterization and CONTRACTS_COMMIT bump
  • PR 4 (base): Docker Compose services for nitro-local, base-proposer, base-challenger
  • PR 5 (base): Challenger TEE-only mode (skip ZK dispute paths)

Test plan

  • forge build compiles successfully
  • All 8 SystemDeploy_Test tests pass, including test_deploy_devMultiproof_succeeds and test_deploy_devMultiproof_onProductionChain_reverts
  • No changes to SystemDeploy.t.sol — tests use independent constants (teeImageHash = bytes32(uint256(1))) and are unaffected

…ash (PRIV-1982)

Update local-tee.json with the canonical devnet multiproofConfigHash
(0x1bb15c...b1, computed by PerChainConfig for chain 1337) and set
teeImageHash to zero (matching nitro-enclave local mode B256::ZERO).

Move the teeImageHash non-zero require in _assertValidMultiproofInput
into the production (non-dev) branch so dev multiproof deployments can
use a zero image hash — there is no real Nitro enclave in dev mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
@robriks robriks self-assigned this Jun 16, 2026
@linear

linear Bot commented Jun 16, 2026

Copy link
Copy Markdown

PRIV-1982

The 0x1bb15c... hash corresponds to ChainConfig::DEVNET (chain 1337)
which has all-zero genesis fields. local-tee.json deploys on Anvil
chain 901 with real genesis data, so no pre-computed hash is correct
for this ephemeral chain — use 0x00...01 as a non-zero placeholder
to trigger the multiproof deployment path.

The correct per-chain config hash for the real devnet (chain 84538453)
will be set in the base repo deploy config template (PR3).

Co-authored-by: Cursor <cursoragent@cursor.com>
@robriks robriks changed the title feat: align deploy config for dev multiproof and allow zero teeImageH… feat: allow zero teeImageHash in dev multiproof mode Jun 16, 2026
@robriks robriks marked this pull request as ready for review June 16, 2026 18:59
@robriks robriks merged commit 680d7b3 into l3-changes Jun 16, 2026
3 checks passed
@robriks robriks deleted the markusosterlund/priv-1982-align-contracts-deploy-config-allow-zero-teeimagehash-in-dev branch June 16, 2026 20:26
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.

2 participants