From d0aad5c9e5cdd5482599c1c4df96a93da5f6e7b8 Mon Sep 17 00:00:00 2001 From: sukun Date: Mon, 16 Sep 2024 15:46:14 +0530 Subject: [PATCH] remove bound on number of SignedPeerRecords --- p2p/host/peerstore/pstoremem/addr_book.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/p2p/host/peerstore/pstoremem/addr_book.go b/p2p/host/peerstore/pstoremem/addr_book.go index b37aee83c5..89b87bdb47 100644 --- a/p2p/host/peerstore/pstoremem/addr_book.go +++ b/p2p/host/peerstore/pstoremem/addr_book.go @@ -16,8 +16,6 @@ import ( ma "github.com/multiformats/go-multiaddr" ) -var SignedPeerRecordBound = 100_000 - var log = logging.Logger("peerstore") type expiringAddr struct { @@ -231,8 +229,6 @@ func (mab *memoryAddrBook) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du mab.addAddrs(p, addrs, ttl) } -var ErrTooManyRecords = fmt.Errorf("too many signed peer records. Dropping this one") - // ConsumePeerRecord adds addresses from a signed peer.PeerRecord, which will expire after the given TTL. // See https://godoc.org/github.com/libp2p/go-libp2p/core/peerstore#CertifiedAddrBook for more details. func (mab *memoryAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, ttl time.Duration) (bool, error) { @@ -250,9 +246,6 @@ func (mab *memoryAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, tt mab.mu.Lock() defer mab.mu.Unlock() - if (len(mab.signedPeerRecords)) >= SignedPeerRecordBound { - return false, ErrTooManyRecords - } // ensure seq is greater than or equal to the last received lastState, found := mab.signedPeerRecords[rec.PeerID]