From 11977779424b05b80f012692126fde1f9f9f1323 Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Tue, 7 May 2024 10:10:01 +0200 Subject: [PATCH] Fixed sync manager not restoring the last pruned epoch from disk correctly --- .../engine/syncmanager/trivialsyncmanager/syncmanager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go b/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go index 9575be13a..85c625f48 100644 --- a/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go +++ b/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go @@ -160,7 +160,9 @@ func New(subModule module.Module, e *engine.Engine, latestCommitment *model.Comm s.updateSyncStatus() }, time.Duration(e.CommittedAPI().ProtocolParameters().SlotDurationInSeconds())*time.Second/2, ctxUpdateSyncStatusTicker) - s.updatePrunedEpoch(s.engine.Storage.LastPrunedEpoch()) + e.InitializedEvent().OnTrigger(func() { + s.updatePrunedEpoch(s.engine.Storage.LastPrunedEpoch()) + }) // set the default bootstrapped function if s.optsIsBootstrappedFunc == nil {