Skip to content

Commit

Permalink
Adds protobuf-compiler to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mango-dee committed Dec 9, 2024
1 parent f88ac48 commit 9dce552
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Linux Packages
run: |
sudo apt-get update -y
sudo apt-get install libssl-dev openssl -y
sudo apt-get install libssl-dev openssl protobuf-compiler -y
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Linux Packages
run: |
sudo apt-get update -y
sudo apt-get install libssl-dev openssl -y
sudo apt-get install libssl-dev openssl protobuf-compiler -y
- uses: actions/checkout@v4

Expand Down
21 changes: 5 additions & 16 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jemallocator = "0.5"
quinn = "0.10.2"
quinn-proto = "0.10.5"
rustls = { version = "0.21.7", default-features = false, features = ["quic"] }
rcgen = "0.13.1"
rcgen = "0.9.3"

solana-lite-rpc-services = {path = "services", version="0.2.4"}
solana-lite-rpc-core = {path = "core", version="0.2.4"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ use solana_streamer::nonblocking::quic::{ConnectionPeerType, SpawnNonBlockingSer
use solana_streamer::packet::PacketBatch;
use solana_streamer::quic::StreamStats;
use solana_streamer::streamer::StakedNodes;
use solana_streamer::tls_certificates::new_self_signed_tls_certificate;
use std::collections::{HashMap, HashSet};
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
use std::net::{Ipv4Addr, SocketAddr, UdpSocket};

Check warning on line 23 in quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs

Check warning on line 23 in quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

unused import: `Ipv4Addr`

use itertools::Itertools;
use std::str::FromStr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, RwLock};
use std::thread;

Check warning on line 29 in quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs
use std::time::{Duration, Instant};
use solana_streamer::tls_certificates::new_dummy_x509_certificate;
use tokio::runtime::Builder;

use tokio::task::{yield_now, JoinHandle};
Expand Down Expand Up @@ -423,20 +423,19 @@ async fn solana_quic_streamer_start() {
// keypair to derive the server tls certificate
let keypair = Keypair::new();
// gossip_host is used in the server certificate
let gossip_host = "127.0.0.1".parse().unwrap();
let SpawnNonBlockingServerResult { stats, thread, .. } =
solana_streamer::nonblocking::quic::spawn_server(
"test-quic-server",
sock.try_clone().unwrap(),
&keypair,
gossip_host,
sender,
exit.clone(),
1,
staked_nodes,
10,
10,
9999, // max_streams_per_ms
10,
Duration::from_millis(1000),
Duration::from_millis(1000),
)
Expand Down Expand Up @@ -467,11 +466,7 @@ async fn start_literpc_client_direct_mode(
// (String, Vec<u8>) (signature, transaction)
let (sender, _) = tokio::sync::broadcast::channel(MAXIMUM_TRANSACTIONS_IN_QUEUE);
let broadcast_sender = Arc::new(sender);
let (certificate, key) = new_self_signed_tls_certificate(
literpc_validator_identity.as_ref(),
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
)
.expect("Failed to initialize QUIC connection certificates");
let (certificate, key) = new_dummy_x509_certificate(literpc_validator_identity.as_ref());

let tpu_connection_manager =
TpuConnectionManager::new(certificate, key, fanout_slots as usize).await;
Expand Down Expand Up @@ -568,11 +563,7 @@ async fn start_literpc_client_proxy_mode(
// (String, Vec<u8>) (signature, transaction)
let (sender, _) = tokio::sync::broadcast::channel(MAXIMUM_TRANSACTIONS_IN_QUEUE);
let broadcast_sender = Arc::new(sender);
let (certificate, key) = new_self_signed_tls_certificate(
validator_identity.as_ref(),
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
)
.expect("Failed to initialize QUIC connection certificates");
let (certificate, key) = new_dummy_x509_certificate(validator_identity.as_ref());

let quic_proxy_connection_manager =
QuicProxyConnectionManager::new(certificate, key, forward_proxy_address).await;
Expand Down Expand Up @@ -707,21 +698,20 @@ impl SolanaQuicStreamer {
let exit = Arc::new(AtomicBool::new(false));
// keypair to derive the server tls certificate
let keypair = Keypair::new();
// gossip_host is used in the server certificate
let gossip_host = "127.0.0.1".parse().unwrap();

let SpawnNonBlockingServerResult { stats, thread, .. } =
solana_streamer::nonblocking::quic::spawn_server(
"test-quic-server",
udp_socket.try_clone().unwrap(),
&keypair,
gossip_host,
sender,
exit.clone(),
MAX_QUIC_CONNECTIONS_PER_PEER,
staked_nodes,
10,
10,
9999, // max_streams_per_ms
10,
Duration::from_millis(1000),
Duration::from_millis(1000),
)
Expand Down
9 changes: 3 additions & 6 deletions quic-forward-proxy/src/outbound/tx_forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use quinn::{
use solana_lite_rpc_core::network_utils::apply_gso_workaround;
use solana_sdk::quic::QUIC_MAX_TIMEOUT;
use solana_streamer::nonblocking::quic::ALPN_TPU_PROTOCOL_ID;
use solana_streamer::tls_certificates::new_self_signed_tls_certificate;
use solana_streamer::tls_certificates::new_dummy_x509_certificate;
use std::collections::HashMap;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::sync::atomic::{AtomicBool, Ordering};
Expand Down Expand Up @@ -267,11 +267,8 @@ async fn new_endpoint_with_validator_identity(validator_identity: ValidatorIdent
validator_identity
);
// the counterpart of this function is get_remote_pubkey+get_pubkey_from_tls_certificate
let (certificate, key) = new_self_signed_tls_certificate(
&validator_identity.get_keypair_for_tls(),
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
)
.expect("Failed to initialize QUIC connection certificates");
let (certificate, key) =
new_dummy_x509_certificate(validator_identity.get_keypair_for_tls().as_ref());

create_tpu_client_endpoint(certificate, key)
}
Expand Down

0 comments on commit 9dce552

Please sign in to comment.