fix: Wait until rollup catches up to inbox for msg sync#17039
Merged
spalladino merged 1 commit intonextfrom Sep 16, 2025
Merged
fix: Wait until rollup catches up to inbox for msg sync#17039spalladino merged 1 commit intonextfrom
spalladino merged 1 commit intonextfrom
Conversation
LHerskind
approved these changes
Sep 15, 2025
| /** Returns whether a message with the given leaf index is synced */ | ||
| static isMessageSynced(index: bigint, l2BlockNumber: number): boolean { | ||
| const messageL2Block = this.l2BlockFromIndex(index); | ||
| return messageL2Block <= l2BlockNumber; |
Contributor
There was a problem hiding this comment.
Think you can get away with
return messageL2Block <= l2BlockNumber + 1;since the messages should be inserted at the start of the block, so can work if it is the next block. But this is stricter so should also work well, just slightly longer than needed.
d20698a to
ae630ed
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 16, 2025
Do not acknowledge an L1 to L2 message as synced until the rollup pending block number has caught up with the message block. The inbox block number may drift way ahead of the rollup block number in the event of a reorg or if there are too many l1 to l2 messages being inserted. Note that the existing approach used throughout the codebase of waiting for two blocks if flawed, since if there was an earlier reorg on the chain, then the inbox will have drifted and the message will require more blocks to become available. This PR does NOT remove the existing isL1ToL2MessageSynced call, since it's used all over the place, but rather flags it as deprecated. Instead, the node and pxe now expose a function that returns the block in which the message is to be available, and aztecjs provides a helper to wait until the block is reached. The bot factory is updated to use this new approach.
alexghr
added a commit
that referenced
this pull request
Sep 16, 2025
This PR takes the changes introduced by [this](#17039) PR and applies then to `v2`. --------- Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com> Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com> Co-authored-by: alexghr <3816165+alexghr@users.noreply.github.com>
Do not acknowledge an L1 to L2 message as synced until the rollup pending block number has caught up with the message block. The inbox block number may drift way ahead of the rollup block number in the event of a reorg or if there are too many l1 to l2 messages being inserted. Note that the existing approach used throughout the codebase of waiting for two blocks if flawed, since if there was an earlier reorg on the chain, then the inbox will have drifted and the message will require more blocks to become available. This PR does NOT remove the existing isL1ToL2MessageSynced call, since it's used all over the place, but rather flags it as deprecated. Instead, the node and pxe now expose a function that returns the block in which the message is to be available, and aztecjs provides a helper to wait until the block is reached. The bot factory is updated to use this new approach.
ae630ed to
7b8396d
Compare
Contributor
Author
|
I've fixed a flake on the |
spalladino
added a commit
that referenced
this pull request
Sep 25, 2025
Do not acknowledge an L1 to L2 message as synced until the rollup pending block number has caught up with the message block. The inbox block number may drift way ahead of the rollup block number in the event of a reorg or if there are too many l1 to l2 messages being inserted. Note that the existing approach used throughout the codebase of waiting for two blocks if flawed, since if there was an earlier reorg on the chain, then the inbox will have drifted and the message will require more blocks to become available. This PR does NOT remove the existing isL1ToL2MessageSynced call, since it's used all over the place, but rather flags it as deprecated. Instead, the node and pxe now expose a function that returns the block in which the message is to be available, and aztecjs provides a helper to wait until the block is reached. The bot factory is updated to use this new approach.
PhilWindle
added a commit
that referenced
this pull request
Sep 29, 2025
This PR is a backport of the following into V2. #17169 #17176 #17186 #17178 #17177 #17130 #17039 #17230 #17245 #17273 #17186 #17192 #17194 #17225 #17285 #17312 #17326 --------- Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com> Co-authored-by: Santiago Palladino <santiago@aztec-labs.com> Co-authored-by: Santiago Palladino <spalladino@gmail.com> Co-authored-by: alexghr <3816165+alexghr@users.noreply.github.com>
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not acknowledge an L1 to L2 message as synced until the rollup
pending block number has caught up with the message block. The inbox
block number may drift way ahead of the rollup block number in the event
of a reorg or if there are too many l1 to l2 messages being inserted.
Note that the existing approach used throughout the codebase of waiting
for two blocks if flawed, since if there was an earlier reorg on the
chain, then the inbox will have drifted and the message will require
more blocks to become available.
This PR does NOT remove the existing isL1ToL2MessageSynced call, since
it's used all over the place, but rather flags it as deprecated.
Instead, the node and pxe now expose a function that returns the block
in which the message is to be available, and aztecjs provides a helper
to wait until the block is reached.
The bot factory is updated to use this new approach.