Skip to content

Commit

Permalink
polygon/heimdall: fix errors.Is typo for ErrNotInMilestoneList (#11812)
Browse files Browse the repository at this point in the history
fixing typo in previous PR
#11808
  • Loading branch information
taratorio authored Aug 30, 2024
1 parent 970ac1a commit 68f4196
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion polygon/heimdall/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ func newCheckpointFetcher(client HeimdallClient, logger log.Logger) entityFetche
func newMilestoneFetcher(client HeimdallClient, logger log.Logger) entityFetcher[*Milestone] {
fetchEntity := func(ctx context.Context, number int64) (*Milestone, error) {
milestone, err := client.FetchMilestone(ctx, number)
if errors.Is(ErrNotInMilestoneList, err) {
if errors.Is(err, ErrNotInMilestoneList) {
// this is needed because there may be an unfortunate edge case where FetchFirstMilestoneNum returned 10
// but by the time our request reaches heimdall milestone=10 has been already pruned
// also we've been observing this error happening sporadically for the latest milestone
return milestone, fmt.Errorf("%w: %w", errTransientEntityFetcherFailure, err)
}
return milestone, err
Expand Down

0 comments on commit 68f4196

Please sign in to comment.