feat(l1): reorgs for blocks that are connected to the canonical chain#577
Merged
Conversation
… Fix ancestry check bug.
mpaulucci
reviewed
Oct 3, 2024
mpaulucci
reviewed
Oct 3, 2024
mpaulucci
reviewed
Oct 3, 2024
mpaulucci
reviewed
Oct 4, 2024
mpaulucci
reviewed
Oct 4, 2024
mpaulucci
reviewed
Oct 4, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
reviewed
Oct 15, 2024
mpaulucci
pushed a commit
that referenced
this pull request
Oct 16, 2024
…#577) **Motivation** Up until now we can perform reorgs as long as the parent of the newly added block is canonical. This PR aims to enable blocks that have canonical ancestors, even if they may not be direct parents. **Changes** - `blockchain.add_block`: - We now stopped checking if the parent is canonical, we rely on the state transition to check that the parent's state exists in the db, which is all we need to execute the block. - The latest canonical block is not updated here now, as it now symbolizes the head of the chain instead of the latest block that has arrived. - `ForkChoiceUpdatedV3`: - All ancestors of head are made canonical after the reorg. - New checks: it is checked that finalized, safe and head blocks are part of the new canonical chain and in the correct order. - We now allow for finalized and safe hashes to be zero in the request (needed for near-merge times when no blocks can be yet dimmed safe or finalized). - Most of the fork choice functionality is moved to the blockchain.rs file and errors are returned when the request should fail and payload attributes should not be executed. - Fork choice has now been moved to before payload building, as it needs to be applied regardless of wether the payload succeeds or not. This is to be completed by #853 as the parsing needs to be fixed too. - Logs are added for easier debugging. - A basic integration test is added for the payload + fork choice updated functionality. - We no longer make imported blocks canonical, even if they come from the genesis file. Closes #444
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Up until now we can perform reorgs as long as the parent of the newly added block is canonical. This PR aims to enable blocks that have canonical ancestors, even if they may not be direct parents.
Changes
blockchain.add_block:ForkChoiceUpdatedV3:Closes #444