mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 04:04:19 +00:00
Found by Cem Özer: Ignore older latest messages in attesting balance sum, instead of assertion error
This commit is contained in:
parent
452ecf8e27
commit
01af304403
@ -101,8 +101,12 @@ def get_genesis_store(genesis_state: BeaconState) -> Store:
|
|||||||
```python
|
```python
|
||||||
def get_ancestor(store: Store, root: Hash, slot: Slot) -> Hash:
|
def get_ancestor(store: Store, root: Hash, slot: Slot) -> Hash:
|
||||||
block = store.blocks[root]
|
block = store.blocks[root]
|
||||||
assert block.slot >= slot
|
if block.slot > slot:
|
||||||
return root if block.slot == slot else get_ancestor(store, block.parent_root, 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`
|
#### `get_latest_attesting_balance`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user