feat: merge-train/spartan-v5 - #24384
Merged
Merged
Conversation
…e automine race (#24378) ## Context anvil's automine races a batched `forge script` broadcast: it mines a block on the first ready tx and leaves txs that arrived just after the trigger sitting in the pool, so forge waits forever for their receipts. The previous workaround kept automine on and ran a JS txpool watchdog that `evm_mine`d any stragglers — extra moving parts on every deploy. This PR is a fix for an issue introduced in #24316. ## Approach Sidestep the race instead of policing it: on anvil, broadcast one tx at a time (`--batch-size 1`). With only a single tx in flight there is nothing for the auto-miner to strand, and automine still mines it instantly so deploys stay fast. Real chains keep forge's default batch size. - Drop the watchdog, the `anvil_getAutomine` probe, and all mining-mode manipulation; keep `web3_clientVersion` anvil detection only to choose the batch size. - Add a hard broadcast timeout (`FORGE_BROADCAST_TIMEOUT_MS`, default 120s anvil / 600s otherwise) that SIGTERMs then SIGKILLs forge and exits non-zero, so a hung broadcast fails fast instead of waiting out the jest hook budget. - Preserve the buffer-stdout-and-flush-after-exit behavior the TS deploy helper relies on to parse `JSON DEPLOY RESULT:`. Validated locally: 20/20 fresh-anvil deploys clean at ~350ms (on par with the watchdog path, far faster than interval mining), and `@aztec/ethereum` `rollup_cheat_codes.test.ts` passes.
…ut as the known flake (#24385) ## What Extends the existing `.test_patterns.yml` flake entry for `src/composed/e2e_token_bridge_tutorial_test.test.ts` so it also matches the viem `WaitForTransactionReceiptTimeoutError` confirmation-timeout failure mode, not just the jest per-test timeout. ## Why — the `merge-train/spartan-v5` CI red on this branch The train CI run failed on this one test: ``` FAIL src/composed/e2e_token_bridge_tutorial_test.test.ts ✕ Deploys tokens & bridges to L1 & L2, mints & publicly bridges tokens (189531 ms) WaitForTransactionReceiptTimeoutError: Timed out while waiting for transaction with hash "0x01f3fb09…" to be confirmed. Version: viem@2.38.2 ``` (test log: http://ci.aztec-labs.com/1643e817d7242e0e) This test is **already known-flaky** — there is an entry for it owned by @spalladino — but its `error_regex` only covered `Exceeded timeout of N ms for a test` (the jest per-test budget). In this run the test failed *faster* (~189s of its 900s budget) because viem's own per-tx confirmation timeout fired first, producing a different error string. The flake matcher (`grep -E` over the test log in `ci3/get_test_entry`) therefore did not classify it, so the failure went red and blocked the train. The L1↔L2 bridging flow sends a series of L1 txs against an automining anvil that the local-network sequencer and cheat codes also drive concurrently. Under load a tx can sit unmined past viem's confirmation window — the same automine-race class, surfacing here in the test's own L1 txs. Both observed symptoms (jest timeout, viem confirmation timeout) are the same flake. ## Not caused by #24378 The train HEAD is #24378 (`broadcast L1 deploy txs one at a time on anvil`), but that change only touches `l1-contracts/scripts/forge_broadcast.js` (the L1 *contract deploy* path). In the failing run that deploy **succeeded** (`[forge_broadcast] Broadcast succeeded` at 20:52:19); the failure is ~3.5 min later in the test body, which never goes through `forge_broadcast.js`. In every version (pre-#24316, #24316, #24378) anvil ends in automine after deploy, so #24378 does not change the test-body mining environment. #24378 was simply the train HEAD when this pre-existing flake surfaced in a mode the pattern didn't catch. ## Verification A full `./bootstrap.sh ci` run is neither meaningful nor feasible for a flake-classification config change (and the test is non-deterministic by nature). The meaningful check is that `ci3/get_test_entry` now classifies the observed failure: - `yq` parses the updated entry cleanly. - `get_test_entry "<compose token_bridge_tutorial cmd>" <log-with-WaitForTransactionReceiptTimeoutError>` now returns the entry (→ flake, non-blocking). - A negative control (an unrelated error line) still returns nothing, so the broadened regex stays scoped to this test's timeout flake. --- *Created by [claudebox](https://claudebox.work/v2/sessions/c01cbe3dd422bf00) · group: `slackbot`*
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
Aug 5, 2026
RAW cherry-pick of public merge aaf448b (-m 1). Conflicts committed as git produced them. Conflicted: l1-contracts/.rebuild_patterns. Resolution in fix(port) commit.
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
Aug 5, 2026
…esolution Kept next's fuller pattern set (lib/.*, foundry.lock, package.json, l1-artifacts entries — next's build hashing relies on them) and took AztecProtocol#24384's regex-escaped forge_broadcast\.js$ form in place of the unescaped duplicate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
fix(ethereum): broadcast L1 deploy txs one at a time on anvil to dodge automine race (#24378)
test(ci): classify e2e_token_bridge_tutorial L1-tx confirmation timeout as the known flake (#24385)
END_COMMIT_OVERRIDE