fix(archiver): do not query MessageSent events by blockhash#22641
Merged
spalladino merged 1 commit intomerge-train/spartanfrom Apr 21, 2026
Merged
fix(archiver): do not query MessageSent events by blockhash#22641spalladino merged 1 commit intomerge-train/spartanfrom
spalladino merged 1 commit intomerge-train/spartanfrom
Conversation
Switch getMessageSentEventByHash from blockHash lookup to a +/-5 block window, so we can still find a message after an L1 reorg that moved it to a different block. Add a fast-path in rollbackL1ToL2Messages that matches the local rolling hash against the current remote state, avoiding per-message log queries when the reorg only removed messages.
spalladino
added a commit
that referenced
this pull request
Apr 17, 2026
Use remote messages state in rollbackL1ToL2Messages. On v4 the syncpoint does not need treeInProgress, so only destructure messagesRollingHash. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PhilWindle
approved these changes
Apr 21, 2026
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.
When rolling back local L1 to L2 messages, we query each message against L1 by fetching its log. Since #22154 (v5) this was done via blockHash. However, querying logs by blockhash throws an RPC error if the block no longer exists, which is likely if the local message was removed due to an L1 reorg. We never hit this during testing because of foundry-rs/foundry#14371.
To fix this, we know query by an L1 block number range. This also allows to still find the locall message on L1 even if it was moved by a few blocks due to a small reorg.
Additionally, this PR adds a fast-path in
rollbackL1ToL2Messagesthat matches the local rolling hash against the current remote state, so we don't query by event when we don't need to.