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
4 changes: 2 additions & 2 deletions crates/primitives/src/node/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ pub const DEV_SYSTEM_CONTRACT_ADDRESS: Address =
address!("000000000000000000000000000000000003dead");

/// The L1 start block for Mainnet.
pub const MAINNET_L1_START_BLOCK_NUMBER: u64 = 18318215;
pub const MAINNET_L1_START_BLOCK_NUMBER: u64 = 18306000;

/// The L1 start block for Sepolia.
pub const SEPOLIA_L1_START_BLOCK_NUMBER: u64 = 4041343;
pub const SEPOLIA_L1_START_BLOCK_NUMBER: u64 = 4038000;

/// The L1 start block for Devnet.
pub const DEV_L1_START_BLOCK_NUMBER: u64 = 0;
Expand Down
9 changes: 6 additions & 3 deletions crates/watcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,14 @@ where
/// Handles the batch commits events.
#[tracing::instrument(skip_all)]
async fn handle_batch_commits(&self, logs: &[Log]) -> L1WatcherResult<Vec<L1Notification>> {
// filter commit logs.
// filter commit logs and skip genesis batch (batch_index == 0).
let mut commit_logs_with_tx = logs
.iter()
.map(|l| (l, l.transaction_hash))
.filter_map(|(log, tx_hash)| {
let tx_hash = tx_hash?;
try_decode_log::<CommitBatch>(&log.inner)
.filter(|decoded| !decoded.data.batch_index.is_zero())
.map(|decoded| (log, decoded.data, tx_hash))
})
.collect::<Vec<_>>();
Expand Down Expand Up @@ -509,11 +510,13 @@ where
&self,
logs: &[Log],
) -> L1WatcherResult<Vec<L1Notification>> {
// filter finalize logs.
// filter finalize logs and skip genesis batch (batch_index == 0).
logs.iter()
.map(|l| (l, l.block_number))
.filter_map(|(log, bn)| {
try_decode_log::<FinalizeBatch>(&log.inner).map(|decoded| (decoded.data, bn))
try_decode_log::<FinalizeBatch>(&log.inner)
.filter(|decoded| !decoded.data.batch_index.is_zero())
.map(|decoded| (decoded.data, bn))
})
.map(|(decoded_log, maybe_block_number)| {
// fetch the finalize transaction.
Expand Down