* adds validator flag to allow private ip addresses (#18850)
(cherry picked from commit d2d5f36a3c
)
# Conflicts:
# accounts-cluster-bench/Cargo.toml
# bench-tps/Cargo.toml
# cli/Cargo.toml
# core/benches/cluster_info.rs
# core/src/banking_stage.rs
# core/src/broadcast_stage.rs
# core/src/broadcast_stage/broadcast_duplicates_run.rs
# core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
# core/src/broadcast_stage/standard_broadcast_run.rs
# core/src/cluster_slots_service.rs
# core/src/repair_service.rs
# core/src/tvu.rs
# core/src/validator.rs
# dos/Cargo.toml
# gossip/src/cluster_info.rs
# gossip/src/crds_gossip_pull.rs
# gossip/src/crds_gossip_push.rs
# gossip/src/gossip_service.rs
# local-cluster/Cargo.toml
# local-cluster/src/cluster_tests.rs
# local-cluster/tests/local_cluster.rs
# rpc/Cargo.toml
# rpc/src/rpc.rs
# tokens/Cargo.toml
# validator/Cargo.toml
# validator/src/main.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
@@ -70,6 +70,7 @@ use solana_sdk::{
|
||||
signature::{Keypair, Signer},
|
||||
timing::timestamp,
|
||||
};
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use solana_vote_program::vote_state::VoteState;
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
@@ -273,6 +274,7 @@ pub(crate) fn abort() -> ! {
|
||||
}
|
||||
|
||||
impl Validator {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
mut node: Node,
|
||||
identity_keypair: &Arc<Keypair>,
|
||||
@@ -283,6 +285,7 @@ impl Validator {
|
||||
config: &ValidatorConfig,
|
||||
should_check_duplicate_instance: bool,
|
||||
start_progress: Arc<RwLock<ValidatorStartProgress>>,
|
||||
socket_addr_space: SocketAddrSpace,
|
||||
) -> Self {
|
||||
let id = identity_keypair.pubkey();
|
||||
assert_eq!(id, node.info.id);
|
||||
@@ -433,7 +436,11 @@ impl Validator {
|
||||
}
|
||||
}
|
||||
|
||||
let mut cluster_info = ClusterInfo::new(node.info.clone(), identity_keypair.clone());
|
||||
let mut cluster_info = ClusterInfo::new(
|
||||
node.info.clone(),
|
||||
identity_keypair.clone(),
|
||||
socket_addr_space,
|
||||
);
|
||||
cluster_info.set_contact_debug_interval(config.contact_debug_interval);
|
||||
cluster_info.set_entrypoints(cluster_entrypoints);
|
||||
cluster_info.restore_contact_info(ledger_path, config.contact_save_interval);
|
||||
@@ -506,10 +513,16 @@ impl Validator {
|
||||
optimistically_confirmed_bank_tracker,
|
||||
bank_notification_sender,
|
||||
) = if let Some((rpc_addr, rpc_pubsub_addr)) = config.rpc_addrs {
|
||||
if ContactInfo::is_valid_address(&node.info.rpc) {
|
||||
assert!(ContactInfo::is_valid_address(&node.info.rpc_pubsub));
|
||||
if ContactInfo::is_valid_address(&node.info.rpc, &socket_addr_space) {
|
||||
assert!(ContactInfo::is_valid_address(
|
||||
&node.info.rpc_pubsub,
|
||||
&socket_addr_space
|
||||
));
|
||||
} else {
|
||||
assert!(!ContactInfo::is_valid_address(&node.info.rpc_pubsub));
|
||||
assert!(!ContactInfo::is_valid_address(
|
||||
&node.info.rpc_pubsub,
|
||||
&socket_addr_space
|
||||
));
|
||||
}
|
||||
let (bank_notification_sender, bank_notification_receiver) = unbounded();
|
||||
(
|
||||
@@ -590,6 +603,7 @@ impl Validator {
|
||||
&serve_repair,
|
||||
Some(blockstore.clone()),
|
||||
node.sockets.serve_repair,
|
||||
socket_addr_space,
|
||||
&exit,
|
||||
);
|
||||
|
||||
@@ -1591,6 +1605,7 @@ mod tests {
|
||||
&config,
|
||||
true, // should_check_duplicate_instance
|
||||
start_progress.clone(),
|
||||
SocketAddrSpace::Unspecified,
|
||||
);
|
||||
assert_eq!(
|
||||
*start_progress.read().unwrap(),
|
||||
@@ -1669,6 +1684,7 @@ mod tests {
|
||||
&config,
|
||||
true, // should_check_duplicate_instance
|
||||
Arc::new(RwLock::new(ValidatorStartProgress::default())),
|
||||
SocketAddrSpace::Unspecified,
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
@@ -1694,6 +1710,7 @@ mod tests {
|
||||
let cluster_info = ClusterInfo::new(
|
||||
ContactInfo::new_localhost(&node_keypair.pubkey(), timestamp()),
|
||||
node_keypair,
|
||||
SocketAddrSpace::Unspecified,
|
||||
);
|
||||
|
||||
let (genesis_config, _mint_keypair) = create_genesis_config(1);
|
||||
|
Reference in New Issue
Block a user