mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Don't penalize peers if locally constructed light client data is stale (#7996)
#7994 We seem to be penalizing peers in situations where locally constructed light client data is stale. This PR ignores incoming light client data if our locally constructed light client data isn't up to date. Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -116,7 +116,13 @@ impl<T: BeaconChainTypes> VerifiedLightClientFinalityUpdate<T> {
|
||||
// Verify that the gossiped finality update is the same as the locally constructed one.
|
||||
if latest_finality_update != rcv_finality_update {
|
||||
let signature_slot = latest_finality_update.signature_slot();
|
||||
|
||||
if signature_slot != rcv_finality_update.signature_slot() {
|
||||
// The locally constructed finality update is not up to date, probably
|
||||
// because the node has fallen behind and needs to sync.
|
||||
if rcv_finality_update.signature_slot() > signature_slot {
|
||||
return Err(Error::Ignore);
|
||||
}
|
||||
return Err(Error::MismatchedSignatureSlot {
|
||||
local: signature_slot,
|
||||
observed: rcv_finality_update.signature_slot(),
|
||||
|
||||
@@ -118,6 +118,11 @@ impl<T: BeaconChainTypes> VerifiedLightClientOptimisticUpdate<T> {
|
||||
if latest_optimistic_update != rcv_optimistic_update {
|
||||
let signature_slot = latest_optimistic_update.signature_slot();
|
||||
if signature_slot != rcv_optimistic_update.signature_slot() {
|
||||
// The locally constructed optimistic update is not up to date, probably
|
||||
// because the node has fallen behind and needs to sync.
|
||||
if rcv_optimistic_update.signature_slot() > signature_slot {
|
||||
return Err(Error::Ignore);
|
||||
}
|
||||
return Err(Error::MismatchedSignatureSlot {
|
||||
local: signature_slot,
|
||||
observed: rcv_optimistic_update.signature_slot(),
|
||||
|
||||
Reference in New Issue
Block a user