Skip to content

Commit 5a67760

Browse files
authored
Handle no viable nodes in Gloas
1 parent d122181 commit 5a67760

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

specs/gloas/fork-choice.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,16 @@ between *full* and *empty* nodes.
634634
def get_head(store: Store) -> ForkChoiceNode:
635635
# Get filtered node tree that only includes viable branches
636636
filtered_node_tree = get_filtered_node_tree(store)
637+
638+
# [New in Gloas:EIP7732]
639+
if not any(filtered_node_tree):
640+
# Return empty node if there are no viable nodes
641+
# to ensure that head is never a pending node
642+
return ForkChoiceNode(
643+
root=store.justified_checkpoint.root,
644+
payload_status=PAYLOAD_STATUS_EMPTY
645+
)
646+
637647
# Execute the LMD-GHOST fork-choice
638648
head = ForkChoiceNode(
639649
root=store.justified_checkpoint.root,

0 commit comments

Comments
 (0)