From 1fb40643fdb64669df783a716a95b167697a1e18 Mon Sep 17 00:00:00 2001 From: jesse Date: Wed, 30 Aug 2023 11:35:42 -0400 Subject: [PATCH] docs --- crypto/server/src/helpers/user.rs | 1 + .../src/signing_client/new_party/signing_protocol.rs | 2 +- .../src/signing_client/protocol_transport/mod.rs | 1 - crypto/server/src/user/api.rs | 12 ++++++------ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/server/src/helpers/user.rs b/crypto/server/src/helpers/user.rs index 16651d469..8aa3de2ee 100644 --- a/crypto/server/src/helpers/user.rs +++ b/crypto/server/src/helpers/user.rs @@ -74,6 +74,7 @@ pub async fn do_dkg( Ok(result) } +/// Send's user key share to other members of signing subgroup pub async fn send_key( api: &OnlineClient, stash_address: &subxtAccountId32, diff --git a/crypto/server/src/signing_client/new_party/signing_protocol.rs b/crypto/server/src/signing_client/new_party/signing_protocol.rs index 3b6a23970..36dd61977 100644 --- a/crypto/server/src/signing_client/new_party/signing_protocol.rs +++ b/crypto/server/src/signing_client/new_party/signing_protocol.rs @@ -143,7 +143,7 @@ pub(super) async fn execute_protocol( } } -/// execute threshold signing protocol. +/// Execute dkg. #[instrument(skip(chans, threshold_signer))] pub async fn execute_dkg( mut chans: Channels, diff --git a/crypto/server/src/signing_client/protocol_transport/mod.rs b/crypto/server/src/signing_client/protocol_transport/mod.rs index 43b5f3490..e8266c961 100644 --- a/crypto/server/src/signing_client/protocol_transport/mod.rs +++ b/crypto/server/src/signing_client/protocol_transport/mod.rs @@ -26,7 +26,6 @@ use crate::{ AppState, SignerState, SUBSCRIBE_TIMEOUT_SECONDS, }; -// TODO remove ctx and pass only needed info /// Set up websocket connections to other members of the signing committee pub async fn open_protocol_connections( validators_info: &[ValidatorInfo], diff --git a/crypto/server/src/user/api.rs b/crypto/server/src/user/api.rs index d26f9536e..50a3b1af3 100644 --- a/crypto/server/src/user/api.rs +++ b/crypto/server/src/user/api.rs @@ -79,10 +79,13 @@ pub struct UserTransactionRequest { pub validators_info: Vec, } +/// Type for validators to send user key's back and forth #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] pub struct UserRegistrationInfo { + /// Signing request key (also kvdb key) pub key: String, + /// User threshold signing key pub value: Vec, } /// Called by a user to initiate the signing process for a message @@ -157,12 +160,9 @@ pub async fn sign_tx( } } -/// HTTP POST endoint called by the user when registering. -/// -/// This adds a new Keyshare to this node's set of known Keyshares and stores the it in the [kvdb]. -/// -/// The http request takes a [SignedMessage] containing a bincode-encoded -/// [KeyShare](synedrion::KeyShare). +/// HTTP POST endpoint called by the off-chain worker (propagation pallet) during user registration. +/// The http request takes a parity scale encoded [OCWMessage] which tells us which validators are +/// in the registration group and will perform a DKG. pub async fn new_user( State(app_state): State, encoded_data: Bytes,