Skip to content

perf(store): avoid loading headers while finding boundaries - #411

Open
loglapa wants to merge 2 commits into
celestiaorg:mainfrom
loglapa:fix/restore-boundaries-332
Open

perf(store): avoid loading headers while finding boundaries#411
loglapa wants to merge 2 commits into
celestiaorg:mainfrom
loglapa:fix/restore-boundaries-332

Conversation

@loglapa

@loglapa loglapa commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #332

Overview

  • scan contiguous head and tail ranges with height-index presence checks
  • load and unmarshal only the final boundary header after the scan
  • include pending headers and cached height indexes in presence checks
  • keep the current boundary unchanged on datastore errors or cancellation
  • guard height arithmetic at both uint64 limits
  • assert datastore read counts for head and tail scans

Validation

  • go test ./store -count=1
  • go test -race ./store -count=1
  • golangci-lint run

go test ./... reaches the existing p2p/TestExchangeServer_partialRangeNotExpanded panic on current main. That unrelated regression predates this branch and is fixed by #409; all other packages, including the changed store package, pass.

@loglapa
loglapa requested a review from a team as a code owner September 3, 2026 18:05
@loglapa
loglapa requested a review from chatton September 3, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: optimize advancing head and receding tail

2 participants