Skip to content

Commit 79f7441

Browse files
committed
updated all solana crates
1 parent 3d68999 commit 79f7441

19 files changed

Lines changed: 900 additions & 704 deletions

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2024"
1414
homepage = "https://triton.one"
1515
repository = "https://github.com/rpcpool/yellowstone-jet"
1616
license = "Apache-2.0"
17-
rust-version = "1.89.0"
17+
rust-version = "1.91.0"
1818
keywords = ["yellowstone", "solana", "rpc", "jet", "tpu", "triton"]
1919
publish = false
2020

@@ -91,10 +91,10 @@ solana-commitment-config = "3.0.0"
9191
solana-compute-budget-interface = "3.0.0"
9292
solana-epoch-info = "3.0.0"
9393
solana-epoch-schedule = "3.0.0"
94-
solana-hash = "4.0.0"
94+
solana-hash = "4.5.0"
9595
solana-instruction = "3.0.0"
9696
solana-keypair = "3.0.0"
97-
solana-message = "3.0.0"
97+
solana-message = "4.0.0"
9898
solana-native-token = "3.0.0"
9999
solana-nonce = "3.0.0"
100100
solana-packet = "4.0.0"
@@ -103,20 +103,20 @@ solana-quic-definitions = "3.0.0"
103103
solana-sdk-ids = "3.0.0"
104104
solana-signature = "3.0.0"
105105
solana-signer = "3.0.0"
106-
solana-transaction = "3.0.0"
106+
solana-transaction = "4.0.0"
107107
solana-transaction-error = "3.0.0"
108-
solana-leader-schedule = "4.0.0"
109108

110109
# Yellowstone
111110
yellowstone-grpc-client = "13.1.0"
112111
yellowstone-grpc-proto = "12.5.0"
113112
yellowstone-jet-tpu-client = { path = "crates/tpu-client", version = "0.4.0" }
114-
yellowstone-shield-store = "0.10.0"
113+
yellowstone-shield-store = "0.11.0"
115114

116115
[workspace.lints.clippy]
117116
clone_on_ref_ptr = "deny"
118117
missing_const_for_fn = "deny"
119118
trivially_copy_pass_by_ref = "deny"
119+
collapsible_if = "allow"
120120

121121
[profile.release]
122122
codegen-units = 1

apps/jet/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ license.workspace = true
88
homepage.workspace = true
99
repository.workspace = true
1010
publish = false
11+
rust-version.workspace = true
1112

1213
[dependencies]
1314
anyhow = { workspace = true }
@@ -75,7 +76,7 @@ solana-commitment-config = { workspace = true }
7576
solana-compute-budget-interface = { workspace = true }
7677
solana-epoch-info = { workspace = true }
7778
solana-epoch-schedule = { workspace = true }
78-
solana-hash = { workspace = true }
79+
solana-hash = { workspace = true, features = ["atomic"] }
7980
solana-instruction = { workspace = true }
8081
solana-keypair = { workspace = true }
8182
solana-message = { workspace = true }
@@ -89,7 +90,6 @@ solana-signature = { workspace = true, features = ["rand"] }
8990
solana-signer = { workspace = true }
9091
solana-transaction = { workspace = true }
9192
solana-transaction-error = { workspace = true }
92-
solana-leader-schedule = { workspace = true, features = ["agave-unstable-api"] }
9393

9494
# Yellowstone
9595
yellowstone-grpc-client = { workspace = true }

apps/jet/src/bin/txn-inspector.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ fn print_summary(encoding: &str, bytes: &[u8], tx: &VersionedTransaction, detail
116116
let message_version = match &tx.message {
117117
VersionedMessage::Legacy(_) => "legacy",
118118
VersionedMessage::V0(_) => "v0",
119+
VersionedMessage::V1(_) => "v1",
119120
};
120121
let instruction_count = tx.message.instructions().len();
121122
let static_accounts = tx
@@ -151,6 +152,9 @@ fn print_summary(encoding: &str, bytes: &[u8], tx: &VersionedTransaction, detail
151152
);
152153
}
153154
}
155+
VersionedMessage::V1(_) => {
156+
println!("alt accounts: none (v1 message)");
157+
}
154158
}
155159

156160
if let Some(first_sig) = tx.signatures.first() {
@@ -229,5 +233,31 @@ fn print_detailed_transaction(tx: &VersionedTransaction) {
229233
);
230234
}
231235
}
236+
VersionedMessage::V1(message) => {
237+
println!("message: v1");
238+
println!(
239+
"header: required_signatures={} readonly_signed={} readonly_unsigned={}",
240+
message.header.num_required_signatures,
241+
message.header.num_readonly_signed_accounts,
242+
message.header.num_readonly_unsigned_accounts
243+
);
244+
println!("recent_blockhash: {}", message.lifetime_specifier);
245+
println!("config: {:?}", message.config);
246+
println!("account_keys ({}):", message.account_keys.len());
247+
for (i, key) in message.account_keys.iter().enumerate() {
248+
println!("- [{i}] {key}");
249+
}
250+
println!("instructions ({}):", message.instructions.len());
251+
for (i, ix) in message.instructions.iter().enumerate() {
252+
println!(
253+
"- [{i}] program_id_index={} accounts={:?} data_len={} data={:?}",
254+
ix.program_id_index,
255+
ix.accounts,
256+
ix.data.len(),
257+
ix.data
258+
);
259+
}
260+
println!("address_table_lookups: none (v1 message)");
261+
}
232262
}
233263
}

apps/jet/src/cluster_tpu_info.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#[allow(deprecated)]
2-
use solana_clock::NUM_CONSECUTIVE_LEADER_SLOTS;
31
use {
42
crate::{
53
grpc_geyser::SlotUpdateWithStatus,
@@ -61,6 +59,8 @@ impl ClusterTpuInfoProvider for ClusterTpuInfo {
6159
// This provides a buffer to avoid constantly fetching new schedules
6260
const LEADER_SCHEDULE_RETENTION_SLOTS: u64 = 42;
6361

62+
const NUM_CONSECUTIVE_LEADER_SLOTS: u64 = 4;
63+
6464
#[derive(Debug, Clone, Copy)]
6565
pub struct TpuInfo {
6666
pub leader: Pubkey,
@@ -155,8 +155,6 @@ impl ClusterTpuInfo {
155155
cluster_nodes_update_interval: Duration,
156156
cancellation_token: CancellationToken,
157157
) -> (Self, impl Future<Output = ()>) {
158-
assert_eq!(NUM_CONSECUTIVE_LEADER_SLOTS, 4);
159-
160158
let inner = Arc::new(StdRwLock::new(ClusterTpuInfoInner {
161159
epoch_schedule: ClusterTpuInfoInner::get_epoch_schedule(Arc::clone(&rpc)).await,
162160
..Default::default()
@@ -188,12 +186,10 @@ impl ClusterTpuInfo {
188186
}
189187

190188
pub fn latest_seen_slot(&self) -> Slot {
191-
let result = self
192-
.inner
189+
self.inner
193190
.read()
194191
.expect("rwlock schedule poisoned")
195-
.latest_seen_slot;
196-
result
192+
.latest_seen_slot
197193
}
198194

199195
pub fn get_cluster_nodes(&self) -> HashMap<Pubkey, RpcContactInfo> {
@@ -461,13 +457,11 @@ impl ClusterTpuInfo {
461457
.read()
462458
.expect("rwlock epoch schedule is poisoned");
463459

464-
let result = (0..=leader_forward_count as u64)
460+
(0..=leader_forward_count as u64)
465461
.filter_map(|i| {
466462
let leader_slot = inner.latest_seen_slot + i * NUM_CONSECUTIVE_LEADER_SLOTS;
467463
inner.get_tpu_info(leader_slot)
468464
})
469-
.collect::<Vec<_>>();
470-
471-
result
465+
.collect::<Vec<_>>()
472466
}
473467
}

apps/jet/src/grpc_lewis.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ async fn connect_and_stream(
280280

281281
loop {
282282
// Check stream timeout
283-
if let Some(deadline) = stream_deadline {
284-
if tokio::time::Instant::now() >= deadline {
285-
warn!("Stream timeout reached after {:?}", config.stream_timeout);
286-
break;
287-
}
283+
if let Some(deadline) = stream_deadline
284+
&& tokio::time::Instant::now() >= deadline
285+
{
286+
warn!("Stream timeout reached after {:?}", config.stream_timeout);
287+
break;
288288
}
289289

290290
tokio::select! {

apps/jet/src/recent_leader_slot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ pub enum SlotEvent {
1717
}
1818

1919
impl SlotEvent {
20-
pub fn slot(&self) -> Slot {
20+
pub const fn slot(&self) -> Slot {
2121
match self {
2222
SlotEvent::Start(slot) => *slot,
2323
SlotEvent::End(slot) => *slot,
2424
}
2525
}
2626

27-
pub fn is_start(&self) -> bool {
27+
pub const fn is_start(&self) -> bool {
2828
matches!(self, SlotEvent::Start(_))
2929
}
3030
}

apps/jet/src/rpc.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ pub mod rpc_admin {
278278

279279
impl RpcServerImpl {
280280
async fn set_keypair(&self, identity: Keypair) -> RpcResult<()> {
281-
if let Some(allow_ident) = &self.allowed_identity {
282-
if allow_ident != &identity.pubkey() {
283-
return Err(invalid_params("invalid identity".to_owned()));
284-
}
281+
if let Some(allow_ident) = &self.allowed_identity
282+
&& allow_ident != &identity.pubkey()
283+
{
284+
return Err(invalid_params("invalid identity".to_owned()));
285285
}
286286
let pubkey = identity.pubkey();
287287
self.jet_identity_updater
@@ -402,16 +402,14 @@ pub mod rpc_solana_like {
402402
} else {
403403
Cow::Borrowed("unknown")
404404
}
405+
} else if maybe_txn_sig.is_some() {
406+
Cow::Borrowed("[REDACTED]")
405407
} else {
406-
if maybe_txn_sig.is_some() {
407-
Cow::Borrowed("[REDACTED]")
408-
} else {
409-
Cow::Borrowed("unknown")
410-
}
408+
Cow::Borrowed("unknown")
411409
};
412410
warn!(
413411
signature = %sig,
414-
x_request_id = %maybe_request_id.unwrap_or_else(|| Cow::Borrowed("unknown")),
412+
x_request_id = %maybe_request_id.unwrap_or(Cow::Borrowed("unknown")),
415413
error = %err,
416414
"send_transaction failed"
417415
)

apps/jet/src/stake.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ pub mod tests {
369369
epoch_credits: vec![],
370370
last_vote: 1,
371371
root_slot: 1,
372+
inflation_rewards_commission_bps: None,
372373
}
373374
}
374375

apps/jet/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl IncrementalBackoff {
155155
let next_delay = self.initial_interval * 2u32.pow(retries);
156156
sleep(self.max_interval.min(next_delay)).await;
157157

158-
self.retries = Some(retries.checked_add(1).unwrap_or(u32::MAX));
158+
self.retries = Some(retries.saturating_add(1));
159159
}
160160
}
161161
}

0 commit comments

Comments
 (0)