Skip to content

Commit

Permalink
Derive rpc(client,server) for EthereumRpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jfldde committed Dec 19, 2024
1 parent d240484 commit 21fc3af
Show file tree
Hide file tree
Showing 7 changed files with 806 additions and 697 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bin/citrea/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn register_ethereum<Da: DaService>(
}
};

let ethereum_rpc = ethereum_rpc::get_ethereum_rpc::<DefaultContext, Da>(
let ethereum_rpc = ethereum_rpc::create_rpc_module::<DefaultContext, Da>(
da_service,
eth_rpc_config,
storage,
Expand Down
1 change: 1 addition & 0 deletions crates/ethereum-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
async-trait = { workspace = true }

# Reth deps
alloy-network = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions crates/ethereum-rpc/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub struct Ethereum<C: sov_modules_api::Context, Da: DaService> {
pub(crate) web3_client_version: String,
pub(crate) trace_cache: Mutex<LruMap<u64, Vec<GethTrace>, ByLength>>,
pub(crate) subscription_manager: Option<SubscriptionManager>,
pub(crate) is_sequencer: bool,
pub(crate) enable_subscription: bool,
}

impl<C: sov_modules_api::Context, Da: DaService> Ethereum<C, Da> {
Expand All @@ -55,6 +57,8 @@ impl<C: sov_modules_api::Context, Da: DaService> Ethereum<C, Da> {
ledger_db: LedgerDB,
sequencer_client: Option<HttpClient>,
soft_confirmation_rx: Option<broadcast::Receiver<u64>>,
is_sequencer: bool,
enable_subscription: bool,
) -> Self {
let evm = Evm::<C>::default();
let gas_price_oracle =
Expand Down Expand Up @@ -82,6 +86,8 @@ impl<C: sov_modules_api::Context, Da: DaService> Ethereum<C, Da> {
web3_client_version: current_version,
trace_cache,
subscription_manager,
is_sequencer,
enable_subscription,
}
}

Expand Down
Loading

0 comments on commit 21fc3af

Please sign in to comment.