Skip to content

fix: set anvilSlotsInAnEpoch in e2e_offchain_payment to prevent premature finalization#21398

Closed
AztecBot wants to merge 1 commit intomerge-train/fairiesfrom
claudebox/fix-offchain-payment-reorg-test
Closed

fix: set anvilSlotsInAnEpoch in e2e_offchain_payment to prevent premature finalization#21398
AztecBot wants to merge 1 commit intomerge-train/fairiesfrom
claudebox/fix-offchain-payment-reorg-test

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 12, 2026

Summary

  • The reprocesses an offchain-delivered payment after an L1 reorg test in e2e_offchain_payment.test.ts was failing with Cannot rollback to block 8 as it is before finalized 9.
  • chore: Properly compute finalized block #21156 changed finalized block computation to use L1 finality. With Anvil's default slotsInAnEpoch=1, blocks finalize almost immediately (finalized = latest - 2), so by the time the test calls rollbackTo(block-1) the block is already finalized.
  • Adds anvilSlotsInAnEpoch: 32 to the test setup, matching the pattern in epochs_l1_reorgs.parallel.test.ts, so the finalized block lags far enough behind for rollbacks to work.

Full analysis: https://gist.github.com/AztecBot/1e9ac04fcafb77b3405ea001de7d1a00

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 12, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-offchain-payment-reorg-test branch from 794d44a to d1c3bc0 Compare March 12, 2026 15:21
@AztecBot AztecBot changed the title fix: pass force=true to rollbackTo in e2e_offchain_payment reorg test fix: set anvilSlotsInAnEpoch in e2e_offchain_payment to prevent premature finalization Mar 12, 2026
@ludamad
Copy link
Collaborator

ludamad commented Mar 12, 2026

Closing as duplicate — superseded by a newer attempt.

@ludamad ludamad closed this Mar 12, 2026
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