Skip to content

chore: Accumulated backports to v4#20980

Merged
ludamad merged 18 commits intov4from
backport-to-v4-staging
Mar 3, 2026
Merged

chore: Accumulated backports to v4#20980
ludamad merged 18 commits intov4from
backport-to-v4-staging

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Feb 27, 2026

BEGIN_COMMIT_OVERRIDE
fix(aztec-nr): account for AES PKCS#7 padding in message plaintext length (#20840)
feat: remove epk sign from message payload (#20926)
chore: increase mainnet local ejection threshold to 190k (#20884)
feat: add pinned-build support for protocol contracts in noir-contracts (v4) (#20982)
fix!: undo bad fix (#20987)
chore: backport #20967 to v4 (metric on how many epochs validator has been on committee) (#20989)
chore(sequencer): e2e tests for invalid signature recovery in checkpoint attestations (#20971)
feat: allow custom addresses to be prefunded with fee juice in local network (backport #21000) (#21004)
chore: increase max fee bots use in tests (#20867)
fix(spartan): wire SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT env var (#21017)
fix: update MAX_EVENT_SERIALIZATION_LENGTH and re-enable TXE tests in CI (backport #21020) (#21027)
test: update proving-real test to mbps (#20991)
chore: epoch proving log analyzer (#21033)
chore: update pause script to allow resume (#21032)
END_COMMIT_OVERRIDE

…ngth (#20840)

## Summary

- Fixes index-out-of-bounds when using notes with arrays by accounting for AES PKCS#7 padding expansion (16 bytes) when computing `MESSAGE_PLAINTEXT_LEN`
- Updates `MAX_NOTE_PACKED_LEN` (9 -> 8) and `MAX_EVENT_SERIALIZED_LEN` (11 -> 10) in both Noir and TypeScript to match the corrected capacity
- Adds boundary tests for max-size and oversized messages, notes, and encryption plaintexts

Fixes F-336
Fixes #20737
This frees up one byte of capacity, but more importantly it reduces the leakage in the logs as they'll no longer contain a byte that is either 0 or 1.
## Summary
- Increases the mainnet `AZTEC_LOCAL_EJECTION_THRESHOLD` from 162,000 TST to 190,000 TST in `network-defaults.yml`.

## Test plan
- [ ] Verify generated config files reflect the updated threshold after regeneration
AztecBot and others added 3 commits February 27, 2026 20:06
…ts (v4) (#20982)

**Problem**: The `mainnet_compatibility.test.ts` test checks that
`protocolContractsHash` matches a hardcoded mainnet value. We missed
protocol contracts while pinning protocol circuits.

**Solution**: 
- When `pinned-protocol-contracts.tar.gz` exists in the
`noir-contracts/` directory, the build extracts pre-compiled protocol
contract artifacts and skips compiling them
- Adds `./bootstrap.sh pin-protocol-contracts` command to build protocol
contracts and create the tarball
In b7605403131 a fix was applied to avoid a revert when slashing quorum was reached for empty committees. This was something that was quite unlikely, but as the fix seemed easy we applied it. In doing so, we did not validate the new use of input values properly (missing input validation anyone?). Anyway, then r0bert from Spearbit had a look because he was reviewing some faintly related code, and realized that the new part could be used to bypass a slash by convincing the execution that it was empty.

To avoid this issue, we are essentially undoing the fix (no longer skip), but keep the test slightly altered to showcase that this is now intended behaviour.

The code is current not deployed anywhere
AztecBot and others added 2 commits March 2, 2026 13:31
… been on committee) (#20989)

## Summary
Backport of #20967
to v4.

- Adds metrics tracking how many epochs each validator has been on the
committee
- Adds `ATTESTER_ADDRESS` attribute, `VALIDATOR_CURRENT_EPOCH` and
`VALIDATOR_ATTESTED_EPOCH_COUNT` metric definitions
- Adds Grafana dashboard panels for Attester Epoch Participation
(current epoch, attested epochs per attester, participation rate)
- Tracks epoch participation per attester in the validator client

### Conflict resolution
- `yarn-project/telemetry-client/src/attributes.ts`: v4 doesn't have HA
signer attributes (`HA_DUTY_TYPE`, `HA_NODE_ID`). Added only the new
`ATTESTER_ADDRESS` attribute.
- `spartan/metrics/grafana/dashboards/aztec_validators.json`: v4 doesn't
have HA Signing Coordination dashboard panels. Added only the new
Attester Epoch Participation panels with adjusted y positions.

Fixes
[A-298](https://linear.app/aztec-labs/issue/A-298/metric-how-many-epochs-validator-has-been-on-committee)

[ClaudeBox log](http://ci.aztec-labs.com/11ad132d2af4d581-1)

Co-authored-by: spypsy <spypsy@outlook.com>
…int attestations (#20971)

Test that high-s or invalid ECDSA signatures posted by a malicious proposer can be properly invalidated.

## Summary
- Adds e2e tests for A-71: nodes correctly detect and invalidate checkpoints with malleable (high-s) or unrecoverable attestation signatures
- Adds `injectHighSValueAttestation` and `injectUnrecoverableSignatureAttestation` sequencer config options for testing
- Updates `Signature.random()` to produce valid ECDSA signatures with low s-values
- Adds `generateRecoverableSignature` / `generateUnrecoverableSignature` utilities with unit tests
- Adds unit test for high-s value attestation validation in archiver
- Refactors e2e invalidate block tests with shared helpers to reduce duplication

Fixes A-71

## Test plan
- [x] Two new e2e tests pass: high-s value attestation invalidation, unrecoverable signature invalidation
- [x] Unit tests pass: `Signature.random()` validity, `generateRecoverableSignature`, `generateUnrecoverableSignature`, high-s validation
- [x] Existing e2e invalidate block tests unchanged in behavior (refactored with helpers)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ludamad and others added 3 commits March 2, 2026 16:09
Extends the pinned-protocol-contracts.tar.gz to also include the
SponsoredFPC artifact compiled against v4's aztec-nr. This prevents
aztec-nr changes (AES PKCS#7 padding fix, EPK sign removal) from
changing SponsoredFPC's canonical address and breaking the testnet
compatibility genesis archive root check.

FPC is still compiled normally; only SponsoredFPC is pinned.
…network (backport #21000) (#21004)

## Summary
Backport of #21000
to v4.

### Commit 1: Cherry-pick with conflict markers
Applied PR #21000 diff to v4. The `start_node.ts` import section has
conflict markers where the `AztecAddress` import could not be cleanly
applied (the surrounding import context differs between `next` and `v4`
— v4 has additional imports like `RegistryContract`, `sleep`,
`EthAddress` that were removed on `next`).

### Commit 2: Resolve conflict
Added `import { AztecAddress } from '@aztec/stdlib/aztec-address'` in
the correct location for v4 and removed the conflict markers.

Original PR by @mverzilli.
… CI (backport #21020) (#21027)

Backport of #21020
to v4.

Cherry-pick applied cleanly — no conflicts.

## Summary

Two fixes:

### 1. Fix `MAX_EVENT_SERIALIZATION_LENGTH` mismatch
PR #20840 changed `MAX_EVENT_LEN` from 12 to 10 in
`yarn-project/txe/src/rpc_translator.ts` but forgot to update the
corresponding Noir constant `MAX_EVENT_SERIALIZATION_LENGTH` in
`txe_oracles.nr`. This caused the TXE oracle to return `10 * 5 = 50`
fields while the Noir oracle declaration expected `12 * 5 = 60` fields,
crashing the `emit_and_discover_event` test.

### 2. Re-enable TXE-dependent noir tests in CI
The `build_and_test` function in `bootstrap.sh` had a guard that only
ran TXE tests when no argument was passed, but CI always calls
`build_and_test fast` or `build_and_test full`. This fix removes the
conditional so TXE tests run in all CI modes.

ClaudeBox log: http://ci.aztec-labs.com/ed670f8e16fb711b-1
@ludamad ludamad enabled auto-merge March 3, 2026 05:02
Upgrades proving-n-tps-real to use MBPS and swaps out the BencharmkingContract used in the test to the AvmGadgets contracts and tests keccak_1400.
A script to analyze the proving timeline of an epoch. Output example:

```
$ ./spartan/scripts/extract_proving_metrics.ts prove-n-tps-real --start 2026-03-02 --epoch 3

Epoch 3 stats:
  Checkpoints: 32 (33 to 64), Blocks: 256 (40 to 295), Txs: 2283
  Blob fields per checkpoint: 211.92ms
  Blob batching: 3408.91ms

Timeline:
  Epoch started proving                                T+0s
  Blocks started processing                            T+1m 3s
  PUBLIC_CHONK_VERIFIER first enqueued (2283 jobs)     T+1m 9s
  PARITY_BASE first enqueued (1 jobs)                  T+1m 9s
  # ...
Proving jobs by stage:
  PARITY_BASE                     1 jobs    enqueued T+1m 9s                   completed T+1m 22s  (13s)
  PARITY_ROOT                     1 jobs    enqueued T+1m 23s                  completed T+7m 1s  (5m 38s)
  PUBLIC_CHONK_VERIFIER        2283 jobs    enqueued T+1m 9s..T+1m 16s         completed T+1m 21s..T+6m 55s  (5m 46s)
  # ...

Per-job duration stats:
  Type                          Count    Median      Mean       p90       Max
  PARITY_BASE                       1     13.4s     13.4s     13.4s     13.4s
  PARITY_ROOT                       1    338.3s    338.3s    338.3s    338.3s
  # ...

Per block (sorted by block number):
  Block 40 (slot 96): 18 txs, processing 29.4s
  Block 41 (slot 96): 18 txs, processing 44.8s
  # ...
```
Updates the pause script to save its state in order for later resume.
AztecBot and others added 2 commits March 3, 2026 10:26
…) (#21037)

Backport of #20898
to v4.

This PR removes the update checker with a simpler version checker. It
also enables network_config.json to specify a latest node version which
the node will check against.

The node won't restart automatically if the rollup or node version
changes but it will print a warning to logs every 10 minutes to inform
the operator to restart.

## Conflict resolution

One conflict in `yarn-project/foundation/src/config/network_config.ts`:
the cherry-pick brought along `txPublicSetupAllowListExtend` (which
exists on `next` but not `v4`). Resolved by only adding `nodeVersion`
(this PR's actual change).

ClaudeBox log: http://ci.aztec-labs.com/38233e207fde40f9-1

Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
…o v4 (#21036)

Backport of #20806
to v4.

Adds a configurable percentage-based price bump requirement for
RPC-submitted transactions that clash on nullifiers with existing pool
transactions, or that need to evict the lowest-priority tx when the pool
is full. This prevents spam via infinitesimally small fee increments.

## Conflict resolution

Three files had conflicts due to `dropTransactionsProbability` (present
on next, absent on v4):
- `docs/docs-operate/operators/reference/changelog/v4.md` — added the
price bump changelog section without the unrelated "Setup allow list"
section
- `yarn-project/p2p/src/client/factory.ts` — added `priceBumpPercentage`
config pass-through (without `dropTransactionsProbability`)
- `yarn-project/p2p/src/mem_pools/tx_pool_v2/interfaces.ts` — added
`priceBumpPercentage` to type and defaults (without
`dropTransactionsProbability`)

ClaudeBox log: http://ci.aztec-labs.com/ff393a9b4d8e95fb-1

Co-authored-by: Michal Rzeszutko <michal.rzeszutko@gmail.com>
Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the Aztec.nr stuff and it's exactly the same code as we have on merge-train/fairies branch so the backport is clean there.

@ludamad ludamad merged commit 48f35d8 into v4 Mar 3, 2026
9 checks passed
@ludamad ludamad deleted the backport-to-v4-staging branch March 3, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants