From 4d8bd8854e636c5ba4ba690bcdc9eb8b96c31e15 Mon Sep 17 00:00:00 2001 From: steveluscher Date: Sun, 26 Jun 2022 23:59:30 -0700 Subject: [PATCH] Enable wire compression in Solana CLI and Rust client --- Cargo.lock | 53 ++++++++++++++++++++++++++++++++++++++- cli/Cargo.toml | 2 +- client/Cargo.toml | 2 +- core/Cargo.toml | 1 - download-utils/Cargo.toml | 2 +- install/Cargo.toml | 2 +- metrics/Cargo.toml | 2 +- notifier/Cargo.toml | 2 +- programs/bpf/Cargo.lock | 52 ++++++++++++++++++++++++++++++++++++++ rpc-test/Cargo.toml | 2 +- 10 files changed, 111 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da0bb56f1e354b..84afbe36a489fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,6 +80,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "alloc-no-stdlib" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -139,6 +154,20 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-compression" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-mutex" version = "1.4.0" @@ -447,6 +476,27 @@ dependencies = [ "syn 1.0.93", ] +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.4.0" @@ -3741,6 +3791,7 @@ version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" dependencies = [ + "async-compression", "base64 0.13.0", "bytes", "encoding_rs", @@ -3768,6 +3819,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.23.3", + "tokio-util 0.6.9", "url 2.2.2", "wasm-bindgen", "wasm-bindgen-futures", @@ -4892,7 +4944,6 @@ dependencies = [ "rand_chacha 0.2.2", "raptorq", "rayon", - "reqwest", "rustc_version 0.4.0", "serde", "serde_derive", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index eff15017685eb8..d3cdff5eecee75 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -22,7 +22,7 @@ humantime = "2.0.1" log = "0.4.17" num-traits = "0.2" pretty-hex = "0.3.0" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } semver = "1.0.10" serde = "1.0.137" serde_derive = "1.0.103" diff --git a/client/Cargo.toml b/client/Cargo.toml index 369f3324c6b93e..ef1e20fd459a87 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -32,7 +32,7 @@ quinn-proto = "0.8.3" rand = "0.7.0" rand_chacha = "0.2.2" rayon = "1.5.3" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } rustls = { version = "0.20.6", features = ["dangerous_configuration"] } semver = "1.0.10" serde = "1.0.137" diff --git a/core/Cargo.toml b/core/Cargo.toml index f31cd91e5387ef..f706ac09c0ad47 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -67,7 +67,6 @@ trees = "0.4.2" [dev-dependencies] matches = "0.1.9" raptorq = "1.7.0" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } serde_json = "1.0.81" serial_test = "0.6.0" solana-logger = { path = "../logger", version = "=1.11.2" } diff --git a/download-utils/Cargo.toml b/download-utils/Cargo.toml index 8461a1f03cafb7..553bfc1efdb776 100644 --- a/download-utils/Cargo.toml +++ b/download-utils/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" console = "0.15.0" indicatif = "0.16.2" log = "0.4.17" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } solana-runtime = { path = "../runtime", version = "=1.11.2" } solana-sdk = { path = "../sdk", version = "=1.11.2" } diff --git a/install/Cargo.toml b/install/Cargo.toml index 6b50902cb761c7..d58370ab10d0af 100644 --- a/install/Cargo.toml +++ b/install/Cargo.toml @@ -22,7 +22,7 @@ dirs-next = "2.0.0" indicatif = "0.16.2" lazy_static = "1.4.0" nix = "0.24.0" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } semver = "1.0.10" serde = { version = "1.0.137", features = ["derive"] } serde_yaml = "0.8.24" diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index b4920fc7d5c68e..35bb2ab00b76e6 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -14,7 +14,7 @@ crossbeam-channel = "0.5" gethostname = "0.2.3" lazy_static = "1.4.0" log = "0.4.17" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } solana-sdk = { path = "../sdk", version = "=1.11.2" } [dev-dependencies] diff --git a/notifier/Cargo.toml b/notifier/Cargo.toml index afa5769d8ac7d3..6abbd786f1f707 100644 --- a/notifier/Cargo.toml +++ b/notifier/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" [dependencies] log = "0.4.17" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } serde_json = "1.0" [lib] diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 6337f429c0802e..5cb075d7145c7a 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -80,6 +80,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "alloc-no-stdlib" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -125,6 +140,20 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-compression" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-mutex" version = "1.4.0" @@ -406,6 +435,27 @@ dependencies = [ "syn 1.0.93", ] +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.4.0" @@ -3325,6 +3375,7 @@ version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" dependencies = [ + "async-compression", "base64 0.13.0", "bytes", "encoding_rs", @@ -3352,6 +3403,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.23.2", + "tokio-util 0.6.9", "url 2.2.2", "wasm-bindgen", "wasm-bindgen-futures", diff --git a/rpc-test/Cargo.toml b/rpc-test/Cargo.toml index ea7b7516dafa06..5c0e2ec0f3eb19 100644 --- a/rpc-test/Cargo.toml +++ b/rpc-test/Cargo.toml @@ -16,7 +16,7 @@ bs58 = "0.4.0" crossbeam-channel = "0.5" futures-util = "0.3.21" log = "0.4.17" -reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "rustls-tls", "json"] } +reqwest = { version = "0.11.10", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } serde = "1.0.137" serde_json = "1.0.81" solana-account-decoder = { path = "../account-decoder", version = "=1.11.2" }