Skip to content

Commit 9a5eba1

Browse files
authored
refactor: use state da height as well (#2872)
quick follow-up of #2870
1 parent faabb32 commit 9a5eba1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

block/internal/syncing/syncer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ func (s *Syncer) initializeState() error {
217217
s.SetLastState(state)
218218

219219
// Set DA height
220-
s.SetDAHeight(max(s.genesis.DAStartHeight, s.cache.DaHeight()))
220+
// we get the max from the genesis da height, the state da height and the cache (fetched) da height
221+
// if a user has messed up and sync da too far ahead, on restart they can clear the cache (--clear-cache) and the retrieve will restart fetching from the last known block synced and executed from DA or the set genesis da height.
222+
s.SetDAHeight(max(s.genesis.DAStartHeight, s.cache.DaHeight(), state.DAHeight))
221223

222224
s.logger.Info().
223225
Uint64("height", state.LastBlockHeight).

0 commit comments

Comments
 (0)