From 01af3044032735fa9266d08656090f1bc1e09351 Mon Sep 17 00:00:00 2001 From: protolambda Date: Sat, 20 Jul 2019 02:13:31 +0200 Subject: [PATCH] =?UTF-8?q?Found=20by=20Cem=20=C3=96zer:=20Ignore=20older?= =?UTF-8?q?=20latest=20messages=20in=20attesting=20balance=20sum,=20instea?= =?UTF-8?q?d=20of=20assertion=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specs/core/0_fork-choice.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/specs/core/0_fork-choice.md b/specs/core/0_fork-choice.md index 9fd8ab53e..00374fee9 100644 --- a/specs/core/0_fork-choice.md +++ b/specs/core/0_fork-choice.md @@ -101,8 +101,12 @@ def get_genesis_store(genesis_state: BeaconState) -> Store: ```python def get_ancestor(store: Store, root: Hash, slot: Slot) -> Hash: block = store.blocks[root] - assert block.slot >= slot - return root if block.slot == slot else get_ancestor(store, block.parent_root, slot) + if block.slot > slot: + return get_ancestor(store, block.parent_root, slot) + elif block.slot == slot: + return root + else: + return Bytes32() # root is older than queried slot: no results. ``` #### `get_latest_attesting_balance`