diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 7713f9863..0ff217dd8 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -63,8 +63,6 @@ EFFECTIVE_BALANCE_INCREMENT: 1000000000 # Initial values # --------------------------------------------------------------- -# 0, GENESIS_EPOCH is derived from this constant -GENESIS_SLOT: 0 # Mainnet initial fork version, recommend altering for testnets GENESIS_FORK_VERSION: 0x00000000 BLS_WITHDRAWAL_PREFIX: 0x00 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 70bb6ca34..6a8b82709 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -63,8 +63,6 @@ EFFECTIVE_BALANCE_INCREMENT: 1000000000 # Initial values # --------------------------------------------------------------- -# 0, GENESIS_EPOCH is derived from this constant -GENESIS_SLOT: 0 # Highest byte set to 0x01 to avoid collisions with mainnet versioning GENESIS_FORK_VERSION: 0x00000001 BLS_WITHDRAWAL_PREFIX: 0x00 diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 9ffce3317..c0d43601e 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -158,6 +158,8 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | | - | - | +| `GENESIS_SLOT` | `Slot(0)` | +| `GENESIS_EPOCH` | `Epoch(0)` | | `FAR_FUTURE_EPOCH` | `Epoch(2**64 - 1)` | | `BASE_REWARDS_PER_EPOCH` | `4` | | `DEPOSIT_CONTRACT_TREE_DEPTH` | `2**5` (= 32) | @@ -196,8 +198,6 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | | - | - | -| `GENESIS_SLOT` | `Slot(0)` | -| `GENESIS_EPOCH` | `Epoch(0)` | | `GENESIS_FORK_VERSION` | `Version('0x00000000')` | | `BLS_WITHDRAWAL_PREFIX` | `Bytes1('0x00')` | diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index 2c9a0c661..5876cbb7e 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -260,10 +260,15 @@ Let `get_eth1_data(block: Eth1Block) -> Eth1Data` be the function that returns t An honest block proposer sets `block.body.eth1_data = get_eth1_vote(state)` where: +```python +def compute_time_at_slot(state: BeaconState, slot: Slot) -> uint64: + return state.genesis_time + slot * SECONDS_PER_SLOT +``` + ```python def voting_period_start_time(state: BeaconState) -> uint64: - eth1_voting_period_start_slot = state.slot % SLOTS_PER_ETH1_VOTING_PERIOD - return state.genesis_time + eth1_voting_period_start_slot * SECONDS_PER_SLOT + eth1_voting_period_start_slot = Slot(state.slot - state.slot % SLOTS_PER_ETH1_VOTING_PERIOD) + return compute_time_at_slot(state, eth1_voting_period_start_slot) ``` ```python