mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 14:54:12 +00:00
rm PENDING_ACTIVATION
This commit is contained in:
parent
2ff973e46f
commit
44edf400d2
@ -64,11 +64,11 @@ func process_deposit(state: var BeaconState,
|
|||||||
if pubkey notin validator_pubkeys:
|
if pubkey notin validator_pubkeys:
|
||||||
# Add new validator
|
# Add new validator
|
||||||
let validator = ValidatorRecord(
|
let validator = ValidatorRecord(
|
||||||
|
status: UNUSED,
|
||||||
pubkey: pubkey,
|
pubkey: pubkey,
|
||||||
withdrawal_credentials: withdrawal_credentials,
|
withdrawal_credentials: withdrawal_credentials,
|
||||||
randao_commitment: randao_commitment,
|
randao_commitment: randao_commitment,
|
||||||
randao_layers: 0,
|
randao_layers: 0,
|
||||||
status: PENDING_ACTIVATION,
|
|
||||||
activation_slot: FAR_FUTURE_SLOT,
|
activation_slot: FAR_FUTURE_SLOT,
|
||||||
exit_slot: FAR_FUTURE_SLOT,
|
exit_slot: FAR_FUTURE_SLOT,
|
||||||
withdrawal_slot: FAR_FUTURE_SLOT,
|
withdrawal_slot: FAR_FUTURE_SLOT,
|
||||||
@ -333,7 +333,7 @@ func update_validator_registry*(state: var BeaconState) =
|
|||||||
# Activate validators within the allowable balance churn
|
# Activate validators within the allowable balance churn
|
||||||
var balance_churn = 0'u64
|
var balance_churn = 0'u64
|
||||||
for index, validator in state.validator_registry:
|
for index, validator in state.validator_registry:
|
||||||
if validator.status == PENDING_ACTIVATION and
|
if validator.activation_slot > state.slot + ENTRY_EXIT_DELAY and
|
||||||
state.validator_balances[index] >= MAX_DEPOSIT * GWEI_PER_ETH:
|
state.validator_balances[index] >= MAX_DEPOSIT * GWEI_PER_ETH:
|
||||||
# Check the balance churn would be within the allowance
|
# Check the balance churn would be within the allowance
|
||||||
balance_churn += get_effective_balance(state, index.Uint24)
|
balance_churn += get_effective_balance(state, index.Uint24)
|
||||||
|
@ -450,7 +450,7 @@ type
|
|||||||
flag*: ValidatorSetDeltaFlags
|
flag*: ValidatorSetDeltaFlags
|
||||||
|
|
||||||
ValidatorStatusCodes* {.pure.} = enum
|
ValidatorStatusCodes* {.pure.} = enum
|
||||||
PENDING_ACTIVATION = 0
|
UNUSED = 0
|
||||||
ACTIVE = 1
|
ACTIVE = 1
|
||||||
ACTIVE_PENDING_EXIT = 2
|
ACTIVE_PENDING_EXIT = 2
|
||||||
EXITED_WITHOUT_PENALTY = 3
|
EXITED_WITHOUT_PENALTY = 3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user