mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Blacklist invalid block root in block verification and blacklist invalid finalized epochs in sync.
This commit is contained in:
@@ -120,6 +120,19 @@ where
|
||||
.finalized_epoch
|
||||
.start_slot(T::EthSpec::slots_per_epoch());
|
||||
|
||||
// Prevent syncing from peers that had finalized an invalid chain on Holesky.
|
||||
let non_finality_start_epoch = Epoch::new(115969);
|
||||
let possible_finality_start_epoch = Epoch::new(116052);
|
||||
if remote_info.finalized_epoch >= non_finality_start_epoch
|
||||
&& remote_info.finalized_epoch <= possible_finality_start_epoch
|
||||
{
|
||||
if !self.failed_chains.contains(&remote_info.finalized_root) {
|
||||
self.failed_chains.insert(remote_info.finalized_root);
|
||||
}
|
||||
network.goodbye_peer(peer_id, GoodbyeReason::IrrelevantNetwork);
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE: A peer that has been re-status'd may now exist in multiple finalized chains. This
|
||||
// is OK since we since only one finalized chain at a time.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user