mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 14:54:12 +00:00
keep unviables in quarantine (#3331)
they remain unviable even after a reorg
This commit is contained in:
parent
49b7daa39d
commit
e264276b36
@ -171,8 +171,11 @@ func cleanupOrphans(quarantine: var Quarantine, finalizedSlot: Slot) =
|
||||
for k in toDel:
|
||||
quarantine.addUnviable k[0]
|
||||
|
||||
func clearQuarantine*(quarantine: var Quarantine) =
|
||||
quarantine = Quarantine()
|
||||
func clearAfterReorg*(quarantine: var Quarantine) =
|
||||
## Clear missing and orphans to start with a fresh slate in case of a reorg
|
||||
## Unviables remain unviable and are not cleared.
|
||||
quarantine.missing.reset()
|
||||
quarantine.orphans.reset()
|
||||
|
||||
# Typically, blocks will arrive in mostly topological order, with some
|
||||
# out-of-order block pairs. Therefore, it is unhelpful to use either a
|
||||
|
@ -1344,7 +1344,8 @@ proc updateHead*(
|
||||
dag.onReorgHappened(data)
|
||||
|
||||
# A reasonable criterion for "reorganizations of the chain"
|
||||
quarantine.clearQuarantine()
|
||||
quarantine.clearAfterReorg()
|
||||
|
||||
beacon_reorgs_total_total.inc()
|
||||
beacon_reorgs_total.inc()
|
||||
else:
|
||||
@ -1510,9 +1511,6 @@ proc preInit*(
|
||||
tailBlock: ForkedTrustedSignedBeaconBlock) =
|
||||
# write a genesis state, the way the ChainDAGRef expects it to be stored in
|
||||
# database
|
||||
# TODO probably should just init a block pool with the freshly written
|
||||
# state - but there's more refactoring needed to make it nice - doing
|
||||
# a minimal patch for now..
|
||||
|
||||
logScope:
|
||||
genesisStateRoot = getStateRoot(genesisState)
|
||||
|
Loading…
x
Reference in New Issue
Block a user