diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index be3e3d7d0..51feb147f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1710,7 +1710,7 @@ def process_attester_slashing(state: BeaconState, attester_slashing: AttesterSla slashed_any = False attesting_indices_1 = attestation_1.custody_bit_0_indices + attestation_1.custody_bit_1_indices attesting_indices_2 = attestation_2.custody_bit_0_indices + attestation_2.custody_bit_1_indices - for index in set(attesting_indices_1).intersection(attesting_indices_2): + for index in sorted(set(attesting_indices_1).intersection(attesting_indices_2)): if is_slashable_validator(state.validator_registry[index], get_current_epoch(state)): slash_validator(state, index) slashed_any = True diff --git a/specs/core/1_custody-game.md b/specs/core/1_custody-game.md index e71a92cd9..81c041b79 100644 --- a/specs/core/1_custody-game.md +++ b/specs/core/1_custody-game.md @@ -39,6 +39,16 @@ - [`get_chunk_bits_root`](#get_chunk_bits_root) - [`get_randao_epoch_for_custody_period`](#get_randao_epoch_for_custody_period) - [`get_validators_custody_reveal_period`](#get_validators_custody_reveal_period) + - [`replace_empty_or_append`](#replace_empty_or_append) + - [Per-block processing](#per-block-processing) + - [Operations](#operations) + - [Custody key reveals](#custody-key-reveals) + - [Early derived secret reveals](#early-derived-secret-reveals) + - [Chunk challenges](#chunk-challenges) + - [Bit challenges](#bit-challenges) + - [Custody responses](#custody-responses) + - [Per-epoch processing](#per-epoch-processing) + - [Handling of custody-related deadlines](#handling-of-custody-related-deadlines) @@ -385,7 +395,7 @@ def process_custody_key_reveal(state: BeaconState, increase_balance(state, proposer_index, get_base_reward(state, proposer_index) // MINOR_REWARD_QUOTIENT) ``` -##### Early derived secret reveals +#### Early derived secret reveals Verify that `len(block.body.early_derived_secret_reveals) <= MAX_EARLY_DERIVED_SECRET_REVEALS`. @@ -724,26 +734,3 @@ def after_process_final_updates(state: BeaconState) -> None: if validator.exit_epoch != FAR_FUTURE_EPOCH and validator.withdrawable_epoch == FAR_FUTURE_EPOCH: validator.withdrawable_epoch = validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY ``` - -In `process_penalties_and_exits`, change the definition of `eligible` to the following (note that it is not a pure function because `state` is declared in the surrounding scope): - -```python -def eligible(state: BeaconState, index: ValidatorIndex) -> bool: - validator = state.validator_registry[index] - # Cannot exit if there are still open chunk challenges - if len([record for record in state.custody_chunk_challenge_records if record.responder_index == index]) > 0: - return False - # Cannot exit if there are still open bit challenges - if len([record for record in state.custody_bit_challenge_records if record.responder_index == index]) > 0: - return False - # Cannot exit if you have not revealed all of your custody keys - elif (validator.next_custody_reveal_period - <= get_validators_custody_reveal_period(state, index, validator.exit_epoch)): - return False - # Cannot exit if you already have - elif validator.withdrawable_epoch < FAR_FUTURE_EPOCH: - return False - # Return minimum time - else: - return get_current_epoch(state) >= validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY -```