mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-22 19:28:20 +00:00
testnet optimizations for low participation (#4100)
Update finality check to improve performance in testnets.
This commit is contained in:
parent
0a5b06317d
commit
5ab57369f7
@ -541,11 +541,13 @@ func nodeIsViableForHead(self: ProtoArray, node: ProtoNode): bool =
|
||||
return false
|
||||
|
||||
if self.hasLowParticipation:
|
||||
return
|
||||
if node.checkpoints.justified.epoch < self.checkpoints.justified.epoch:
|
||||
return false
|
||||
if self.isPreviousEpochJustified:
|
||||
return true
|
||||
return node.checkpoints.finalized == self.checkpoints.finalized or
|
||||
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
|
||||
|
||||
## Any node that has a different finalized or justified epoch
|
||||
|
Loading…
x
Reference in New Issue
Block a user