Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 168 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
unreachable_pub = "deny"

[workspace.lints.clippy]
manual_let_else = "warn"
match_same_arms = "warn"
unused_async = "warn"
uninlined_format_args = "warn"
manual_let_else = "warn"
unused_async = "warn"
3 changes: 3 additions & 0 deletions crates/rproxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ actix-http = { version = "3.11.1", features = ["ws"] }
actix-tls = "3.4.0"
actix-web = { version = "4.11.0", features = ["rustls-0_23"] }
actix-ws = "0.3.0"
alloy-json-rpc = "1.0.41"
alloy-primitives = "1.3.1"
alloy-rlp = "0.3.12"
awc = "3.7.0"
Expand All @@ -31,11 +32,13 @@ futures-core = "0.3.31"
hex = "0.4.3"
http = "1.3.1"
humantime = "2.2.0"
moka = { version = "0.12.11", features = ["sync"] }
op-alloy-consensus = "0.20.0"
parking_lot = "0.12.4"
pin-project = "1.1.10"
pnet = "0.35.0"
prometheus-client = { git = "https://github.com/0x416e746f6e/client_rust.git", branch = "nested-labels"}
rustc-hash = "2.1.1"
rustls = "0.23.32"
rustls-pemfile = "2.2.0"
scc = "3.0.2"
Expand Down
25 changes: 23 additions & 2 deletions crates/rproxy/src/jrpc/jrpc_request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::borrow::Cow;

use alloy_json_rpc::Id;
use serde::Deserialize;

// JrpcRequestMeta -----------------------------------------------------
Expand All @@ -12,11 +13,20 @@ const JRPC_METHOD_FCUV3_WITH_PAYLOAD: Cow<'static, str> =
Cow::Borrowed("engine_forkchoiceUpdatedV3_withPayload");

pub(crate) struct JrpcRequestMeta {
id: Id,

method: Cow<'static, str>,
method_enriched: Cow<'static, str>,

params: Vec<serde_json::Value>,
}

impl JrpcRequestMeta {
#[inline]
pub(crate) fn id(&self) -> &Id {
&self.id
}

#[inline]
pub(crate) fn method(&self) -> Cow<'static, str> {
self.method.clone()
Expand All @@ -26,6 +36,11 @@ impl JrpcRequestMeta {
pub(crate) fn method_enriched(&self) -> Cow<'static, str> {
self.method_enriched.clone()
}

#[inline]
pub(crate) fn params(&self) -> &Vec<serde_json::Value> {
&self.params
}
}

impl<'a> Deserialize<'a> for JrpcRequestMeta {
Expand All @@ -35,6 +50,7 @@ impl<'a> Deserialize<'a> for JrpcRequestMeta {
{
#[derive(Deserialize)]
struct JrpcRequestMetaWire {
id: Id,
method: Cow<'static, str>,
params: Vec<serde_json::Value>,
}
Expand All @@ -49,7 +65,12 @@ impl<'a> Deserialize<'a> for JrpcRequestMeta {
}

if params_count < 2 {
return Ok(Self { method: wire.method.clone(), method_enriched: wire.method.clone() });
return Ok(Self {
id: wire.id,
method: wire.method.clone(),
method_enriched: wire.method.clone(),
params: wire.params,
});
}

let method_enriched = match wire.method.as_ref() {
Expand All @@ -60,7 +81,7 @@ impl<'a> Deserialize<'a> for JrpcRequestMeta {
_ => wire.method.clone(),
};

Ok(Self { method: wire.method, method_enriched })
Ok(Self { id: wire.id, method: wire.method, method_enriched, params: wire.params })
}
}

Expand Down
Loading