Skip to content

Conversation

@alecps
Copy link

@alecps alecps commented Feb 11, 2025

The optimism codebase expects there to be a certain type of file suffixed by .meta in the db that does not exist in our legacy dbs from cel1. These files are automatically created when we open the db in read/write mode using the optimism codebase, but not when we open in readonly mode. So, we need to add this change or else the script will fail when run on a legacy celo db for the first time.

I didn't detect this earlier because the datadirs I've been testing the continuity script with locally already had the .meta files created

This came up in testing for celo-org/celo-l2-node-docker-compose#32

@alecps alecps requested a review from piersy February 11, 2025 20:18
@alecps alecps changed the title Check DB Script fix, open DB without reedonly flag Check DB Script fix, open DB without readonly flag Feb 11, 2025
Copy link

@piersy piersy left a comment

Choose a reason for hiding this comment

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

All looks good

@piersy piersy self-requested a review February 12, 2025 18:13
return fmt.Errorf("failed to close db in readwrite mode: %w", err)
}

ancientDB, err := NewChainFreezer(filepath.Join(opts.dbPath, "ancient"), "", true)
Copy link

Choose a reason for hiding this comment

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

With this change can we change how we open the db for the pre and full migrations, which are currently not using readonly.

Copy link
Author

Choose a reason for hiding this comment

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

In theory, but if we ever run those scripts without the continuity script before them for whatever reason they'll have this problem. It would be creating a hard dependency between the scripts. What do you think about that tradeoff?

Copy link

Choose a reason for hiding this comment

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

Oh I was thinking the open/close step came before all flows. Not a big issue.

@piersy piersy changed the base branch from celo10 to celo-rebase-12 February 12, 2025 18:16
@piersy piersy changed the base branch from celo-rebase-12 to celo10 February 12, 2025 18:16
Copy link

@piersy piersy left a comment

Choose a reason for hiding this comment

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

This should be rebased onto, the celo-rebase-12 branch before being merged

@alecps alecps force-pushed the alecps/fixCheckDBReadonly branch from 4075779 to 1a17d82 Compare February 12, 2025 18:20
@alecps alecps force-pushed the alecps/fixCheckDBReadonly branch from 1a17d82 to 5985c1a Compare February 12, 2025 18:22
@alecps alecps changed the base branch from celo10 to celo-rebase-12 February 12, 2025 18:22
@alecps alecps requested a review from piersy February 12, 2025 18:23
@alecps alecps merged commit 02fa878 into celo-rebase-12 Feb 12, 2025
30 checks passed
@alecps alecps deleted the alecps/fixCheckDBReadonly branch February 12, 2025 19:03
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.

3 participants