Skip to content

Commit 54d5b91

Browse files
committed
fix(restart): Fix sl chain id
Signed-off-by: Danil Lugovskoi <deniallugo@gmail.com>
1 parent 9eeb34a commit 54d5b91

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

bin/withdrawal-finalizer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ async fn main() -> Result<()> {
269269
we_tx_wrapped,
270270
));
271271

272-
let watcher_handle = tokio::spawn(watcher.run(blocks_rx, we_rx, from_l2_block));
272+
let watcher_handle = tokio::spawn(watcher.run(blocks_rx, we_rx, from_l2_block, sl_chain_id));
273273

274274
let block_events_handle = tokio::spawn(event_mux.run_with_reconnects(
275275
config.diamond_proxy_addr,

watcher/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ where
6060
block_events: BE,
6161
withdrawal_events: WE,
6262
from_l2_block: u64,
63+
sl_chain_id: u32,
6364
) -> Result<()>
6465
where
6566
BE: Stream<Item = BlockEvent> + Send + 'static,
@@ -90,6 +91,7 @@ where
9091
pgpool.clone(),
9192
block_events,
9293
l2_provider,
94+
sl_chain_id,
9395
));
9496
let l2_loop_handler = tokio::spawn(async move {
9597
run_l2_events_loop(
@@ -346,7 +348,12 @@ async fn process_withdrawals_in_block(
346348
Ok(())
347349
}
348350

349-
async fn run_l1_events_loop<BE, M2>(pool: PgPool, be: BE, l2_middleware: M2) -> Result<()>
351+
async fn run_l1_events_loop<BE, M2>(
352+
pool: PgPool,
353+
be: BE,
354+
l2_middleware: M2,
355+
chain_id: u32,
356+
) -> Result<()>
350357
where
351358
BE: Stream<Item = BlockEvent>,
352359
M2: ZksyncMiddleware,
@@ -357,7 +364,6 @@ where
357364
let mut batch_begin = Instant::now();
358365
let batch_backoff = Duration::from_secs(5);
359366
let batch_size = 1024;
360-
let chain_id = l2_middleware.get_chain_id().await?;
361367
while let Some(event) = be.next().await {
362368
tracing::debug!("block event {event}");
363369
block_event_batch.push(event);

0 commit comments

Comments
 (0)