/eth/v1/debug/fork_choice
method is a debug API endpoint in the Ethereum Beacon Chain that retrieves the complete fork choice context, including justified and finalized checkpoints and the entire fork choice tree with all nodes and their weights. This endpoint provides deep insight into the consensus mechanism’s decision-making process for determining the canonical chain.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
This endpoint does not require any parameters.Response
The response provides comprehensive fork choice data:-
justified_checkpoint
— the current justified checkpoint containing:epoch
— the epoch number of the justified checkpointroot
— the block root of the justified checkpoint
-
finalized_checkpoint
— the current finalized checkpoint containing:epoch
— the epoch number of the finalized checkpointroot
— the block root of the finalized checkpoint
-
fork_choice_nodes
— array of all nodes in the fork choice tree, each containing:slot
— the slot number of this blockblock_root
— the merkle root of this beacon blockparent_root
— the merkle root of the parent beacon blockjustified_epoch
— the justified epoch from this block’s perspectivefinalized_epoch
— the finalized epoch from this block’s perspectiveweight
— the cumulative weight/score of this block in the fork choice algorithmvalidity
— the validity status (valid
,invalid
, oroptimistic
)execution_block_hash
— the execution layer block hashextra_data
— optional client-specific additional data
-
extra_data
— optional additional data at the response level (client-specific)
Usage notes
The/eth/v1/debug/fork_choice
method is an advanced debugging tool that exposes the internal state of the fork choice algorithm, which is the heart of Ethereum’s consensus mechanism. This endpoint is invaluable for understanding how the beacon chain determines the canonical chain among potentially competing forks.
Key concepts for understanding the response:
- Fork choice tree — represents all known blocks and their relationships, forming a tree structure where each node is a block
- Weight — indicates the cumulative attestation support for each block; higher weight means more validators support this chain
- Checkpoints — justified and finalized checkpoints represent consensus milestones that cannot be reverted
- Validity states:
valid
— block has been fully validatedinvalid
— block failed validationoptimistic
— block assumed valid but not yet verified by execution layer
- Consensus debugging — understanding why certain blocks are chosen as canonical
- Network analysis — identifying competing forks and their relative support
- Performance monitoring — tracking the efficiency of finalization
- Research — studying fork choice behavior under various network conditions
- Validator operations — understanding attestation targets and block production decisions
Response
Success - Fork choice data retrieved
Debugging context of fork choice
The Checkpoint object from the CL spec
The Checkpoint object from the CL spec
Fork choice nodes representing the complete fork choice tree
Minimum length:
1
Optional extra data that clients may provide, which could differ from client to client