Fix on_startup

This commit is contained in:
terence tsao 2018-11-28 18:32:07 -08:00 committed by GitHub
parent 92f8f8e587
commit a891d5d585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -747,9 +747,7 @@ A valid block with slot `0` (the "genesis block") has the following values. Othe
`STARTUP_STATE_ROOT` is the root of the initial state, computed by running the following code: `STARTUP_STATE_ROOT` is the root of the initial state, computed by running the following code:
```python ```python
def on_startup(current_validators: List[ValidatorRecord], def on_startup(initial_validator_entries: List[Any],
pre_fork_version: int,
initial_validator_entries: List[Any],
genesis_time: int, genesis_time: int,
processed_pow_receipt_root: Hash32) -> BeaconState: processed_pow_receipt_root: Hash32) -> BeaconState:
# Induct validators # Induct validators
@ -759,8 +757,8 @@ def on_startup(current_validators: List[ValidatorRecord],
validators, _ = get_new_validators( validators, _ = get_new_validators(
current_validators=validators, current_validators=validators,
fork_data=ForkData( fork_data=ForkData(
pre_fork_version=pre_fork_version, pre_fork_version=INITIAL_FORK_VERSION,
post_fork_version=pre_fork_version, post_fork_version=INITIAL_FORK_VERSION,
fork_slot_number=2**64 - 1, fork_slot_number=2**64 - 1,
), ),
pubkey=pubkey, pubkey=pubkey,
@ -811,7 +809,6 @@ def on_startup(current_validators: List[ValidatorRecord],
return state return state
``` ```
The `add_or_topup_validator` routine is defined below.
### Routine for adding a validator ### Routine for adding a validator