Skip to content

Commit

Permalink
migrate every fucking thing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Apr 5, 2024
1 parent 7913c44 commit d04d558
Show file tree
Hide file tree
Showing 24 changed files with 176 additions and 180 deletions.
60 changes: 25 additions & 35 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ reth-trie-parallel = { path = "crates/trie-parallel" }
# revm
revm = { version = "8.0.0", features = ["std", "secp256k1"], default-features = false }
revm-primitives = { version = "3.1.0", features = ["std"], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "0ef5814" }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "c34b770" }

# eth
alloy-chains = { version = "0.1", feature = ["serde", "rlp", "arbitrary"] }
Expand All @@ -263,12 +263,12 @@ alloy-dyn-abi = "0.7.0"
alloy-sol-types = "0.7.0"
alloy-rlp = "0.3.4"
alloy-trie = "0.3"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "8c9dd0a" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "17633df" }

# TODO: Remove
ethers-core = { version = "2.0.14", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions crates/node-core/src/args/rpc_server_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use reth_rpc_builder::{
auth::{AuthServerConfig, AuthServerHandle},
constants,
error::RpcError,
EthConfig, IpcServerBuilder, RethRpcModule, RpcModuleConfig, RpcModuleSelection,
EthConfig, Identity, IpcServerBuilder, RethRpcModule, RpcModuleConfig, RpcModuleSelection,
RpcServerConfig, RpcServerHandle, ServerBuilder, TransportRpcModuleConfig,
};
use reth_rpc_engine_api::EngineApi;
Expand Down Expand Up @@ -414,7 +414,7 @@ impl RethRpcConfig for RpcServerArgs {
config
}

fn http_ws_server_builder(&self) -> ServerBuilder {
fn http_ws_server_builder(&self) -> ServerBuilder<Identity, Identity> {
ServerBuilder::new()
.max_connections(self.rpc_max_connections.get())
.max_request_body_size(self.rpc_max_request_size_bytes())
Expand Down
6 changes: 3 additions & 3 deletions crates/node-core/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use reth_rpc::{
JwtError, JwtSecret,
};
use reth_rpc_builder::{
auth::AuthServerConfig, error::RpcError, EthConfig, IpcServerBuilder, RpcServerConfig,
ServerBuilder, TransportRpcModuleConfig,
auth::AuthServerConfig, error::RpcError, EthConfig, Identity, IpcServerBuilder,
RpcServerConfig, ServerBuilder, TransportRpcModuleConfig,
};
use reth_transaction_pool::PoolConfig;
use std::{borrow::Cow, path::PathBuf, time::Duration};
Expand Down Expand Up @@ -46,7 +46,7 @@ pub trait RethRpcConfig {
fn transport_rpc_module_config(&self) -> TransportRpcModuleConfig;

/// Returns the default server builder for http/ws
fn http_ws_server_builder(&self) -> ServerBuilder;
fn http_ws_server_builder(&self) -> ServerBuilder<Identity, Identity>;

/// Returns the default ipc server builder
fn ipc_server_builder(&self) -> IpcServerBuilder;
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ use std::{
time::{Duration, SystemTime, UNIX_EPOCH},
};
use strum::{AsRefStr, EnumIter, IntoStaticStr, ParseError, VariantArray, VariantNames};
use tower::layer::util::{Identity, Stack};
pub use tower::layer::util::{Identity, Stack};
use tower_http::cors::CorsLayer;
use tracing::{instrument, trace};

Expand Down
4 changes: 3 additions & 1 deletion crates/rpc/rpc-builder/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl RpcRequestMetrics {
}

/// Creates a new instance of the metrics layer for Ws.
#[allow(unused)]
pub(crate) fn ipc(module: &RpcModule<()>) -> Self {
Self::new(module, RpcTransport::Ipc)
}
Expand Down Expand Up @@ -176,6 +177,7 @@ impl<F: Future<Output = MethodResponse>> Future for MeteredRequestFuture<F> {
pub(crate) enum RpcTransport {
Http,
WebSocket,
#[allow(unused)]
Ipc,
}

Expand All @@ -190,7 +192,7 @@ impl RpcTransport {
}

/// Returns the connection metrics for the transport protocol.
pub(crate) fn connection_metrics(&self) -> RpcServerConnectionMetrics {
fn connection_metrics(&self) -> RpcServerConnectionMetrics {
RpcServerConnectionMetrics::new_with_labels(&[("transport", self.as_str())])
}
}
Expand Down
5 changes: 2 additions & 3 deletions crates/rpc/rpc-builder/tests/it/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::utils::{launch_http, launch_http_ws, launch_ws};
use jsonrpsee::{
core::{
client::{ClientT, SubscriptionClientT},
error::Error,
params::ArrayParams,
},
http_client::HttpClient,
Expand All @@ -30,9 +29,9 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashSet;

fn is_unimplemented(err: Error) -> bool {
fn is_unimplemented(err: jsonrpsee::core::client::Error) -> bool {
match err {
Error::Call(error_obj) => {
jsonrpsee::core::client::Error::Call(error_obj) => {
error_obj.code() == ErrorCode::InternalError.code() &&
error_obj.message() == "unimplemented"
}
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-builder/tests/it/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::utils::launch_http;
use jsonrpsee::{
core::{client::ClientT, traits::ToRpcParams, Error},
core::{client::ClientT, traits::ToRpcParams},
types::Request,
};
use reth_primitives::U256;
Expand All @@ -12,7 +12,7 @@ use serde_json::value::RawValue;
struct RawRpcParams(Box<RawValue>);

impl ToRpcParams for RawRpcParams {
fn to_rpc_params(self) -> Result<Option<Box<RawValue>>, Error> {
fn to_rpc_params(self) -> Result<Option<Box<RawValue>>, serde_json::Error> {
Ok(Some(self.0))
}
}
Expand Down
5 changes: 1 addition & 4 deletions crates/rpc/rpc-engine-api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ impl From<EngineApiError> for jsonrpsee_types::error::ErrorObject<'static> {
),
// Error responses from the consensus engine
EngineApiError::ForkChoiceUpdate(ref err) => match err {
BeaconForkChoiceUpdateError::ForkchoiceUpdateError(err) => {
todo!("mattsse: needs version bump on alloy")
// (*err).into()
}
BeaconForkChoiceUpdateError::ForkchoiceUpdateError(err) => (*err).into(),
BeaconForkChoiceUpdateError::EngineUnavailable |
BeaconForkChoiceUpdateError::Internal(_) => {
jsonrpsee_types::error::ErrorObject::owned(
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-testing-util/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Helpers for testing debug trace calls.

use futures::{Stream, StreamExt};
use jsonrpsee::Error as RpcError;
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::{BlockId, TxHash, B256};
use reth_rpc_api::{clients::DebugApiClient, EthApiClient};
use reth_rpc_types::{
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Helpers for testing trace calls.

use futures::{Stream, StreamExt};
use jsonrpsee::core::Error as RpcError;
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::{BlockId, Bytes, TxHash, B256};
use reth_rpc_api::clients::TraceApiClient;
use reth_rpc_types::{
Expand All @@ -17,6 +17,7 @@ use std::{
pin::Pin,
task::{Context, Poll},
};

/// A type alias that represents the result of a raw transaction trace stream.
type RawTransactionTraceResult<'a> =
Pin<Box<dyn Stream<Item = Result<(TraceResults, Bytes), (RpcError, Bytes)>> + 'a>>;
Expand Down
Loading

0 comments on commit d04d558

Please sign in to comment.