Skip to content

fix: v4-staging#21448

Merged
nventuro merged 12 commits intobackport-to-v4-stagingfrom
nv/fix-v4-staging
Mar 12, 2026
Merged

fix: v4-staging#21448
nventuro merged 12 commits intobackport-to-v4-stagingfrom
nv/fix-v4-staging

Conversation

@nventuro
Copy link
Contributor

This fixes the merge conflicts in #21370.

AztecBot and others added 12 commits March 10, 2026 17:23
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: mverzilli <mverzilli@users.noreply.github.com>
Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: danielntmd <danielntmd@users.noreply.github.com>
Co-authored-by: deffrian <deffrian@users.noreply.github.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
…21367)

The archiver block store checks that blocks added as proposed are not
already checkpointed, and fails if so. But this can still happen if the
processing of a block proposal is too slow, and the checkpointed data
from L1 comes in first. Still, if the proposed block matches the checkpointed
one, we should not err.

In a separate commit, simplifies the implementation of `addProposedBlock`
so it takes only one block at a time, which is the only usage in teh codebase.
Despite the request in claude.md, claude still tries to do this. It suggested adding a rule to stress this, so here it goes.
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
fix: Simulate gas in n tps test. Set min txs per block to 1 (backport
#21312) (#21329)
fix(log): do not log validation error if unregistered handler (#21111)
fix(node): fix index misalignment in findLeavesIndexes (#21327)
fix: limit parallel blocks in prover to max AVM parallel simulations
(#21320)
fix: use native sha256 to speed up proving job id generation (#21292)
fix(validator): wait for l1 sync before processing block proposals
(#21336)
fix(txpool): cap priority fee with max fees when computing priority
(#21279)
chore: reduce severity of errors due to HA node not acquiring signature
(#21311)
fix: (A-643) add buffer to maxFeePerBlobGas for gas estimation and fix
bump loop truncation (#21323)
END_COMMIT_OVERRIDE
…ng blocks (#21378)

Update the per-block budgets so that, on every block, the limits are further adjusted to `remainingCheckpointBudget / remainingBlocks * multiplier`. This prevents the last blocks from starvation. Also adjusts the multiplier from 2x to 1.2x.

## Visualization

Using the https://github.com/AztecProtocol/explorations/tree/main/block-distribution-simulator

### Before this PR

No redistribution, 2x multiplier

<img width="1544" height="737" alt="Screenshot From 2026-03-11 15-50-38" src="https://github.com/user-attachments/assets/fda36d04-5d9e-456a-9ced-4649fa58d724" />

### After this PR

Redistribution enabled, 1.2x multiplier

<img width="1544" height="737" alt="Screenshot From 2026-03-11 15-50-49" src="https://github.com/user-attachments/assets/2bc196f3-77fa-47bf-9294-4eb4199f8f93" />

### With no multiplier

For comparison purposes only, note the lower gas utilization

<img width="1544" height="737" alt="Screenshot From 2026-03-11 15-50-59" src="https://github.com/user-attachments/assets/0facbc36-65e3-446e-abaf-eb7f637b87c9" />

## Summary

- Adds `SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET` (default: true) to distribute remaining checkpoint budget evenly across remaining blocks instead of letting one block consume it all. Fair share per block is `ceil(remainingBudget / remainingBlocks * multiplier)`, applied to all four dimensions (L2 gas, DA gas, blob fields, tx count).
- Changes default `perBlockAllocationMultiplier` from 2 to 1.2 for smoother distribution.
- Wires `maxBlocksPerCheckpoint` from the timetable through to the checkpoint builder config.

## Test plan

- Existing `capLimitsByCheckpointBudgets` tests pass with `redistributeCheckpointBudget: false` (old behavior)
- New tests cover: even split with multiplier=1, fair share with multiplier=1.2, last block gets all remaining, disabled flag falls back to old behavior, DA gas and tx count redistribution
- `computeBlockLimits` tests updated for new default multiplier and `maxBlocksPerCheckpoint` return value

🤖 Generated with [Claude Code](https://claude.com/claude-code)
#21418)

## Summary
Backport of #21386
to v4-next.

If there was a block in L2 slot zero, then `getL2ToL1Messages` returned
an incorrect response, since the `slotNumber !== previousSlotNumber`
would fail in the first iteration of the loop. Fix replaces manual loop
with `chunkBy` utility.

## Conflicts
Minor import conflict in `server.test.ts` — v4-next didn't have
`BlockHash` in the block import (not needed by new tests). Resolved by
importing only `CheckpointedL2Block` and `L1PublishedData`.

## Original PR
#21386 by
@spalladino

ClaudeBox log: https://claudebox.work/s/759eab130be2139b?run=1

---------

Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
…21385) (#21421)

## Summary

Backport of #21385
to `v4-next`.

When requesting world state at a given block hash, double check that the
returned world state is actually at that same block hash. Also check
that world state is synced to the requested block if using block hash.

## Changes
- Changed `#getWorldState` from private to `protected getWorldState` so
it can be tested via subclass
- Added block hash verification: after getting a snapshot by block
number, verify the archive tree has the expected block hash
- Added sync range check for block hash lookups (not just block number)
- Added comprehensive tests for `getWorldState` and `findLeavesIndexes`

## Conflict resolution
- Import conflict in test file: v4-next didn't have
`CheckpointedL2Block` or `L1PublishedData` imports (used on `next` but
not needed here). Resolved by importing only `BlockHash`,
`BlockParameter`, `L2Block`, and `L2BlockSource`.
- Test block conflict: v4-next didn't have the `findLeavesIndexes` or
`getWorldState` test sections. Both were added from the incoming
cherry-pick.

ClaudeBox log: https://claudebox.work/s/fb04bb3ea475c9c5?run=1

---------

Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com>
BEGIN_COMMIT_OVERRIDE
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)
feat(p2p): use l2 priority fee only for tx priority (#21420)
fix: update private kernel reset hints builder (#20760)
END_COMMIT_OVERRIDE
…index (backport #21438) (#21440)

## Summary
Backport of #21438
to `v4-next`.

Cherry-pick applied cleanly with no conflicts.

## Changes
- Search all possible note hash indices for nonces instead of just the
one corresponding to the note hash index
- Add `bvec_filter` helper for filtering `BoundedVec`
- Add tests for misaligned nonces, out-of-bounds indices, and duplicate
unique note hashes

ClaudeBox log: https://claudebox.work/s/f0603f16b3f1c566?run=1

---------

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
This PR was created because merging `v4` into `v4-next` resulted in
conflicts.

Please resolve the conflicts and merge this PR to keep `v4-next` up to
date.

This PR was auto-generated by the `pull-v4-into-v4-next` workflow.
@nventuro nventuro requested a review from ludamad March 12, 2026 19:16
@nventuro nventuro enabled auto-merge (squash) March 12, 2026 19:17
@nventuro nventuro merged commit 41217c2 into backport-to-v4-staging Mar 12, 2026
13 of 16 checks passed
@nventuro nventuro deleted the nv/fix-v4-staging branch March 12, 2026 19:17
@nventuro nventuro mentioned this pull request Mar 12, 2026
ludamad added a commit that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants