Update fork-choice.md

This commit is contained in:
danny 2023-10-20 12:06:47 -06:00 committed by GitHub
parent 991d6d5609
commit 16498c60aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,7 @@ Initially, verification requires every verifying actor to retrieve all matching
The block MUST NOT be considered valid until all valid `Blob`s have been downloaded. Blocks that have been previously validated as available SHOULD be considered available even if the associated `Blob`s have subsequently been pruned. The block MUST NOT be considered valid until all valid `Blob`s have been downloaded. Blocks that have been previously validated as available SHOULD be considered available even if the associated `Blob`s have subsequently been pruned.
*Note*: Extraneous or invalid Blobs received on the p2p network MUST NOT invalidate a block that is otherwise valid and available. *Note*: Extraneous or invalid Blobs (in addition to KZG expected/referenced valid blobs) received on the p2p network MUST NOT invalidate a block that is otherwise valid and available.
```python ```python
def is_data_available(beacon_block_root: Root, blob_kzg_commitments: Sequence[KZGCommitment]) -> bool: def is_data_available(beacon_block_root: Root, blob_kzg_commitments: Sequence[KZGCommitment]) -> bool:
@ -95,6 +95,9 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# If not, this block MAY be queued and subsequently considered when blob data becomes available # If not, this block MAY be queued and subsequently considered when blob data becomes available
assert is_data_available(hash_tree_root(block), block.body.blob_kzg_commitments) assert is_data_available(hash_tree_root(block), block.body.blob_kzg_commitments)
# *Note*: Extraneous or invalid Blobs (in addition to the expected/referenced valid blobs)
# received on the p2p network MUST NOT invalidate a block that is otherwise valid and available
# Check the block is valid and compute the post-state # Check the block is valid and compute the post-state
state = pre_state.copy() state = pre_state.copy()
block_root = hash_tree_root(block) block_root = hash_tree_root(block)