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

Add continuity script to pre-migration #347

Merged
merged 2 commits into from
Mar 6, 2025
Merged

Conversation

alecps
Copy link

@alecps alecps commented Mar 5, 2025

Adds the runDBCheck process to the beginning of the pre-migration, and also adds a start parameter so that the continuity check can start from the last migrated ancient block in the newDB. This allows us to attach the continuity script to the beginning of the pre-migration without incurring extra delays during a full migration, as the majority of blocks will have already been pre-migrated and will not be checked for continuity.
The last ancient block in the newDB is chosen as the starting point because the non-ancient block data is modified during a full migration and only copied during a pre-migration. Depending on whether previous full or pre-migrations have been run, the non ancient data may have been modified in various ways since the last continuity check was performed. Non-ancient data is also only 90000 blocks. For these reasons, it makes sense to always run the continuity script on the non-ancient data as it only takes a few seconds.

In local testing using a baklava datadir the continuity script only added about 17s to the pre-migration when run a second time. This is mostly due to time spent opening and closing the dbs. While this is slow considering that most blocks have already been checked, it's much faster than running the whole continuity script again. This approach aims to minimize code changes to the migration script and keep things simple given our timeline.

Tested locally on baklava datadir

@alecps alecps requested review from piersy, gastonponti and palango March 5, 2025 22:00
@alecps alecps force-pushed the alecps/alwaysCheckDb branch from a00cdca to 4cf83d3 Compare March 6, 2025 15:19
Copy link

@gastonponti gastonponti left a comment

Choose a reason for hiding this comment

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

LGTM

@alecps alecps merged commit b3f0d13 into celo-rebase-12 Mar 6, 2025
32 checks passed
@alecps alecps deleted the alecps/alwaysCheckDb branch March 6, 2025 16:01
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