diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index bb1379b93..8f57967ed 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1139,11 +1139,11 @@ When `is_genesis_trigger(deposits, timestamp, deposit_root) is True` for the fir * `genesis_deposits = deposits` * `genesis_time = timestamp - timestamp % SECONDS_PER_DAY + 2 * SECONDS_PER_DAY` where `SECONDS_PER_DAY = 86400` -* `deposit_root` is the tree root of the given `deposits` +* `deposit_root` is the Merkle tree root of the data of the given `deposits` * `genesis_eth1_data` be the object of type `Eth1Data` where: - * `genesis_eth1_data.block_hash` is the Ethereum 1.0 block hash that emitted the log for the last deposit in `deposits` * `genesis_eth1_data.deposit_root` is the deposit root for the last deposit in `deposits` * `genesis_eth1_data.deposit_count = len(genesis_deposits)` + * `genesis_eth1_data.block_hash` is the Ethereum 1.0 block hash that emitted the log for the last deposit in `deposits` *Note*: The function `is_genesis_trigger` has yet to be agreed by the community, and can be updated as necessary. We define the following testing placeholder: diff --git a/test_libs/pyspec/eth2spec/test/sanity/test_genesis.py b/test_libs/pyspec/eth2spec/test/sanity/test_genesis.py index 37d8a2b17..780d039eb 100644 --- a/test_libs/pyspec/eth2spec/test/sanity/test_genesis.py +++ b/test_libs/pyspec/eth2spec/test/sanity/test_genesis.py @@ -60,6 +60,7 @@ def test_genesis(spec): deposit_count = spec.GENESIS_ACTIVE_VALIDATOR_COUNT genesis_deposits, deposit_root = prepare_genesis_deposits(spec, deposit_count, spec.MAX_EFFECTIVE_BALANCE) genesis_time = 1546300800 + block_hash = b'\x12' * 32 yield genesis_deposits yield genesis_time @@ -67,7 +68,7 @@ def test_genesis(spec): genesis_eth1_data = spec.Eth1Data( deposit_root=deposit_root, deposit_count=deposit_count, - block_hash=b'\x12' * 32, + block_hash=block_hash, ) yield genesis_eth1_data @@ -76,4 +77,11 @@ def test_genesis(spec): genesis_time, genesis_eth1_data, ) + + assert genesis_state.genesis_time == genesis_time + assert len(genesis_state.validators) == deposit_count + assert genesis_state.eth1_data.deposit_root == deposit_root + assert genesis_state.eth1_data.deposit_count == deposit_count + assert genesis_state.eth1_data.block_hash == block_hash + yield genesis_state