Skip to content

Commit

Permalink
Add ContactInfo handling for shred versioning (solana-labs#34286)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gregcusack authored Dec 21, 2023
1 parent a583035 commit 8ed149a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 8ed149a

Please sign in to comment.