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

Load system contract addresses on restart. #2102

Merged
merged 3 commits into from
Oct 27, 2024
Merged

Conversation

StefanIliev545
Copy link
Contributor

Why this change is needed

Load() method was not wired up meaning that restarts never managed to set the required addresses as the second batch that creates contracts is in the past.

What changes were made as part of this PR

Please provide a high level list of the changes made

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

lgtm
(minor comment)

@@ -251,6 +251,11 @@ func NewEnclave(
logger.Crit("failed to resync L2 chain state DB after restart", log.ErrKey, err)
}

err = scb.Load()
if err != nil && !errors.Is(err, errutil.ErrNotFound) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you handle not-found in any way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not found means db is there, but batches are not, which in turn means we havent bootstrapped yet with the first batches. Unless we delete them, but we should avoid pruning the first two.

@StefanIliev545 StefanIliev545 merged commit 5ea5a99 into main Oct 27, 2024
19 of 20 checks passed
@StefanIliev545 StefanIliev545 deleted the siliev/wire-up-load branch October 27, 2024 10:21
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