Skip to content

Commit 5afd106

Browse files
authored
Some minor fixes (#7082)
* remove duplicated check * remove redundant return * fix build error * format process_withdrawal_request
1 parent f65effd commit 5afd106

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

beacon_chain/spec/state_transition_block.nim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,6 @@ proc check_voluntary_exit*(
418418
return err("Exit: not in validator set long enough")
419419

420420
when typeof(state).kind >= ConsensusFork.Electra:
421-
if voluntary_exit.validator_index >= state.validators.lenu64:
422-
return err("Exit: validator index out of range")
423-
424421
# Only exit validator if it has no pending withdrawals in the queue
425422
if not (get_pending_balance_to_withdraw(
426423
state, voluntary_exit.validator_index.ValidatorIndex) == 0.Gwei):
@@ -531,9 +528,7 @@ func process_withdrawal_request*(
531528
if is_full_exit_request:
532529
# Only exit validator if it has no pending withdrawals in the queue
533530
if pending_balance_to_withdraw == 0.Gwei:
534-
if initiate_validator_exit(cfg, state, index, default(ExitQueueInfo),
535-
cache).isErr():
536-
return
531+
discard initiate_validator_exit(cfg, state, index, ExitQueueInfo(), cache)
537532
return
538533

539534
let

0 commit comments

Comments
 (0)