Skip to content

Commit

Permalink
fix: apply legacy cleanup to opnode (#13775)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jan 11, 2025
1 parent 8e7768d commit cc84f83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
8 changes: 6 additions & 2 deletions crates/optimism/bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ fn main() {
if let Err(err) =
Cli::<OpChainSpecParser, RollupArgs>::parse().run(|builder, rollup_args| async move {
let engine_tree_config = TreeConfig::default()
.with_persistence_threshold(rollup_args.persistence_threshold)
.with_memory_block_buffer_target(rollup_args.memory_block_buffer_target);
.with_persistence_threshold(builder.config().engine.persistence_threshold)
.with_memory_block_buffer_target(builder.config().engine.memory_block_buffer_target)
.with_state_root_task(builder.config().engine.state_root_task_enabled)
.with_always_compare_trie_updates(
builder.config().engine.state_root_task_compare_updates,
);

let op_node = OpNode::new(rollup_args.clone());
let handle = builder
Expand Down
15 changes: 1 addition & 14 deletions crates/optimism/node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
//! clap [Args](clap::Args) for optimism rollup configuration
use reth_node_builder::engine_tree_config::{
DEFAULT_MEMORY_BLOCK_BUFFER_TARGET, DEFAULT_PERSISTENCE_THRESHOLD,
};

/// Parameters for rollup configuration
#[derive(Debug, Clone, PartialEq, Eq, clap::Args)]
#[command(next_help_heading = "Rollup")]
Expand Down Expand Up @@ -37,16 +33,9 @@ pub struct RollupArgs {
/// enables discovery v4 if provided
#[arg(long = "rollup.discovery.v4", default_value = "false")]
pub discovery_v4: bool,

/// Configure persistence threshold for engine experimental.
#[arg(long = "engine.persistence-threshold", default_value_t = DEFAULT_PERSISTENCE_THRESHOLD)]
pub persistence_threshold: u64,

/// Configure the target number of blocks to keep in memory.
#[arg(long = "engine.memory-block-buffer-target", default_value_t = DEFAULT_MEMORY_BLOCK_BUFFER_TARGET)]
pub memory_block_buffer_target: u64,
}

#[allow(clippy::derivable_impls)]
impl Default for RollupArgs {
fn default() -> Self {
Self {
Expand All @@ -55,8 +44,6 @@ impl Default for RollupArgs {
enable_genesis_walkback: false,
compute_pending_block: false,
discovery_v4: false,
persistence_threshold: DEFAULT_PERSISTENCE_THRESHOLD,
memory_block_buffer_target: DEFAULT_MEMORY_BLOCK_BUFFER_TARGET,
}
}
}
Expand Down

0 comments on commit cc84f83

Please sign in to comment.