Skip to content

Commit

Permalink
renames sync to target -> sync to target height
Browse files Browse the repository at this point in the history
  • Loading branch information
danwt committed May 13, 2024
1 parent 744d90c commit c4db6ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (m *Manager) syncBlockManager() error {
}
// Set the syncTarget according to the result
m.SyncTarget.Store(res.EndHeight)
err = m.syncUntilTarget(res.EndHeight)
err = m.syncToTargetHeight(res.EndHeight)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions block/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ func (m *Manager) RetrieveLoop(ctx context.Context) {
default:
// Get only the latest sync target
targetHeight := syncTargetPoller.Next()
err := m.syncUntilTarget(*(*uint64)(targetHeight))
err := m.syncToTargetHeight(*(*uint64)(targetHeight))
if err != nil {
panic(fmt.Errorf("sync until target: %w", err))
}
}
}
}

// syncUntilTarget syncs blocks until the target height is reached.
// syncToTargetHeight syncs blocks until the target height is reached.
// It fetches the batches from the settlement, gets the DA height and gets
// the actual blocks from the DA.
func (m *Manager) syncUntilTarget(targetHeight uint64) error {
func (m *Manager) syncToTargetHeight(targetHeight uint64) error {
for currH := m.Store.Height(); currH < targetHeight; currH = m.Store.Height() {

// It's important that we query the state index before fetching the batch, rather
Expand Down

0 comments on commit c4db6ff

Please sign in to comment.