Skip to content

fix(node): handle slot zero in getL2ToL1Messages (backport to v4-next)#21418

Merged
spalladino merged 2 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-21386-v4-next
Mar 12, 2026
Merged

fix(node): handle slot zero in getL2ToL1Messages (backport to v4-next)#21418
spalladino merged 2 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-21386-v4-next

Conversation

@AztecBot
Copy link
Collaborator

Summary

Backport of #21386 to v4-next.

If there was a block in L2 slot zero, then getL2ToL1Messages returned an incorrect response, since the slotNumber !== previousSlotNumber would fail in the first iteration of the loop. Fix replaces manual loop with chunkBy utility.

Conflicts

Minor import conflict in server.test.ts — v4-next didn't have BlockHash in the block import (not needed by new tests). Resolved by importing only CheckpointedL2Block and L1PublishedData.

Original PR

#21386 by @spalladino

ClaudeBox log: https://claudebox.work/s/759eab130be2139b?run=1

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 12, 2026
@spalladino spalladino marked this pull request as ready for review March 12, 2026 12:30
@spalladino spalladino enabled auto-merge (squash) March 12, 2026 12:30
@spalladino spalladino merged commit 9fd9a0d into backport-to-v4-next-staging Mar 12, 2026
21 checks passed
@spalladino spalladino deleted the claudebox/backport-21386-v4-next branch March 12, 2026 12:48
ludamad pushed a commit that referenced this pull request Mar 12, 2026
#21418)

Backport of #21386
to v4-next.

If there was a block in L2 slot zero, then `getL2ToL1Messages` returned
an incorrect response, since the `slotNumber !== previousSlotNumber`
would fail in the first iteration of the loop. Fix replaces manual loop
with `chunkBy` utility.

Minor import conflict in `server.test.ts` — v4-next didn't have
`BlockHash` in the block import (not needed by new tests). Resolved by
importing only `CheckpointedL2Block` and `L1PublishedData`.

#21386 by
@spalladino

ClaudeBox log: https://claudebox.work/s/759eab130be2139b?run=1

---------

Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants