mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: bump jsonrpsee 0.19 (#3989)
This commit is contained in:
59
Cargo.lock
generated
59
Cargo.lock
generated
@ -2515,14 +2515,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gloo-net"
|
||||
version = "0.2.6"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10"
|
||||
checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"gloo-utils",
|
||||
"http",
|
||||
"js-sys",
|
||||
"pin-project",
|
||||
"serde",
|
||||
@ -3279,9 +3280,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1822d18e4384a5e79d94dc9e4d1239cfa9fad24e55b44d2efeff5b394c9fece4"
|
||||
checksum = "e5f3783308bddc49d0218307f66a09330c106fbd792c58bac5c8dc294fdd0f98"
|
||||
dependencies = [
|
||||
"jsonrpsee-client-transport",
|
||||
"jsonrpsee-core",
|
||||
@ -3296,9 +3297,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-client-transport"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11aa5766d5c430b89cb26a99b88f3245eb91534be8126102cea9e45ee3891b22"
|
||||
checksum = "abc5630e4fa0096f00ec7b44d520701fda4504170cb85e22dca603ae5d7ad0d7"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
@ -3318,9 +3319,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-core"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64c6832a55f662b5a6ecc844db24b8b9c387453f923de863062c60ce33d62b81"
|
||||
checksum = "5aaa4c4d5fb801dcc316d81f76422db259809037a86b3194ae538dd026b05ed7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-lock",
|
||||
@ -3346,9 +3347,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-http-client"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1705c65069729e3dccff6fd91ee431d5d31cabcf00ce68a62a2c6435ac713af9"
|
||||
checksum = "aa7165efcbfbc951d180162ff28fe91b657ed81925e37a35e4a396ce12109f96"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"hyper",
|
||||
@ -3365,9 +3366,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-proc-macros"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6027ac0b197ce9543097d02a290f550ce1d9432bf301524b013053c0b75cc94"
|
||||
checksum = "21dc12b1d4f16a86e8c522823c4fab219c88c03eb7c924ec0501a64bf12e058b"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-crate",
|
||||
@ -3378,9 +3379,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-server"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f06661d1a6b6e5b85469dc9c29acfbb9b3bb613797a6fd10a3ebb8a70754057"
|
||||
checksum = "6e79d78cfd5abd8394da10753723093c3ff64391602941c9c4b1d80a3414fd53"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"hyper",
|
||||
@ -3398,9 +3399,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-types"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e5bf6c75ce2a4217421154adfc65a24d2b46e77286e59bba5d9fa6544ccc8f4"
|
||||
checksum = "00aa7cc87bc42e04e26c8ac3e7186142f7fd2949c763d9b6a7e64a69672d8fb2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"beef",
|
||||
@ -3412,9 +3413,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-wasm-client"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34e6ea7c6d862e60f8baebd946c037b70c6808a4e4e31e792a4029184e3ce13a"
|
||||
checksum = "0fe953c2801356f214d3f4051f786b3d11134512a46763ee8c39a9e3fa2cc1c0"
|
||||
dependencies = [
|
||||
"jsonrpsee-client-transport",
|
||||
"jsonrpsee-core",
|
||||
@ -3423,9 +3424,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jsonrpsee-ws-client"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a64b2589680ba1ad7863f279cd2d5083c1dc0a7c0ea959d22924553050f8ab9f"
|
||||
checksum = "5c71b2597ec1c958c6d5bc94bb61b44d74eb28e69dc421731ab0035706f13882"
|
||||
dependencies = [
|
||||
"http",
|
||||
"jsonrpsee-client-transport",
|
||||
@ -6174,7 +6175,7 @@ checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-webpki 0.101.2",
|
||||
"rustls-webpki",
|
||||
"sct",
|
||||
]
|
||||
|
||||
@ -6199,16 +6200,6 @@ dependencies = [
|
||||
"base64 0.21.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.100.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.101.2"
|
||||
@ -7975,11 +7966,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.23.1"
|
||||
version = "0.24.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"
|
||||
checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888"
|
||||
dependencies = [
|
||||
"rustls-webpki 0.100.1",
|
||||
"rustls-webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@ -133,5 +133,10 @@ futures = "0.3.26"
|
||||
pin-project = "1.0.12"
|
||||
futures-util = "0.3.25"
|
||||
|
||||
## json
|
||||
jsonrpsee = { version = "0.19" }
|
||||
jsonrpsee-core = { version = "0.19" }
|
||||
jsonrpsee-types = { version = "0.19" }
|
||||
|
||||
## crypto
|
||||
secp256k1 = { version = "0.27.0", default-features = false, features = ["global-context", "rand-std", "recovery"] }
|
||||
|
||||
@ -23,7 +23,7 @@ pin-project.workspace = true
|
||||
tower = "0.4"
|
||||
|
||||
# misc
|
||||
jsonrpsee = { version = "0.18", features = ["server", "client"] }
|
||||
jsonrpsee = { workspace = true, features = ["server", "client"] }
|
||||
serde_json.workspace = true
|
||||
tracing.workspace = true
|
||||
bytes.workspace = true
|
||||
|
||||
@ -6,7 +6,7 @@ use jsonrpsee::{
|
||||
tracing::{rx_log_from_json, tx_log_from_str},
|
||||
JsonRawValue,
|
||||
},
|
||||
helpers::batch_response_error,
|
||||
helpers::{batch_response_error, MethodResponseResult},
|
||||
server::{
|
||||
logger,
|
||||
logger::{Logger, TransportProtocol},
|
||||
@ -219,14 +219,20 @@ pub(crate) async fn execute_call<L: Logger>(
|
||||
};
|
||||
|
||||
tx_log_from_str(&response.as_response().result, max_log_length);
|
||||
logger.on_result(name, response.as_response().success, request_start, TransportProtocol::Http);
|
||||
logger.on_result(
|
||||
name,
|
||||
response.as_response().success_or_error,
|
||||
request_start,
|
||||
TransportProtocol::Http,
|
||||
);
|
||||
response
|
||||
}
|
||||
|
||||
#[instrument(name = "notification", fields(method = notif.method.as_ref()), skip(notif, max_log_length), level = "TRACE")]
|
||||
fn execute_notification(notif: Notif<'_>, max_log_length: u32) -> MethodResponse {
|
||||
rx_log_from_json(¬if, max_log_length);
|
||||
let response = MethodResponse { result: String::new(), success: true };
|
||||
let response =
|
||||
MethodResponse { result: String::new(), success_or_error: MethodResponseResult::Success };
|
||||
tx_log_from_str(&response.result, max_log_length);
|
||||
response
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ reth-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
|
||||
# misc
|
||||
jsonrpsee = { version = "0.18", features = ["server", "macros"] }
|
||||
jsonrpsee = { workspace = true, features = ["server", "macros"] }
|
||||
serde_json.workspace = true
|
||||
|
||||
[features]
|
||||
|
||||
@ -24,7 +24,7 @@ reth-transaction-pool.workspace = true
|
||||
reth-metrics = { workspace = true, features = ["common"] }
|
||||
|
||||
# rpc/net
|
||||
jsonrpsee = { version = "0.18", features = ["server"] }
|
||||
jsonrpsee = { workspace = true, features = ["server"] }
|
||||
tower-http = { version = "0.4", features = ["full"] }
|
||||
tower = { version = "0.4", features = ["full"] }
|
||||
hyper = "0.14"
|
||||
|
||||
@ -115,7 +115,7 @@ where
|
||||
|
||||
let local_addr = server.local_addr()?;
|
||||
|
||||
let handle = server.start(module)?;
|
||||
let handle = server.start(module);
|
||||
Ok(AuthServerHandle { handle, local_addr, secret })
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ impl AuthServerConfig {
|
||||
|
||||
let local_addr = server.local_addr()?;
|
||||
|
||||
let handle = server.start(module.inner)?;
|
||||
let handle = server.start(module.inner);
|
||||
Ok(AuthServerHandle { handle, local_addr, secret })
|
||||
}
|
||||
}
|
||||
|
||||
@ -1500,7 +1500,7 @@ impl WsHttpServers {
|
||||
config.ensure_ws_http_identical()?;
|
||||
|
||||
if let Some(module) = http_module.or(ws_module) {
|
||||
let handle = both.start(module).await?;
|
||||
let handle = both.start(module).await;
|
||||
http_handle = Some(handle.clone());
|
||||
ws_handle = Some(handle);
|
||||
}
|
||||
@ -1509,12 +1509,12 @@ impl WsHttpServers {
|
||||
if let Some((server, module)) =
|
||||
http.and_then(|server| http_module.map(|module| (server, module)))
|
||||
{
|
||||
http_handle = Some(server.start(module).await?);
|
||||
http_handle = Some(server.start(module).await);
|
||||
}
|
||||
if let Some((server, module)) =
|
||||
ws.and_then(|server| ws_module.map(|module| (server, module)))
|
||||
{
|
||||
ws_handle = Some(server.start(module).await?);
|
||||
ws_handle = Some(server.start(module).await);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1541,10 +1541,10 @@ enum WsHttpServerKind {
|
||||
|
||||
impl WsHttpServerKind {
|
||||
/// Starts the server and returns the handle
|
||||
async fn start(self, module: RpcModule<()>) -> Result<ServerHandle, RpcError> {
|
||||
async fn start(self, module: RpcModule<()>) -> ServerHandle {
|
||||
match self {
|
||||
WsHttpServerKind::Plain(server) => Ok(server.start(module)?),
|
||||
WsHttpServerKind::WithCors(server) => Ok(server.start(module)?),
|
||||
WsHttpServerKind::Plain(server) => server.start(module),
|
||||
WsHttpServerKind::WithCors(server) => server.start(module),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
use jsonrpsee::server::logger::{HttpRequest, Logger, MethodKind, Params, TransportProtocol};
|
||||
use jsonrpsee::{
|
||||
helpers::MethodResponseResult,
|
||||
server::logger::{HttpRequest, Logger, MethodKind, Params, TransportProtocol},
|
||||
};
|
||||
use reth_metrics::{
|
||||
metrics::{self, Counter, Histogram},
|
||||
Metrics,
|
||||
@ -58,13 +61,13 @@ impl Logger for RpcServerMetrics {
|
||||
fn on_result(
|
||||
&self,
|
||||
_method_name: &str,
|
||||
success: bool,
|
||||
success: MethodResponseResult,
|
||||
started_at: Self::Instant,
|
||||
_transport: TransportProtocol,
|
||||
) {
|
||||
// capture call duration
|
||||
self.call_latency.record(started_at.elapsed().as_millis() as f64);
|
||||
if !success {
|
||||
if success.is_error() {
|
||||
self.failed_calls.increment(1);
|
||||
} else {
|
||||
self.successful_calls.increment(1);
|
||||
|
||||
@ -25,8 +25,8 @@ tokio = { workspace = true, features = ["sync"] }
|
||||
# misc
|
||||
async-trait.workspace = true
|
||||
thiserror.workspace = true
|
||||
jsonrpsee-types = "0.18"
|
||||
jsonrpsee-core = "0.18"
|
||||
jsonrpsee-types.workspace = true
|
||||
jsonrpsee-core.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@ -21,7 +21,7 @@ async-trait.workspace = true
|
||||
futures.workspace = true
|
||||
|
||||
# misc
|
||||
jsonrpsee = { version = "0.18", features = ["client", "async-client"] }
|
||||
jsonrpsee = { workspace = true, features = ["client", "async-client"] }
|
||||
serde_json.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@ -22,7 +22,7 @@ thiserror.workspace = true
|
||||
itertools = "0.10"
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json.workspace = true
|
||||
jsonrpsee-types = { version = "0.18" }
|
||||
jsonrpsee-types.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
# misc
|
||||
|
||||
@ -35,7 +35,7 @@ ethers-core = { workspace = true, features = ["eip712"] }
|
||||
revm-primitives = { workspace = true, features = ["serde"] }
|
||||
|
||||
# rpc
|
||||
jsonrpsee = { version = "0.18" }
|
||||
jsonrpsee.workspace = true
|
||||
http = "0.2.8"
|
||||
http-body = "0.4.5"
|
||||
hyper = "0.14.24"
|
||||
@ -63,7 +63,7 @@ schnellru = "0.2"
|
||||
futures.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
jsonrpsee = { version = "0.18", features = ["client"] }
|
||||
jsonrpsee = { workspace = true, features = ["client"] }
|
||||
assert_matches = "1.5.0"
|
||||
tempfile = "3.5.0"
|
||||
reth-interfaces = { workspace = true, features = ["test-utils"] }
|
||||
|
||||
@ -286,7 +286,7 @@ mod tests {
|
||||
let mut module = RpcModule::new(());
|
||||
module.register_method("greet_melkor", |_, _| "You are the dark lord").unwrap();
|
||||
|
||||
server.start(module).unwrap()
|
||||
server.start(module)
|
||||
}
|
||||
|
||||
fn to_u64(time: SystemTime) -> u64 {
|
||||
|
||||
Reference in New Issue
Block a user