Skip to content

Fix scanned blocks clean up for a single chain indexers#429

Merged
DZakh merged 2 commits into
mainfrom
dz/fix-scanned-blocks-cleanup
Jan 20, 2025
Merged

Fix scanned blocks clean up for a single chain indexers#429
DZakh merged 2 commits into
mainfrom
dz/fix-scanned-blocks-cleanup

Conversation

@DZakh

@DZakh DZakh commented Jan 20, 2025

Copy link
Copy Markdown
Member

No description provided.

@DZakh DZakh requested a review from JonoPrest January 20, 2025 14:44
updatedChainFetcher.chainConfig.confirmedBlockThreshold,
blockTimestampThreshold: chainManager
->ChainManager.getEarliestMultiChainTimestampInThreshold
->Option.getWithDefault(0),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so this was the bug beforehand?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the LastBlockScannedHashes would operate only with blocks in reorg threshold (<200), but it only prunes blocks on response, so if the indexer restarts and the first query detects a rollback, then there'd be 15k+ calls to hypersync.

@JonoPrest JonoPrest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for finding this 🙏🏼

@DZakh DZakh enabled auto-merge (squash) January 20, 2025 15:58
@DZakh DZakh merged commit 6a77ddc into main Jan 20, 2025
@DZakh DZakh deleted the dz/fix-scanned-blocks-cleanup branch January 20, 2025 16:00
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.

2 participants