Skip to content

Commit 0d17f70

Browse files
authored
chore: update rust and deny check (#118)
* chore: update rust and deny check * chore: bump jet to v0.2.0 * chore: ignore bincode discontinued * chore: remove protoc * chore: fix clippy warnings
1 parent 81b75fd commit 0d17f70

File tree

21 files changed

+41
-57
lines changed

21 files changed

+41
-57
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,10 @@ jobs:
6767
run: cargo +nightly fmt --all -- --check
6868

6969
- name: cargo deny check advisories
70-
uses: EmbarkStudios/cargo-deny-action@v1
70+
uses: EmbarkStudios/cargo-deny-action@v2
7171
with:
7272
command: check advisories
7373

74-
- name: install protoc
75-
run: |
76-
sudo apt update
77-
sudo apt install protobuf-compiler
78-
7974
- name: Run clippy
8075
run: cargo clippy --all-targets --tests --all-features -- -Dwarnings
8176

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tonic-prost-build = "0.14.0"
108108
vergen = "9.0.1"
109109
tikv-jemallocator = "0.6.1"
110110
libc = "0.2.177"
111-
yellowstone-jet-tpu-client = { path = "crates/tpu-client", version = "0.1.0-rc1" }
111+
yellowstone-jet-tpu-client = { path = "crates/tpu-client", version = "0.2.0" }
112112

113113
[workspace.lints.clippy]
114114
clone_on_ref_ptr = "deny"
@@ -131,4 +131,4 @@ solana-transaction-status = { git = "https://github.com/rpcpool/solana-public.gi
131131
solana-transaction-status-client-types = { git = "https://github.com/rpcpool/solana-public.git", tag = "v3.0.6-triton-public" }
132132
solana-net-utils = { git = "https://github.com/rpcpool/solana-public.git", tag = "v3.0.6-triton-public" }
133133
solana-tpu-client = { git = "https://github.com/rpcpool/solana-public.git", tag = "v3.0.6-triton-public" }
134-
solana-quic-client = { git = "https://github.com/rpcpool/solana-public.git", tag = "v3.0.6-triton-public" }
134+
solana-quic-client = { git = "https://github.com/rpcpool/solana-public.git", tag = "v3.0.6-triton-public" }

apps/jet/src/bin/gentx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl Config {
109109
let path = path.as_ref();
110110
let contents = fs::read(path)
111111
.await
112-
.with_context(|| format!("failed to read config from {:?}", path))?;
112+
.with_context(|| format!("failed to read config from {path:?}"))?;
113113
Ok(serde_yaml::from_slice(&contents)?)
114114
}
115115

@@ -208,7 +208,7 @@ impl TransactionSender {
208208
encoded_tx,
209209
{
210210
"skipPreflight": config.config.skip_preflight,
211-
"preflightCommitment": config.config.preflight_commitment.map(|c| format!("{:?}", c).to_lowercase()),
211+
"preflightCommitment": config.config.preflight_commitment.map(|c| format!("{c:?}").to_lowercase()),
212212
"encoding": "base64",
213213
"maxRetries": config.config.max_retries,
214214
"minContextSlot": config.config.min_context_slot,
@@ -227,7 +227,7 @@ impl TransactionSender {
227227
.await?;
228228

229229
if let Some(err) = response.get("error") {
230-
return Err(anyhow::anyhow!("RPC error: {:?}", err));
230+
return Err(anyhow::anyhow!("RPC error: {err:?}"));
231231
}
232232

233233
if let Some(result) = response.get("result") {

apps/jet/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,15 @@ where
556556
port,
557557
))),
558558
Value::Env { env } => std::env::var(env)
559-
.map_err(|error| format!("{:}", error))
559+
.map_err(|error| format!("{error:}"))
560560
.and_then(|value| match value.parse() {
561561
Ok(addr) => Ok(addr),
562562
Err(error) => match value.parse() {
563563
Ok(port) => Ok(SocketAddr::V4(SocketAddrV4::new(
564564
Ipv4Addr::new(0, 0, 0, 0),
565565
port,
566566
))),
567-
Err(_) => Err(format!("{:?}", error)),
567+
Err(_) => Err(format!("{error:?}")),
568568
},
569569
})
570570
.map_err(de::Error::custom),

apps/jet/src/grpc_geyser.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct SlotTrackingInfo {
103103
}
104104

105105
impl SlotTrackingInfo {
106-
fn mark_status_seen(&mut self, status: SlotStatus) {
106+
const fn mark_status_seen(&mut self, status: SlotStatus) {
107107
self.statuses_seen |= 1 << (status as i32 as u8);
108108
}
109109

@@ -711,7 +711,7 @@ impl GeyserSubscriber {
711711
let response = geyser
712712
.get_version()
713713
.await
714-
.map_err(|e| GeyserError::GrpcClient(format!("failed to get version: {}", e)))?;
714+
.map_err(|e| GeyserError::GrpcClient(format!("failed to get version: {e}")))?;
715715

716716
let version = match serde_json::from_str::<GrpcVersion>(&response.version)? {
717717
GrpcVersion::Old(s) => s.version,
@@ -720,13 +720,12 @@ impl GeyserSubscriber {
720720

721721
let version = Version::parse(&version)?;
722722
let required = VersionReq::parse(">=1.14.1").map_err(|e| {
723-
GeyserError::VersionParse(format!("failed to parse required version: {}", e))
723+
GeyserError::VersionParse(format!("failed to parse required version: {e}"))
724724
})?;
725725

726726
if !required.matches(&version) {
727727
return Err(GeyserError::VersionValidation(format!(
728-
"gRPC version {} doesn't match required {}",
729-
version, required
728+
"gRPC version {version} doesn't match required {required}"
730729
)));
731730
}
732731

apps/jet/src/grpc_jet.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ pub async fn grpc_subscribe_jet_gw(
234234
Ok(resp) => resp.into_inner(),
235235
Err(status) => {
236236
return Err(anyhow::anyhow!(
237-
"Failed to establish subscription: {}",
238-
status
237+
"Failed to establish subscription: {status}"
239238
));
240239
}
241240
};
@@ -271,7 +270,7 @@ pub async fn grpc_subscribe_jet_gw(
271270
};
272271

273272
if let Err(e) = init_tx.clone().send(limit_message).await {
274-
return Err(anyhow::anyhow!("Failed to send rate limit message: {}", e));
273+
return Err(anyhow::anyhow!("Failed to send rate limit message: {e}"));
275274
}
276275

277276
// Forward remaining messages

apps/jet/src/pubkey_challenger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl OneTimeAuthTokenStore for InMemoryTokenStore {
244244
let expire_at = Instant::now() + ttl;
245245
let mut inner = self.inner.lock().await;
246246
if let Some(old) = inner.insert(token.clone(), (pubkey, expire_at)) {
247-
panic!("Token collision: with {:?}", old);
247+
panic!("Token collision: with {old:?}");
248248
}
249249

250250
// Here we garbage collect expired tokens

apps/jet/src/stake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl RefreshStakeInfoMapTask {
222222
tracing::error!("Failed to get epoch info: {:?}", err);
223223
return;
224224
} else {
225-
panic!("Failed to get epoch info: {:?}", err);
225+
panic!("Failed to get epoch info: {err:?}");
226226
}
227227
}
228228
};
@@ -248,7 +248,7 @@ impl RefreshStakeInfoMapTask {
248248
if err.is_transient() {
249249
tracing::error!("Failed to get vote accounts: {:?}", err);
250250
} else {
251-
panic!("Failed to get vote accounts: {:?}", err);
251+
panic!("Failed to get vote accounts: {err:?}");
252252
}
253253
}
254254
}

apps/jet/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl IncrementalBackoff {
142142
}
143143
}
144144

145-
pub fn reset(&mut self) {
145+
pub const fn reset(&mut self) {
146146
self.retries = None;
147147
}
148148

0 commit comments

Comments
 (0)