test(localnet): deploy + vote the tee-verifier in the cluster script - #3888
test(localnet): deploy + vote the tee-verifier in the cluster script#3888barakeinav1 wants to merge 1 commit into
Conversation
Adds deploy_verifier (build/create/deploy tee-verifier) and vote_tee_verifier_threshold (vote_tee_verifier_change from threshold participants during Initializing) to deploy-tee-cluster.sh, plus a how-to doc. Optional VERIFIER_TERA_GAS_OVERRIDE sets init_config.verifier_tera_gas (off by default; needed once #3714 lands). Refs #3887, #3642.
|
PR title type suggestion: This PR changes development infrastructure scripts and documentation, not test code itself. The type prefix should probably be Suggested title: |
Pull request overviewExtends the localnet TDX deploy script ( Changes:
Reviewed changesPer-file summary
FindingsNon-blocking (nits, follow-ups, suggestions):
✅ Approved |
There was a problem hiding this comment.
Pull request overview
Adds support for deploying and adopting the standalone tee-verifier contract in the localnet TDX cluster deploy flow, so developers can exercise the verifier-based attestation path on real hardware. This aligns the localnet tooling with the planned async verify_quote flow and documents the required gas budget override for real DCAP verification workloads.
Changes:
- Extend
deploy-tee-cluster.shto build/deploycrates/tee-verifierand vote it in viavote_tee_verifier_changeduringInitializing. - Add an opt-in
VERIFIER_TERA_GAS_OVERRIDEthat injectsinit_config.verifier_tera_gasinto the init args when set. - Add a how-to doc for running/verifying the verifier-enabled e2e flow on a localnet TDX cluster.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| localnet/tee/scripts/rust-launcher/deploy-tee-cluster.sh | Builds + deploys tee-verifier, votes it in at threshold, and supports an optional verifier gas override in init args. |
| localnet/tee/scripts/rust-launcher/how-to-test-tee-verifier-e2e.md | Documents the deploy/vote/verify workflow and the verifier gas budget note for the async attestation path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 2. **`vote_tee_verifier_threshold`** (right after `init`, while the contract is | ||
| `Initializing`) — every node account calls `vote_tee_verifier_change` | ||
| committing to the wasm's sha256 as `expected_code_hash`, crossing threshold so | ||
| the verifier account is trusted before keygen finishes. |
| _vtg = "${VERIFIER_TERA_GAS_OVERRIDE:-}" | ||
| if _vtg: | ||
| init["init_config"] = {"verifier_tera_gas": int(_vtg)} |
| export TEE_VERIFIER_HASH="$(sha256sum "$TEE_VERIFIER_PATH" | awk '{print $1}')" | ||
| log "TEE_VERIFIER_PATH=$TEE_VERIFIER_PATH" | ||
| log "TEE verifier sha256 (expected_code_hash): $TEE_VERIFIER_HASH" |
| if [ -z "${TEE_VERIFIER_HASH:-}" ]; then | ||
| [ -n "${TEE_VERIFIER_PATH:-}" ] && [ -f "$TEE_VERIFIER_PATH" ] \ | ||
| || { err "TEE_VERIFIER_HASH unset and no TEE_VERIFIER_PATH wasm to hash"; exit 1; } | ||
| export TEE_VERIFIER_HASH="$(sha256sum "$TEE_VERIFIER_PATH" | awk '{print $1}')" | ||
| fi |
Removes the TEE cluster deploy/test scripts (deploy-tee-cluster.sh, set-*-env.sh, create-and-sweep-to-treasury.sh, test-migration.sh, test-verify-and-upgrade.sh, test-hash-override.sh, how-to-run doc); they now live in near/mpc-private tools/tee-cluster and run against a local mpc checkout via MPC_REPO_ROOT. Keeps single-node.sh (+ readme), common.sh and the templates here (the moved scripts reference them via MPC_REPO_ROOT; single-node.sh generates the Rust test fixtures). Repoints the testnet setup guide and trims the rust-launcher README accordingly. Replaces #3888.
Closes #3887 (script + doc portion).
Adds TEE verifier support to the localnet TDX deploy so the verifier path can be exercised on a real cluster (the account voting
vote_tee_verifier_changeis already onmain; the asyncverify_quotewiring lands with #3714):deploy_verifier(in thenear_contractphase): buildscrates/tee-verifier(or reusesTEE_VERIFIER_PATH), createstee-verifier.<root>, deploys the wasm (stateless, no init).vote_tee_verifier_threshold(right afterinit, whileInitializing): each node account votesvote_tee_verifier_changecommitting to the wasm sha256, crossing threshold so the verifier is trusted before keygen finishes.VERIFIER_TERA_GAS_OVERRIDE(opt-in): setsinit_config.verifier_tera_gas. Off by default so this stays valid onmain(no suchInitConfigfield there yet); needed once feat(contract): async TEE attestation verification, dropdcap-qvl#3714 lands, since realdcap_qvl::verifyburns ~173 Tgas and the contract's100default OOGs the cross-call.localnet/tee/scripts/rust-launcher/how-to-test-tee-verifier-e2e.md.Verified end-to-end on a localnet TDX cluster (stock
release-v3.13node + a #3714 contract): both nodes attested as Dstack (get_attestation→Dstack), contract reachedRunning, and an ECDSAsignsucceeded. Full context in #3887.Follow-up (tracked in #3887): a sandbox/e2e test that runs
verify_quoteat production gas against a valid quote (see #3715).