Skip to content

Commit

Permalink
fix: store reshared key after generation (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppca authored May 30, 2024
1 parent 7a4b85b commit df5c78c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion node/src/protocol/cryptography.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl CryptographicProtocol for WaitingForConsensusState {
impl CryptographicProtocol for ResharingState {
async fn progress<C: CryptographicCtx + Send + Sync>(
mut self,
ctx: C,
mut ctx: C,
) -> Result<NodeState, CryptographicError> {
// TODO: we are not using active potential participants here, but we should in the future.
// Currently resharing protocol does not timeout and restart with new set of participants.
Expand Down Expand Up @@ -300,6 +300,13 @@ impl CryptographicProtocol for ResharingState {
}
Action::Return(private_share) => {
tracing::debug!("resharing: successfully completed key reshare");
ctx.secret_storage()
.store(&PersistentNodeData {
epoch: self.old_epoch + 1,
private_share,
public_key: self.public_key,
})
.await?;

// Send any leftover messages.
let failures = self
Expand Down

0 comments on commit df5c78c

Please sign in to comment.