remove assumption of shared finalized-block ancestery between fork choice and chaindag in getDebugForkChoice (#5328)
This commit is contained in:
parent
b4b40fa7d2
commit
d889b62b79
|
@ -113,7 +113,14 @@ proc installDebugApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
validity:
|
||||
if item.invalid:
|
||||
RestNodeValidity.invalid
|
||||
elif node.dag.is_optimistic(item.bid):
|
||||
else:
|
||||
# Fork choice doesn't necessarily prune finalized blocks in a
|
||||
# synchronized way to the chaindag, so can't assume that when
|
||||
# item.bid.slot is before finalizedHead, it has shared status
|
||||
# regarding optimistic/validity as finalizedHead, so fallback
|
||||
# to optimistic is more appropriate for this REST endpoint.
|
||||
let blck = node.dag.getBlockRef(item.bid.root)
|
||||
if blck.isNone() or not blck.get.executionValid:
|
||||
RestNodeValidity.optimistic
|
||||
else:
|
||||
RestNodeValidity.valid,
|
||||
|
|
Loading…
Reference in New Issue