Skip to content

Commit

Permalink
fix synchronizer when epoch duties can't be loaded from any client
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Jun 21, 2024
1 parent 78a52c4 commit c05f943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion indexer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ func (sync *synchronizerState) syncEpoch(syncEpoch uint64, retryCount int, lastT
}

epochAssignments, err := client.rpcClient.GetEpochAssignments(syncEpoch, dependentRoot)
if err != nil || epochAssignments == nil {
if (err != nil || epochAssignments == nil) && !lastTry {
return false, client, fmt.Errorf("error fetching epoch %v duties: %v", syncEpoch, err)
}
if epochAssignments == nil {
return false, client, fmt.Errorf("error fetching epoch %v duties: %v", syncEpoch, err)
}
if len(epochAssignments.ProposerAssignments) == 0 && !lastTry {
Expand Down
2 changes: 1 addition & 1 deletion services/validatornames.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (vn *ValidatorNames) updateDb() error {
}

if len(updateNames) > 0 || len(removeIndexes) > 0 {
logger_vn.Infof("update validator names %v-%v: %v changed, %v removed", lastIndex, maxIdx, len(updateNames), len(removeIndexes))
logger_vn.Infof("update validator names %v-%v: %v changed, %v removed", lastIndex, maxIndex, len(updateNames), len(removeIndexes))
time.Sleep(2 * time.Second)
} else {
time.Sleep(100 * time.Millisecond)
Expand Down

0 comments on commit c05f943

Please sign in to comment.