From 8ed149a3f2a94adfc7317a1c6fc43f2ccb829d04 Mon Sep 17 00:00:00 2001 From: Greg Cusack Date: Thu, 21 Dec 2023 14:15:50 -0800 Subject: [PATCH] Add ContactInfo handling for shred versioning (#34286) * handle ContactInfo in places where only LegacyContactInfo was used * missed a spot * missed a spot * import contact info for crds lookup * cargo fmt * rm contactinfo from crds_entry. not supported yet * typo * remove crds.nodes insert for ContactInfo. not supported yet * forgot to remove clusterinfo in remove() * move around contactinfo match arm * remove contactinfo updating crds.shred_version --- gossip/src/cluster_info.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index d79e0ac995..cc539f5abe 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -3080,6 +3080,7 @@ fn filter_on_shred_version( if crds.get_shred_version(from) == Some(self_shred_version) { values.retain(|value| match &value.data { // Allow contact-infos so that shred-versions are updated. + CrdsData::ContactInfo(_) => true, CrdsData::LegacyContactInfo(_) => true, CrdsData::NodeInstance(_) => true, // Only retain values with the same shred version. @@ -3089,6 +3090,7 @@ fn filter_on_shred_version( values.retain(|value| match &value.data { // Allow node to update its own contact info in case their // shred-version changes + CrdsData::ContactInfo(node) => node.pubkey() == from, CrdsData::LegacyContactInfo(node) => node.pubkey() == from, CrdsData::NodeInstance(_) => true, _ => false, @@ -3107,6 +3109,11 @@ fn filter_on_shred_version( { Some(msg) } + CrdsData::ContactInfo(node) + if node.shred_version() == 0 || node.shred_version() == self_shred_version => + { + Some(msg) + } _ => { stats.skip_pull_shred_version.add_relaxed(1); None