Skip to content

fix(cheat-codes): warpL2TimeAtLeastBy advances relative to leading clock#23675

Merged
PhilWindle merged 2 commits into
merge-train/spartanfrom
cb/fix-warp-l2-time-by
May 29, 2026
Merged

fix(cheat-codes): warpL2TimeAtLeastBy advances relative to leading clock#23675
PhilWindle merged 2 commits into
merge-train/spartanfrom
cb/fix-warp-l2-time-by

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Problem

CI on merge-train/spartan failed in yarn-project/end-to-end/src/composed/e2e_cheat_codes.test.ts (log → test-engine 358cb51c378c69134baba53d3b9feb67):

e2e_cheat_codes › warpL2TimeAtLeastBy advances time by at least the duration
  expect(received).toBeGreaterThanOrEqual(expected)
  Expected: >= 1780048759   (timestampBefore_L2 + 100)
  Received:    1780048731    (advanced only ~72s)

Root cause

CheatCodes.warpL2TimeAtLeastBy(duration) computed its target as eth.lastBlockTimestamp() (L1) + duration, but its documented contract is that the L2 timestamp advances by at least duration, and the test measures advancement against the latest L2 block timestamp.

In the composed test a live sequencer mines L2 blocks at slot boundaries that can run ahead of anvil's L1 clock. When the latest L2 block timestamp leads L1, adding duration to L1 produces a target below latestL2 + duration, so the resulting block advances L2 time by less than duration and the assertion fails. This is a latent correctness bug in the helper that surfaces non-deterministically depending on slot/L1 alignment.

Fix

Anchor the target to whichever clock leads — max(currentL1Timestamp, latestL2BlockTimestamp) + duration — before delegating to warpL2TimeAtLeastTo. This guarantees the post-warp L2 block is at least duration ahead of the current one, while remaining a strict superset of the old behaviour (it never advances by less than before), so other callers (e2e_expiration_timestamp, e2e_contract_updates, blacklist_token_contract, e2e_automine_smoke, lending_simulator) are unaffected.

Single-file change in yarn-project/aztec/src/testing/cheat_codes.ts.


Created by claudebox · group: slackbot

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label May 29, 2026
@PhilWindle PhilWindle marked this pull request as ready for review May 29, 2026 09:45
@PhilWindle PhilWindle merged commit f5ba790 into merge-train/spartan May 29, 2026
25 of 31 checks passed
@PhilWindle PhilWindle deleted the cb/fix-warp-l2-time-by branch May 29, 2026 09:45
PhilWindle pushed a commit that referenced this pull request May 29, 2026
)

## Problem

CI on `merge-train/spartan` is failing in the `aztec-nr` step
([log](http://ci.aztec-labs.com/1780053790683323)) with
`BoundedVec::from_parts_unchecked` deprecation errors under `nargo check
--deny-warnings`.

The train's noir submodule had diverged from `next`:

| Branch | noir pin | date | `from_parts_unchecked` deprecated? |
|---|---|---|---|
| `next` | `f1a4575` | May 11 | no |
| `merge-train/spartan` | `4d039268` | May 28 | **yes** |

The newer pin (`4d039268`) was pulled onto the train by **PR #23675**
("fix(cheat-codes): warpL2TimeAtLeastBy…"), which bumped
`noir/noir-repo` from the May-11 pin to a May-28 nightly. That nightly
added `#[deprecated]` to `BoundedVec::from_parts_unchecked`, and since
aztec-nr builds with `--deny-warnings`, the two remaining call sites
became hard errors. The two noir commits are on divergent lines (neither
is an ancestor of the other), so the train was simply ahead of `next` on
noir.

## Fix

Pin the train's noir back to exactly what `next` uses. Only two files
differed from `next`:

- `noir/noir-repo` → `f1a4575` (next's pin)
- `avm-transpiler/Cargo.lock` → next's version (it had been re-synced to
the May-28 noir by #23683; restored to match the May-11 pin)

This restores parity with `next` and removes the deprecated API
entirely, so no aztec-nr source change is needed.

## Verification

Built `nargo` from the `f1a4575` pin and ran the failing check against
the **unmodified** aztec-nr source:

- `nargo check --deny-warnings` → exit 0 (the deprecation attribute is
absent in `f1a4575`).

## Note

This is an alternative to #23687, which fixed the same failure by
patching the two aztec-nr call sites to use `from_parts` against the
newer noir. Pick one: this PR keeps the train aligned with `next`'s
noir; #23687 keeps the newer noir and updates the source. Closing
whichever isn't chosen.

---
*Created by
[claudebox](https://claudebox.work/v2/sessions/2f980b2000011f91) ·
group: `slackbot`*
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jun 4, 2026
BEGIN_COMMIT_OVERRIDE
test(e2e): unskip pipelining related e2e tests (AztecProtocol#23642)
fix(archiver): prune blocks without proposed checkpoint by end of build
slot (AztecProtocol#23606)
test: migrate benchmarks to pipelining setup (AztecProtocol#23647)
fix(p2p): fall back to archiver in BLOCK_TXS response validation
(AztecProtocol#23624)
docs(slashing): align operator and slasher docs with AZIP-7 (AztecProtocol#23494)
fix(p2p): do not penalize peers that signal a missing block with Fr.ZERO
(AztecProtocol#23672)
chore: adjust metrics deployment (AztecProtocol#23676)
fix(cheat-codes): warpL2TimeAtLeastBy advances relative to leading clock
(AztecProtocol#23675)
chore: tighten node pool sizes (AztecProtocol#23678)
chore: remove archival nodes (AztecProtocol#23630)
chore: merge blob sink duties into RPC node (AztecProtocol#23631)
fix: sync avm-transpiler Cargo.lock with noir submodule (AztecProtocol#23683)
fix(spartan): set validator lag env vars in tps-scenario (AztecProtocol#23684)
fix: make world-state hash queries reorg-aware to close getWorldState
race (AztecProtocol#23677)
fix: pin noir submodule to next's version on merge-train/spartan
(AztecProtocol#23690)
fix: ensure image ref is used by bench runner (AztecProtocol#23682)
fix(ci): retry aztec-nr nargo dependency clone on transient network
flake (AztecProtocol#23653)
chore: run one-off jobs on network nodes (AztecProtocol#23701)
fix: simulate proposals inside target slot (AztecProtocol#23692)
chore: smaller eth-devnet (AztecProtocol#23704)
chore: enable testnet autoscaling (AztecProtocol#23705)
feat(api)!: redesign node log retrieval API around tag-based queries
(AztecProtocol#23625)
fix(sequencer): set own proposed checkpoint locally instead of via p2p
loopback (AztecProtocol#23659)
END_COMMIT_OVERRIDE
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