fix: Don't update state if we failed to execute sufficient transactions#21443
Merged
PhilWindle merged 5 commits intomerge-train/spartanfrom Mar 16, 2026
Merged
fix: Don't update state if we failed to execute sufficient transactions#21443PhilWindle merged 5 commits intomerge-train/spartanfrom
PhilWindle merged 5 commits intomerge-train/spartanfrom
Conversation
Collaborator
Author
|
Looking further into this. It may not be the complete fix. |
spalladino
approved these changes
Mar 12, 2026
alexghr
approved these changes
Mar 16, 2026
spalladino
added a commit
that referenced
this pull request
Mar 16, 2026
Temporarily skips the `acir_tests/browser-test-app` browser prove tests (`verify_honk_proof` and `a_1_mul`) which are failing with "Failed to fetch" errors in CI, blocking the v4 merge train. This unblocks #21595 and transitively #21592 and #21443. ClaudeBox log: https://claudebox.work/s/8663550bd346778b?run=1 --------- Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Collaborator
|
❌ Failed to cherry-pick to |
PhilWindle
added a commit
that referenced
this pull request
Mar 16, 2026
…ficient transactions (v4) (#21610) ## Summary Backport of #21443 to v4. This PR fixes a bug in block building where the sequencer would update state even when it failed to execute sufficient transactions. The fix: - Replaces `NoValidTxsError` with `InsufficientValidTxsError` (includes `processedCount` and `minRequired`) - Moves the minimum valid tx check into `CheckpointBuilder.buildBlock()` so state is not updated for blocks that will be discarded - Introduces a `ForkCheckpoint` wrapper to revert world state changes on failure - Passes `minValidTxs` from `CheckpointProposalJob` into the builder ## Cherry-pick conflicts The second commit (`3ccb6868a8 — Use an additional world state fork checkpoint`) conflicted in `checkpoint_builder.ts` because the first commit had already restructured the code into the try/catch/ForkCheckpoint pattern. The conflict was just duplicate leftover code that needed to be removed. ## Build fix On v4, `LightweightCheckpointBuilder.addBlock()` returns `Promise<L2Block>` directly, while on `next` it returns `Promise<{ block: L2Block, timings: ... }>`. Adjusted the destructuring accordingly. ## Commit structure 1. **Cherry-pick**: `Don't update state if we failed to execute sufficient transactions` (clean) 2. **Cherry-pick with conflicts**: `Use an additional world state fork checkpoint when building blocks` 3. **Conflict resolution**: Remove duplicate code block left by conflict 4. **Cherry-pick**: `Comment` (clean) 5. **Build fix**: Adapt to v4 API (`addBlock` returns `L2Block` directly) ClaudeBox log: https://claudebox.work/s/a4bb51a881c56125?run=1
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
BEGIN_COMMIT_OVERRIDE feat: add ETHEREUM_HTTP_TIMEOUT_MS env var for viem HTTP transport (#20919) fix(archiver): filter tagged log queries by block number (#21388) fix(node): handle slot zero in getL2ToL1Messages (#21386) feat(sequencer): redistribute checkpoint budget evenly across remaining blocks (#21378) fix: fall back to package.json for CLI version detection (#21382) chore: Removed multiplier config (#21412) chore: Removed default snapshot url config (#21413) chore: Read tx filestores from network config (#21416) fix(node): check world state against requested block hash (#21385) feat(p2p): use l2 priority fee only for tx priority (#21420) feat(p2p): reject and evict txs with insufficient max fee per gas (#21281) revert "feat(p2p): reject and evict txs with insufficient max fee per gas (#21281)" (#21432) chore: Reduce log spam (#21436) fix(tx): reject txs with invalid setup when unprotecting (#21224) fix: orchestrator enqueue yield (#21286) chore(builder): check archive tree next leaf index during block building (#21457) fix: scenario deployment (#21428) chore: add claude skill to read network-logs (#21495) chore: update claude network-logs skill (#21523) feat(rpc): add package version to RPC response headers (#21526) chore(prover): silence "epoch to prove" debug logs (#21527) chore(sequencer): do not log blob data (#21530) fix: dependabot alerts (#21531) docs(p2p): nicer READMEs (#21456) fix(archiver): guard getL1ToL2Messages against incomplete message sync (#21494) fix(sequencer): await syncing proposed block to archiver (#21554) feat(ethereum): check VK tree root and protocol contracts hash in rollup compatibility (#21537) fix: marking peer as dumb on failed responses (#21316) fix(kv-store): make LMDB clear and drop operations atomic across sub-databases (#21539) feat(world-state): add blockHash verification to syncImmediate (#21556) chore(monitor): print out l2 fees components (#21559) chore: rm faucet (#21538) chore: remove old merkle trees (#21577) feat: Implement commit all and revert all for world state checkpoints (#21532) chore: skip flaky browser acir tests in CI (#21596) fix: Better detection for epoch prune (#21478) chore: logging (#21604) fix: Don't update state if we failed to execute sufficient transactions (#21443) END_COMMIT_OVERRIDE
alexghr
pushed a commit
that referenced
this pull request
Mar 17, 2026
BEGIN_COMMIT_OVERRIDE fix(aztec-nr): return Option from decode functions and fix event commitment capacity (backport #21264) (#21360) fix: backport #21271 — handle bad note lengths on compute_note_hash_and_nullifier (#21364) fix: not reusing tags of partially reverted txs (#20817) chore: revert accidental backport of #20817 (#21583) feat: Implement commit all and revert all for world state checkpoints (#21532) cherry-pick: fix: dependabot alerts (#21531) fix: dependabot alerts (backport #21531 to v4) (#21592) fix: backport #21443 — Don't update state if we failed to execute sufficient transactions (v4) (#21610) chore: Fix msgpack serialisation (#21612) END_COMMIT_OVERRIDE --------- Co-authored-by: Jan Beneš <janbenes1234@gmail.com> Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com> Co-authored-by: Phil Windle <philip.windle@gmail.com> Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: ludamad <adam.domurad@gmail.com>
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.
This PR fixes a bug in block building. Reproduction was as follows:
CheckpointBuilder.buildBlock()would update the state regardless.CheckpointProposalJob.buildSingleBlock()would detect an insufficient number of transactions and discard the block, leaving the state invalid for further block building.This PR moves the detection of sufficient transaction count into
CheckpointBuilder.buildBlock()so the state is left unmodified. It also introduces an additional fork checkpoint and reverts all changes made for blocks that are discarded.