Skip to content

Introduce is_previous_slot_payload_decision predicate#10784

Merged
zilm13 merged 5 commits into
Consensys:masterfrom
zilm13:previous-slot-payload
Jun 3, 2026
Merged

Introduce is_previous_slot_payload_decision predicate#10784
zilm13 merged 5 commits into
Consensys:masterfrom
zilm13:previous-slot-payload

Conversation

@zilm13

@zilm13 zilm13 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

PR Description

ethereum/consensus-specs#5317
part of #10773

Fixed Issue(s)

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

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 isPreviousSlotPayloadDecision helper in ForkChoiceModelGloas aligned with the Gloas fork-choice spec, and routes effectiveWeight and computePayloadStatusTiebreaker through it instead of duplicating slot/payload-status checks.

Spec tracking is updated: is_previous_slot_payload_decision#gloas is wired to the Java implementation in functions.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.

gfukushima
gfukushima previously approved these changes Jun 3, 2026

@gfukushima gfukushima left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

StefanBratanov
StefanBratanov previously approved these changes Jun 3, 2026

@StefanBratanov StefanBratanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree, will update

@zilm13 zilm13 dismissed stale reviews from StefanBratanov and gfukushima via 4a7cc3f June 3, 2026 08:01
tbenr
tbenr previously approved these changes Jun 3, 2026

@tbenr tbenr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zilm13 zilm13 enabled auto-merge (squash) June 3, 2026 13:36

@tbenr tbenr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zilm13 zilm13 merged commit 13aafe3 into Consensys:master Jun 3, 2026
83 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
@zilm13 zilm13 deleted the previous-slot-payload branch June 3, 2026 13:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants