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
20 changes: 20 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ bytes = "1.10.0"
bincode = "1.3.3"
solana-entry = "2"
solana-pubkey = "2"
solana-sdk = "=2.2.1"

# UDP shred reconstruction dependencies
solana-ledger = { git = "https://github.com/jito-foundation/jito-solana.git", branch = "eric/v2.2-merkle-recovery" }
solana-perf = "=2.2.1"
solana-streamer = "=2.2.1"
solana-net-utils = "=2.2.1"
solana-metrics = "=2.2.1"
ahash = "0.8"
itertools = "0.14.0"
crossbeam-channel = "0.5.8"
rand = "0.8"
socket2 = "0.5"
tikv-jemallocator = "0.6"
lazy_static = "1.5.0"
dashmap = "6"
comfy-table = "7.1.0"
Expand All @@ -37,3 +51,9 @@ thorstreamer-grpc-client = "0.1.3"
[build-dependencies]
tonic-prost-build = "0.14"
protoc-bin-vendored = "3"

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
18 changes: 16 additions & 2 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,17 @@ impl BackendConfigPayload {

impl BackendEndpointPayload {
fn from_endpoint(endpoint: &Endpoint, provided_ip: Option<String>) -> Self {
let (kind_str, url) = match endpoint.kind {
// Backend doesn't know UDP variant: map kind and wrap bare socket addr as URL
crate::config::EndpointKind::UdpShredstream => {
("shredstream", format!("udp://{}", endpoint.url))
}
_ => (endpoint.kind.as_str(), endpoint.url.clone()),
};
Self {
name: endpoint.name.clone(),
url: endpoint.url.clone(),
kind: Some(endpoint.kind.as_str().to_string()),
url,
kind: Some(kind_str.to_string()),
resolved_ip: provided_ip,
}
}
Expand All @@ -577,6 +584,13 @@ async fn build_endpoint_payloads(endpoints: &[Endpoint]) -> Vec<BackendEndpointP
}

async fn resolve_endpoint_ip(endpoint: &Endpoint) -> Option<String> {
// UDP endpoints use bare socket addresses (e.g. "127.0.0.1:8001"), not URLs
if matches!(endpoint.kind, crate::config::EndpointKind::UdpShredstream) {
return endpoint.url.parse::<std::net::SocketAddr>()
.ok()
.map(|addr| addr.ip().to_string());
}

let parsed = match Url::parse(&endpoint.url) {
Ok(url) => url,
Err(err) => {
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ pub enum EndpointKind {
Shredstream,
Shreder,
Jetstream,
#[serde(alias = "udpshredstream")]
UdpShredstream,
}

#[derive(Debug, Clone, Copy, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -88,6 +90,7 @@ impl EndpointKind {
EndpointKind::Shredstream => "shredstream",
EndpointKind::Shreder => "shreder",
EndpointKind::Jetstream => "jetstream",
EndpointKind::UdpShredstream => "udpshredstream",
}
}
}
Expand Down
Loading