diff --git a/dkg/dkg.go b/dkg/dkg.go index a1568ed45..500d3a93a 100644 --- a/dkg/dkg.go +++ b/dkg/dkg.go @@ -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 @@ -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() } diff --git a/dkg/sync/client.go b/dkg/sync/client.go index 028b08dc3..d810a5dc9 100644 --- a/dkg/sync/client.go +++ b/dkg/sync/client.go @@ -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 {