Skip to content

Avoid parsing tcb_info.json inside contract to reduce TEE verification gas costs #1634

Closed

Description

@barakeinav1

Background

Our TEE verification flow currently parses the full tcb_info.json (and also tcb_info_dev.json) inside the contract for every attestation that is verified. This significantly increases gas usage and contributes to verify_tee costing ~270 TGas per call (for 2 users). The relevant values from tcb_info.json.

improvements:

  1. Only 5 fields of the json file are really needed.
  2. all the values are known in compile time, and should not require parsing a json that could fail.
  3. Move them to a more efficient (storage/gas) storage location /stract

open:
How do we handle leftover data from the existing json files?

User Story

As MPC user, I'd like my contract to be efficient as possible. allowing many MPC nodes participants.

Acceptance Criteria

New solution implemented.

  1. Need to test upgrade flow.
  2. test regular (existing) attestation verification follow
  3. if possible - measure gas costs

Resources & Additional Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions