Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 2964e14

Browse files
committed
adds QUIC endpoint specific for turbine connections
Working towards separating out turbine QUIC from TPU.
1 parent 09debae commit 2964e14

File tree

8 files changed

+472
-8
lines changed

8 files changed

+472
-8
lines changed

Cargo.lock

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

programs/sbf/Cargo.lock

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quic-client/src/nonblocking/quic_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use {
3838
tokio::{sync::OnceCell, time::timeout},
3939
};
4040

41-
struct SkipServerVerification;
41+
pub struct SkipServerVerification;
4242

4343
impl SkipServerVerification {
4444
pub fn new() -> Arc<Self> {

streamer/src/nonblocking/quic.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,22 @@ fn prune_unstaked_connection_table(
190190
}
191191
}
192192

193-
fn get_connection_stake(
194-
connection: &Connection,
195-
staked_nodes: &RwLock<StakedNodes>,
196-
) -> Option<(Pubkey, u64, u64, u64, u64)> {
193+
pub fn get_remote_pubkey(connection: &Connection) -> Option<Pubkey> {
197194
// Use the client cert only if it is self signed and the chain length is 1.
198-
let pubkey = connection
195+
connection
199196
.peer_identity()?
200197
.downcast::<Vec<rustls::Certificate>>()
201198
.ok()
202199
.filter(|certs| certs.len() == 1)?
203200
.first()
204-
.and_then(get_pubkey_from_tls_certificate)?;
201+
.and_then(get_pubkey_from_tls_certificate)
202+
}
203+
204+
fn get_connection_stake(
205+
connection: &Connection,
206+
staked_nodes: &RwLock<StakedNodes>,
207+
) -> Option<(Pubkey, u64, u64, u64, u64)> {
208+
let pubkey = get_remote_pubkey(connection)?;
205209
debug!("Peer public key is {pubkey:?}");
206210
let staked_nodes = staked_nodes.read().unwrap();
207211
Some((

streamer/src/quic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use {
2828
pub const MAX_STAKED_CONNECTIONS: usize = 2000;
2929
pub const MAX_UNSTAKED_CONNECTIONS: usize = 500;
3030

31-
struct SkipClientVerification;
31+
pub struct SkipClientVerification;
3232

3333
impl SkipClientVerification {
3434
pub fn new() -> Arc<Self> {

turbine/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ edition = { workspace = true }
1111

1212
[dependencies]
1313
bincode = { workspace = true }
14+
bytes = { workspace = true }
1415
crossbeam-channel = { workspace = true }
16+
futures = { workspace = true }
1517
itertools = { workspace = true }
1618
log = { workspace = true }
1719
lru = { workspace = true }
20+
quinn = { workspace = true }
1821
rand = { workspace = true }
1922
rand_chacha = { workspace = true }
2023
rayon = { workspace = true }
24+
rcgen = { workspace = true }
25+
rustls = { workspace = true }
2126
solana-client = { workspace = true }
2227
solana-entry = { workspace = true }
2328
solana-gossip = { workspace = true }
@@ -34,6 +39,7 @@ solana-runtime = { workspace = true }
3439
solana-sdk = { workspace = true }
3540
solana-streamer = { workspace = true }
3641
thiserror = { workspace = true }
42+
tokio = { workspace = true }
3743

3844
[dev-dependencies]
3945
matches = { workspace = true }

turbine/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
pub mod broadcast_stage;
44
pub mod cluster_nodes;
5+
pub mod quic_endpoint;
56
pub mod retransmit_stage;
67
pub mod sigverify_shreds;
78

0 commit comments

Comments
 (0)