jsonrpc dep: Work with vanilla v18.0.0

And switch to an override that will enable gzip support by default.
This commit is contained in:
Christian Kamm 2023-03-21 11:34:05 +01:00
parent ede1f41088
commit 7dc07c8709
4 changed files with 35 additions and 20 deletions

42
Cargo.lock generated
View File

@ -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",

View File

@ -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" }

View File

@ -44,7 +44,7 @@ async fn get_snapshot_gpa(
rpc_http_url: String,
program_id: String,
) -> anyhow::Result<OptionalContext<Vec<RpcKeyedAccount>>> {
let rpc_client = http::connect_with_options::<AccountsDataClient>(&rpc_http_url, true)
let rpc_client = http::connect::<AccountsDataClient>(&rpc_http_url)
.await
.map_err_anyhow()?;
@ -73,7 +73,7 @@ async fn get_snapshot_gma(
rpc_http_url: String,
ids: Vec<String>,
) -> anyhow::Result<solana_client::rpc_response::Response<Vec<Option<UiAccount>>>> {
let rpc_client = http::connect_with_options::<AccountsDataClient>(&rpc_http_url, true)
let rpc_client = http::connect::<AccountsDataClient>(&rpc_http_url)
.await
.map_err_anyhow()?;

View File

@ -35,10 +35,9 @@ async fn feed_data(
let connect = ws::try_connect::<RpcSolPubSubClient>(&config.rpc_ws_url).map_err_anyhow()?;
let client = connect.await.map_err_anyhow()?;
let rpc_client =
http::connect_with_options::<AccountsDataClient>(&config.snapshot.rpc_http_url, true)
.await
.map_err_anyhow()?;
let rpc_client = http::connect::<AccountsDataClient>(&config.snapshot.rpc_http_url)
.await
.map_err_anyhow()?;
let account_info_config = RpcAccountInfoConfig {
encoding: Some(UiAccountEncoding::Base64),