You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Suprisingly call to Peerstore.RemovePeer(...) doesn’t fully remove peer information from Peerstore. And Peerstore.Peers() keeps returning peer ID that was recently removed.
The reason why it’s happening because one should call RemovePeer() and ClearAddrs (method from AddrBook interface). Here is actual implementation of RemovePeer from *pstoremem:
// RemovePeer removes entries associated with a peer from:
// * the KeyBook
// * the ProtoBook
// * the PeerMetadata
// * the Metrics
// It DOES NOT remove the peer from the AddrBook.
func (ps *pstoremem) RemovePeer(p peer.ID) {
ps.memoryKeyBook.RemovePeer(p)
ps.memoryProtoBook.RemovePeer(p)
ps.memoryPeerMetadata.RemovePeer(p)
ps.Metrics.RemovePeer(p)
}
So my question is what was the design decision to keep address, but remove the rest of information for a peer?
What are use-cases for it? thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! Suprisingly call to Peerstore.RemovePeer(...) doesn’t fully remove peer information from Peerstore. And Peerstore.Peers() keeps returning peer ID that was recently removed.
The reason why it’s happening because one should call RemovePeer() and ClearAddrs (method from AddrBook interface). Here is actual implementation of RemovePeer from
*pstoremem
:So my question is what was the design decision to keep address, but remove the rest of information for a peer?
What are use-cases for it? thanks
Beta Was this translation helpful? Give feedback.
All reactions