From d00f709c785c9d31375eda7ee8ef4d55f5ec0c08 Mon Sep 17 00:00:00 2001 From: Ian Suvak Date: Thu, 1 Aug 2024 14:39:22 -0400 Subject: [PATCH 1/2] Remove trackedSubnet check for explicitly named peers in network.Send() --- network/network.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/network/network.go b/network/network.go index 2aee13a910d9..413d23ad0ccd 100644 --- a/network/network.go +++ b/network/network.go @@ -677,10 +677,10 @@ func (n *network) track(ip *ips.ClaimedIPPort) error { // // - [nodeIDs] the IDs of the peers that should be returned if they are // connected. -// - [subnetID] the subnetID whose membership should be considered if -// [validatorOnly] is set to true. -// - [validatorOnly] is the flag to drop any nodes from [nodeIDs] that are not -// validators in [subnetID]. +// - [subnetID] the subnetID whose membership should be considered to +// determine if the node is a validator. +// - [allower] interface that determines if a node is allowed to connect to +// the subnet based on it's validator status. func (n *network) getPeers( nodeIDs set.Set[ids.NodeID], subnetID ids.ID, @@ -697,10 +697,6 @@ func (n *network) getPeers( continue } - if trackedSubnets := peer.TrackedSubnets(); !trackedSubnets.Contains(subnetID) { - continue - } - _, isValidator := n.config.Validators.GetValidator(subnetID, nodeID) // check if the peer is allowed to connect to the subnet if !allower.IsAllowed(nodeID, isValidator) { From aebb1a2d4f73f8467df959c1cb775e4a870f2208 Mon Sep 17 00:00:00 2001 From: Ian Suvak Date: Fri, 2 Aug 2024 09:35:09 -0400 Subject: [PATCH 2/2] Update network/network.go Co-authored-by: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Signed-off-by: Ian Suvak --- network/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/network.go b/network/network.go index c995f284bc25..94993a129d81 100644 --- a/network/network.go +++ b/network/network.go @@ -681,7 +681,7 @@ func (n *network) track(ip *ips.ClaimedIPPort) error { // - [subnetID] the subnetID whose membership should be considered to // determine if the node is a validator. // - [allower] interface that determines if a node is allowed to connect to -// the subnet based on it's validator status. +// the subnet based on its validator status. func (n *network) getPeers( nodeIDs set.Set[ids.NodeID], subnetID ids.ID,