-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
eth/catalyst: reset to current header if chain is rewound (in dev mode) #27992
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.
An edge case is if SetHead
is invoked after the check you have added, and before the end of sealBlock
. One change that needs to be made is adding a check that returns from sealBlock
if the ForkChoiceStatus
returned from ForkChoiceUpdatedV2
(on line 147) is engine.STATUS_SYNCING
.
I'm looking to see if anything else needs to be done.
We will also want to check if |
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
b9864b8
to
dfd8a79
Compare
@jwasinger thanks for the advice, PTAL :) |
Co-authored-by: Martin Holst Swende <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
…in rewind. move calculation of finalized block hash into its own function
Signed-off-by: jsvisa <[email protected]>
finalizedHash := c.finalizedBlockHash(header.Number.Uint64()) | ||
c.setCurrentState(header.Hash(), *finalizedHash) |
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.
finalizedHash
can be nil, should have nil check here.
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.
Yes, it could happen in theory but should be extremely unlikely: a setHead which rolls back to before the latest finalized block would have to occur between the execution of line 147 and 148.
…e) (ethereum#27992) Signed-off-by: jsvisa <[email protected]> Co-authored-by: Jared Wasinger <[email protected]>
… dev mode) (ethereum#27992)" This reverts commit f796c8f.
… dev mode) (ethereum#27992)" This reverts commit f796c8f.
…e) (ethereum#27992) Signed-off-by: jsvisa <[email protected]> Co-authored-by: Jared Wasinger <[email protected]> (cherry picked from commit cde462c)
fix #27990