fix(p2p/server): reject range requests below the store tail - #406
Conversation
A range request whose `from` is below the store's tail can only be served as a hard NOT_FOUND, since a partial range must start at `from`. Check the tail up front and return ErrNotFound instead of walking into pruned heights. Resolves PROTOCO-2383. Complements celestiaorg#405. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
|
The merged change currently makes the existing
|
|
I opened a minimal follow-up fix in #409. It adds an explicit tail to the existing test double, preserves the original partial-range path, and restores the full suite on Go 1.27. |
Resolves PROTOCO-2383.
Rejects a
GetRangeRequestwhosefromis below the store's tail withErrNotFoundup front, instead of loading headers until it runs into a pruned height.WHY? A partial range must start at
from(seeinterface.gopartial-range contract), so a below-tailfromcan only be aNOT_FOUND.Complements #405: the tail check guards the request bottom,
#405'smin(to, head+1)guards the top.Tail()load (atomic.Pointer), no datastore hit.TestExchangeServer_rangeBelowTail.🤖 Generated with Claude Code