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
This commit is contained in:
Greg Cusack 2023-12-21 14:15:50 -08:00 committed by GitHub
parent a583035812
commit 8ed149a3f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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