Skip to content
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

speedup epoch stats restore from db for old unfinalized epochs #222

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Jan 22, 2025

This PR speeds up the epoch stats restoration from db on dora startup.
Restoring the epoch stats from db can be a time consuming operation when the chain faces long unfinality as currently seen on devnet5:

time="2025-01-21T16:06:15Z" level=info msg="restored 687 unfinalized epoch stats from DB (101.074 sec)" service=cl-indexer

already takes about 100s (1:40min) to restore and recalculate duties for 687 epochs.

With this PR, the recalculation for attester duties gets skipped for old unfinalized epoch stats.
For old unfinalized epochs, this information is pruned right after restore anyway, so there is no point on computing these duties upfront.
Computing the attester duties is the most time consuming task, as the whole validator set needs to be shuffled for that, so this should speed up the restoration a lot.

@pk910 pk910 merged commit 7c0dc09 into master Jan 22, 2025
1 check passed
@pk910 pk910 deleted the pk910/speedup-epoch-restore branch January 22, 2025 13:37
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