Merge pull request #2827 from terencechain/patch-131

Fix typo justified
This commit is contained in:
Danny Ryan 2022-02-07 07:16:28 -07:00 committed by GitHub
commit 7879ed58c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,9 +82,9 @@ def is_execution_block(block: BeaconBlock) -> bool:
```python
def is_optimistic_candidate_block(opt_store: OptimisticStore, current_slot: Slot, block: BeaconBlock) -> bool:
justified_root = opt_store.block_states[opt_store.head_block_root].current_justified_checkpoint.root
justifed_is_execution_block = is_execution_block(opt_store.blocks[justified_root])
justified_is_execution_block = is_execution_block(opt_store.blocks[justified_root])
block_is_deep = block.slot + SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY <= current_slot
return justifed_is_execution_block or block_is_deep
return justified_is_execution_block or block_is_deep
```
Let only a node which returns `is_optimistic(opt_store, head) is True` be an *optimistic