Skip to content

Commit

Permalink
Try #6193:
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemesh-bors[bot] authored Aug 1, 2024
2 parents 5a6e94b + 263e011 commit 43e771f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
36 changes: 34 additions & 2 deletions cmd/bootstrapper/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,40 @@ func (s *Server) Start(ctx context.Context, errCh chan error, params *NetworkPar
// start generating fallback data
s.eg.Go(
func() error {
s.genDataLoop(ctx, errCh, last, params.updateActiveSetTime, s.GenFallbackActiveSet)
return nil
var (
errs = 0
maxErrs = 10
timer *time.Timer
timeC <-chan time.Time
backoff = 10 * time.Second
)
for epoch := last; ; epoch++ {
wait := time.Until(params.updateActiveSetTime(epoch))
select {
case <-timeC:
if err := s.GenFallbackActiveSet(ctx, epoch); err != nil {
errs++
timer.Reset(backoff)
continue
}
errs = 0
if !timer.Stop() {
<-timer.C
}
timeC = nil
case <-time.After(wait):
if err := s.GenFallbackActiveSet(ctx, epoch); err != nil {
timer = time.NewTimer(backoff)
timeC = timer.C
if errs >= maxErrs {
errCh <- err
return err
}
}
case <-ctx.Done():
return ctx.Err()
}
}
})
s.eg.Go(
func() error {
Expand Down
4 changes: 3 additions & 1 deletion config/presets/fastnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func fastnet() config.Config {
conf.LayerDuration = 15 * time.Second
conf.Sync.Interval = 5 * time.Second
conf.Sync.GossipDuration = 10 * time.Second
conf.Sync.AtxSync.EpochInfoInterval = 20 * time.Second
conf.Sync.AtxSync.EpochInfoInterval = 1 * time.Second
conf.Sync.AtxSync.EpochInfoPeers = 10
conf.Sync.AtxSync.RequestsLimit = 100
conf.Sync.MalSync.IDRequestInterval = 20 * time.Second
conf.LayersPerEpoch = 4
conf.RegossipAtxInterval = 30 * time.Second
Expand Down
4 changes: 2 additions & 2 deletions systest/tests/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ func TestCheckpoint(t *testing.T) {
}

tctx.Log.Infow("waiting for all miners to be smeshing", "last epoch", checkpointEpoch+2)
ensureSmeshing(t, tctx, cl, checkpointEpoch+2)
ensureSmeshing(t, tctx, cl, checkpointEpoch+4)

// increase the cluster size to the original test size
tctx.Log.Info("cluster size changed to ", size)
tctx.ClusterSize = size
require.NoError(t, cl.AddSmeshers(tctx, addedLater))

tctx.Log.Infow("waiting for all miners to be smeshing", "last epoch", lastEpoch)
ensureSmeshing(t, tctx, cl, lastEpoch)
ensureSmeshing(t, tctx, cl, lastEpoch+6)
}

func ensureSmeshing(t *testing.T, tctx *testcontext.Context, cl *cluster.Cluster, stop uint32) {
Expand Down

0 comments on commit 43e771f

Please sign in to comment.