forkchoice: use only the "new" pool for update_safe_target#680
Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom Apr 25, 2026
Merged
Conversation
Treat safe target as an availability signal: compute it strictly from latest_new_aggregated_payloads and ignore latest_known_aggregated_payloads. update_safe_target runs at interval 3, before the migration step at interval 4. That ordering is intentional: votes still in "new" at interval 3 reflect the current slot's online view, while anything already in "known" reflects historical knowledge (block-included attestations, previously migrated gossip, self-attestations stored locally). Counting "known" would let the safe target keep advancing on stale evidence even when live participation has collapsed. This brings the spec in line with the zeam client (see blockblaz/zeam#779) and the Ream reference implementation. The merged-pool test is rewritten to pin the new-only behaviour: with "known" at 2 votes and "new" at 2 votes (threshold 4), the safe target now stays at genesis instead of advancing to block_2.
g11tech
approved these changes
Apr 24, 2026
5 tasks
tcoratger
approved these changes
Apr 25, 2026
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
Treat safe target as an availability signal: compute it strictly from
latest_new_aggregated_payloadsand stop merging inlatest_known_aggregated_payloads.This aligns the spec with the zeam client's existing behaviour (see blockblaz/zeam#779) and the Ream reference implementation.
Rationale
update_safe_targetruns at interval 3, strictly before the migration step at interval 4 that movesnew -> known. The tick ordering is the whole argument:accept_new_votesfirst, thencompute_safe_targeton a merged pool) and chose not to.newrepresent the current slot's online view. Anything already inknownrepresents historical knowledge: block-included attestations, gossip votes migrated in previous slots, self-attestations stored locally without passing through gossipsub.knownwould let a node keep advancing its safe target on stale evidence even when live participation has collapsed. That is exactly the failure mode safe target is supposed to prevent.Quoting the zeam review thread:
What changes
`src/lean_spec/subspecs/forkchoice/store.py` (`update_safe_target`):
`tests/consensus/devnet/fc/test_safe_target.py`:
Notes
Test plan