Skip to content

Commit

Permalink
[JIT-1207] Backport deduplication updates to relayer (solana-labs#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
esemeniuc authored Apr 24, 2023
1 parent 0c88849 commit 8bbb22c
Show file tree
Hide file tree
Showing 9 changed files with 272 additions and 253 deletions.
418 changes: 217 additions & 201 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions block_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cached = "0.42.0"
dashmap = "5.4.0"
jito-protos = { path = "../jito-protos" }
log = "0.4.17"
prost-types = "0.11.8"
solana-metrics = "=1.14.13"
solana-perf = "=1.14.13"
solana-sdk = "=1.14.13"
prost-types = "0.11.9"
solana-metrics = "=1.14.17"
solana-perf = "=1.14.17"
solana-sdk = "=1.14.17"
thiserror = "1.0.40"
tokio = { version = "~1.14.1", features = ["rt-multi-thread"] }
tokio-stream = "0.1.12"
Expand Down
22 changes: 11 additions & 11 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ edition = "2021"
publish = false

[dependencies]
crossbeam-channel = "0.5.7"
crossbeam-channel = "0.5.8"
jito-rpc = { path = "../rpc" }
lazy_static = "1.4.0"
log = "0.4.17"
rayon = "1.7.0"
solana-client = "=1.14.13"
solana-core = "=1.14.13"
solana-gossip = "=1.14.13"
solana-measure = "=1.14.13"
solana-metrics = "=1.14.13"
solana-perf = "=1.14.13"
solana-rayon-threadlimit = "=1.14.13"
solana-runtime = "=1.14.13"
solana-sdk = "=1.14.13"
solana-streamer = "=1.14.13"
solana-client = "=1.14.17"
solana-core = "=1.14.17"
solana-gossip = "=1.14.17"
solana-measure = "=1.14.17"
solana-metrics = "=1.14.17"
solana-perf = "=1.14.17"
solana-rayon-threadlimit = "=1.14.17"
solana-runtime = "=1.14.17"
solana-sdk = "=1.14.17"
solana-streamer = "=1.14.17"
thiserror = "1.0.40"
tokio = { version = "~1.14.1", features = ["rt-multi-thread"] }
tokio-stream = "0.1.12"
8 changes: 4 additions & 4 deletions jito-protos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ publish = false

[dependencies]
bytes = "1.4.0"
prost = "0.11.8"
prost-types = "0.11.8"
solana-perf = "=1.14.13"
solana-sdk = "=1.14.13"
prost = "0.11.9"
prost-types = "0.11.9"
solana-perf = "=1.14.17"
solana-sdk = "=1.14.17"
tonic = "0.9.2"

[build-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions packet_blaster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ log = "0.4.17"
once_cell = "1"
quinn = "0.9"
rustls = { version = "0.20", features = ["dangerous_configuration"] }
solana-client = "=1.14.13"
solana-perf = "=1.14.13"
solana-net-utils = "=1.14.13"
solana-sdk = "=1.14.13"
solana-streamer = "=1.14.13"
solana-client = "=1.14.17"
solana-perf = "=1.14.17"
solana-net-utils = "=1.14.17"
solana-sdk = "=1.14.17"
solana-streamer = "=1.14.17"
thiserror = "1.0"
tokio = { version = "~1.14.1", features = ["rt-multi-thread"] }
16 changes: 8 additions & 8 deletions relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ publish = false

[dependencies]
chrono = "0.4.24"
crossbeam-channel = "0.5.7"
crossbeam-channel = "0.5.8"
ed25519-dalek = "1.0.1"
histogram = "0.6.9"
jito-protos = { path = "../jito-protos" }
jito-rpc = { path = "../rpc" }
jwt = { version = "0.16.0", features = ["openssl"] }
keyed_priority_queue = "0.4.1"
log = "0.4.17"
openssl = "0.10.49"
prost-types = "0.11.8"
openssl = "0.10.51"
prost-types = "0.11.9"
rand = "0.8.5"
serde = "1.0.159"
serde = "1.0.160"
sha2 = "0.10.6"
solana-client = "=1.14.13"
solana-metrics = "=1.14.13"
solana-perf = "=1.14.13"
solana-sdk = "=1.14.13"
solana-client = "=1.14.17"
solana-metrics = "=1.14.17"
solana-perf = "=1.14.17"
solana-sdk = "=1.14.17"
thiserror = "1.0.40"
tokio = { version = "~1.14.1" }
tokio-stream = "0.1.12"
Expand Down
11 changes: 7 additions & 4 deletions relayer/src/auth_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ impl<V: ValidatorAuther> AuthService for AuthServiceImpl<V> {
));
}

let pubkey = Pubkey::new(&inner_req.pubkey[..]);
let pubkey = Pubkey::try_from(inner_req.pubkey)
.map_err(|_| Status::invalid_argument("Invalid pubkey supplied."))?;

if !self.validator_auther.is_authorized(&pubkey) {
return Err(Status::permission_denied(
"The supplied pubkey is not authorized to generate a challenge.",
Expand Down Expand Up @@ -218,11 +220,12 @@ impl<V: ValidatorAuther> AuthService for AuthServiceImpl<V> {
let client_ip = Self::client_ip(&req)?;
let inner_req = req.into_inner();

let client_pubkey = PublicKey::from_bytes(&inner_req.client_pubkey[..]).map_err(|e| {
let client_pubkey = PublicKey::from_bytes(&inner_req.client_pubkey).map_err(|e| {
warn!("Failed to create pubkey from string: {}", e);
Status::invalid_argument("Invalid pubkey supplied.")
})?;
let sqlana_pubkey = Pubkey::new(&client_pubkey.to_bytes());
let solana_pubkey = Pubkey::try_from(client_pubkey.to_bytes())
.map_err(|_| Status::invalid_argument("Invalid pubkey supplied."))?;

let auth_challenge = if let Some(challenge) = auth_challenges.get_priority(&client_ip).await
{
Expand All @@ -234,7 +237,7 @@ impl<V: ValidatorAuther> AuthService for AuthServiceImpl<V> {
}?;

// Prepended with the pubkey to invalidate any tx this server could maliciously send.
let expected_challenge = format!("{}-{}", sqlana_pubkey, auth_challenge.0.challenge);
let expected_challenge = format!("{}-{}", solana_pubkey, auth_challenge.0.challenge);
if expected_challenge != inner_req.challenge {
return Err(Status::invalid_argument(format!(
"The provided challenge does not match the expected challenge: {expected_challenge}"
Expand Down
8 changes: 4 additions & 4 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ edition = "2021"
publish = false

[dependencies]
crossbeam-channel = "0.5.7"
crossbeam-channel = "0.5.8"
dashmap = "5"
log = "0.4.17"
solana-client = "=1.14.13"
solana-metrics = "=1.14.13"
solana-sdk = "=1.14.13"
solana-client = "=1.14.17"
solana-metrics = "=1.14.17"
solana-sdk = "=1.14.17"
24 changes: 12 additions & 12 deletions transaction-relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ publish = false
[dependencies]
bincode = "1.3.3"
clap = { version = "4", features = ["derive", "env"] }
crossbeam-channel = "0.5.7"
crossbeam-channel = "0.5.8"
dashmap = "5.4.0"
env_logger = "0.9"
h2 = "=0.3.18" # CVE-2023-26964
hostname = "0.3"
itertools = "0.10.5"
jito-block-engine = { path = "../block_engine", version = "0.1.0" }
jito-block-engine = { path = "../block_engine" }
jito-core = { path = "../core" }
jito-protos = { path = "../jito-protos" }
jito-relayer = { path = "../relayer" }
jito-rpc = { path = "../rpc" }
jwt = { version = "0.16.0", features = ["openssl"] }
log = "0.4.17"
openssl = "0.10.49"
prost-types = "0.11.8"
openssl = "0.10.51"
prost-types = "0.11.9"
reqwest = "0.11.16"
solana-address-lookup-table-program = "=1.14.13"
solana-client = "=1.14.13"
solana-core = "=1.14.13"
solana-metrics = "=1.14.13"
solana-net-utils = "=1.14.13"
solana-perf = "=1.14.13"
solana-program = "=1.14.13"
solana-sdk = "=1.14.13"
solana-address-lookup-table-program = "=1.14.17"
solana-client = "=1.14.17"
solana-core = "=1.14.17"
solana-metrics = "=1.14.17"
solana-net-utils = "=1.14.17"
solana-perf = "=1.14.17"
solana-program = "=1.14.17"
solana-sdk = "=1.14.17"
tikv-jemallocator = { version = "0.5", features = ["profiling"] }
tokio = { version = "~1.14.1", features = ["rt-multi-thread"] }
tokio-stream = "0.1.12"
Expand Down

0 comments on commit 8bbb22c

Please sign in to comment.