mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-18 17:37:33 +00:00
rm unused lowParticipation
flag (#4624)
Remove an unused flag and associated (unreachable) logic, as the flag wasn't even passed to that module.
This commit is contained in:
parent
cf551f10c4
commit
1ac7f1a47a
@ -922,7 +922,7 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
|
|||||||
cfg.checkForkConsistency()
|
cfg.checkForkConsistency()
|
||||||
|
|
||||||
doAssert updateFlags - {
|
doAssert updateFlags - {
|
||||||
strictVerification, experimental, enableTestFeatures, lowParticipation
|
strictVerification, experimental, enableTestFeatures
|
||||||
} == {}, "Other flags not supported in ChainDAG"
|
} == {}, "Other flags not supported in ChainDAG"
|
||||||
|
|
||||||
# TODO we require that the db contains both a head and a tail block -
|
# TODO we require that the db contains both a head and a tail block -
|
||||||
@ -952,7 +952,7 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
|
|||||||
# The only allowed flag right now is strictVerification, as the others all
|
# The only allowed flag right now is strictVerification, as the others all
|
||||||
# allow skipping some validation.
|
# allow skipping some validation.
|
||||||
updateFlags: updateFlags * {
|
updateFlags: updateFlags * {
|
||||||
strictVerification, experimental, enableTestFeatures, lowParticipation
|
strictVerification, experimental, enableTestFeatures
|
||||||
},
|
},
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
|
|
||||||
|
@ -40,7 +40,5 @@ type
|
|||||||
## Whether to enable extra features in development.
|
## Whether to enable extra features in development.
|
||||||
enableTestFeatures ##\
|
enableTestFeatures ##\
|
||||||
## Whether to enable extra features for testing.
|
## Whether to enable extra features for testing.
|
||||||
lowParticipation ##\
|
|
||||||
## Whether the network is prone to low participation.
|
|
||||||
|
|
||||||
UpdateFlags* = set[UpdateFlag]
|
UpdateFlags* = set[UpdateFlag]
|
||||||
|
@ -177,11 +177,6 @@ func applyScoreChanges*(self: var ProtoArray,
|
|||||||
self.currentEpoch = currentEpoch
|
self.currentEpoch = currentEpoch
|
||||||
self.checkpoints = checkpoints
|
self.checkpoints = checkpoints
|
||||||
|
|
||||||
# If previous epoch is justified, pull up all current tips to previous epoch
|
|
||||||
if self.experimental and self.isPreviousEpochJustified:
|
|
||||||
for realized in self.realizePendingCheckpoints(resetTipTracking = false):
|
|
||||||
discard
|
|
||||||
|
|
||||||
## Alias
|
## Alias
|
||||||
# This cannot raise the IndexError exception, how to tell compiler?
|
# This cannot raise the IndexError exception, how to tell compiler?
|
||||||
template node: untyped {.dirty.} =
|
template node: untyped {.dirty.} =
|
||||||
@ -546,16 +541,6 @@ func nodeIsViableForHead(
|
|||||||
if node.invalid:
|
if node.invalid:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
if self.hasLowParticipation:
|
|
||||||
return
|
|
||||||
if node.checkpoints.justified.epoch < self.checkpoints.justified.epoch:
|
|
||||||
false
|
|
||||||
elif self.isPreviousEpochJustified:
|
|
||||||
node.checkpoints.finalized.epoch >= self.checkpoints.finalized.epoch
|
|
||||||
else:
|
|
||||||
node.checkpoints.finalized == self.checkpoints.finalized or
|
|
||||||
self.checkpoints.finalized.epoch == GENESIS_EPOCH
|
|
||||||
|
|
||||||
if self.experimental:
|
if self.experimental:
|
||||||
var correctJustified =
|
var correctJustified =
|
||||||
self.checkpoints.justified.epoch == GENESIS_EPOCH or
|
self.checkpoints.justified.epoch == GENESIS_EPOCH or
|
||||||
|
@ -172,8 +172,6 @@ proc loadChainDag(
|
|||||||
var extraFlags = {enableTestFeatures}
|
var extraFlags = {enableTestFeatures}
|
||||||
if config.deploymentPhase <= DeploymentPhase.Testnet:
|
if config.deploymentPhase <= DeploymentPhase.Testnet:
|
||||||
extraFlags.incl experimental
|
extraFlags.incl experimental
|
||||||
if config.deploymentPhase <= DeploymentPhase.Devnet:
|
|
||||||
extraFlags.incl lowParticipation
|
|
||||||
let
|
let
|
||||||
chainDagFlags =
|
chainDagFlags =
|
||||||
if config.strictVerification: {strictVerification}
|
if config.strictVerification: {strictVerification}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user