From e26c40a6d94b131a8f844aaf99b599bc9103ccff Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Sat, 20 Dec 2025 07:44:40 -0600 Subject: [PATCH] experiment: reject bad peer info messages --- node/consensus/app/message_validation.go | 4 ++-- node/consensus/global/message_validation.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/consensus/app/message_validation.go b/node/consensus/app/message_validation.go index ed1e3a9..35c8e53 100644 --- a/node/consensus/app/message_validation.go +++ b/node/consensus/app/message_validation.go @@ -476,7 +476,7 @@ func (e *AppConsensusEngine) validatePeerInfoMessage( zap.Int64("peer_timestamp", peerInfo.Timestamp), zap.Int64("cutoff", oneMinuteAgo), ) - return p2p.ValidationResultIgnore + return p2p.ValidationResultReject } if peerInfo.Timestamp > fiveMinutesLater { @@ -501,7 +501,7 @@ func (e *AppConsensusEngine) validatePeerInfoMessage( now := time.Now().UnixMilli() if int64(keyRegistry.LastUpdated) < now-1000 { e.logger.Debug("key registry timestamp too old") - return p2p.ValidationResultIgnore + return p2p.ValidationResultReject } if int64(keyRegistry.LastUpdated) > now+5000 { e.logger.Debug("key registry timestamp too far in future") diff --git a/node/consensus/global/message_validation.go b/node/consensus/global/message_validation.go index 0844d5d..3108c0d 100644 --- a/node/consensus/global/message_validation.go +++ b/node/consensus/global/message_validation.go @@ -523,7 +523,7 @@ func (e *GlobalConsensusEngine) validatePeerInfoMessage( e.logger.Debug("peer info timestamp too old", zap.Int64("peer_timestamp", peerInfo.Timestamp), ) - return tp2p.ValidationResultIgnore + return tp2p.ValidationResultReject } if peerInfo.Timestamp > now+5000 { @@ -549,7 +549,7 @@ func (e *GlobalConsensusEngine) validatePeerInfoMessage( if int64(keyRegistry.LastUpdated) < now-1000 { e.logger.Debug("key registry timestamp too old") - return tp2p.ValidationResultIgnore + return tp2p.ValidationResultReject } if int64(keyRegistry.LastUpdated) > now+5000 {