From 130b8379751b6bb792138643dfff5fdadfacb8cd Mon Sep 17 00:00:00 2001 From: terence tsao Date: Wed, 5 Dec 2018 06:41:11 -0800 Subject: [PATCH] Fix ZERO_BALANCE_VALIDATOR_TTL and move get_domain --- specs/core/0_beacon-chain.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index fabb325d9..251aae181 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -65,6 +65,7 @@ - [`bytes1`, `bytes2`, ...](#bytes1-bytes2-) - [`get_effective_balance`](#get_effective_balance) - [`get_new_validator_registry_delta_chain_tip`](#get_new_validator_registry_delta_chain_tip) + - [`get_domain`](#get_domain) - [`integer_squareroot`](#integer_squareroot) - [On startup](#on-startup) - [Routine for activating a validator](#routine-for-activating-a-validator) @@ -172,7 +173,7 @@ Unless otherwise indicated, code appearing in `this style` is to be interpreted | `POW_RECEIPT_ROOT_VOTING_PERIOD` | `2**10` (= 1,024) | slots | ~1.7 hours | | `SHARD_PERSISTENT_COMMITTEE_CHANGE_PERIOD` | `2**17` (= 131,072) | slots | ~9 days | | `COLLECTIVE_PENALTY_CALCULATION_PERIOD` | `2**20` (= 1,048,576) | slots | ~73 days | -| `ZERO_BALANCE_VALIDATOR_TTL` | `2**22` (= 16,777,216) | slots | ~290 days | +| `ZERO_BALANCE_VALIDATOR_TTL` | `2**22` (= 4,194,304) | slots | ~291 days | ### Reward and penalty quotients @@ -922,6 +923,18 @@ def get_new_validator_registry_delta_chain_tip(current_validator_registry_delta_ ) ``` +#### `get_domain` + +```python +def get_domain(fork_data: ForkData, + slot: int, + domain_type: int) -> int: + return get_fork_version( + fork_data, + slot + ) * 2**32 + domain_type +``` + #### `integer_squareroot` ```python @@ -1038,14 +1051,6 @@ def get_fork_version(fork_data: ForkData, else: return fork_data.post_fork_version -def get_domain(fork_data: ForkData, - slot: int, - domain_type: int) -> int: - return get_fork_version( - fork_data, - slot - ) * 2**32 + domain_type - def get_new_validators(validators: List[ValidatorRecord], fork_data: ForkData, pubkey: int,