Eth1 block hashes have type Hash32 (#2693)

* Eth1 block hashes have type Hash32

* Modify other forks as well

Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
This commit is contained in:
Ben Edgington 2021-11-23 15:20:26 +00:00 committed by GitHub
parent 9999331f81
commit 44fec310b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -685,7 +685,7 @@ This helper function is only for initializing the state for pure Altair testnets
*Note*: The function `initialize_beacon_state_from_eth1` is modified: (1) using `ALTAIR_FORK_VERSION` as the current fork version, (2) utilizing the Altair `BeaconBlockBody` when constructing the initial `latest_block_header`, and (3) adding initial sync committees. *Note*: The function `initialize_beacon_state_from_eth1` is modified: (1) using `ALTAIR_FORK_VERSION` as the current fork version, (2) utilizing the Altair `BeaconBlockBody` when constructing the initial `latest_block_header`, and (3) adding initial sync committees.
```python ```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32, def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
eth1_timestamp: uint64, eth1_timestamp: uint64,
deposits: Sequence[Deposit]) -> BeaconState: deposits: Sequence[Deposit]) -> BeaconState:
fork = Fork( fork = Fork(

View File

@ -406,7 +406,7 @@ Modifications include:
Else, the Merge starts from genesis and the transition is incomplete. Else, the Merge starts from genesis and the transition is incomplete.
```python ```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32, def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
eth1_timestamp: uint64, eth1_timestamp: uint64,
deposits: Sequence[Deposit], deposits: Sequence[Deposit],
execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader() execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader()

View File

@ -1175,7 +1175,7 @@ Before the Ethereum beacon chain genesis has been triggered, and for every Ether
Proof-of-work blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case. Proof-of-work blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case.
```python ```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32, def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
eth1_timestamp: uint64, eth1_timestamp: uint64,
deposits: Sequence[Deposit]) -> BeaconState: deposits: Sequence[Deposit]) -> BeaconState:
fork = Fork( fork = Fork(