Skip to content

Commit

Permalink
only add active validators to knownValidators at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Apr 6, 2023
1 parent 1459189 commit 558ca85
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,13 @@ proc initFullNode(
node.validatorMonitor[].addMonitor(validator.pubkey, validator.index)

if validator.index.isSome():
node.consensusManager[].actionTracker.knownValidators[
validator.index.get()] = wallSlot
withState(dag.headState):
let idx = validator.index.get()
if distinctBase(idx) <= forkyState.data.validators.lenu64:
template v: auto = forkyState.data.validators.item(idx)
if is_active_validator(v, wallSlot.epoch) or
is_active_validator(v, wallSlot.epoch + 1):
node.consensusManager[].actionTracker.knownValidators[idx] = wallSlot
let stabilitySubnets =
node.consensusManager[].actionTracker.stabilitySubnets(wallSlot)
# Here, we also set the correct ENR should we be in all subnets mode!
Expand Down

0 comments on commit 558ca85

Please sign in to comment.