diff --git a/crates/protocol/src/execute_protocol.rs b/crates/protocol/src/execute_protocol.rs index 5de763a04..c80af4574 100644 --- a/crates/protocol/src/execute_protocol.rs +++ b/crates/protocol/src/execute_protocol.rs @@ -333,7 +333,6 @@ pub async fn execute_reshare( session_id: SessionId, chans: Channels, threshold_pair: &sr25519::Pair, - threshold_accounts: Vec, inputs: KeyResharingInputs, aux_info_option: Option>, ) -> Result< @@ -343,8 +342,6 @@ pub async fn execute_reshare( tracing::debug!("Executing proactive refresh"); tracing::debug!("Signing with {:?}", &threshold_pair.public()); - let party_ids: BTreeSet = - threshold_accounts.iter().cloned().map(PartyId::new).collect(); let pair = PairWrapper(threshold_pair.clone()); let session_id_hash = session_id.blake2(None)?; @@ -353,13 +350,12 @@ pub async fn execute_reshare( &mut OsRng, SynedrionSessionId::from_seed(session_id_hash.as_slice()), pair, - &party_ids, - inputs, + &inputs.new_holders, + inputs.clone(), ) .map_err(ProtocolExecutionErr::SessionCreation)?; let (new_key_share, chans) = execute_protocol_generic(chans, session, session_id_hash).await?; - let aux_info = if let Some(aux_info) = aux_info_option { aux_info } else { @@ -369,11 +365,11 @@ pub async fn execute_reshare( &mut OsRng, SynedrionSessionId::from_seed(session_id_hash_aux_data.as_slice()), PairWrapper(threshold_pair.clone()), - &party_ids, + &inputs.new_holders, ) .map_err(ProtocolExecutionErr::SessionCreation)?; - execute_protocol_generic(chans, session, session_id_hash).await?.0 + execute_protocol_generic(chans, session, session_id_hash_aux_data).await?.0 }; Ok((new_key_share.ok_or(ProtocolExecutionErr::NoOutputFromReshareProtocol)?, aux_info)) diff --git a/crates/protocol/tests/helpers/mod.rs b/crates/protocol/tests/helpers/mod.rs index e1ab7c70c..a1a0f60e9 100644 --- a/crates/protocol/tests/helpers/mod.rs +++ b/crates/protocol/tests/helpers/mod.rs @@ -144,8 +144,7 @@ pub async fn server( new_threshold: old_key.threshold(), }; - let new_keyshare = - execute_reshare(session_id, channels, &pair, tss_accounts, inputs, None).await?; + let new_keyshare = execute_reshare(session_id, channels, &pair, inputs, None).await?; Ok(ProtocolOutput::Reshare(new_keyshare.0)) }, SessionId::Dkg { .. } => { diff --git a/crates/threshold-signature-server/src/signing_client/api.rs b/crates/threshold-signature-server/src/signing_client/api.rs index 0df9adb3f..973499eec 100644 --- a/crates/threshold-signature-server/src/signing_client/api.rs +++ b/crates/threshold-signature-server/src/signing_client/api.rs @@ -204,15 +204,8 @@ pub async fn do_proactive_refresh( ) .await?; - let result = execute_reshare( - session_id, - channels, - signer.signer(), - tss_accounts, - inputs, - Some(aux_info), - ) - .await?; + let result = + execute_reshare(session_id, channels, signer.signer(), inputs, Some(aux_info)).await?; Ok(result) } diff --git a/crates/threshold-signature-server/src/validator/api.rs b/crates/threshold-signature-server/src/validator/api.rs index 4c7f76306..efccb4b98 100644 --- a/crates/threshold-signature-server/src/validator/api.rs +++ b/crates/threshold-signature-server/src/validator/api.rs @@ -169,8 +169,7 @@ pub async fn new_reshare( .await?; let (new_key_share, aux_info) = - execute_reshare(session_id.clone(), channels, signer.signer(), tss_accounts, inputs, None) - .await?; + execute_reshare(session_id.clone(), channels, signer.signer(), inputs, None).await?; let serialized_key_share = key_serialize(&(new_key_share, aux_info)) .map_err(|_| ProtocolErr::KvSerialize("Kv Serialize Error".to_string()))?;