Skip to content

docs: TEE verifier deploy + vote-in runbook - #3882

Merged
pbeza merged 6 commits into
mainfrom
fix-tee-verifier-reproducible-build
Jul 22, 2026
Merged

docs: TEE verifier deploy + vote-in runbook#3882
pbeza merged 6 commits into
mainfrom
fix-tee-verifier-reproducible-build

Conversation

@pbeza

@pbeza pbeza commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #3883

Copilot AI review requested due to automatic review settings July 21, 2026 15:22
@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR title type suggestion: This PR includes a reproducible build configuration fix in Cargo.toml, so the type prefix should be build: instead of docs:.

Suggested title: build: TEE verifier reproducible build + deploy runbook

@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown

Pull request overview

Adds docs/deploy-tee-verifier.md, a network-agnostic runbook for building, deploying, locking, and voting-in the stateless tee-verifier contract; also inherits repository from the workspace in crates/tee-verifier/Cargo.toml so cargo near build reproducible-wasm no longer fails the NEP-330 metadata check.

Changes:

  • crates/tee-verifier/Cargo.toml: add repository = { workspace = true } — the workspace [workspace.package] already sets repository = "https://github.com/near/mpc", so this unblocks the reproducible (docker) build.
  • docs/deploy-tee-verifier.md: new 7-step runbook (mainnet/testnet parameterised) covering reproducible build, account creation, deploy, audit, key-deletion lock, vote via vote_tee_verifier_change, and confirmation via tee_verifier_votes.

Reviewed changes

Per-file summary
File Description
crates/tee-verifier/Cargo.toml Inherit repository from [workspace.package] so NEP-330 metadata is populated for cargo-near reproducible builds.
docs/deploy-tee-verifier.md New operator runbook for deploying the tee-verifier contract and voting it in as trusted verifier.

Findings

I verified the referenced contract entry points against the current source:

  • vote_tee_verifier_change(candidate_account_id, expected_code_hash)crates/contract/src/lib.rs:1618
  • tee_verifier_votes() view — crates/contract/src/lib.rs:2123
  • state() view — crates/contract/src/lib.rs:2082
  • verify_quote on the verifier — crates/tee-verifier/src/lib.rs:49
  • The log line the runbook grep-relies on (vote_tee_verifier_change: new verifier = {}) is emitted at crates/contract/src/lib.rs:1647.

expected_code_hash serde format is hex (see serialize_hash at crates/primitives/src/hash.rs:21 and the macro at hash.rs:78), so the runbook's "SHA-256 hex from step 1" instruction is correct.

Non-blocking (nits / suggestions):

  • docs/deploy-tee-verifier.md:117 — the optional verify_quote sanity-check references crates/tee-verifier/tests/fixtures/verify_quote_args.borsh, which does not exist on this branch (fixtures dir is empty; see crates/tee-verifier/tests/). PR description notes this resolves once test(localnet): deploy and vote in the TEE verifier contract #3855 merges, but an operator following the doc between the two merges will hit a missing-file error. Consider either (a) an inline callout in the doc ("Requires the fixture from test(localnet): deploy and vote in the TEE verifier contract #3855; skip until that PR lands"), or (b) rebasing this PR on top of test(localnet): deploy and vote in the TEE verifier contract #3855.
  • crates/tee-verifier/Cargo.toml:6 — for consistency with the other workspace-inheriting crates in the repo (near-contract-transport, near-mpc-contract-interface, near-mpc-sdk, near-mpc-crypto-types, near-mpc-bounded-collections, near-mpc-signature-verifier, all use repository.workspace = true), consider the shorthand repository.workspace = true instead of repository = { workspace = true }. Purely cosmetic; both forms are equivalent.
  • PR description mentions the fix mirrors what mpc-contract "already does", but crates/contract/Cargo.toml:6 uses a literal string (repository = \"https://github.com/near/mpc\"), not workspace inheritance. Description-only nit — the change itself is correct and produces the same URL.
  • docs/deploy-tee-verifier.md:130 — suggesting state json-args {} for reading the threshold returns the full ProtocolContractState, which is verbose. If a narrower view exists (or is worth adding), operators would appreciate it; not required.

✅ Approved

Network-agnostic guide (mainnet or testnet) covering the reproducible build,
deploy to a locked account, the operator audit checklist, locking, and the
vote_tee_verifier_change flow.
@pbeza
pbeza force-pushed the fix-tee-verifier-reproducible-build branch from 328bd7b to 4b555cb Compare July 21, 2026 15:48
@pbeza pbeza changed the title docs: TEE verifier deploy runbook + reproducible-build fix docs: TEE verifier deploy + vote-in runbook Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread docs/deploy-tee-verifier.md
netrome
netrome previously approved these changes Jul 21, 2026

@netrome netrome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be some fixtures missing, but the gudie otherwise looks good.

Comment thread docs/deploy-tee-verifier.md Outdated
Comment thread docs/deploy-tee-verifier.md Outdated
Comment on lines +19 to +20
`near-cli`, and toolchain versions. A running Docker daemon is required for the
reproducible build. Both `mainnet` and `testnet` are built-in `near-cli` network configs,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still sad that we require a dunning Docker daemon for reproducible builds. Long for the day when I can do this with Podman as well. Don't think it's super complicated but we've never had time to prioritize it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I am not sure if it depends on us, as that reproducible build is managed by cargo-near not us

Comment thread docs/deploy-tee-verifier.md
gilcu3
gilcu3 previously approved these changes Jul 22, 2026

@gilcu3 gilcu3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment on lines +19 to +20
`near-cli`, and toolchain versions. A running Docker daemon is required for the
reproducible build. Both `mainnet` and `testnet` are built-in `near-cli` network configs,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I am not sure if it depends on us, as that reproducible build is managed by cargo-near not us

Comment thread docs/deploy-tee-verifier.md Outdated
Comment thread docs/deploy-tee-verifier.md
Comment thread docs/deploy-tee-verifier.md
Comment thread docs/deploy-tee-verifier.md
barakeinav1
barakeinav1 previously approved these changes Jul 22, 2026

@barakeinav1 barakeinav1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, approved with one comment.

Note - I haven't tried to run those steps myself.

Comment thread docs/deploy-tee-verifier.md Outdated
@pbeza
pbeza dismissed stale reviews from barakeinav1, gilcu3, and netrome via 3bacf4c July 22, 2026 08:47
gilcu3
gilcu3 previously approved these changes Jul 22, 2026
@pbeza

pbeza commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all the comments. Could you please re-approve, @barakeinav1 @netrome @gilcu3?

@pbeza
pbeza added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit 66f40e1 Jul 22, 2026
16 checks passed
@pbeza
pbeza deleted the fix-tee-verifier-reproducible-build branch July 22, 2026 10:13
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.

Document TEE verifier deploy + vote-in

5 participants