-
Notifications
You must be signed in to change notification settings - Fork 41
feat(contract): async TEE attestation verification, drop dcap-qvl
#3714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 47 commits
29dc047
16ce226
68837a1
43e3be6
79dc9fe
cde4a47
c21a4db
fd2291f
e15bc3d
74e9f72
5e4ea28
87937db
029f1d8
d9d5066
486d463
9c1a346
290b3dc
c1a8d07
b4fa873
6a6a1a9
9b0851e
6d27650
ee9f82e
8563815
aa46261
d11cb85
721dc6c
756c598
a44b6b2
64a3e94
8e75745
f2f470a
6d228ab
67d6388
de63ecf
43d1fb8
01d9cea
91a7891
2b4ea85
812488f
386d6cd
8ab4f4c
195d7b3
90693be
f950275
22b50b0
8710f65
28f9b90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ const DEFAULT_RETURN_SIGNATURE_AND_CLEAN_STATE_ON_SUCCESS_CALL_TERA_GAS: u64 = 7 | |
| const DEFAULT_RETURN_CK_AND_CLEAN_STATE_ON_SUCCESS_CALL_TERA_GAS: u64 = 7; | ||
| /// Prepaid gas for a `fail_on_timeout` call | ||
| const DEFAULT_FAIL_ON_TIMEOUT_TERA_GAS: u64 = 2; | ||
| /// Prepaid gas for a `fail_attestation_submission` call | ||
| const DEFAULT_FAIL_ATTESTATION_SUBMISSION_TERA_GAS: u64 = 2; | ||
| /// Prepaid gas for a `clean_tee_status` call | ||
| const DEFAULT_CLEAN_TEE_STATUS_TERA_GAS: u64 = 10; | ||
| /// Prepaid gas for the reshare-time `clean_invalid_attestations` promise. | ||
|
|
@@ -34,6 +36,11 @@ const DEFAULT_REMOVE_NON_PARTICIPANT_UPDATE_VOTES_TERA_GAS: u64 = 5; | |
| const DEFAULT_CLEAN_FOREIGN_CHAIN_DATA_TERA_GAS: u64 = 5; | ||
| /// Prepaid gas for a `remove_non_participant_tee_verifier_votes` call | ||
| const DEFAULT_REMOVE_NON_PARTICIPANT_TEE_VERIFIER_VOTES_TERA_GAS: u64 = 5; | ||
| /// Gas attached to the cross-contract `verify_quote` call on the TEE verifier. | ||
| const DEFAULT_VERIFIER_TERA_GAS: u64 = 200; | ||
| /// Prepaid gas for the `resolve_verification` callback. Carries the bulk of the | ||
| /// post-DCAP work (allowlist match, RTMR3 replay, app-compose validation, store). | ||
| const DEFAULT_RESOLVE_VERIFICATION_TERA_GAS: u64 = 60; | ||
|
Comment on lines
+39
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: That's expensive. How does it compare to the current costs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I never benchmarked it, and I think we have quite a few other unbenchmarked constants too, for example here: #3641 (comment), although that one is in the e2e tests. I’d defer this to #3715 (noted here), where I added the tests. Perhaps we can benchmark it there, or in a follow-up if it’s not trivial. |
||
|
|
||
| /// Config for V2 of the contract. | ||
| #[near(serializers=[borsh, json])] | ||
|
|
@@ -56,6 +63,8 @@ pub(crate) struct Config { | |
| pub(crate) return_ck_and_clean_state_on_success_call_tera_gas: u64, | ||
| /// Prepaid gas for a `fail_on_timeout` call. | ||
| pub(crate) fail_on_timeout_tera_gas: u64, | ||
| /// Prepaid gas for a `fail_attestation_submission` call. | ||
| pub(crate) fail_attestation_submission_tera_gas: u64, | ||
| /// Prepaid gas for a `clean_tee_status` call. | ||
| pub(crate) clean_tee_status_tera_gas: u64, | ||
| /// Prepaid gas for the reshare-time `clean_invalid_attestations` promise. | ||
|
|
@@ -68,6 +77,10 @@ pub(crate) struct Config { | |
| pub(crate) clean_foreign_chain_data_tera_gas: u64, | ||
| /// Prepaid gas for a `remove_non_participant_tee_verifier_votes` call. | ||
| pub(crate) remove_non_participant_tee_verifier_votes_tera_gas: u64, | ||
| /// Gas attached to the cross-contract `verify_quote` call on the verifier. | ||
| pub(crate) verifier_tera_gas: u64, | ||
| /// Prepaid gas for the `resolve_verification` callback. | ||
| pub(crate) resolve_verification_tera_gas: u64, | ||
| } | ||
|
|
||
| impl Default for Config { | ||
|
|
@@ -85,6 +98,7 @@ impl Default for Config { | |
| return_ck_and_clean_state_on_success_call_tera_gas: | ||
| DEFAULT_RETURN_CK_AND_CLEAN_STATE_ON_SUCCESS_CALL_TERA_GAS, | ||
| fail_on_timeout_tera_gas: DEFAULT_FAIL_ON_TIMEOUT_TERA_GAS, | ||
| fail_attestation_submission_tera_gas: DEFAULT_FAIL_ATTESTATION_SUBMISSION_TERA_GAS, | ||
| clean_tee_status_tera_gas: DEFAULT_CLEAN_TEE_STATUS_TERA_GAS, | ||
| clean_invalid_attestations_tera_gas: DEFAULT_CLEAN_INVALID_ATTESTATIONS_TERA_GAS, | ||
| cleanup_orphaned_node_migrations_tera_gas: | ||
|
|
@@ -94,6 +108,8 @@ impl Default for Config { | |
| clean_foreign_chain_data_tera_gas: DEFAULT_CLEAN_FOREIGN_CHAIN_DATA_TERA_GAS, | ||
| remove_non_participant_tee_verifier_votes_tera_gas: | ||
| DEFAULT_REMOVE_NON_PARTICIPANT_TEE_VERIFIER_VOTES_TERA_GAS, | ||
| verifier_tera_gas: DEFAULT_VERIFIER_TERA_GAS, | ||
| resolve_verification_tera_gas: DEFAULT_RESOLVE_VERIFICATION_TERA_GAS, | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.