display invalid status in extra fork choice info (#4074)

* fork choice: support marking roots/nodes invalid

* check for invalid first

* display invalid status in extra fork choice info
This commit is contained in:
tersec 2022-09-06 18:05:57 +00:00 committed by GitHub
parent 11ebf60ab8
commit 8fbb3d975b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,7 @@ proc installDebugApiHandlers*(router: var RestRouter, node: BeaconNode) =
u_finalized_checkpoint: Option[Checkpoint]
best_child: Eth2Digest
best_descendant: Eth2Digest
invalid: bool
ForkChoiceResponse = object
slot: Slot
@ -174,7 +175,8 @@ proc installDebugApiHandlers*(router: var RestRouter, node: BeaconNode) =
u_justified_checkpoint: u_justified_checkpoint,
u_finalized_checkpoint: u_finalized_checkpoint,
best_child: item.bestChild,
bestDescendant: item.bestDescendant))
bestDescendant: item.bestDescendant,
invalid: item.invalid))
return RestApiResponse.jsonResponse(responses)
# Legacy URLS - Nimbus <= 1.5.5 used to expose the REST API with an additional