-
Notifications
You must be signed in to change notification settings - Fork 10
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
Configure indexer reorg check interval #472
Conversation
WalkthroughThe changes adjust the interval and range parameters used for blockchain reorganization checks. In the Changes
Sequence Diagram(s)sequenceDiagram
participant I as Indexer (indexLogs)
participant RH as ReorgHandler
participant DB as Database
I->>I: Initiate reorg check (every 60 blocks)
I->>RH: Trigger reorg handling
RH->>DB: Retrieve block page (range of 600 blocks)
DB-->>RH: Return block data
RH-->>I: Process reorg status
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/indexer/reorgHandler_test.go (1)
10-34
: Consider adding test cases for better coverage.While the current test cases are valid, consider adding the following scenarios to improve coverage:
- Values above 601 (e.g., 700, 1200) to verify behavior beyond the BLOCK_RANGE_SIZE
- Values at multiples of 600 (e.g., 1200) to verify behavior at range boundaries
Here's a suggested addition to the test cases:
tests := []struct { name string from uint64 wantStartBlock uint64 wantEndBlock uint64 }{ + { + name: "block range above boundary", + from: 700, + wantStartBlock: 100, + wantEndBlock: 700, + }, + { + name: "block range at multiple boundary", + from: 1200, + wantStartBlock: 600, + wantEndBlock: 1200, + }, { name: "block range with subtraction",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/indexer/reorgHandler_test.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test (Node)
🔇 Additional comments (1)
pkg/indexer/reorgHandler_test.go (1)
18-20
: LGTM! Test case updated correctly.The test case values have been properly aligned with the new BLOCK_RANGE_SIZE of 600.
Summary by CodeRabbit