Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/node/src/add_ons/remote_block_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ where
continue;
}

if !self.config.build {
tracing::debug!(target: "scroll::remote_source", "Imported block is valid, but build is disabled, skipping build");
continue;
}

// Trigger block building on top of the imported block
self.orchestrator_handle.build_block();

Expand Down
5 changes: 5 additions & 0 deletions crates/node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ pub struct RemoteBlockSourceArgs {
value_name = "POLL_INTERVAL_MS"
)]
pub poll_interval_ms: u64,

/// Whether to build blocks using the remote source.
#[arg(long = "remote-source.build")]
pub build: bool,
}

/// Returns the total difficulty constant for the given chain.
Expand Down Expand Up @@ -1097,6 +1101,7 @@ mod tests {
enabled: true,
url: None,
poll_interval_ms: 100,
build: false,
},
require_l1_data_fee_buffer: false,
};
Expand Down
1 change: 1 addition & 0 deletions crates/node/src/test_utils/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ impl TestFixtureBuilder {
let mut remote_config = self.config.clone();
remote_config.sequencer_args.sequencer_enabled = true; // needs to build blocks
remote_config.sequencer_args.auto_start = false;
remote_config.remote_block_source_args.build = true;
remote_config.remote_block_source_args.enabled = true;
remote_config.remote_block_source_args.url = Some(sequencer_url);
// Use a fast poll interval for tests
Expand Down
1 change: 1 addition & 0 deletions crates/node/src/test_utils/reboot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl TestFixture {
let mut remote_config = self.config.clone();
remote_config.sequencer_args.sequencer_enabled = true;
remote_config.sequencer_args.auto_start = false;
remote_config.remote_block_source_args.build = true;
remote_config.remote_block_source_args.enabled = true;
remote_config.remote_block_source_args.url = Some(sequencer_url);
remote_config.remote_block_source_args.poll_interval_ms = 100;
Expand Down
1 change: 1 addition & 0 deletions tests/launch_rollup_node_remote_source.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ exec rollup-node node --chain /l2reth/l2reth-genesis-e2e.json --datadir=/l2reth
--remote-source.enabled \
--remote-source.url http://rollup-node-sequencer:8545 \
--remote-source.poll-interval-ms 100 \
--remote-source.build \
--l1.url http://l1-node:8545 \
--blob.mock
Loading