From 7dc07c8709821ad24b34b03bdf04a9447a4987e1 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 21 Mar 2023 11:34:05 +0100 Subject: [PATCH] jsonrpc dep: Work with vanilla v18.0.0 And switch to an override that will enable gzip support by default. --- Cargo.lock | 42 ++++++++++++++++++++--------- Cargo.toml | 2 +- connector/src/grpc_plugin_source.rs | 4 +-- connector/src/websocket_source.rs | 7 +++-- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1593350..0a4523a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2207,7 +2207,7 @@ dependencies = [ "http", "httpdate", "mime 0.3.16", - "sha1", + "sha1 0.10.5", ] [[package]] @@ -2628,18 +2628,19 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" version = "18.0.0" -source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip#3e83f454313b218a75be25d3d4cfc2c4e76bb8bd" +source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0#48566963667af263622724e2ea3971847141269c" dependencies = [ "derive_more", "flate2 0.2.20", "futures 0.3.26", "hyper 0.14.24", - "jsonrpc-core 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip)", - "jsonrpc-pubsub 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip)", + "jsonrpc-core 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0)", + "jsonrpc-pubsub 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0)", "log 0.4.17", "serde", "serde_json", "tokio", + "url 1.7.2", "websocket", ] @@ -2661,7 +2662,7 @@ dependencies = [ [[package]] name = "jsonrpc-core" version = "18.0.0" -source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip#3e83f454313b218a75be25d3d4cfc2c4e76bb8bd" +source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0#48566963667af263622724e2ea3971847141269c" dependencies = [ "futures 0.3.26", "futures-executor", @@ -2675,7 +2676,7 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" version = "18.0.0" -source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip#3e83f454313b218a75be25d3d4cfc2c4e76bb8bd" +source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0#48566963667af263622724e2ea3971847141269c" dependencies = [ "futures 0.3.26", "jsonrpc-client-transports", @@ -2727,10 +2728,10 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "18.0.0" -source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip#3e83f454313b218a75be25d3d4cfc2c4e76bb8bd" +source = "git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0#48566963667af263622724e2ea3971847141269c" dependencies = [ "futures 0.3.26", - "jsonrpc-core 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip)", + "jsonrpc-core 18.0.0 (git+https://github.com/ckamm/jsonrpc.git?branch=ckamm/http-with-gzip-default-v18.0.0)", "lazy_static", "log 0.4.17", "parking_lot 0.11.2", @@ -5422,6 +5423,15 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + [[package]] name = "sha1" version = "0.10.5" @@ -5433,6 +5443,12 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" version = "0.9.9" @@ -7964,9 +7980,9 @@ dependencies = [ [[package]] name = "websocket" -version = "0.26.5" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92aacab060eea423e4036820ddd28f3f9003b2c4d8048cbda985e5a14e18038d" +checksum = "413b37840b9e27b340ce91b319ede10731de8c72f5bc4cb0206ec1ca4ce581d0" dependencies = [ "bytes 0.4.12", "futures 0.1.31", @@ -7985,9 +8001,9 @@ dependencies = [ [[package]] name = "websocket-base" -version = "0.26.5" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aec794b07318993d1db16156d5a9c750120597a5ee40c6b928d416186cb138" +checksum = "5e3810f0d00c4dccb54c30a4eee815e703232819dec7b007db115791c42aa374" dependencies = [ "base64 0.10.1", "bitflags", @@ -7996,7 +8012,7 @@ dependencies = [ "futures 0.1.31", "native-tls", "rand 0.6.5", - "sha-1 0.8.2", + "sha1 0.6.1", "tokio-codec", "tokio-io", "tokio-tcp", diff --git a/Cargo.toml b/Cargo.toml index 97a5422..56c34e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ members = [ [patch.crates-io] # for gzip encoded responses -jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip" } +jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip-default-v18.0.0" } # force usage of mango-v4 submodules with 1.14.9 support anchor-spl = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" } anchor-lang = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" } diff --git a/connector/src/grpc_plugin_source.rs b/connector/src/grpc_plugin_source.rs index e704612..66f713e 100644 --- a/connector/src/grpc_plugin_source.rs +++ b/connector/src/grpc_plugin_source.rs @@ -44,7 +44,7 @@ async fn get_snapshot_gpa( rpc_http_url: String, program_id: String, ) -> anyhow::Result>> { - let rpc_client = http::connect_with_options::(&rpc_http_url, true) + let rpc_client = http::connect::(&rpc_http_url) .await .map_err_anyhow()?; @@ -73,7 +73,7 @@ async fn get_snapshot_gma( rpc_http_url: String, ids: Vec, ) -> anyhow::Result>>> { - let rpc_client = http::connect_with_options::(&rpc_http_url, true) + let rpc_client = http::connect::(&rpc_http_url) .await .map_err_anyhow()?; diff --git a/connector/src/websocket_source.rs b/connector/src/websocket_source.rs index 9f4ce00..0b12054 100644 --- a/connector/src/websocket_source.rs +++ b/connector/src/websocket_source.rs @@ -35,10 +35,9 @@ async fn feed_data( let connect = ws::try_connect::(&config.rpc_ws_url).map_err_anyhow()?; let client = connect.await.map_err_anyhow()?; - let rpc_client = - http::connect_with_options::(&config.snapshot.rpc_http_url, true) - .await - .map_err_anyhow()?; + let rpc_client = http::connect::(&config.snapshot.rpc_http_url) + .await + .map_err_anyhow()?; let account_info_config = RpcAccountInfoConfig { encoding: Some(UiAccountEncoding::Base64),