Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
referenced chainspec instead of arcs
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Nov 3, 2023
1 parent 0474763 commit ac050a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions crates/revm/src/optimism/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use revm::{
primitives::{BedrockSpec, RegolithSpec},
L1BlockInfo,
};
use std::sync::Arc;

/// Optimism-specific processor implementation for the `EVMProcessor`
pub mod processor;
Expand Down Expand Up @@ -87,7 +86,7 @@ pub trait RethL1BlockInfo {
/// - `is_deposit`: Whether or not the transaction is a deposit.
fn l1_tx_data_fee(
&self,
chain_spec: Arc<ChainSpec>,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
is_deposit: bool,
Expand All @@ -101,7 +100,7 @@ pub trait RethL1BlockInfo {
/// - `input`: The calldata of the transaction.
fn l1_data_gas(
&self,
chain_spec: Arc<ChainSpec>,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
) -> Result<U256, BlockExecutionError>;
Expand All @@ -110,7 +109,7 @@ pub trait RethL1BlockInfo {
impl RethL1BlockInfo for L1BlockInfo {
fn l1_tx_data_fee(
&self,
chain_spec: Arc<ChainSpec>,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
is_deposit: bool,
Expand All @@ -134,7 +133,7 @@ impl RethL1BlockInfo for L1BlockInfo {

fn l1_data_gas(
&self,
chain_spec: Arc<ChainSpec>,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
) -> Result<U256, BlockExecutionError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc/src/eth/api/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ where
let (l1_fee, l1_data_gas) = match (!tx.is_deposit())
.then(|| {
let inner_l1_fee = match l1_block_info.l1_tx_data_fee(
self.inner.provider.chain_spec(),
&self.inner.provider.chain_spec(),
block_timestamp,
&envelope_buf,
tx.is_deposit(),
Expand All @@ -941,7 +941,7 @@ where
Err(e) => return Err(e),
};
let inner_l1_data_gas = match l1_block_info.l1_data_gas(
self.inner.provider.chain_spec(),
&self.inner.provider.chain_spec(),
block_timestamp,
&envelope_buf,
) {
Expand Down
2 changes: 1 addition & 1 deletion crates/transaction-pool/src/validate/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ where
transaction.to_recovered_transaction().encode_enveloped(&mut encoded);
let cost_addition = match reth_revm::optimism::extract_l1_info(&block).map(|info| {
info.l1_tx_data_fee(
Arc::clone(&self.chain_spec),
&self.chain_spec,
block.timestamp,
&encoded.freeze().into(),
transaction.is_deposit(),
Expand Down

0 comments on commit ac050a2

Please sign in to comment.