Add optimistic import for blocks for VALID ancestors - #2841
Closed
paulhauner wants to merge 6 commits into
Closed
Conversation
This was referenced Feb 26, 2022
Contributor
Author
mkalinin
reviewed
Feb 28, 2022
| # back in the chain. | ||
| elif hash_tree_root(block) == finalized_root: | ||
| return False | ||
| elif block.parent_root == Hash32() or block.parent_root not in opt_store.blocks: |
Contributor
There was a problem hiding this comment.
Won't just block.parent_root not in opt_store.blocks be sufficient in this case?
djrtwo
reviewed
Feb 28, 2022
| 1. The current slot (as per the system clock) is at least | ||
| `SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY` ahead of the slot of the block being | ||
| imported. | ||
| 1. The block has a ancestor with an execution payload that has been deemed to |
Contributor
There was a problem hiding this comment.
Suggested change
| 1. The block has a ancestor with an execution payload that has been deemed to | |
| 1. The block has an ancestor with an execution payload that has been deemed to |
Contributor
Author
|
I'm closing this in favor of the more general solution in #2844. Thanks to those that reviewed. |
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.
Allow a node to optimistically import a block if it has an ancestor which:
VALIDpayload.The
VALIDancestor infers that the transition block was available, therefore this chain is not performing a malicious fork choice "poisoning" attack.Implementations are permitted to stop searching at the finalized block, if they wish. This means implementations can use fork choice to store the execution status, they don't need to maintain it in the database for ancient blocks.