-
Notifications
You must be signed in to change notification settings - Fork 28
improve start block determination for poller #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve start block determination for poller #253
Conversation
WalkthroughThe changes update the initialization logic for the poller's starting block in the orchestrator, adding conditional checks and error handling when determining the last polled block from staging and main storage. Additionally, comprehensive unit tests are introduced to verify poller initialization under various scenarios, including configuration options and storage states. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (1)internal/orchestrator/poller_test.go (8)
🔇 Additional comments (16)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |

TL;DR
Improved block selection logic in the poller to use the highest available block number from either staging or main storage.
What changed?
NewPollerfunction to check both staging and main storage for the highest block numberHow to test?
go test ./internal/orchestrator -vWhy make this change?
This change prevents the indexer from reprocessing blocks that have already been indexed in either staging or main storage. By selecting the highest available block number, we avoid duplicate processing and improve efficiency, especially after restarts or when switching between different storage systems.
Summary by CodeRabbit
Bug Fixes
Tests