Skip to content

Commit

Permalink
switch to ContactInfo propagation in PullRequests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcusack committed Sep 11, 2024
1 parent f0a77e9 commit 99e76ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
15 changes: 3 additions & 12 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,11 +1605,7 @@ impl ClusterInfo {
.map(|(_, filters)| filters.len())
.sum::<usize>() as u64;
self.stats.new_pull_requests_count.add_relaxed(num_requests);
// TODO: Use new ContactInfo once the cluster has upgraded to:
// https://github.com/anza-xyz/agave/pull/803
let self_info = LegacyContactInfo::try_from(&self.my_contact_info())
.map(CrdsData::LegacyContactInfo)
.expect("Operator must spin up node with valid contact-info");
let self_info = CrdsData::ContactInfo(self.my_contact_info());
let self_info = CrdsValue::new_signed(self_info, &self.keypair());
let pulls = pulls
.into_iter()
Expand Down Expand Up @@ -4386,10 +4382,7 @@ mod tests {
}

fn check_pull_request_size(filter: CrdsFilter) {
// TODO: Use new ContactInfo once the cluster has upgraded to:
// https://github.com/anza-xyz/agave/pull/803
let value =
CrdsValue::new_unsigned(CrdsData::LegacyContactInfo(LegacyContactInfo::default()));
let value = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::default()));
let protocol = Protocol::PullRequest(filter, value);
assert!(serialized_size(&protocol).unwrap() <= PACKET_DATA_SIZE as u64);
}
Expand Down Expand Up @@ -4557,11 +4550,9 @@ mod tests {
fn max_bloom_size() -> usize {
let filter_size = serialized_size(&CrdsFilter::default())
.expect("unable to serialize default filter") as usize;
// TODO: Use new ContactInfo once the cluster has upgraded to:
// https://github.com/anza-xyz/agave/pull/803
let protocol = Protocol::PullRequest(
CrdsFilter::default(),
CrdsValue::new_unsigned(CrdsData::LegacyContactInfo(LegacyContactInfo::default())),
CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::default())),
);
let protocol_size =
serialized_size(&protocol).expect("unable to serialize gossip protocol") as usize;
Expand Down
1 change: 0 additions & 1 deletion local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5738,7 +5738,6 @@ fn test_randomly_mixed_block_verification_methods_between_bootstrap_and_not() {

/// Forks previous marked invalid should be marked as such in fork choice on restart
#[test]
#[ignore]
#[serial]
fn test_invalid_forks_persisted_on_restart() {
solana_logger::setup_with("info,solana_metrics=off,solana_ledger=off");
Expand Down

0 comments on commit 99e76ab

Please sign in to comment.