diff --git a/api/gateway/availability.go b/api/gateway/availability.go index 3833aae166..383f69bb54 100644 --- a/api/gateway/availability.go +++ b/api/gateway/availability.go @@ -28,6 +28,7 @@ func (h *Handler) handleHeightAvailabilityRequest(w http.ResponseWriter, r *http return } + //TODO: change this to NetworkHead once the adjacency in the store is fixed. head, err := h.header.LocalHead(r.Context()) if err != nil { writeError(w, http.StatusInternalServerError, heightAvailabilityEndpoint, err) @@ -35,7 +36,8 @@ func (h *Handler) handleHeightAvailabilityRequest(w http.ResponseWriter, r *http } if headHeight := int(head.Height()); headHeight < height { err = fmt.Errorf( - "current header store head height: %v is lower then requested height: %v", headHeight, height) + "current head store head height: %v is lower then requested height: %v"+ + " give header sync some time and retry later", headHeight, height) writeError(w, http.StatusServiceUnavailable, heightAvailabilityEndpoint, err) return } diff --git a/api/gateway/header.go b/api/gateway/header.go index cdef2211e4..c816750957 100644 --- a/api/gateway/header.go +++ b/api/gateway/header.go @@ -70,6 +70,7 @@ func (h *Handler) performGetHeaderRequest( writeError(w, http.StatusBadRequest, endpoint, err) return nil, err } + //TODO: change this to NetworkHead once the adjacency in the store is fixed. head, err := h.header.LocalHead(r.Context()) if err != nil { writeError(w, http.StatusInternalServerError, heightAvailabilityEndpoint, err) @@ -77,7 +78,8 @@ func (h *Handler) performGetHeaderRequest( } if headHeight := int(head.Height()); headHeight < height { err = fmt.Errorf( - "current head store head height: %v is lower then requested height: %v", headHeight, height) + "current head store head height: %v is lower then requested height: %v"+ + " give header sync some time and retry later", headHeight, height) writeError(w, http.StatusServiceUnavailable, endpoint, err) return nil, err } diff --git a/api/gateway/share.go b/api/gateway/share.go index b97f7422e4..0696a2b237 100644 --- a/api/gateway/share.go +++ b/api/gateway/share.go @@ -100,6 +100,7 @@ func (h *Handler) getShares(ctx context.Context, height uint64, nID namespace.ID header *header.ExtendedHeader ) + //TODO: change this to NetworkHead once the adjacency in the store is fixed. header, err = h.header.LocalHead(ctx) if err != nil { return nil, 0, err @@ -108,9 +109,8 @@ func (h *Handler) getShares(ctx context.Context, height uint64, nID namespace.ID if height > 0 { if storeHeight := uint64(header.Height()); storeHeight < height { return nil, 0, fmt.Errorf( - "current header store head height: %v is lower then requested height: %v", - storeHeight, height, - ) + "current head store head height: %v is lower then requested height: %v"+ + " give header sync some time and retry later", storeHeight, height) } header, err = h.header.GetByHeight(ctx, height) }