Skip to content

Conversation

@yiweichi
Copy link
Member

@yiweichi yiweichi commented Oct 22, 2025

This PR add feature to gracefully handle commit/finalize genesis batch event.

  • set the mainnet/sepolia start block number to the one we commit genesis batch
  • skip event commit/finalize genesis batch, since it was already persisted default empty batch in db.

corresponding issue: #369

@yiweichi yiweichi requested a review from greged93 October 22, 2025 07:50
@yiweichi yiweichi requested a review from frisitano October 22, 2025 07:50
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 22, 2025

CodSpeed Performance Report

Merging #383 will not alter performance

Comparing feat-gracefull-handle-commit-genesis-batch-event (43f0005) with main (1146460)

Summary

✅ 2 untouched

@greged93
Copy link
Collaborator

just a note here: the genesis batch isn't persisted to DB, we persist a default empty batch. However, the genesis batch commits to the genesis of the chain, which we already have in the EN.

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little concerned that we are adding additional computational overhead in the statement for no functional difference in processing:

                    .filter(|decoded| !decoded.data.batch_index.is_zero())

@yiweichi
Copy link
Member Author

yiweichi commented Oct 22, 2025

I'm a little concerned that we are adding additional computational overhead in the statement for no functional difference in processing:

                    .filter(|decoded| !decoded.data.batch_index.is_zero())

Claude says the computational overhead is minimal, shouldn't bring performance issue for L1 watcher at all. And we kinda need this filter to skip genesis batch commit event.

I can move the filter logic above notifications.push(L1Notification::BatchCommit(BatchCommitData {, but this look more elegant.

@yiweichi yiweichi requested a review from frisitano October 22, 2025 12:14
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yiweichi yiweichi merged commit 59cb712 into main Oct 22, 2025
15 checks passed
@yiweichi yiweichi deleted the feat-gracefull-handle-commit-genesis-batch-event branch October 22, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants