From b5542046883e252dfbb1de2fb2b20c199ae7e598 Mon Sep 17 00:00:00 2001 From: Gregory Markou Date: Thu, 13 Dec 2018 08:08:51 -0500 Subject: [PATCH] clarified language around start_up (#303) --- specs/core/0_beacon-chain.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index f12d6646e..f2637d2fc 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -592,7 +592,7 @@ Every deposit, of size between `MIN_DEPOSIT` and `MAX_DEPOSIT`, emits an `Eth1De ### `ChainStart` log -When sufficiently many full deposits have been made the deposit contract emits the `ChainStart` log. The beacon chain may then be initialized by calling the `on_startup` function (defined below) where: +When sufficiently many full deposits have been made the deposit contract emits the `ChainStart` log. The beacon chain state may then be initialized by calling the `get_initial_beacon_state` function (defined below) where: * `genesis_time` equals `time` in the `ChainStart` log * `processed_pow_receipt_root` equals `receipt_root` in the `ChainStart` log @@ -1076,12 +1076,12 @@ A valid block with slot `INITIAL_SLOT_NUMBER` (a "genesis block") has the follow } ``` -`STARTUP_STATE_ROOT` is the root of the initial state, computed by running the following code: +`STARTUP_STATE_ROOT` (in the above "genesis block") is generated from the `get_initial_beacon_state` function below. When enough full deposits have been made to the deposit contract and the `ChainStart` log has been emitted, `get_initial_beacon_state` will execute to compute the `ssz_tree_hash` of `BeaconState`. ```python -def on_startup(initial_validator_deposits: List[Deposit], - genesis_time: int, - processed_pow_receipt_root: Hash32) -> BeaconState: +def get_initial_beacon_state(initial_validator_deposits: List[Deposit], + genesis_time: int, + processed_pow_receipt_root: Hash32) -> BeaconState: state = BeaconState( # Misc slot=INITIAL_SLOT_NUMBER, @@ -1283,7 +1283,7 @@ def exit_validator(state: BeaconState, prev_status = validator.status if prev_status == EXITED_WITH_PENALTY: - return + return validator.status = new_status validator.latest_status_change_slot = state.slot