Skip to content

refactor: split catchup state into dedicated store#96

Open
vietddude wants to merge 2 commits intomainfrom
fix-indexer-catchup
Open

refactor: split catchup state into dedicated store#96
vietddude wants to merge 2 commits intomainfrom
fix-indexer-catchup

Conversation

@vietddude
Copy link
Copy Markdown
Collaborator

@vietddude vietddude commented Apr 3, 2026

Summary

Refactor catchup processing to use a dedicated Redis-backed catchupstore instead of storing catchup state in the block store.

What changed

  • Split catchup state out of pkg/store/blockstore into pkg/store/catchupstore
  • Updated worker wiring to inject and use catchupStore where catchup progress is loaded and persisted
  • Simplified CatchupWorker so it only reads existing catchup ranges and processes them
  • Kept catchup behavior aligned with the regular worker’s responsibility for creating new ranges
  • Added/updated tests for:
    • catchup worker behavior
    • factory wiring
    • catchup store persistence and range merging

Behavior changes

  • Catchup progress is now stored and loaded from Redis
  • Catchup worker no longer owns range creation logic
  • Catchup state is isolated from the main block store, which reduces coupling and makes recovery/persistence cleaner

Catchup status source

Catchup progress is now sourced directly from Redis via catchupStore.

  • CatchupWorker loads catchup ranges from Redis
  • /status refreshes catchup ranges from Redis before returning the snapshot
  • catchup state no longer depends on other workers to materialize or update the ranges

@vietddude vietddude requested a review from anhthii April 3, 2026 08:02
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.

1 participant