Skip to content

Implement GET v2/debug/fork_choice endpoint - #10215

Open
SamAg19 wants to merge 26 commits into
sigp:unstablefrom
SamAg19:debug-fork-choice-v2-endpoint
Open

SamAg19 wants to merge 26 commits into
sigp:unstablefrom
SamAg19:debug-fork-choice-v2-endpoint

Conversation

@SamAg19

@SamAg19 SamAg19 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Issue Addressed

Add the v2 fork choice debug endpoint proposed in ethereum/beacon-APIs#615 and deprecate v1

Proposed Changes

  • Add ForkChoiceV2, ForkChoiceExtraDataV2, ForkChoiceNodeV2 and ForkChoiceNodeExtraDataV2 response types to common/eth2/src/types.rs for the endpoint
  • Add client and server support for the GET v2/debug/fork_choice endpoint
  • Add a debug_fork_choice.rs module that expands each proto-array node into the spec's (block_root, payload_status) nodes
  • Add a comment about v1 deprecation above get_debug_fork_choice_v1 and replaced fork choice v1 test with fork choice v2 test (following a similar pattern seen with the GET debug/beacon/heads endpoint)

@chong-he

chong-he commented Oct 7, 2026

Copy link
Copy Markdown
Member

not marking this as ready to review as the upstream PR isn't merged yet

@SamAg19

SamAg19 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@chong-he The spec PR has been merged and this PR has been upto date with the spec hence this PR is ready for review.

@chong-he chong-he added the ready-for-review The code is ready for review label Oct 8, 2026
@mergify

mergify Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Could you please resolve them @SamAg19? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 8, 2026
@chong-he chong-he mentioned this pull request Oct 8, 2026
2 tasks
@mergify mergify Bot added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Oct 8, 2026
@eserilev eserilev added the gloas label Oct 14, 2026

@chong-he chong-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some comments below. I notice for V2 debug endpoint, both the inner and outer-most extra_data is now required in the beacon API:
https://github.com/ethereum/beacon-APIs/blob/master/types/fork_choice.yaml
https://github.com/ethereum/beacon-APIs/blob/master/apis/debug/fork_choice.v2.yaml#L25

This wasn't the case for the V1 debug endpoint. So we now have both extra_data to have some content there

Comment thread beacon_node/http_api/tests/tests.rs Resolved
Comment thread beacon_node/http_api/tests/tests.rs Resolved
Comment thread common/eth2/src/types.rs Resolved
Comment thread common/eth2/src/types.rs Resolved
@chong-he chong-he added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 16, 2026
@SamAg19
SamAg19 requested a review from chong-he October 19, 2026 03:25

@chong-he chong-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks pretty good now, just a bit more comments to make the test structure more organized

Comment thread beacon_node/http_api/tests/tests.rs Resolved
Comment thread beacon_node/http_api/tests/tests.rs Resolved
Comment thread beacon_node/http_api/tests/tests.rs Resolved

@chong-he chong-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good now, just the following function that I am unsure of if it is necessary. We will wait for developers' opinion on this


/// Fills in `parent_root` from the store for nodes whose parent was pruned. Stays zero if the
/// block can't be loaded.
fn fill_pruned_parent_roots<T: BeaconChainTypes>(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure if this is necessary? We will wait for a dev's comment on this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah this is not necessary or desired. if a node has had its parents pruned we can either leave it with null parents or exclude it from the dump

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.

Addressed dec40d7

@chong-he chong-he added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Oct 20, 2026
@chong-he
chong-he requested a review from macladson as a code owner October 21, 2026 08:14

@chong-he chong-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The diff is much cleaner now, thanks for the PR

@mergify

mergify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

@mergify

mergify Bot commented Oct 22, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Could you please resolve them @SamAg19? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 22, 2026
@michaelsproul michaelsproul added the v9.0.0 Gloas mainnet release label Oct 27, 2026
@cla-assistant

cla-assistant Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas HTTP-API v9.0.0 Gloas mainnet release waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants