You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* main:
refactor: use state da height as well (#2872)
refactor: retrieve highest da height in cache (#2870)
chore: change from event count to start and end height (#2871)
Copy file name to clipboardExpand all lines: block/internal/syncing/syncer.go
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ func (s *Syncer) SetLastState(state types.State) {
177
177
178
178
// GetDAHeight returns the current DA height
179
179
func (s*Syncer) GetDAHeight() uint64 {
180
-
returns.daHeight.Load()
180
+
returnmax(s.daHeight.Load(), s.cache.DaHeight())
181
181
}
182
182
183
183
// SetDAHeight updates the DA height
@@ -217,7 +217,9 @@ func (s *Syncer) initializeState() error {
217
217
s.SetLastState(state)
218
218
219
219
// Set DA height
220
-
s.SetDAHeight(state.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.
0 commit comments