Introduce is_previous_slot_payload_decision predicate#10784
Merged
Conversation
StefanBratanov
previously approved these changes
Jun 3, 2026
StefanBratanov
left a comment
Contributor
There was a problem hiding this comment.
LGTM with a small comment
|
|
||
| private boolean isPreviousSlotPayloadDecision(final ProtoNode node, final UInt64 currentSlot) { | ||
| return node.getBlockSlot().plus(1).equals(currentSlot) | ||
| && node.getPayloadStatus() != ForkChoicePayloadStatus.PAYLOAD_STATUS_PENDING; |
Contributor
There was a problem hiding this comment.
What if in future, there are more statuses, I think it's cleaner to just do:
final boolean isPayloadDecision = node.getPayloadStatus() == ForkChoicePayloadStatus.PAYLOAD_STATUS_EMPTY || node.getPayloadStatus == ForkChoicePayloadStatus.PAYLOAD_STATUS_FULL
return node.getBlockSlot().plus(1).equals(currentSlot) && isPayloadDecision;
Contributor
Author
There was a problem hiding this comment.
Totally agree, will update
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Description
ethereum/consensus-specs#5317
part of #10773
Fixed Issue(s)
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Medium Risk
Touches Gloas fork-choice head selection (weights and EMPTY/FULL tiebreakers); behavior should match prior inlined logic but errors here affect chain head choice.
Overview
Adds a named
isPreviousSlotPayloadDecisionhelper inForkChoiceModelGloasaligned with the Gloas fork-choice spec, and routeseffectiveWeightandcomputePayloadStatusTiebreakerthrough it instead of duplicating slot/payload-status checks.Spec tracking is updated:
is_previous_slot_payload_decision#gloasis wired to the Java implementation infunctions.yml, removed from the “not implemented / redesign” exception list in.ethspecify.yml, and documented via a spec link in the class javadoc.Reviewed by Cursor Bugbot for commit 32de270. Bugbot is set up for automated code reviews on this repo. Configure here.