Skip to content

Commit

Permalink
dkg: lockstep success message (#2514)
Browse files Browse the repository at this point in the history
Make every peer participating in the DKG wait for the "slow" one, and synchronize the `Successfully completed DKG ceremony 🎉` message output.


category: misc
ticket: none
  • Loading branch information
gsora authored Aug 4, 2023
1 parent 9cbb146 commit 12ee4f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions dkg/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ func Run(ctx context.Context, conf Config) (err error) {
}
}

if err = stopSync(ctx); err != nil {
return errors.Wrap(err, "sync shutdown") // Consider increasing --shutdown-delay if this occurs often.
}

// Write keystores, deposit data and cluster lock files after exchange of partial signatures in order
// to prevent partial data writes in case of peer connection lost

Expand Down Expand Up @@ -349,6 +345,15 @@ func Run(ctx context.Context, conf Config) (err error) {
}
log.Debug(ctx, "Saved deposit data file to disk")

// Signature verification and disk key write was step 6, advance to step 7
if err := nextStepSync(ctx); err != nil {
return err
}

if err = stopSync(ctx); err != nil {
return errors.Wrap(err, "sync shutdown") // Consider increasing --shutdown-delay if this occurs often.
}

if conf.TestConfig.ShutdownCallback != nil {
conf.TestConfig.ShutdownCallback()
}
Expand Down
2 changes: 1 addition & 1 deletion dkg/sync/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewClient(tcpNode host.Host, peer peer.ID, hashSig []byte, version version.
done: make(chan struct{}),
reconnect: true,
version: version,
period: time.Second,
period: 250 * time.Millisecond,
}

for _, opt := range opts {
Expand Down

0 comments on commit 12ee4f7

Please sign in to comment.