Skip to content

Commit

Permalink
pretify
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin committed Nov 11, 2024
1 parent 9f690dd commit eaf2549
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions block/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func (m *Manager) ApplyBatchFromSL(slBatch *settlement.Batch) error {
m.blockCache.Delete(block.Header.Height)
}
}

// if no blocks were applied, we are stuck
if lastAppliedHeight == 0 {
return fmt.Errorf("no applicable blocks found in the DA")
}

types.LastReceivedDAHeightGauge.Set(lastAppliedHeight)

return nil
Expand Down
6 changes: 0 additions & 6 deletions block/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ func (m *Manager) SettlementSyncLoop(ctx context.Context) error {
return fmt.Errorf("process next DA batch. err:%w", err)
}

// if height havent been updated, we are stuck
// this covers the scenario where no applicable blocks were found in the DA
if m.State.NextHeight() == currH {
return fmt.Errorf("stuck at height %d", currH)
}

m.logger.Info("Synced from DA", "store height", m.State.Height(), "target height", m.LastSettlementHeight.Load())

// trigger state update validation, after each state update is applied
Expand Down

0 comments on commit eaf2549

Please sign in to comment.