Skip to content

Commit

Permalink
renames ContactInfo to LegacyContactInfo (solana-labs#29566)
Browse files Browse the repository at this point in the history
Working towards adding a new ContactInfo where new sockets can be
added in a backward compatible way.
  • Loading branch information
behzadnouri authored Jan 8, 2023
1 parent aa3aa5c commit 8c212f5
Show file tree
Hide file tree
Showing 44 changed files with 281 additions and 273 deletions.
2 changes: 1 addition & 1 deletion core/benches/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
},
solana_gossip::{
cluster_info::{ClusterInfo, Node},
contact_info::ContactInfo,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
genesis_utils::{create_genesis_config, GenesisConfigInfo},
Expand Down
2 changes: 1 addition & 1 deletion core/benches/cluster_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use {
cluster_nodes::{make_test_cluster, new_cluster_nodes, ClusterNodes},
retransmit_stage::RetransmitStage,
},
solana_gossip::contact_info::ContactInfo,
solana_gossip::legacy_contact_info::LegacyContactInfo as ContactInfo,
solana_ledger::{
genesis_utils::{create_genesis_config, GenesisConfigInfo},
shred::{Shred, ShredFlags},
Expand Down
2 changes: 1 addition & 1 deletion core/benches/retransmit_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
solana_entry::entry::Entry,
solana_gossip::{
cluster_info::{ClusterInfo, Node},
contact_info::ContactInfo,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
genesis_utils::{create_genesis_config, GenesisConfigInfo},
Expand Down
5 changes: 4 additions & 1 deletion core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ mod tests {
use {
super::*,
rand::seq::SliceRandom,
solana_gossip::{cluster_info::make_accounts_hashes_message, contact_info::ContactInfo},
solana_gossip::{
cluster_info::make_accounts_hashes_message,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_sdk::{
hash::hash,
signature::{Keypair, Signer},
Expand Down
2 changes: 1 addition & 1 deletion core/src/ancestor_hashes_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ mod test {
},
solana_gossip::{
cluster_info::{ClusterInfo, Node},
contact_info::ContactInfo,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{blockstore::make_many_slot_entries, get_tmp_ledger_path, shred::Nonce},
solana_runtime::{accounts_background_service::AbsRequestSender, bank_forks::BankForks},
Expand Down
6 changes: 4 additions & 2 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ use {
itertools::Itertools,
solana_client::{connection_cache::ConnectionCache, tpu_connection::TpuConnection},
solana_entry::entry::hash_transactions,
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
solana_gossip::{
cluster_info::ClusterInfo, legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
blockstore_processor::TransactionStatusSender, token_balances::collect_token_balances,
},
Expand Down Expand Up @@ -1964,7 +1966,7 @@ mod tests {
crossbeam_channel::{unbounded, Receiver},
solana_address_lookup_table_program::state::{AddressLookupTable, LookupTableMeta},
solana_entry::entry::{next_entry, next_versioned_entry, Entry, EntrySlice},
solana_gossip::{cluster_info::Node, contact_info::ContactInfo},
solana_gossip::cluster_info::Node,
solana_ledger::{
blockstore::{entries_to_test_shreds, Blockstore},
genesis_utils::{create_genesis_config, GenesisConfigInfo},
Expand Down
2 changes: 1 addition & 1 deletion core/src/broadcast_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use {
itertools::Itertools,
solana_gossip::{
cluster_info::{ClusterInfo, ClusterInfoError},
contact_info::ContactInfo,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{blockstore::Blockstore, shred::Shred},
solana_measure::measure::Measure,
Expand Down
2 changes: 1 addition & 1 deletion core/src/broadcast_stage/broadcast_duplicates_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use {
crate::cluster_nodes::ClusterNodesCache,
itertools::Itertools,
solana_entry::entry::Entry,
solana_gossip::contact_info::ContactInfo,
solana_gossip::legacy_contact_info::LegacyContactInfo as ContactInfo,
solana_ledger::shred::{ProcessShredsStats, ReedSolomonCache, Shredder},
solana_sdk::{
hash::Hash,
Expand Down
2 changes: 1 addition & 1 deletion core/src/broadcast_stage/broadcast_fake_shreds_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl BroadcastRun for BroadcastFakeShredsRun {
mod tests {
use {
super::*,
solana_gossip::contact_info::ContactInfo,
solana_gossip::legacy_contact_info::LegacyContactInfo as ContactInfo,
solana_streamer::socket::SocketAddrSpace,
std::net::{IpAddr, Ipv4Addr, SocketAddr},
};
Expand Down
4 changes: 2 additions & 2 deletions core/src/cluster_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use {
rand_chacha::ChaChaRng,
solana_gossip::{
cluster_info::{compute_retransmit_peers, ClusterInfo, DATA_PLANE_FANOUT},
contact_info::ContactInfo,
crds::GossipRoute,
crds_gossip_pull::CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS,
crds_value::{CrdsData, CrdsValue},
legacy_contact_info::LegacyContactInfo as ContactInfo,
weighted_shuffle::WeightedShuffle,
},
solana_ledger::shred::ShredId,
Expand Down Expand Up @@ -475,7 +475,7 @@ pub fn make_test_cluster<R: Rng>(
let mut gossip_crds = cluster_info.gossip.crds.write().unwrap();
// First node is pushed to crds table by ClusterInfo constructor.
for node in nodes.iter().skip(1) {
let node = CrdsData::ContactInfo(node.clone());
let node = CrdsData::LegacyContactInfo(node.clone());
let node = CrdsValue::new_unsigned(node);
assert_eq!(
gossip_crds.insert(node, now, GossipRoute::LocalMessage),
Expand Down
3 changes: 2 additions & 1 deletion core/src/cluster_slots.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use {
itertools::Itertools,
solana_gossip::{
cluster_info::ClusterInfo, contact_info::ContactInfo, crds::Cursor, epoch_slots::EpochSlots,
cluster_info::ClusterInfo, crds::Cursor, epoch_slots::EpochSlots,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_runtime::{bank::Bank, epoch_stakes::NodeIdToVoteAccounts},
solana_sdk::{
Expand Down
4 changes: 3 additions & 1 deletion core/src/repair_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,9 @@ impl RepairService {
mod test {
use {
super::*,
solana_gossip::{cluster_info::Node, contact_info::ContactInfo},
solana_gossip::{
cluster_info::Node, legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
blockstore::{
make_chaining_slot_entries, make_many_slot_entries, make_slot_entries, Blockstore,
Expand Down
4 changes: 3 additions & 1 deletion core/src/retransmit_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use {
itertools::{izip, Itertools},
lru::LruCache,
rayon::{prelude::*, ThreadPool, ThreadPoolBuilder},
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
solana_gossip::{
cluster_info::ClusterInfo, legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
leader_schedule_cache::LeaderScheduleCache,
shred::{self, ShredId},
Expand Down
16 changes: 8 additions & 8 deletions core/src/serve_repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use {
},
solana_gossip::{
cluster_info::{ClusterInfo, ClusterInfoError},
contact_info::ContactInfo,
legacy_contact_info::{LegacyContactInfo as ContactInfo, LegacyContactInfo},
ping_pong::{self, PingCache, Pong},
weighted_shuffle::WeightedShuffle,
},
Expand Down Expand Up @@ -208,13 +208,13 @@ pub(crate) type Ping = ping_pong::Ping<[u8; REPAIR_PING_TOKEN_SIZE]>;
/// Window protocol messages
#[derive(Serialize, Deserialize, Debug)]
pub enum RepairProtocol {
LegacyWindowIndex(ContactInfo, Slot, u64),
LegacyHighestWindowIndex(ContactInfo, Slot, u64),
LegacyOrphan(ContactInfo, Slot),
LegacyWindowIndexWithNonce(ContactInfo, Slot, u64, Nonce),
LegacyHighestWindowIndexWithNonce(ContactInfo, Slot, u64, Nonce),
LegacyOrphanWithNonce(ContactInfo, Slot, Nonce),
LegacyAncestorHashes(ContactInfo, Slot, Nonce),
LegacyWindowIndex(LegacyContactInfo, Slot, u64),
LegacyHighestWindowIndex(LegacyContactInfo, Slot, u64),
LegacyOrphan(LegacyContactInfo, Slot),
LegacyWindowIndexWithNonce(LegacyContactInfo, Slot, u64, Nonce),
LegacyHighestWindowIndexWithNonce(LegacyContactInfo, Slot, u64, Nonce),
LegacyOrphanWithNonce(LegacyContactInfo, Slot, Nonce),
LegacyAncestorHashes(LegacyContactInfo, Slot, Nonce),
Pong(ping_pong::Pong),
WindowIndex {
header: RepairRequestHeader,
Expand Down
2 changes: 1 addition & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ use {
ClusterInfo, Node, DEFAULT_CONTACT_DEBUG_INTERVAL_MILLIS,
DEFAULT_CONTACT_SAVE_INTERVAL_MILLIS,
},
contact_info::ContactInfo,
crds_gossip_pull::CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS,
gossip_service::GossipService,
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_ledger::{
bank_forks_utils,
Expand Down
2 changes: 1 addition & 1 deletion core/src/window_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ mod test {
use {
super::*,
solana_entry::entry::{create_ticks, Entry},
solana_gossip::contact_info::ContactInfo,
solana_gossip::legacy_contact_info::LegacyContactInfo as ContactInfo,
solana_ledger::{
blockstore::{make_many_slot_entries, Blockstore},
get_tmp_ledger_path,
Expand Down
4 changes: 3 additions & 1 deletion core/tests/epoch_accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use {
accounts_hash_verifier::AccountsHashVerifier,
snapshot_packager_service::SnapshotPackagerService,
},
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
solana_gossip::{
cluster_info::ClusterInfo, legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_runtime::{
accounts_background_service::{
AbsRequestHandlers, AbsRequestSender, AccountsBackgroundService, DroppedSlotsReceiver,
Expand Down
4 changes: 3 additions & 1 deletion core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use {
accounts_hash_verifier::AccountsHashVerifier,
snapshot_packager_service::SnapshotPackagerService,
},
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
solana_gossip::{
cluster_info::ClusterInfo, legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_runtime::{
accounts_background_service::{
AbsRequestHandlers, AbsRequestSender, AccountsBackgroundService,
Expand Down
2 changes: 1 addition & 1 deletion dos/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ use {
solana_core::serve_repair::{RepairProtocol, RepairRequestHeader, ServeRepair},
solana_dos::cli::*,
solana_gossip::{
contact_info::ContactInfo,
gossip_service::{discover, get_multi_client},
legacy_contact_info::LegacyContactInfo as ContactInfo,
},
solana_measure::measure::Measure,
solana_rpc_client::rpc_client::RpcClient,
Expand Down
Loading

0 comments on commit 8c212f5

Please sign in to comment.