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

Commit

Permalink
🧹
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Jul 9, 2023
1 parent ac826c9 commit bc46ac2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
2 changes: 2 additions & 0 deletions bin/reth/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ mod tests {
fork_timestamps: ForkTimestamps { shanghai: None },
genesis_hash: None,
paris_block_and_final_difficulty: None,
#[cfg(feature = "optimism")]
optimism: None,
});

let db = create_test_rw_db();
Expand Down
5 changes: 1 addition & 4 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ pub fn validate_transaction_regarding_header(
Some(*chain_id)
}
#[cfg(feature = "optimism")]
Transaction::Deposit(TxDeposit { .. }) => {
// TODO: I believe the chain id should be None here, but have to confirm.
None
}
Transaction::Deposit(TxDeposit { .. }) => None,
};
if let Some(chain_id) = chain_id {
if chain_id != chain_spec.chain().id() {
Expand Down
10 changes: 5 additions & 5 deletions crates/net/eth-wire/src/types/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ mod test {
data: hex!("0100ff")[..].into(),
},
],
bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(),
}
success: false,
#[cfg(feature = "optimism")]
deposit_nonce: None,
success: false,
#[cfg(feature = "optimism")]
deposit_nonce: None,
},
bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(),
},
]]),
};
Expand Down
7 changes: 2 additions & 5 deletions crates/primitives/src/chain/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,8 @@ pub static OP_GOERLI: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
(Hardfork::MuirGlacier, ForkCondition::Block(0)),
(Hardfork::Berlin, ForkCondition::Block(0)),
(Hardfork::London, ForkCondition::Block(0)),
(
Hardfork::Paris,
ForkCondition::TTD { fork_block: Some(0), total_difficulty: U256::from(0) },
),
(Hardfork::Shanghai, ForkCondition::Timestamp(0)),
(Hardfork::Paris, ForkCondition::Block(0)),
(Hardfork::Regolith, ForkCondition::Timestamp(1679079600)),
]),
optimism: Some(OptimismConfig { eip_1559_elasticity: 10, eip_1559_denominator: 50 }),
}
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ impl ReceiptWithBloom {
success,
cumulative_gas_used,
logs,
#[cfg(feature = "optimism")]
deposit_nonce: Some(deposit_nonce),
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/revm/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ where
cumulative_gas_used,
// convert to reth log
logs: result.into_logs().into_iter().map(into_reth_log).collect(),
#[cfg(feature = "optimism")]
deposit_nonce: None,
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl L1BlockInfo {
/// Calculate the gas cost of a transaction based on L1 block data posted on L2
pub fn calculate_tx_l1_cost(&mut self, tx: &TransactionSigned) -> U256 {
let rollup_data_gas_cost = U256::from(tx.input().iter().fold(0, |acc, byte| {
acc + if byte == &0x00 { ZERO_BYTE_COST } else { NON_ZERO_BYTE_COST }
acc + if *byte == 0x00 { ZERO_BYTE_COST } else { NON_ZERO_BYTE_COST }
}));

if tx.is_deposit() || rollup_data_gas_cost == U256::ZERO {
Expand Down

0 comments on commit bc46ac2

Please sign in to comment.