Skip to content

Commit

Permalink
chore: Remove optimism flag from eth consensus crate (#8760)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianBland authored Jun 11, 2024
1 parent 64d6853 commit 92d2f29
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion crates/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-blockchain-tree/optimism",
"reth-ethereum-consensus/optimism",
"reth-rpc/optimism",
]
3 changes: 0 additions & 3 deletions crates/ethereum/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ reth-primitives.workspace = true
reth-consensus.workspace = true

tracing.workspace = true

[features]
optimism = ["reth-primitives/optimism"]
13 changes: 2 additions & 11 deletions crates/ethereum/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,18 @@ impl Consensus for EthBeaconConsensus {
Ok(())
}

#[allow(unused_assignments)]
#[allow(unused_mut)]
fn validate_header_with_total_difficulty(
&self,
header: &Header,
total_difficulty: U256,
) -> Result<(), ConsensusError> {
let mut is_post_merge = self
let is_post_merge = self
.chain_spec
.fork(Hardfork::Paris)
.active_at_ttd(total_difficulty, header.difficulty);

#[cfg(feature = "optimism")]
{
// If OP-Stack then bedrock activation number determines when TTD (eth Merge) has been
// reached.
is_post_merge = self.chain_spec.is_bedrock_active_at_block(header.number);
}

if is_post_merge {
if !self.chain_spec.is_optimism() && !header.is_zero_difficulty() {
if !header.is_zero_difficulty() {
return Err(ConsensusError::TheMergeDifficultyIsNotZero)
}

Expand Down

0 comments on commit 92d2f29

Please sign in to comment.