Skip to content

Commit d3340d8

Browse files
authored
feat: add cli arg to disbable block building for remote source mode (#490)
* add cli arg to disbable block building for remote source mode * add cli remote source build arg to docker integration tests
1 parent 7c58ea8 commit d3340d8

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

crates/node/src/add_ons/remote_block_source.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ where
190190
continue;
191191
}
192192

193+
if !self.config.build {
194+
tracing::debug!(target: "scroll::remote_source", "Imported block is valid, but build is disabled, skipping build");
195+
continue;
196+
}
197+
193198
// Trigger block building on top of the imported block
194199
self.orchestrator_handle.build_block();
195200

crates/node/src/args.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,10 @@ pub struct RemoteBlockSourceArgs {
976976
value_name = "POLL_INTERVAL_MS"
977977
)]
978978
pub poll_interval_ms: u64,
979+
980+
/// Whether to build blocks using the remote source.
981+
#[arg(long = "remote-source.build")]
982+
pub build: bool,
979983
}
980984

981985
/// Returns the total difficulty constant for the given chain.
@@ -1097,6 +1101,7 @@ mod tests {
10971101
enabled: true,
10981102
url: None,
10991103
poll_interval_ms: 100,
1104+
build: false,
11001105
},
11011106
require_l1_data_fee_buffer: false,
11021107
};

crates/node/src/test_utils/fixture.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ impl TestFixtureBuilder {
726726
let mut remote_config = self.config.clone();
727727
remote_config.sequencer_args.sequencer_enabled = true; // needs to build blocks
728728
remote_config.sequencer_args.auto_start = false;
729+
remote_config.remote_block_source_args.build = true;
729730
remote_config.remote_block_source_args.enabled = true;
730731
remote_config.remote_block_source_args.url = Some(sequencer_url);
731732
// Use a fast poll interval for tests

crates/node/src/test_utils/reboot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ impl TestFixture {
112112
let mut remote_config = self.config.clone();
113113
remote_config.sequencer_args.sequencer_enabled = true;
114114
remote_config.sequencer_args.auto_start = false;
115+
remote_config.remote_block_source_args.build = true;
115116
remote_config.remote_block_source_args.enabled = true;
116117
remote_config.remote_block_source_args.url = Some(sequencer_url);
117118
remote_config.remote_block_source_args.poll_interval_ms = 100;

tests/launch_rollup_node_remote_source.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ exec rollup-node node --chain /l2reth/l2reth-genesis-e2e.json --datadir=/l2reth
3030
--remote-source.enabled \
3131
--remote-source.url http://rollup-node-sequencer:8545 \
3232
--remote-source.poll-interval-ms 100 \
33+
--remote-source.build \
3334
--l1.url http://l1-node:8545 \
3435
--blob.mock

0 commit comments

Comments
 (0)