Perform block pre-check before validating execution #5169
Merged
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.
When syncing, blocks have not been gossip-validated and are therefore prone to trivial faults like being known-unviable, duplicate or missing their parent.
In addition, the duplicate-block check in BlockProcessor was not considering the quarantine flow and would therefore cause recently-quarantined blocks to be silenty dropped when their parent appears delaying the sync end-game and thus causing longer startup resync time.
This PR verifies trivial conditions before performing execution validation thus avoiding duplicates and missing parents alike.
It also ensures that the fast-sync EL mode is used for finalized blocks even if the EL is timing out / slow to respond - this allows the CL to complete its sync faster and switch to "normal" lock-step at the head of the chain more quickly, thus also allowing the EL to access the latest consensensus information earlier.