Skip to content

fix(archiver): do not query MessageSent events by blockhash#22641

Merged
spalladino merged 1 commit intomerge-train/spartanfrom
spl/no-blockhash-in-query
Apr 21, 2026
Merged

fix(archiver): do not query MessageSent events by blockhash#22641
spalladino merged 1 commit intomerge-train/spartanfrom
spl/no-blockhash-in-query

Conversation

@spalladino
Copy link
Copy Markdown
Contributor

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 rollbackL1ToL2Messages that matches the local rolling hash against the current remote state, so we don't query by event when we don't need to.

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
…22641) [conflicts]

Cherry-pick of 4a10365 with unresolved conflicts in l1_synchronizer.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
@spalladino spalladino changed the base branch from next to merge-train/spartan April 17, 2026 17:22
@spalladino spalladino enabled auto-merge (squash) April 17, 2026 17:22
@spalladino spalladino merged commit 711d714 into merge-train/spartan Apr 21, 2026
36 checks passed
@spalladino spalladino deleted the spl/no-blockhash-in-query branch April 21, 2026 11:55
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.

3 participants