Skip to content

Add a gas-metered sandbox test for verify_quote with a valid quote (cover the verifier_tera_gas budget) #3897

Description

@barakeinav1

Background

The async TEE attestation path (#3714) forwards config.verifier_tera_gas to the cross-contract verify_quote call. Real dcap_qvl::verify on a valid quote burns ~173 Tgas, above DEFAULT_VERIFIER_TERA_GAS = 100, so with the default the cross-call OOGs (Exceeded the prepaid gas), the yield times out, and attestation never completes (hit in a real-TDX e2e — see #3714).

The #3715 tests don't catch it: the gas-metered sandbox tests (tee_verifier.rs) only cover not-configured / Rejected (a 16-byte quote that dies at parse) / unreachable — all negligible gas; the Verified verdict is covered in-process (testing_env!, which does not meter gas); and contract_configuration.rs only round-trips verifier_tera_gas without executing verify_quote. So no test runs a valid quote through verify_quote under a realistic budget.

User Story

As an MPC contract maintainer, I need a test that exercises verify_quote with a valid quote at the production gas budget, so that an insufficient verifier_tera_gas (like the 100 default) is caught in CI instead of only in a live TDX deployment.

Acceptance Criteria

  • A sandbox (near-workspaces, gas-metered) test that deploys the real tee-verifier, votes it in, and submits a valid Dstack attestation via submit_participant_info — using the test_utils::attestation::quote()/collateral() fixtures with the sandbox block clock fast-forwarded into the fixture's validity window (cf. crates/tee-verifier/tests/verify_quote.rs::verify_quote__should_return_verified_td10_report_for_valid_fixture) — at the production verifier_tera_gas, asserting the submission resolves to a stored attestation (get_attestationDstack).
  • (bonus) A negative case at a deliberately-too-low verifier_tera_gas asserting the submission fails/rolls back cleanly, pinning the required budget with a test.

Resources & Additional Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIAn issue related to the continuous integration: linters, formatters, tests, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions