Merge pull request #2092 from ethereum/ralexstokes-patch-1
Simplify fork choice spec
This commit is contained in:
commit
bfaef689e4
|
@ -226,11 +226,10 @@ def get_head(store: Store) -> Root:
|
||||||
blocks = get_filtered_block_tree(store)
|
blocks = get_filtered_block_tree(store)
|
||||||
# Execute the LMD-GHOST fork choice
|
# Execute the LMD-GHOST fork choice
|
||||||
head = store.justified_checkpoint.root
|
head = store.justified_checkpoint.root
|
||||||
justified_slot = compute_start_slot_at_epoch(store.justified_checkpoint.epoch)
|
|
||||||
while True:
|
while True:
|
||||||
children = [
|
children = [
|
||||||
root for root in blocks.keys()
|
root for root in blocks.keys()
|
||||||
if blocks[root].parent_root == head and blocks[root].slot > justified_slot
|
if blocks[root].parent_root == head
|
||||||
]
|
]
|
||||||
if len(children) == 0:
|
if len(children) == 0:
|
||||||
return head
|
return head
|
||||||
|
|
Loading…
Reference in New Issue