mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Add extra data in /eth/v1/debug/fork_choice (#7845)
* #7829 Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io> Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
This commit is contained in:
@@ -3088,6 +3088,32 @@ impl ApiTester {
|
||||
.execution_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,
|
||||
unrealized_justified_root: node
|
||||
.unrealized_justified_checkpoint
|
||||
.map(|checkpoint| checkpoint.root),
|
||||
unrealized_finalized_root: node
|
||||
.unrealized_finalized_checkpoint
|
||||
.map(|checkpoint| checkpoint.root),
|
||||
unrealized_justified_epoch: node
|
||||
.unrealized_justified_checkpoint
|
||||
.map(|checkpoint| checkpoint.epoch),
|
||||
unrealized_finalized_epoch: node
|
||||
.unrealized_finalized_checkpoint
|
||||
.map(|checkpoint| checkpoint.epoch),
|
||||
execution_status: node.execution_status.to_string(),
|
||||
best_child: node
|
||||
.best_child
|
||||
.and_then(|index| expected_proto_array.nodes.get(index))
|
||||
.map(|child| child.root),
|
||||
best_descendant: node
|
||||
.best_descendant
|
||||
.and_then(|index| expected_proto_array.nodes.get(index))
|
||||
.map(|descendant| descendant.root),
|
||||
},
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user