Background
Make dcap-qvl (Intel TDX quote verification) an optional dependency of the attestation / mpc-attestation crates, so it is no longer in their default build. dcap-qvl is ~310 KB / ~21% of the mpc-contract WASM, pushing it toward NEAR's 1.5 MiB deployment cap (NEP-509).
This is a prerequisite refactor: it does not move DCAP off-chain or shrink the WASM yet. The end goal is to stop compiling dcap-qvl into the contract, which requires the contract to verify an attestation without linking it — running only the post-DCAP policy checks (measurement allowlist, report-data binding, RTMR replay) and delegating the cryptographic DCAP step to the standalone tee-verifier contract over a cross-contract call. That was impossible before, because DCAP and the policy checks were welded into a single Attestation::verify that always called dcap_qvl::verify::verify, and dcap-qvl was non-optional.
This PR adds that dcap-qvl-free verification path and makes the dependency optional, so the follow-ups become mechanical:
- Move DCAP off the contract. Instead of running DCAP in-WASM, the contract asks the
tee-verifier contract to do it and returns a verified report; the contract then runs only the policy checks via the verify_with_report entry point added in this PR (which needs no dcap-qvl).
- Drop
dcap-qvl from the contract. With DCAP gone from the contract, it stops opting into the new local-verify feature — and dcap-qvl falls out of the build and the WASM.
The follow-up PRs do not exist yet; this is the first slice of a larger integration effort (#3540) being landed as smaller, self-contained PRs.
Acceptance Criteria
Resources & Additional Notes
See the design doc for the full plan.
Background
Make
dcap-qvl(Intel TDX quote verification) an optional dependency of theattestation/mpc-attestationcrates, so it is no longer in their default build.dcap-qvlis ~310 KB / ~21% of thempc-contractWASM, pushing it toward NEAR's 1.5 MiB deployment cap (NEP-509).This is a prerequisite refactor: it does not move DCAP off-chain or shrink the WASM yet. The end goal is to stop compiling
dcap-qvlinto the contract, which requires the contract to verify an attestation without linking it — running only the post-DCAP policy checks (measurement allowlist, report-data binding, RTMR replay) and delegating the cryptographic DCAP step to the standalonetee-verifiercontract over a cross-contract call. That was impossible before, because DCAP and the policy checks were welded into a singleAttestation::verifythat always calleddcap_qvl::verify::verify, anddcap-qvlwas non-optional.This PR adds that
dcap-qvl-free verification path and makes the dependency optional, so the follow-ups become mechanical:tee-verifiercontract to do it and returns a verified report; the contract then runs only the policy checks via theverify_with_reportentry point added in this PR (which needs nodcap-qvl).dcap-qvlfrom the contract. With DCAP gone from the contract, it stops opting into the newlocal-verifyfeature — anddcap-qvlfalls out of the build and the WASM.The follow-up PRs do not exist yet; this is the first slice of a larger integration effort (#3540) being landed as smaller, self-contained PRs.
Acceptance Criteria
Attestation::verifyis split into:verify_with_report(report, …)— post-DCAP policy checks against an already-verifiedVerifiedReport; does not usedcap-qvl.verify_locally(…)— full DCAP + post-DCAP in one call, behind a newlocal-verifyfeature.dcap-qvlisoptional, gated behindlocal-verify, so it is absent from the default build ofattestationandmpc-attestation(verifiable viacargo tree).dcap_qvl↔tee-verifier-interfaceconversions live in a sharedtee-verifier-conversionscrate, with the byte-layout pin tests in one place.mpc-contractstill enableslocal-verifyand verifies locally exactly as before.Resources & Additional Notes
See the design doc for the full plan.