solve ties by block slot first
This commit is contained in:
parent
d0fad1f380
commit
0c9ca6de24
|
@ -354,16 +354,16 @@ def get_head(store: Store) -> ChildNode:
|
||||||
children += [
|
children += [
|
||||||
ChildNode(root=best_child.root, slot=best_child.slot + 1, is_payload_present=best_child.is_payload_present)
|
ChildNode(root=best_child.root, slot=best_child.slot + 1, is_payload_present=best_child.is_payload_present)
|
||||||
]
|
]
|
||||||
# Sort by latest attesting balance with ties broken lexicographically
|
# Sort by latest attesting balance with
|
||||||
# Ties broken by favoring full blocks according to the PTC vote
|
# Ties broken by the block's slot
|
||||||
|
# Ties are broken by the PTC vote
|
||||||
# Ties are then broken by favoring full blocks
|
# Ties are then broken by favoring full blocks
|
||||||
# Ties broken then by favoring higher slot numbers
|
|
||||||
# Ties then broken by favoring block with lexicographically higher root
|
# Ties then broken by favoring block with lexicographically higher root
|
||||||
new_best_child = max(children, key=lambda child: (
|
new_best_child = max(children, key=lambda child: (
|
||||||
get_weight(store, child),
|
get_weight(store, child),
|
||||||
|
blocks[child.root].slot,
|
||||||
is_payload_present(store, child.root),
|
is_payload_present(store, child.root),
|
||||||
child.is_payload_present,
|
child.is_payload_present,
|
||||||
child.slot,
|
|
||||||
child.root
|
child.root
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue