Skip to content

Commit

Permalink
fix: enable autoseal in op correctly (#8961)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 19, 2024
1 parent 254647c commit d0b27f0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/optimism/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ workspace = true
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-payload-builder.workspace = true
reth-auto-seal-consensus.workspace = true
reth-basic-payload-builder.workspace = true
reth-consensus.workspace = true
reth-optimism-payload-builder.workspace = true
reth-rpc-types.workspace = true
reth-rpc.workspace = true
Expand Down Expand Up @@ -67,4 +69,5 @@ optimism = [
"reth-optimism-payload-builder/optimism",
"reth-beacon-consensus/optimism",
"reth-revm/optimism",
"reth-auto-seal-consensus/optimism",
]
9 changes: 7 additions & 2 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use reth_transaction_pool::{
blobstore::DiskFileBlobStore, CoinbaseTipOrdering, TransactionPool,
TransactionValidationTaskExecutor,
};
use std::sync::Arc;

/// Type configuration for a regular Optimism node.
#[derive(Debug, Default, Clone)]
Expand Down Expand Up @@ -317,9 +318,13 @@ impl<Node> ConsensusBuilder<Node> for OptimismConsensusBuilder
where
Node: FullNodeTypes,
{
type Consensus = OptimismBeaconConsensus;
type Consensus = Arc<dyn reth_consensus::Consensus>;

async fn build_consensus(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::Consensus> {
Ok(OptimismBeaconConsensus::new(ctx.chain_spec()))
if ctx.is_dev() {
Ok(Arc::new(reth_auto_seal_consensus::AutoSealConsensus::new(ctx.chain_spec())))
} else {
Ok(Arc::new(OptimismBeaconConsensus::new(ctx.chain_spec())))
}
}
}

0 comments on commit d0b27f0

Please sign in to comment.