fix(block_import): pipeline FCU for far-ahead NewBlock sync#351
Open
tsutsu wants to merge 1 commit into
Open
Conversation
When new_payload returns Syncing, skip fork_recover if the announced head is more than MAX_FORK_DEPTH above local tip—same threshold as NewBlockHashes. Otherwise recover_ancestors always hits ForkTooDeep while gossip advances the head hash, bypassing per-hash cooldown and stalling sync. Extract spawn_pipeline_trigger_fcu_task for reuse.
Pull Request ReviewThis PR updates the block import flow for far-behind sync scenarios by adding a shared helper that dispatches a pipeline-triggered Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
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.
Resolves #350.
Description
When
new_payloadreturnsSyncingfor a fullNewBlock, before spawningrecover_ancestors, checks whether the announced head exceeds the local tip by at leastMAX_FORK_DEPTH.If the gap is too large, doesn't attempt
recover_ancestors; instead, dispatches a pipeline-triggerforkchoiceUpdated(i.e. the same path thaton_new_block_hashesalready uses) so that the engine-tree can start staged backfill.Rationale
The
on_new_block_hashespath already had this guard (introduced in #334), but bsc-reth's primary gossip mechanism propagates fullNewBlockbodies — which hits theSyncingbranch ofnew_payloaddirectly, bypassing the hash-based check.On a far-behind node, this causes
recover_ancestorsto spin on every slot, always hittingForkTooDeep, with per-hash cooldown ineffective against the ~450ms block cadence.