From 95009a79b0a70d1bcbc9f254c7261c87c32d42ce Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Mon, 18 Sep 2023 17:46:09 +0300 Subject: [PATCH] fix: set overlay in statestore and puller logs --- pkg/node/statestore.go | 5 ++++- pkg/puller/puller.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/node/statestore.go b/pkg/node/statestore.go index e3d8fe4054e..c2fe6598273 100644 --- a/pkg/node/statestore.go +++ b/pkg/node/statestore.go @@ -74,7 +74,10 @@ func checkOverlay(storer storage.StateStorer, overlay swarm.Address) error { var storedOverlay swarm.Address err := storer.Get(noncedOverlayKey, &storedOverlay) if err != nil { - return err + if !errors.Is(err, storage.ErrNotFound) { + return err + } + return storer.Put(noncedOverlayKey, overlay) } if !storedOverlay.Equal(overlay) { diff --git a/pkg/puller/puller.go b/pkg/puller/puller.go index 5ea73581ffc..c4f6933fa97 100644 --- a/pkg/puller/puller.go +++ b/pkg/puller/puller.go @@ -222,7 +222,7 @@ func (p *Puller) syncPeer(ctx context.Context, peer *syncPeer, storageRadius uin // cancel all bins peer.gone() - p.logger.Debug("peer epoch change detected, resetting past synced intervals", "peer_address", peer.address) + p.logger.Debug("peer epoch change detected, resetting past synced intervals", "stored_epoch", storedEpoch, "new_epoch", epoch, "peer_address", peer.address) err = p.resetPeerIntervals(peer.address) if err != nil {