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
s.logger.Error().Err(err).Msg("failed to set initial processed height for p2p handler")
130
130
} else {
131
131
s.p2pHandler.SetProcessedHeight(currentHeight)
132
132
}
133
133
134
+
if!s.waitForGenesis() {
135
+
returnnil
136
+
}
137
+
134
138
// Start main processing loop
135
139
s.wg.Add(1)
136
140
gofunc() {
@@ -175,16 +179,6 @@ func (s *Syncer) SetLastState(state types.State) {
175
179
s.lastState.Store(&state)
176
180
}
177
181
178
-
// GetDAHeight returns the current DA height
179
-
func (s*Syncer) GetDAHeight() uint64 {
180
-
returns.daHeight.Load()
181
-
}
182
-
183
-
// SetDAHeight updates the DA height
184
-
func (s*Syncer) SetDAHeight(heightuint64) {
185
-
s.daHeight.Store(height)
186
-
}
187
-
188
182
// initializeState loads the current sync state
189
183
func (s*Syncer) initializeState() error {
190
184
// Load state from store
@@ -216,12 +210,13 @@ func (s *Syncer) initializeState() error {
216
210
}
217
211
s.SetLastState(state)
218
212
219
-
// Set DA height
220
-
s.SetDAHeight(state.DAHeight)
213
+
// Set DA height to the maximum of the genesis start height, the state's DA height, the cached DA height, and the highest stored included DA height.
214
+
// This ensures we resume from the highest known DA height, even if the cache is cleared on restart. If the DA height is too high because of a user error, reset it with --evnode.clear_cache. The DA height will be back to the last highest known executed DA height for a height.
returnfmt.Errorf("failed to apply block: %w", err)
554
532
}
555
533
556
534
// Update DA height if needed
535
+
// This height is only updated when a height is processed from DA as P2P
536
+
// events do not contain DA height information
557
537
ifevent.DaHeight>newState.DAHeight {
558
538
newState.DAHeight=event.DaHeight
559
539
}
@@ -621,7 +601,8 @@ func (s *Syncer) applyBlock(header types.Header, data *types.Data, currentState
621
601
returnnewState, nil
622
602
}
623
603
624
-
// executeTxsWithRetry executes transactions with retry logic
604
+
// executeTxsWithRetry executes transactions with retry logic.
605
+
// NOTE: the function retries the execution client call regardless of the error. Some execution clients errors are irrecoverable, and will eventually halt the node, as expected.
0 commit comments