resolve merge conflicts

This commit is contained in:
Eitan Seri- Levi
2026-03-31 11:06:08 -07:00
38 changed files with 3861 additions and 790 deletions

View File

@@ -2098,52 +2098,62 @@ pub fn serve<T: BeaconChainTypes>(
.nodes
.iter()
.map(|node| {
let execution_status = if node.execution_status.is_execution_enabled() {
Some(node.execution_status.to_string())
let execution_status = if node
.execution_status()
.is_ok_and(|status| status.is_execution_enabled())
{
node.execution_status()
.ok()
.map(|status| status.to_string())
} else {
None
};
let execution_status_string = node
.execution_status()
.map_or_else(|_| "irrelevant".to_string(), |s| s.to_string());
ForkChoiceNode {
slot: node.slot,
block_root: node.root,
slot: node.slot(),
block_root: node.root(),
parent_root: node
.parent
.parent()
.and_then(|index| proto_array.nodes.get(index))
.map(|parent| parent.root),
justified_epoch: node.justified_checkpoint.epoch,
finalized_epoch: node.finalized_checkpoint.epoch,
weight: node.weight,
.map(|parent| parent.root()),
justified_epoch: node.justified_checkpoint().epoch,
finalized_epoch: node.finalized_checkpoint().epoch,
weight: node.weight(),
validity: execution_status,
execution_block_hash: node
.execution_status
.block_hash()
.execution_status()
.ok()
.and_then(|status| status.block_hash())
.map(|block_hash| block_hash.into_root()),
extra_data: ForkChoiceExtraData {
target_root: node.target_root,
justified_root: node.justified_checkpoint.root,
finalized_root: node.finalized_checkpoint.root,
target_root: node.target_root(),
justified_root: node.justified_checkpoint().root,
finalized_root: node.finalized_checkpoint().root,
unrealized_justified_root: node
.unrealized_justified_checkpoint
.unrealized_justified_checkpoint()
.map(|checkpoint| checkpoint.root),
unrealized_finalized_root: node
.unrealized_finalized_checkpoint
.unrealized_finalized_checkpoint()
.map(|checkpoint| checkpoint.root),
unrealized_justified_epoch: node
.unrealized_justified_checkpoint
.unrealized_justified_checkpoint()
.map(|checkpoint| checkpoint.epoch),
unrealized_finalized_epoch: node
.unrealized_finalized_checkpoint
.unrealized_finalized_checkpoint()
.map(|checkpoint| checkpoint.epoch),
execution_status: node.execution_status.to_string(),
execution_status: execution_status_string,
best_child: node
.best_child
.best_child()
.and_then(|index| proto_array.nodes.get(index))
.map(|child| child.root),
.map(|child| child.root()),
best_descendant: node
.best_descendant
.best_descendant()
.and_then(|index| proto_array.nodes.get(index))
.map(|descendant| descendant.root),
.map(|descendant| descendant.root()),
},
}
})