Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pkg/transport-discovery/store/redis_bandwidth.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/google/uuid"

"github.com/skycoin/skywire/pkg/cipher"
"github.com/skycoin/skywire/pkg/transport"
)

// Bandwidth key generators
Expand Down Expand Up @@ -122,7 +123,17 @@ func (s *redisStore) UpdateLatency(ctx context.Context, transportID string, minM
// Defense-in-depth alongside the aggregator gate: any non-positive
// field means the snapshot is partial, so reject the whole update
// rather than persist a zero in a single field.
if minMS <= 0 || maxMS <= 0 || avgMS <= 0 {
//
// Upper bound: visors running pre-#2421 binaries don't filter
// straggler-pong outliers (35s+ RTT from a delayed pong) and push
// them via CXO. TPD must reject those at ingest, otherwise the
// 35-day lat:<id> retention pins a bogus Max for weeks regardless
// of how many later good samples land. transport.MaxReasonableRTTMs
// is the same 30s threshold the visor side enforces post-#2421.
if minMS <= 0 || maxMS <= 0 || avgMS <= 0 ||
minMS > transport.MaxReasonableRTTMs ||
maxMS > transport.MaxReasonableRTTMs ||
avgMS > transport.MaxReasonableRTTMs {
return nil
}

Expand Down
Loading