Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split MevApi trait into two #11036 #11081

Merged
merged 2 commits into from
Sep 22, 2024
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
4 changes: 2 additions & 2 deletions crates/rpc/rpc-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub mod servers {
admin::AdminApiServer,
debug::DebugApiServer,
engine::{EngineApiServer, EngineEthApiServer},
mev::MevApiServer,
mev::{MevFullApiServer, MevSimApiServer},
net::NetApiServer,
otterscan::OtterscanServer,
reth::RethApiServer,
Expand Down Expand Up @@ -69,7 +69,7 @@ pub mod clients {
engine::{EngineApiClient, EngineEthApiClient},
ganache::GanacheApiClient,
hardhat::HardhatApiClient,
mev::MevApiClient,
mev::{MevFullApiClient, MevSimApiClient},
net::NetApiClient,
otterscan::OtterscanClient,
reth::RethApiClient,
Expand Down
16 changes: 15 additions & 1 deletion crates/rpc/rpc-api/src/mev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,21 @@ use reth_rpc_types::mev::{
/// Mev rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "mev"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "mev"))]
pub trait MevApi {
pub trait MevSimApi {
/// Similar to `mev_sendBundle` but instead of submitting a bundle to the relay, it returns
/// a simulation result. Only fully matched bundles can be simulated.
#[method(name = "simBundle")]
async fn sim_bundle(
&self,
bundle: SendBundleRequest,
sim_overrides: SimBundleOverrides,
) -> jsonrpsee::core::RpcResult<SimBundleResponse>;
}

/// Mev rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "mev"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "mev"))]
pub trait MevFullApi {
/// Submitting bundles to the relay. It takes in a bundle and provides a bundle hash as a
/// return value.
#[method(name = "sendBundle")]
Expand Down
Loading