Skip to content

Commit 26cc171

Browse files
authored
vcus hardening in case of restarts (#7736)
* vcus hardening in case of restarts * fix * fix 2
1 parent 6996638 commit 26cc171

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

beacon_chain/sync/validator_custody.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import
1818
../consensus_object_pools/block_dag,
1919
../consensus_object_pools/blob_quarantine
2020

21-
from std/algorithm import sort
2221
from std/sequtils import toSeq
2322
from ../beacon_clock import GetBeaconTimeFn
2423

@@ -60,12 +59,13 @@ proc detectNewValidatorCustody*(vcus: ValidatorCustodyRef,
6059
max(vcus.dag.cfg.CUSTODY_REQUIREMENT.uint64,
6160
vcustody))
6261

63-
# update data column quarantine custody requirements
64-
vcus.dataColumnQuarantine[].custodyColumns = newer_columns.toSeq()
65-
sort(vcus.dataColumnQuarantine[].custodyColumns)
6662
# check which custody set is larger
6763
if newer_columns.len >= vcus.older_column_set.len:
6864
vcus.diff_set = toSeq(newer_columns.difference(vcus.older_column_set))
69-
vcus.older_column_set = newer_columns
65+
# else declare the difference to be 0
66+
else:
67+
vcus.diff_set = @[]
68+
69+
vcus.older_column_set = vcus.newer_column_set
7070
vcus.newer_column_set = newer_columns
7171
vcus.dag.eaSlot = max(vcus.dag.eaSlot, current_slot)

0 commit comments

Comments
 (0)