-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change attestation flow to be pull based (#1109)
* Add trait for verifying attestations * Clean up some of the Staking Config comments * Use `AttestationHandler` in Staking pallet * Add `Attestation::request_attestation()` extrinsic * Check that there's only one attestation request per account * Write to `Threshold*` data structures in `validate()` Since we're verifying the attestation in the extrinsic we can also write to these structures in the extrinsic again. * Allow mock attestation handler to fail * Add convenience implementation for `AttestationHandler * Do some cleanup in Attestation pallet * For `validate` tests don't use the `ValidationQueue` * Input expected keys into quote verification method directly We need to match what the TSS is committing to (e.g what we write to storage) on the Staking pallet end, but we don't always have that information available on the Attestation pallet side. By having the expected data come in alongside the quote we can more easily check that it does match. * Add test for checking failed quote verification * Add some docs explaining how the quote request system works * Remove `AttestationQueue`, `KeyProvider`, and `ValidationQueue` We don't need all this infrastructure anymore since requests managed better by individual pallets. * Clean up some of the staking tests * Add more relevant event after `validate()` is successful * Update runtime implementation * Bump metadata * Ignore the TSS attestation tests Not sure if we're gonna need this in their current form anymore. Need to discuss with the others. * Feature gate `AttestationHandler` We don't want it to get used for the Client's `wasm` builds. * Missed a few `AttestationHandler` mock implementations * Remove unused associated types * Get rid of `on_initialize()` benchmarks * Remove `MaxPendingAttestations` associated type * Add method for requesting quotes to `AttestationHandler` This let's us request quotes in a non-extrinsic way, useful for testing and benchmarking. * Use threshold account when verifying quote This was using the caller, who is a Substrate/Validator account. * Get `validate()` bench working again We're now using "real" PCKs to get this to pass * Add `nonce` to `request_quote()` This will make it easier for us to control the expected nonce in the context of benchmarking and testing. * Accept more quote types in Staking mock * Tidy up `validate()` bench * Strip down bench for `attest` and add one for `request_attestation` * Use better dummy endpoint in `validate()` bench * RustFmt * Remove Attestation pallet from Staking mock * Remove TODO * Add `CHANGELOG` entry * Remove another TODO, this should become an issue * TaploFmt * Use published version of `tdx-quote` * Mention one more config type added in `CHANGELOG`
- Loading branch information
Showing
21 changed files
with
433 additions
and
734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.