Skip to content

added "backfilling of keystones" #39

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

ClaytonNorthey92
Copy link

on startup, op-geth will backfill all keystones to genesis in an upsert fashion

afterwards, upon each new keystone, it will backfill up to the first keystone found

@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review May 14, 2025 17:02
@ClaytonNorthey92 ClaytonNorthey92 requested a review from AL-CT May 14, 2025 17:04
@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as draft May 14, 2025 20:16
@ClaytonNorthey92
Copy link
Author

@AL-CT hold off on review for now, I am going to take a closer look at changes to the snap protocol before asserting which way to handle this 🤔

@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review May 15, 2025 17:41
AL-CT
AL-CT previously requested changes May 16, 2025
Copy link

@AL-CT AL-CT left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the hard work, I think I understand the premise, just left some comments on things I am not sure about

}

if l2Keystone.L2BlockNumber >= hemi.KeystoneHeaderPeriod {
// 475
Copy link
Author

Choose a reason for hiding this comment

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

remove this comment

@AL-CT AL-CT dismissed their stale review May 16, 2025 17:28

outdated

@AL-CT AL-CT self-requested a review May 16, 2025 17:28
// so continue the for loop if we inserted a new one to handle
// more missing ones

if bc.keystonesBackfilled && l2BlockNumber < finalizedBlockNumber && !insertedNew {
Copy link

Choose a reason for hiding this comment

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

nit, probably need a read lock to read bc.keystonesBackfilled

Copy link
Author

Choose a reason for hiding this comment

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

yes we absolutely do 👍 I'll update

Copy link

@AL-CT AL-CT left a comment

Choose a reason for hiding this comment

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

LGTM 👍

upon startup, "backfill" keystones to genesis.  this shouldn't take too long.

upon each new keystone, backfill keystones from unsafe head to either finalized block or until we have populated all non-found keystones (missing blocks)
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/keystone-backfill branch from 9adfc65 to 97b0fe8 Compare May 16, 2025 18:23
@ClaytonNorthey92 ClaytonNorthey92 merged commit 5ab3724 into toni/hemi-api May 16, 2025
1 check passed
@ClaytonNorthey92 ClaytonNorthey92 deleted the clayton/keystone-backfill branch May 16, 2025 18:26
ClaytonNorthey92 added a commit that referenced this pull request May 16, 2025
upon startup, "backfill" keystones to genesis.  this shouldn't take too long.

upon each new keystone, backfill keystones from unsafe head to either finalized block or until we have populated all non-found keystones (missing blocks)
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