Check init sync before getting payload attributes #13479
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.
This PR adds a helper to forkchoice to return the delay of the latest imported block. It also adds a helper with an heuristic to check if the node is during init sync. If the highest imported node was imported with a delay of less than an epoch then the node is considered in regular sync. If on the other hand, in addition the highest imported node is more than two epochs old, then the node is considered in init Sync.
The helper to check this only uses forkchoice and therefore requires a read lock. There are four paths to call this
second FCU call with attributes. This function may not be called at
all if we are not regularly syncing
postBlockProces->getFCUArgs->computePayloadAttributes
the payloadattributes if we are syncing a late block. In this case forkchoice is already locked and we add a call in
getFCUArgs
to return early if not regularly syncinglateBlockTasks
we simply returnearly if not in regular sync (This is the biggest change as it takes
a longer FC lock for lateBlockTasks)
just add a check to not update head on this path if not regularly
syncing.
What type of PR is this?
What does this PR do? Why is it needed?
Which issues(s) does this PR fix?
Fixes #
Other notes for review