Skip to content

fix(aztec-node): include upcoming checkpoint's L1 to L2 messages in simulatePublicCalls#23163

Merged
PhilWindle merged 3 commits into
merge-train/spartanfrom
spl/fix-simulate-l1-to-l2-fork
May 13, 2026
Merged

fix(aztec-node): include upcoming checkpoint's L1 to L2 messages in simulatePublicCalls#23163
PhilWindle merged 3 commits into
merge-train/spartanfrom
spl/fix-simulate-l1-to-l2-fork

Conversation

@spalladino

@spalladino spalladino commented May 11, 2026

Copy link
Copy Markdown
Contributor

Motivation

simulatePublicCalls forks the world state at the latest synced block but never inserted the L1 to L2 messages that would be added at the start of the next checkpoint, if the next block falls in a new checkpoint.

Approach

If the last proposed block matches the last block in the last proposed checkpoint (read it carefully, I promise it makes sense), then the last proposed block is the last block in its checkpoint, so the next block will land on a new checkpoint, so we add the L1 to L2 messages to the world-state fork before simulating.

@spalladino spalladino added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels May 11, 2026
@spalladino spalladino force-pushed the spl/fix-simulate-l1-to-l2-fork branch from 63d4fab to 5db944c Compare May 12, 2026 12:09
…latePublicCalls

simulatePublicCalls forks the world state at the latest synced block but
never inserted the L1→L2 messages that would be added at the start of the
next checkpoint. Public AVM opcodes l1_to_l2_msg_exists and
consume_l1_to_l2_message read from the fork's L1_TO_L2_MESSAGE_TREE, so
simulations diverged from on-chain execution when the next block opened a
new checkpoint.

The fix derives the pipelining-aware target slot via the epoch cache,
compares it against the latest block's slot, and on a slot crossing fetches
and appends the next checkpoint's messages onto the simulation fork. The
fork is now pinned to the captured latest block number to avoid drift
between syncImmediate and fork.

The pad-and-append pattern is also extracted into a shared
appendL1ToL2MessagesToTree helper in @aztec/stdlib/messaging and adopted by
the four existing inline duplicates. A new resumeCheckpoint guard rejects
the empty-blocks case explicitly. The end-to-end test for public L1→L2
message consumption now also exercises the simulate path.
@spalladino spalladino force-pushed the spl/fix-simulate-l1-to-l2-fork branch from 5db944c to 12e9c79 Compare May 12, 2026 21:46
@spalladino spalladino force-pushed the spl/fix-simulate-l1-to-l2-fork branch from 12e9c79 to 9790acc Compare May 12, 2026 21:52
@spalladino spalladino changed the title fix(aztec-node): include upcoming checkpoint's L1→L2 messages in simulatePublicCalls fix(aztec-node): include upcoming checkpoint's L1 to L2 messages in simulatePublicCalls May 12, 2026
@spalladino spalladino marked this pull request as ready for review May 12, 2026 21:56
@PhilWindle PhilWindle merged commit 1e7eb72 into merge-train/spartan May 13, 2026
22 of 28 checks passed
@PhilWindle PhilWindle deleted the spl/fix-simulate-l1-to-l2-fork branch May 13, 2026 14:48
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request May 16, 2026
BEGIN_COMMIT_OVERRIDE
fix(test): warp L1 forward when proposer scan hits EpochNotStable
(AztecProtocol#22967)
test(e2e): fail epochs tests on proposer-rollup-check-failed (AztecProtocol#22965)
fix: grafana switch to aztec_status="proposed" (AztecProtocol#22978)
chore: update benchmark scraper (AztecProtocol#22984)
test(e2e): migrate simple epoch tests to pipelining (AztecProtocol#22973)
chore: remove top-level yarn.lock (AztecProtocol#22987)
refactor(archiver)!: unify L2BlockSource checkpoint lookups via query
objects (AztecProtocol#22933)
fix(sequencer): bounded sweep instead of event scan for governance
proposal check (AztecProtocol#22989)
fix(docs): allow webapp-tutorial yarn install to populate empty lockfile
in CI (AztecProtocol#23000)
test(e2e): enable pipelining in l1-reorgs and mbps redistribution tests
(AztecProtocol#23009)
fix(archiver): restore pending block height metric under pipelining
(AztecProtocol#22994)
chore(p2p): remove skipped validation result option (AztecProtocol#23034)
refactor(p2p)!: remove slow tx collection flow (AztecProtocol#22878)
chore(spartan): add next-net-clone environment config (AztecProtocol#22995)
chore(sequencer): add context to proposer-rollup-check-failed logs
(AztecProtocol#23071)
test(e2e): wait for archiver sync before asserting pipelining (AztecProtocol#22997)
refactor(node-rpc)!: remove deprecated AztecNode methods and
L2BlockSource tip helpers (AztecProtocol#22934)
feat(p2p): detect and track announce IP changes at runtime (AztecProtocol#22405)
test: mark tx_stats_bench 10 TPS as flake-retryable on
merge-train/spartan (AztecProtocol#23083)
fix(sequencer): bind vote-only multicalls to target slot under
pipelining (AztecProtocol#23090)
feat(sequencer): build optimistically across pruning epoch boundary
(AztecProtocol#23056)
fix(sequencer): use chainTipsOverride.pending for log context (AztecProtocol#23098)
test(e2e): relax post-boundary slot assertion in
epochs_proof_at_boundary (AztecProtocol#23108)
fix(bb-prover): pool long-lived bb verifier processes instead of
spawning per-call (AztecProtocol#23093)
fix(sequencer): anchor fee asset price modifier to predicted parent
(AztecProtocol#23113)
chore: error log when L1 head timestamp drifts (AztecProtocol#22947)
fix(sequencer): override full parent checkpoint cell in pipelined
simulation (AztecProtocol#23073)
test(e2e): enable pipelining on missed l1 slot test (AztecProtocol#23068)
fix: more robust metrics reporting in IRM monitor (AztecProtocol#23038)
fix: preserve LMDB slashing protection (AztecProtocol#23145)
test(e2e): enable pipelining on p2p tests (AztecProtocol#23070)
fix(archiver): move L2 tips cache refresh out of write transactions
(AztecProtocol#23110)
test(e2e): fix data_withholding_slash flake by freezing L1 across
restart (AztecProtocol#23162)
fix(validator): include proposed checkpoint out-hashes when validating
checkpoint proposals (AztecProtocol#23119)
refactor(config): drop nested config option, flatten l1Contracts
(AztecProtocol#23143)
test(e2e): bump bash TIMEOUT for e2e_p2p/add_rollup to match jest 20m
(AztecProtocol#23177)
fix(p2p): chunk archive of mined txs on block finalization (A-969)
(AztecProtocol#23085)
fix(p2p): stream tx pool hydration to bound startup memory (A-968)
(AztecProtocol#23086)
chore: remove orphan --archiver flag usages from start invocations
(AztecProtocol#23186)
feat(ci): daily merge-train/spartan stale-PR notifier (AztecProtocol#23189)
fix: preserve contract artifact permissions (AztecProtocol#23174)
fix(ci3): accept slashes in /list/<path:key> for merge-train
history (AztecProtocol#23160)
feat(ci): route merge-train/spartan flake notifications to
#team-alpha-ci (AztecProtocol#23219)
fix(cheat-codes): wait for post-warp L2 block in warpL2TimeAtLeastTo
(AztecProtocol#23213)
feat: slash attesters signing over bad checkpoints (AztecProtocol#23180)
refactor(prover-client): split orchestrator into sub-tree + top-tree
pair (AztecProtocol#22996)
fix(srs): retry transient CRS HTTP downloads with exponential backoff
(AztecProtocol#23244)
refactor(p2p): remove old reqresp mode (AztecProtocol#23158)
docs(sequencer-client): rewrite top-level and timing READMEs (AztecProtocol#23149)
fix(aztec-node): include upcoming checkpoint's L1 to L2 messages in
simulatePublicCalls (AztecProtocol#23163)
END_COMMIT_OVERRIDE
PhilWindle pushed a commit that referenced this pull request May 20, 2026
Retrying #23313 

The original PR failed due to timeout in docs/examples, which was caused
by `aztecjs_advanced` failing repeatedely due to the bug fixed in
842887b which had been introduced in
#23163. This PR
brings the changes back from #23313, plus the simulation fix, plus an
extra timeout to catch any other deviations since we were already pretty
close to the 600s timeout before enabling pipelining.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants