-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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