@@ -320,24 +320,35 @@ proc init*(T: type BeaconNode,
320320 topics &= getAttestationTopic (enrForkId.forkDigest, subnet)
321321 topics)
322322
323- if conf.testDualSlashingProtectionDBs:
324- info " Loading slashing protection database (dual DB mode)" , path = conf.validatorsDir ()
323+ case conf.slashingDbKind
324+ of SlashingDbKind .v1:
325+ info " Loading slashing protection database" , path = conf.validatorsDir ()
325326 res.attachedValidators = ValidatorPool .init (
326327 SlashingProtectionDB .init (
327328 chainDag.headState.data.data.genesis_validators_root,
328329 conf.validatorsDir (), " slashing_protection" ,
329- modes = {kCompleteArchiveV1, kCompleteArchiveV2 },
330- disagreementBehavior = kChooseV2
330+ modes = {kCompleteArchiveV1},
331+ disagreementBehavior = kChooseV1
331332 )
332333 )
333- else :
334- info " Loading slashing protection database" , path = conf.validatorsDir ()
334+ of SlashingDbKind .v2 :
335+ info " Loading slashing protection database (v2) " , path = conf.validatorsDir ()
335336 res.attachedValidators = ValidatorPool .init (
336337 SlashingProtectionDB .init (
337338 chainDag.headState.data.data.genesis_validators_root,
338339 conf.validatorsDir (), " slashing_protection"
339340 )
340341 )
342+ of SlashingDbKind .both:
343+ info " Loading slashing protection database (dual DB mode)" , path = conf.validatorsDir ()
344+ res.attachedValidators = ValidatorPool .init (
345+ SlashingProtectionDB .init (
346+ chainDag.headState.data.data.genesis_validators_root,
347+ conf.validatorsDir (), " slashing_protection" ,
348+ modes = {kCompleteArchiveV1, kCompleteArchiveV2},
349+ disagreementBehavior = kChooseV2
350+ )
351+ )
341352
342353 proc getWallTime (): BeaconTime = res.beaconClock.now ()
343354
0 commit comments