fix(engine): apply finalized state after syncing FCU head import#23838
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019dd8cf-6f53-77ae-b955-450bfac41360 Co-authored-by: Amp <amp@ampcode.com>
mattsse
approved these changes
Apr 29, 2026
Collaborator
mattsse
left a comment
There was a problem hiding this comment.
that makes a lot of sense, this is basically a fast path towards making the most recent fcu valid
Comment on lines
+1928
to
+1935
| let Some(sync_target_state) = self | ||
| .state | ||
| .forkchoice_state_tracker | ||
| .sync_target_state() | ||
| .filter(|state| state.head_block_hash == target) | ||
| else { | ||
| return; | ||
| }; |
Thegreatsura
pushed a commit
to Thegreatsura/tempo
that referenced
this pull request
May 1, 2026
Automated nightly update of reth dependencies from `paradigmxyz/reth` main branch. ## Upstream reth changes [`077e5ee...fcfa828`](paradigmxyz/reth@077e5ee...fcfa828) 🔗 Amp thread: https://ampcode.com/threads/T-019ddc9d-1d46-75e9-b9e8-644c7bd4c595 - **Engine**: Apply finalized state after syncing FCU head import ([#23838](paradigmxyz/reth#23838)) - **Networking**: Customizable discovery defaults ([#23843](paradigmxyz/reth#23843)) - **DB**: Replace deprecated `MDBX_NOTLS` with `MDBX_NOSTICKYTHREADS` ([#23378](paradigmxyz/reth#23378)) ## Migrations 🔗 Amp thread: https://ampcode.com/threads/T-019ddc9d-2d98-72cb-aac1-a4da293cbabf - Bumped all `reth-*` git dependencies in `Cargo.toml` from rev `077e5ee` to `fcfa828` to pull in the latest upstream Reth SDK changes. [GitHub Workflow](https://github.com/tempoxyz/tempo/actions/runs/25147002830)
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.
Summary
SYNCINGtoVALIDoncesafeandfinalizedcan be appliedSYNCINGFCU whose head is later imported and canonicalized from p2pRoot Cause
When
engine_forkchoiceUpdatedreturnedSYNCING, the engine stored the FCU in the tracker and later canonicalized the target head throughTreeAction::MakeCanonicalonce the block arrived from p2p.That canonicalization path updated the canonical chain, but it did not re-run
ensure_consistent_forkchoice_state(...)for the tracked FCU, so thesafe/finalizedpointers could remain stale even after the head became canonical.Testing
test_canonicalizing_downloaded_sync_target_head_updates_finalized