Skip to content

Commit 5c67af1

Browse files
committed
remove sanitize and patch
1 parent d78291f commit 5c67af1

File tree

11 files changed

+1327
-1897
lines changed

11 files changed

+1327
-1897
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 59 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,76 +19,79 @@ bytes = "1.10.0"
1919
clap = { version = "4.5.2", features = ["cargo", "derive", "env"] }
2020
derivative = "2.2.0"
2121
derive_more = { version = "2.0.1", features = ["display"] }
22-
etcd-client = "0.14.0"
22+
etcd-client = "0.17.0"
2323
futures = "0.3.30"
2424
hostname = "0.4.0"
2525
humantime-serde = "1.1.1"
2626
hyper = "1.5.0"
27-
jsonrpsee = { version = "0.24.7", features = [
27+
jsonrpsee = { version = "0.26.0", features = [
2828
"http-client",
2929
"macros",
3030
"server",
3131
] }
3232
lazy_static = "1.4.0"
33-
lru = "0.12.3"
33+
lru = "0.16.1"
3434
maplit = "1.0.2"
3535
pin-project = "1.1.5"
3636
prometheus = "0.13.3"
37-
prost = "0.13.3"
38-
prost-types = "0.13.3"
37+
prost = "0.14.1"
38+
prost-types = "0.14.1"
3939
quinn = "0.11.6"
4040
quinn-proto = "0.11.6"
41-
rand = "0.8.5"
41+
rand = "0.9.2"
4242
rustls = { version = "0.23.15", default-features = false }
4343
semver = "1.0.22"
4444
serde = "1.0.215"
4545
serde_json = "1.0.116"
4646
serde_yaml = "0.9.25"
4747

4848
# Agave Crates
49-
solana-client = "2"
50-
solana-connection-cache = "2"
51-
solana-net-utils = "2"
52-
solana-quic-client = "2"
53-
solana-rpc-client-api = "2"
54-
solana-streamer = "2"
55-
solana-tpu-client = "2"
56-
solana-version = "2"
57-
solana-rpc-client = "2"
58-
solana-transaction-status-client-types = "2"
59-
solana-system-interface = "1"
60-
solana-bincode = "2"
61-
solana-tls-utils = "2"
49+
solana-client = "2.2.0"
50+
solana-connection-cache = "2.2.0"
51+
solana-net-utils = "2.2.0"
52+
solana-quic-client = "2.2.0"
53+
solana-rpc-client-api = "2.2.0"
54+
solana-streamer = "2.2.0"
55+
solana-tpu-client = "2.2.0"
56+
solana-version = "2.2.0"
57+
solana-rpc-client = "2.2.0"
58+
solana-transaction-status-client-types = "2.2.0"
59+
solana-system-interface = "1.0.0"
60+
solana-sdk-ids = "2.2.0"
61+
solana-bincode = "2.0.0"
62+
solana-tls-utils = "2.0.0"
6263
# --> Anza - Solana SDK (decoupled from agave)
6364
solana-program = "2"
6465
# TEMPORARY
6566
reqwest = { version = "0.12.15", features = ["json"] }
6667
retry = "2.0.0"
67-
solana-instruction = "2"
68-
solana-pubkey = "2"
69-
solana-keypair = "2"
70-
solana-account = "2"
71-
solana-clock = "2"
72-
solana-hash = "2"
73-
solana-epoch-schedule = "2"
74-
solana-quic-definitions = "2"
75-
solana-signature = { version = "2", features = ["rand"] }
76-
solana-signer = "2"
77-
solana-transaction = "2"
78-
solana-epoch-info = "2"
79-
solana-commitment-config = "2"
80-
solana-transaction-error = "2"
81-
solana-message = "2"
82-
solana-compute-budget-interface = "2"
83-
solana-native-token = "2"
84-
solana-nonce = "2"
85-
solana-packet = "2"
86-
thiserror = "1.0.58"
68+
solana-instruction = "2.2.0"
69+
solana-pubkey = "2.2.0"
70+
solana-keypair = "2.2.0"
71+
solana-account = "2.2.0"
72+
solana-clock = "2.2.0"
73+
solana-hash = "2.2.0"
74+
solana-epoch-schedule = "2.2.0"
75+
solana-quic-definitions = "2.2.0"
76+
solana-signature = { version = "2.2.0", features = ["rand"] }
77+
solana-signer = "2.2.0"
78+
solana-transaction = "2.2.0"
79+
solana-epoch-info = "2.2.0"
80+
solana-commitment-config = "2.2.0"
81+
solana-transaction-error = "2.2.0"
82+
solana-transaction-status = "2.2.0"
83+
solana-message = "2.2.0"
84+
solana-compute-budget-interface = "2.2.0"
85+
solana-native-token = "2.2.0"
86+
solana-nonce = "2.2.0"
87+
solana-packet = "2.2.0"
88+
thiserror = "2.0.0"
8789
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] }
8890
tokio-stream = "0.1.15"
89-
tonic = { version = "0.12.3", features = ["tls-native-roots"] }
90-
tonic-health = "0.12.3"
91-
tower = "0.4.13"
91+
tonic = { version = "0.14.2", features = ["tls-native-roots"] }
92+
tonic-prost = "0.14.2"
93+
tonic-health = "0.14.2"
94+
tower = "0.5.2"
9295
tracing = "0.1.40"
9396
tracing-subscriber = { version = "0.3.1", features = [
9497
"ansi",
@@ -97,23 +100,26 @@ tracing-subscriber = { version = "0.3.1", features = [
97100
] }
98101
uuid = { version = "1.11.0", features = ["v4", "serde"] }
99102

100-
yellowstone-grpc-client = "7"
101-
yellowstone-grpc-proto = "7"
102-
yellowstone-shield-store = "~0.5.2"
103-
yellowstone-vixen = "0.2.0"
104-
tokio-util = "0.7.16"
103+
yellowstone-grpc-client = "9.0.0"
104+
yellowstone-grpc-proto = "9.0.0"
105+
# yellowstone-shield-store = "^0.5.2"
106+
yellowstone-shield-store = { git = "https://github.com/rpcpool/yellowstone-shield.git", branch = "26-unpinned-crates" }
107+
yellowstone-vixen = "0.5.0"
108+
yellowstone-vixen-yellowstone-grpc-source = "0.3.0"
109+
tokio-util = "^0.7.16"
105110

106111
[[bin]]
107112
name = "lewis-dummy-server"
108113
path = "src/bin/lewis_dummy_server.rs"
109114

110115
[build-dependencies]
111-
anyhow = "1.0.69"
112-
cargo-lock = "10.0.1"
113-
git-version = "0.3.9"
114-
protobuf-src = "1.1.0"
115-
tonic-build = "0.12.3"
116-
vergen = { version = "9.0.1", features = ["build", "rustc"] }
116+
anyhow = "^1.0.69"
117+
cargo-lock = "^10.0.1"
118+
git-version = "^0.3.9"
119+
protobuf-src = "^1.1.0"
120+
tonic-build = "^0.14.2"
121+
tonic-prost-build = "^0.14.2"
122+
vergen = { version = "^9.0.1", features = ["build", "rustc"] }
117123

118124
[lints.clippy]
119125
clone_on_ref_ptr = "deny"
@@ -124,15 +130,5 @@ trivially_copy_pass_by_ref = "deny"
124130
codegen-units = 1
125131
lto = true
126132

127-
[patch.crates-io]
128-
solana-rpc-client = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
129-
solana-rpc-client-api = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
130-
solana-account-decoder-client-types = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
131-
solana-client = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
132-
solana-net-utils = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
133-
solana-streamer = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
134-
solana-transaction-context = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
135-
solana-transaction-status-client-types = { git = "https://github.com/rpcpool/solana-public.git", tag = "v2.2.19-triton-public" }
136-
137133
[target.'cfg(not(target_env = "msvc"))'.dependencies]
138134
tikv-jemallocator = "0.6"

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() -> anyhow::Result<()> {
2525

2626
// TODO: Audit that the environment access only happens in single-threaded code.
2727
unsafe { std::env::set_var("PROTOC", protobuf_src::protoc()) };
28-
tonic_build::configure()
28+
tonic_prost_build::configure()
2929
.compile_protos(&["proto/jet.proto", "proto/lewis.proto"], &["proto"])?;
3030

3131
Ok(())

src/bin/gentx.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use {
1414
solana_keypair::{Keypair, read_keypair_file},
1515
solana_message::{VersionedMessage, v0},
1616
solana_native_token::LAMPORTS_PER_SOL,
17-
solana_program::system_instruction,
1817
solana_pubkey::Pubkey,
1918
solana_signature::Signature,
2019
solana_signer::Signer,
@@ -348,7 +347,7 @@ async fn main() -> anyhow::Result<()> {
348347
instructions.push(ComputeBudgetInstruction::set_compute_unit_price(price));
349348
}
350349
let lamports = 5_000 + index;
351-
instructions.push(system_instruction::transfer(
350+
instructions.push(solana_system_interface::instruction::transfer(
352351
&wallet_pubkey,
353352
&wallet_pubkey,
354353
lamports,
@@ -368,7 +367,6 @@ async fn main() -> anyhow::Result<()> {
368367
let config = JetRpcSendTransactionConfig::new(
369368
Some(RpcSendTransactionConfig {
370369
skip_preflight: true,
371-
skip_sanitize: false,
372370
preflight_commitment: Some(CommitmentLevel::Finalized),
373371
encoding: Some(UiTransactionEncoding::Base64),
374372
max_retries: config.max_retries,

src/bin/jet.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use {
4848
},
4949
rpc::{RpcServer, RpcServerType, rpc_admin::RpcClient},
5050
setup_tracing,
51-
solana::sanitize_transaction_support_check,
51+
// solana::sanitize_transaction_support_check,
5252
solana_rpc_utils::{RetryRpcSender, RetryRpcSenderStrategy},
5353
stake::{self, StakeInfoMap, spawn_cache_stake_info_map},
5454
transaction_handler::TransactionHandler,
@@ -273,7 +273,7 @@ async fn run_jet(config: ConfigJet) -> anyhow::Result<()> {
273273
{
274274
let policy_store = PolicyStore::build()
275275
.config(config.upstream.clone().into())
276-
.run(&local)
276+
.run()
277277
.await?;
278278

279279
Arc::new(policy_store) as Arc<dyn TransactionPolicyStore + Send + Sync>
@@ -410,13 +410,13 @@ async fn run_jet(config: ConfigJet) -> anyhow::Result<()> {
410410
vec![Box::new(gateway_identity_updater)];
411411

412412
let tx_handler_rpc = Arc::new(SolanaRpcClient::new(config.upstream.rpc.clone()));
413-
let sanitize_supported = sanitize_transaction_support_check(&tx_handler_rpc)
414-
.await
415-
.expect("sanitize transaction support check");
413+
// let sanitize_supported = sanitize_transaction_support_check(&tx_handler_rpc)
414+
// .await
415+
// .expect("sanitize transaction support check");
416416
let tx_handler = TransactionHandler {
417417
transaction_sink: scheduler_in,
418418
rpc: tx_handler_rpc,
419-
proxy_sanitize_check: config.listen_solana_like.proxy_sanitize_check && sanitize_supported,
419+
// proxy_sanitize_check: config.listen_solana_like.proxy_sanitize_check && sanitize_supported,
420420
proxy_preflight_check: config.listen_solana_like.proxy_preflight_check,
421421
};
422422

src/config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use {
2626
},
2727
tokio::{fs, time::Duration},
2828
yellowstone_shield_store::{PolicyStoreConfig, PolicyStoreRpcConfig},
29-
yellowstone_vixen::config::YellowstoneConfig,
29+
yellowstone_vixen_yellowstone_grpc_source::YellowstoneGrpcConfig,
3030
};
3131

3232
fn deserialize_pubkey<'de, D>(deserializer: D) -> Result<Pubkey, D::Error>
@@ -224,10 +224,14 @@ impl From<ConfigUpstream> for PolicyStoreConfig {
224224
) -> Self {
225225
Self {
226226
rpc: PolicyStoreRpcConfig { endpoint: rpc },
227-
grpc: YellowstoneConfig {
227+
grpc: YellowstoneGrpcConfig {
228228
endpoint,
229229
x_token,
230230
timeout: 60,
231+
commitment_level: Some(yellowstone_vixen::CommitmentLevel::Finalized),
232+
from_slot: None,
233+
max_decoding_message_size: Some(100_000_000),
234+
accept_compression: None
231235
},
232236
}
233237
}

src/payload.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ impl TryFrom<(&VersionedTransaction, JetRpcSendTransactionConfig)> for Transacti
280280
.map(|p| p.to_string())
281281
.collect(),
282282
skip_preflight: config_with_forwarding_policies.config.skip_preflight,
283-
skip_sanitize: config_with_forwarding_policies.config.skip_sanitize,
283+
skip_sanitize: true,
284+
// skip_sanitize: config_with_forwarding_policies.config.skip_sanitize,
284285
}),
285286
timestamp: Some(ms_since_epoch()),
286287
}))
@@ -334,7 +335,8 @@ impl TryFrom<&TransactionConfig> for JetRpcSendTransactionConfig {
334335
Some(RpcSendTransactionConfig {
335336
max_retries: proto_config.max_retries.map(|r| r as usize),
336337
skip_preflight: proto_config.skip_preflight,
337-
skip_sanitize: proto_config.skip_sanitize,
338+
// skip_sanitize: proto_config.skip_sanitize,
339+
// skip_sanitize: true,
338340
preflight_commitment: None,
339341
encoding: None,
340342
min_context_slot: None,
@@ -371,7 +373,7 @@ mod tests {
371373
Some(RpcSendTransactionConfig {
372374
encoding: Some(UiTransactionEncoding::Base58),
373375
skip_preflight: true,
374-
skip_sanitize: true,
376+
// skip_sanitize: true,
375377
..Default::default()
376378
}),
377379
None,
@@ -485,7 +487,7 @@ mod tests {
485487
let config = JetRpcSendTransactionConfig::new(
486488
Some(RpcSendTransactionConfig {
487489
skip_preflight: true,
488-
skip_sanitize: true,
490+
// skip_sanitize: true,
489491
encoding: Some(UiTransactionEncoding::Base64),
490492
..Default::default()
491493
}),
@@ -501,7 +503,6 @@ mod tests {
501503
assert!(decoded_config.is_some());
502504
let config_with_forwarding_policies = decoded_config.unwrap();
503505
assert!(config_with_forwarding_policies.config.skip_preflight);
504-
assert!(config_with_forwarding_policies.config.skip_sanitize);
505506
Ok(())
506507
}
507508

@@ -511,7 +512,6 @@ mod tests {
511512
let original_config = JetRpcSendTransactionConfig::new(
512513
Some(RpcSendTransactionConfig {
513514
skip_preflight: true,
514-
skip_sanitize: false,
515515
max_retries: Some(3),
516516
preflight_commitment: None,
517517
encoding: Some(UiTransactionEncoding::Base64),
@@ -533,10 +533,6 @@ mod tests {
533533
config_with_forwarding_policies.config.skip_preflight,
534534
original_config.config.skip_preflight
535535
);
536-
assert_eq!(
537-
config_with_forwarding_policies.config.skip_sanitize,
538-
original_config.config.skip_sanitize
539-
);
540536
Ok(())
541537
}
542538

@@ -568,7 +564,7 @@ mod tests {
568564

569565
assert_eq!(rpc_config.config.max_retries, None);
570566
assert!(!rpc_config.config.skip_preflight);
571-
assert!(!rpc_config.config.skip_sanitize);
567+
// assert!(!rpc_config.config.skip_sanitize);
572568
assert_eq!(rpc_config.forwarding_policies.len(), 0);
573569
Ok(())
574570
}
@@ -615,7 +611,7 @@ mod tests {
615611
Some(RpcSendTransactionConfig {
616612
encoding: Some(UiTransactionEncoding::Base58),
617613
skip_preflight: true,
618-
skip_sanitize: true,
614+
// skip_sanitize: true,
619615
..Default::default()
620616
}),
621617
Some(vec!["11111111111111111111111111111111".to_string()]),
@@ -638,7 +634,7 @@ mod tests {
638634
if let Some(config) = decoded_config {
639635
assert_eq!(config.forwarding_policies.len(), 0);
640636
assert!(config.config.skip_preflight);
641-
assert!(config.config.skip_sanitize);
637+
// assert!(config.config.skip_sanitize);
642638
} else {
643639
panic!("Decoded config is None");
644640
}

src/rpc.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use {
22
crate::{cluster_tpu_info::ClusterTpuInfoProvider, transaction_handler::TransactionHandler},
33
anyhow::Context as _,
4-
futures::future::{BoxFuture, FutureExt, TryFutureExt, ready},
4+
futures::future::{ready, BoxFuture, FutureExt, TryFutureExt},
55
hyper::{Request, Response, StatusCode},
66
jsonrpsee::{
77
core::http_helpers::Body,
8-
server::{ServerBuilder, ServerHandle},
8+
server::{ServerBuilder, ServerConfigBuilder, ServerHandle},
99
types::error::{ErrorObject, ErrorObjectOwned, INVALID_PARAMS_CODE},
1010
},
1111
rpc_admin::JetIdentityUpdater,
@@ -103,9 +103,11 @@ impl RpcServer {
103103
use rpc_solana_like::RpcServer;
104104

105105
let rpc_server_impl = Self::create_solana_like_rpc_server_impl(tx_handler);
106-
107-
ServerBuilder::new()
106+
let config = ServerConfigBuilder::default()
108107
.max_request_body_size(MAX_REQUEST_BODY_SIZE)
108+
.build();
109+
ServerBuilder::new()
110+
.set_config(config)
109111
.build(addr)
110112
.await
111113
.map(|server| server.start(rpc_server_impl.into_rpc()))
@@ -223,7 +225,7 @@ pub mod rpc_admin {
223225
"set_identity_from_bytes with require_tower is not supported".to_owned(),
224226
));
225227
}
226-
let keypair = Keypair::from_bytes(&identity_keypair).map_err(|err| {
228+
let keypair = Keypair::try_from(identity_keypair.as_slice()).map_err(|err| {
227229
invalid_params(format!(
228230
"Failed to read identity keypair from provided byte array: {err}"
229231
))

0 commit comments

Comments
 (0)