Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 11 additions & 24 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ use {
solana_turbine::{
self,
broadcast_stage::BroadcastStageType,
xdp::{master_ip_if_bonded, XdpConfig, XdpRetransmitter},
xdp::{XdpRetransmitBuilder, XdpRetransmitter},
},
solana_unified_scheduler_logic::SchedulingMode,
solana_unified_scheduler_pool::{DefaultSchedulerPool, SupportedSchedulingMode},
Expand All @@ -151,7 +151,7 @@ use {
std::{
borrow::Cow,
collections::{HashMap, HashSet},
net::{IpAddr, SocketAddr},
net::SocketAddr,
num::{NonZeroU64, NonZeroUsize},
path::{Path, PathBuf},
str::FromStr,
Expand Down Expand Up @@ -412,7 +412,6 @@ pub struct ValidatorConfig {
pub replay_transactions_threads: NonZeroUsize,
pub tvu_shred_sigverify_threads: NonZeroUsize,
pub delay_leader_block_for_pending_fork: bool,
pub retransmit_xdp: Option<XdpConfig>,
pub repair_handler_type: RepairHandlerType,
}

Expand Down Expand Up @@ -494,7 +493,6 @@ impl ValidatorConfig {
tvu_shred_sigverify_threads: NonZeroUsize::new(get_thread_count())
.expect("thread count is non-zero"),
delay_leader_block_for_pending_fork: false,
retransmit_xdp: None,
repair_handler_type: RepairHandlerType::default(),
}
}
Expand Down Expand Up @@ -701,6 +699,7 @@ impl Validator {
socket_addr_space: SocketAddrSpace,
tpu_config: ValidatorTpuConfig,
admin_rpc_service_post_init: Arc<RwLock<Option<AdminRpcRequestMetadataPostInit>>>,
maybe_xdp_retransmit_builder: Option<XdpRetransmitBuilder>,
) -> Result<Self> {
#[cfg(debug_assertions)]
const DEBUG_ASSERTION_STATUS: &str = "enabled";
Expand Down Expand Up @@ -1543,27 +1542,13 @@ impl Validator {
)
});

let (xdp_retransmitter, xdp_sender) = if let Some(xdp_config) =
config.retransmit_xdp.clone()
{
let src_port = node.sockets.retransmit_sockets[0]
.local_addr()
.expect("failed to get local address")
.port();
let src_ip = match node.bind_ip_addrs.active() {
IpAddr::V4(ip) if !ip.is_unspecified() => Some(ip),
IpAddr::V4(_unspecified) => xdp_config
.interface
.as_ref()
.and_then(|iface| master_ip_if_bonded(iface)),
_ => panic!("IPv6 not supported"),
let (xdp_retransmitter, xdp_sender) =
if let Some(xdp_retransmit_builder) = maybe_xdp_retransmit_builder {
let (rtx, sender) = xdp_retransmit_builder.build(exit.clone());
(Some(rtx), Some(sender))
} else {
(None, None)
};
let (rtx, sender) = XdpRetransmitter::new(xdp_config, src_port, src_ip, exit.clone())
.expect("failed to create xdp retransmitter");
(Some(rtx), Some(sender))
} else {
(None, None)
};

// disable all2all tests if not allowed for a given cluster type
let alpenglow_socket = if genesis_config.cluster_type == ClusterType::Testnet
Expand Down Expand Up @@ -2967,6 +2952,7 @@ mod tests {
SocketAddrSpace::Unspecified,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.expect("assume successful validator start");
assert_eq!(
Expand Down Expand Up @@ -3181,6 +3167,7 @@ mod tests {
SocketAddrSpace::Unspecified,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.expect("assume successful validator start")
})
Expand Down
2 changes: 1 addition & 1 deletion dev-bins/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions local-cluster/src/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ impl LocalCluster {
// to use the same QUIC ports due to SO_REUSEPORT.
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.expect("assume successful validator start");

Expand Down Expand Up @@ -636,6 +637,7 @@ impl LocalCluster {
socket_addr_space,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.expect("assume successful validator start");

Expand Down Expand Up @@ -702,6 +704,7 @@ impl LocalCluster {
socket_addr_space,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.unwrap_or_else(|e| panic!("Cluster leader failed to start: {e:?}"));

Expand Down Expand Up @@ -768,6 +771,7 @@ impl LocalCluster {
socket_addr_space,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.unwrap_or_else(|e| panic!("Validator {i} failed to start: {e:?}"));

Expand Down Expand Up @@ -1321,6 +1325,7 @@ impl Cluster for LocalCluster {
socket_addr_space,
ValidatorTpuConfig::new_for_tests(),
Arc::new(RwLock::new(None)),
None,
)
.expect("assume successful validator start");
cluster_validator_info.validator = Some(restarted_node);
Expand Down
1 change: 0 additions & 1 deletion local-cluster/src/validator_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
replay_transactions_threads: config.replay_transactions_threads,
tvu_shred_sigverify_threads: config.tvu_shred_sigverify_threads,
delay_leader_block_for_pending_fork: config.delay_leader_block_for_pending_fork,
retransmit_xdp: config.retransmit_xdp.clone(),
repair_handler_type: config.repair_handler_type.clone(),
}
}
Expand Down
3 changes: 2 additions & 1 deletion programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ impl TestValidator {
socket_addr_space,
ValidatorTpuConfig::new_for_tests(),
config.admin_rpc_service_post_init.clone(),
None,
)?);

let test_validator = TestValidator {
Expand Down
1 change: 1 addition & 0 deletions turbine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ thiserror = { workspace = true }
wincode = { workspace = true }

[target.'cfg(target_os = "linux")'.dependencies]
aya = { workspace = true }
caps = { workspace = true }

[dev-dependencies]
Expand Down
Loading
Loading