Skip to content
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

Add TSS endpoint to get TDX quote #1173

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Nov 19, 2024

Part of #982 - see #982 (comment)

This adds an endpoint to the TSS server which allows the operator to get a quote for use in the validate, change_endpoint, and change_tss_accounts extrinsics.

In doing this i noticed a possible problem with our design. I have made an issue: #1174

Ok(nonce)
attestee: &sr25519::Pair,
) -> Result<[u8; 32], ClientError> {
Ok(user::request_attestation(api, rpc, attestee).await?)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function needed to move out of this module because it is behind a feature flag which entropy-tss does not enable. I have left this wrapper so that there is a version of it with the same error type as the other full-client functions.

let nonce = request_attestation(&api, &rpc, signer.signer()).await?;

// We also need the current block number as input
let block_number =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the problem - we cannot know at what block number the node operator is going to submit this quote

@ameba23 ameba23 self-assigned this Nov 19, 2024
@ameba23 ameba23 added this to the v0.4.0 milestone Nov 19, 2024
Copy link
Collaborator

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

/// body.
/// This is used by node operators to get a quote for use in the `validate`, `change_endpoint`
/// and `change_tss_accounts` extrinsics.
pub async fn get_attest(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub async fn get_attest(
pub async fn request_attestation(

To match the extrinsic?

let api = get_api(&app_state.configuration.endpoint).await?;
let rpc = get_rpc(&app_state.configuration.endpoint).await?;

// Request attestation to get nonce
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Request attestation to get nonce

let rpc = get_rpc(&app_state.configuration.endpoint).await?;

// Request attestation to get nonce
let nonce = request_attestation(&api, &rpc, signer.signer()).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of the AttestationIssued event we return not only the nonce but also the block_number at which that request was processed.

I thought it would be useful for that second step, but thinking about it a bit more it might not be.

@ameba23 ameba23 merged commit bdc0df8 into master Nov 21, 2024
7 of 8 checks passed
@ameba23 ameba23 deleted the peg/tss-get-quote-endpoint branch November 21, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants