From 50068e23867af50886ce6c79cc4441b6cb29d190 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Thu, 3 Oct 2024 15:02:55 +0900 Subject: [PATCH] solana: relax dependencies (#430) --- CHANGELOG.md | 2 ++ Cargo.lock | 36 +++++++++--------------- Cargo.toml | 30 +++++++++++--------- deny.toml | 45 +++++++++++++++--------------- examples/rust/Cargo.toml | 5 +++- yellowstone-grpc-client/Cargo.toml | 5 +++- yellowstone-grpc-client/src/lib.rs | 4 +-- yellowstone-grpc-geyser/Cargo.toml | 5 +++- yellowstone-grpc-geyser/src/lib.rs | 4 --- yellowstone-grpc-proto/Cargo.toml | 5 +++- yellowstone-grpc-proto/src/lib.rs | 5 ++++ yellowstone-grpc-tools/Cargo.toml | 6 ++-- yellowstone-grpc-tools/src/lib.rs | 7 ++--- 13 files changed, 84 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ec73077..1b2b4890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ The minor version will be incremented upon a breaking change and the patch versi ### Features +- solana: relax dependencies ([#430](https://github.com/rpcpool/yellowstone-grpc/pull/430)) + ### Breaking ## 2024-09-12 diff --git a/Cargo.lock b/Cargo.lock index 84032072..196fcffe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2003,15 +2003,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" @@ -2849,7 +2840,7 @@ checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" dependencies = [ "bytes", "heck", - "itertools 0.13.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -2869,7 +2860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.72", @@ -3237,9 +3228,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.3", @@ -4424,9 +4415,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -4502,9 +4493,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", @@ -5162,7 +5153,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client" -version = "1.16.2+solana.2.0.10" +version = "1.16.2" dependencies = [ "bytes", "futures", @@ -5175,7 +5166,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client-simple" -version = "1.14.1+solana.2.0.10" +version = "1.14.1" dependencies = [ "anyhow", "backoff", @@ -5199,7 +5190,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-geyser" -version = "1.16.3+solana.2.0.10" +version = "1.16.3" dependencies = [ "agave-geyser-plugin-interface", "anyhow", @@ -5235,7 +5226,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-proto" -version = "1.15.0+solana.2.0.10" +version = "1.15.0" dependencies = [ "anyhow", "bincode", @@ -5250,11 +5241,10 @@ dependencies = [ [[package]] name = "yellowstone-grpc-tools" -version = "1.0.0-rc.12+solana.2.0.10" +version = "1.0.0-rc.12" dependencies = [ "anyhow", "async-trait", - "atty", "cargo-lock", "clap", "const-hex", diff --git a/Cargo.toml b/Cargo.toml index 8294c31f..47427458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [workspace] resolver = "2" members = [ - "examples/rust", # 1.14.1+solana.2.0.10 - "yellowstone-grpc-client", # 1.16.2+solana.2.0.10 - "yellowstone-grpc-geyser", # 1.16.3+solana.2.0.10 - "yellowstone-grpc-proto", # 1.15.0+solana.2.0.10 - "yellowstone-grpc-tools", # 1.0.0-rc.12+solana.2.0.10 + "examples/rust", # 1.14.1 + "yellowstone-grpc-client", # 1.16.2 + "yellowstone-grpc-geyser", # 1.16.3 + "yellowstone-grpc-proto", # 1.15.0 + "yellowstone-grpc-tools", # 1.0.0-rc.12 ] [workspace.package] @@ -17,10 +17,9 @@ license = "AGPL-3.0" keywords = ["solana"] [workspace.dependencies] -agave-geyser-plugin-interface = "=2.0.10" +agave-geyser-plugin-interface = "~2.0.10" anyhow = "1.0.62" async-trait = "0.1.73" -atty = "0.2.14" backoff = "0.4.0" base64 = "0.22.1" bincode = "1.3.3" @@ -56,10 +55,10 @@ serde = "1.0.145" serde_json = "1.0.86" serde_yaml = "0.9.25" sha2 = "0.10.7" -solana-account-decoder = "=2.0.10" -solana-logger = "=2.0.10" -solana-sdk = "=2.0.10" -solana-transaction-status = "=2.0.10" +solana-account-decoder = "~2.0.10" +solana-logger = "~2.0.10" +solana-sdk = "~2.0.10" +solana-transaction-status = "~2.0.10" spl-token-2022 = "4.0.0" thiserror = "1.0" tokio = "1.21.2" @@ -71,8 +70,13 @@ tracing = "0.1.37" tracing-subscriber = "0.3.17" uuid = "1.8.0" vergen = "9.0.0" -yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "=1.16.2+solana.2.0.10" } -yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "=1.15.0+solana.2.0.10", default-features = false } +yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "1.16.2" } +yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "1.15.0", default-features = false } + +[workspace.lints.clippy] +clone_on_ref_ptr = "deny" +missing_const_for_fn = "deny" +trivially_copy_pass_by_ref = "deny" [profile.release] lto = true diff --git a/deny.toml b/deny.toml index 91d93a95..f6efb344 100644 --- a/deny.toml +++ b/deny.toml @@ -3,38 +3,39 @@ all-features = true [advisories] ignore = [ + # atty 0.2.14 + # Advisory: https://rustsec.org/advisories/RUSTSEC-2021-0145 + # On windows, `atty` dereferences a potentially unaligned pointer. + "RUSTSEC-2021-0145", + + # ed25519-dalek 1.0.1 + # Advisory: https://rustsec.org/advisories/RUSTSEC-2022-0093 + # Versions of `ed25519-dalek` prior to v2.0 model private and public keys as + # separate types which can be assembled into a `Keypair`, and also provide APIs + # for serializing and deserializing 64-byte private/public keypairs. + "RUSTSEC-2022-0093", + # borsh 0.9.3 # Advisory: https://rustsec.org/advisories/RUSTSEC-2023-0033 - # Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) + # Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) # are parsed and the Copy/Clone traits are not implemented/derived. - # For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy - # (this can be achieved through a singleton), then accessing/writing to deserialized + # For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy + # (this can be achieved through a singleton), then accessing/writing to deserialized # data will cause a segmentation fault. # borsh 0.10.3 # Advisory: https://rustsec.org/advisories/RUSTSEC-2023-0033 - # Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) + # Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) # are parsed and the Copy/Clone traits are not implemented/derived. - # For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy - # (this can be achieved through a singleton), then accessing/writing to deserialized + # For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy + # (this can be achieved through a singleton), then accessing/writing to deserialized # data will cause a segmentation fault. "RUSTSEC-2023-0033", - # ed25519-dalek 1.0.1 - # Advisory: https://rustsec.org/advisories/RUSTSEC-2022-0093 - # Versions of `ed25519-dalek` prior to v2.0 model private and public keys as - # separate types which can be assembled into a `Keypair`, and also provide APIs - # for serializing and deserializing 64-byte private/public keypairs. - "RUSTSEC-2022-0093", + # proc-macro-error 1.0.4 + # proc-macro-error's maintainer seems to be unreachable, with no commits for 2 years, no releases pushed for 4 years, and no activity on the GitLab repo or response to email. + "RUSTSEC-2024-0370", # atty 0.2.14 - # Advisory: https://rustsec.org/advisories/RUSTSEC-2021-0145 - # On windows, `atty` dereferences a potentially unaligned pointer. - "RUSTSEC-2021-0145", - - # curve25519-dalek 3.2.1 - # Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0344 - # Timing variability of any kind is problematic when working with potentially secret values such as - # elliptic curve scalars, and such issues can potentially leak private keys and other secrets. Such a - # problem was recently discovered in `curve25519-dalek`. - "RUSTSEC-2024-0344", + # The maintainer of `atty` has [published](https://github.com/softprops/atty/commit/5bfdbe9e48c6ca6a4909e8d5b04f5e843a257e93) an official notice that the crate is no longer under development, and that users should instead rely on the functionality in the standard library's [`IsTerminal`](https://doc.rust-lang.org/std/io/trait.IsTerminal.html) trait. + "RUSTSEC-2024-0375", ] diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 6857da2d..43ee7684 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-client-simple" -version = "1.14.1+solana.2.0.10" +version = "1.14.1" authors = { workspace = true } edition = { workspace = true } homepage = { workspace = true } @@ -31,3 +31,6 @@ tokio = { workspace = true, features = ["rt-multi-thread"] } tonic = { workspace = true } yellowstone-grpc-client = { workspace = true } yellowstone-grpc-proto = { workspace = true, default-features = true } + +[lints] +workspace = true diff --git a/yellowstone-grpc-client/Cargo.toml b/yellowstone-grpc-client/Cargo.toml index 44f393c9..80a23a52 100644 --- a/yellowstone-grpc-client/Cargo.toml +++ b/yellowstone-grpc-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-client" -version = "1.16.2+solana.2.0.10" +version = "1.16.2" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Simple Client" @@ -20,3 +20,6 @@ yellowstone-grpc-proto = { workspace = true } [dev-dependencies] tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } + +[lints] +workspace = true diff --git a/yellowstone-grpc-client/src/lib.rs b/yellowstone-grpc-client/src/lib.rs index 46f3d5b2..ce880dde 100644 --- a/yellowstone-grpc-client/src/lib.rs +++ b/yellowstone-grpc-client/src/lib.rs @@ -72,7 +72,7 @@ impl GeyserGrpcClient<()> { } impl GeyserGrpcClient { - pub fn new( + pub const fn new( health: HealthClient>, geyser: GeyserClient>, ) -> Self { @@ -224,7 +224,7 @@ pub struct GeyserGrpcBuilder { impl GeyserGrpcBuilder { // Create new builder - fn new(endpoint: Endpoint) -> Self { + const fn new(endpoint: Endpoint) -> Self { Self { endpoint, x_token: None, diff --git a/yellowstone-grpc-geyser/Cargo.toml b/yellowstone-grpc-geyser/Cargo.toml index 4fc652f4..fe7193c3 100644 --- a/yellowstone-grpc-geyser/Cargo.toml +++ b/yellowstone-grpc-geyser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-geyser" -version = "1.16.3+solana.2.0.10" +version = "1.16.3" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Plugin" @@ -50,3 +50,6 @@ anyhow = { workspace = true } cargo-lock = { workspace = true } git-version = { workspace = true } vergen = { workspace = true, features = ["build", "rustc"] } + +[lints] +workspace = true diff --git a/yellowstone-grpc-geyser/src/lib.rs b/yellowstone-grpc-geyser/src/lib.rs index a0acbd9d..3d68ba9b 100644 --- a/yellowstone-grpc-geyser/src/lib.rs +++ b/yellowstone-grpc-geyser/src/lib.rs @@ -1,7 +1,3 @@ -#![deny(clippy::clone_on_ref_ptr)] -#![deny(clippy::missing_const_for_fn)] -#![deny(clippy::trivially_copy_pass_by_ref)] - pub mod config; pub mod filters; pub mod grpc; diff --git a/yellowstone-grpc-proto/Cargo.toml b/yellowstone-grpc-proto/Cargo.toml index 9fad259a..03bf8baf 100644 --- a/yellowstone-grpc-proto/Cargo.toml +++ b/yellowstone-grpc-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-proto" -version = "1.15.0+solana.2.0.10" +version = "1.15.0" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Protobuf Definitions" @@ -26,3 +26,6 @@ tonic-build = { workspace = true } [features] convert = ["dep:solana-account-decoder", "dep:solana-sdk", "dep:solana-transaction-status"] default = ["convert"] + +[lints] +workspace = true diff --git a/yellowstone-grpc-proto/src/lib.rs b/yellowstone-grpc-proto/src/lib.rs index 510f997d..40868a21 100644 --- a/yellowstone-grpc-proto/src/lib.rs +++ b/yellowstone-grpc-proto/src/lib.rs @@ -1,10 +1,15 @@ #![allow(clippy::large_enum_variant)] pub mod geyser { + #![allow(clippy::clone_on_ref_ptr)] + #![allow(clippy::missing_const_for_fn)] + tonic::include_proto!("geyser"); } pub mod solana { + #![allow(clippy::missing_const_for_fn)] + pub mod storage { pub mod confirmed_block { tonic::include_proto!("solana.storage.confirmed_block"); diff --git a/yellowstone-grpc-tools/Cargo.toml b/yellowstone-grpc-tools/Cargo.toml index 0a2adc2c..ac2d1dd5 100644 --- a/yellowstone-grpc-tools/Cargo.toml +++ b/yellowstone-grpc-tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-tools" -version = "1.0.0-rc.12+solana.2.0.10" +version = "1.0.0-rc.12" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Tools" @@ -21,7 +21,6 @@ required-features = ["kafka"] [dependencies] anyhow = { workspace = true } async-trait = { workspace = true } -atty = { workspace = true } clap = { workspace = true, features = ["derive"] } const-hex = { workspace = true, optional = true } futures = { workspace = true } @@ -68,3 +67,6 @@ vergen = { workspace = true, features = ["build", "rustc"] } default = ["google-pubsub", "kafka"] google-pubsub = ["google-cloud-googleapis", "google-cloud-pubsub"] kafka = ["const-hex", "rdkafka", "sha2"] + +[lints] +workspace = true diff --git a/yellowstone-grpc-tools/src/lib.rs b/yellowstone-grpc-tools/src/lib.rs index b3b86224..0538d094 100644 --- a/yellowstone-grpc-tools/src/lib.rs +++ b/yellowstone-grpc-tools/src/lib.rs @@ -1,7 +1,3 @@ -#![deny(clippy::clone_on_ref_ptr)] -#![deny(clippy::missing_const_for_fn)] -#![deny(clippy::trivially_copy_pass_by_ref)] - pub mod config; #[cfg(feature = "google-pubsub")] pub mod google_pubsub; @@ -13,6 +9,7 @@ pub mod version; use { futures::future::{BoxFuture, FutureExt}, + std::io::{self, IsTerminal}, tokio::signal::unix::{signal, SignalKind}, tracing_subscriber::{ filter::{EnvFilter, LevelFilter}, @@ -22,7 +19,7 @@ use { }; pub fn setup_tracing() -> anyhow::Result<()> { - let is_atty = atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stderr); + let is_atty = io::stdout().is_terminal() && io::stderr().is_terminal(); let io_layer = tracing_subscriber::fmt::layer().with_ansi(is_atty); let level_layer = EnvFilter::builder() .with_default_directive(LevelFilter::INFO.into())