diff --git a/CHANGELOG.md b/CHANGELOG.md index 1081b18522..70d5be85a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ See [RELEASE](./RELEASE.md) for workflow instructions. +## Release v1.6.3 + +### Improvements + +* [#6137](https://github.com/spacemeshos/go-spacemesh/pull/6137) Fix hanging ATX sync. + ## Release v1.6.2 ### Improvements diff --git a/syncer/atxsync/syncer.go b/syncer/atxsync/syncer.go index cea9d825f7..3fc77c805e 100644 --- a/syncer/atxsync/syncer.go +++ b/syncer/atxsync/syncer.go @@ -41,7 +41,7 @@ func DefaultConfig() Config { return Config{ EpochInfoInterval: 4 * time.Hour, AtxsBatch: 1000, - RequestsLimit: 20, + RequestsLimit: 10, EpochInfoPeers: 2, ProgressFraction: 0.1, ProgressInterval: 20 * time.Minute, @@ -314,10 +314,10 @@ func (s *Syncer) downloadAtxs( if _, exists := state[types.ATXID(hash)]; !exists { continue } - if errors.Is(err, fetch.ErrExceedMaxRetries) { - state[types.ATXID(hash)]++ - } else if errors.Is(err, pubsub.ErrValidationReject) { + if errors.Is(err, pubsub.ErrValidationReject) { state[types.ATXID(hash)] = s.cfg.RequestsLimit + } else { + state[types.ATXID(hash)]++ } } } diff --git a/syncer/atxsync/syncer_test.go b/syncer/atxsync/syncer_test.go index 79165f950d..d3a6095fe7 100644 --- a/syncer/atxsync/syncer_test.go +++ b/syncer/atxsync/syncer_test.go @@ -190,7 +190,7 @@ func TestSyncer(t *testing.T) { } for _, bad := range bad.AtxIDs { if bad == id { - berr.Add(bad.Hash32(), fmt.Errorf("%w: test", fetch.ErrExceedMaxRetries)) + berr.Add(bad.Hash32(), fmt.Errorf("%w: test", errors.New("oh no failed"))) } } }