Skip to content

Comments

chore: Accumulated backports to v4#20752

Open
AztecBot wants to merge 23 commits intov4from
backport-to-v4-staging
Open

chore: Accumulated backports to v4#20752
AztecBot wants to merge 23 commits intov4from
backport-to-v4-staging

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Feb 23, 2026

BEGIN_COMMIT_OVERRIDE
chore: fix worker wallet in jest (#20725)
fix: pxe native prover log level (#20724)
chore: encode LOG_LEVEL (#20678)
chore: fix worker wallet log level (#20754)
chore: Removed dead code (#20740)
fix: getVotes return empty instead of stale data (#20756)
fix: pass log level to AVM simulator (#20762)
chore: double Node.js libuv thread count (#20709)
fix: underflow in snapshot synch (#20780)
fix: separate rejected and aborted proving jobs (#20777)
fix: evicted transactions could reappear after a node restart (#20773)
fix: (A-575) prevent checkpoint event spam in L2BlockStream on restart (#20791)
fix: charge 3.6M for epoch verification (#20765)
fix(ethereum): remove viem NonceManager to fix nonce gap after failed sends (#20819)
fix: limit number of threads when verifying server-side proofs (#20818)
chore: Comment update (#20820)
feat: add support for signed integers on contract functions (#20784)
feat: expose blockheader getters (#20790)
docs: minor clarification (#20788)
fix: Use async poseidon (#20826)
END_COMMIT_OVERRIDE

This PR removes the old `getTxsByHash` call from `P2PClient` as it is no longer used.
Fix `getVotes` in `TallySlashingProposer.sol` to return empty bytes when `_index >= voteCount` (preventing stale per-index reads from reused circular storage), add a regression test in `TallySlashingProposer.t.sol`, and clarify the related staleness comments.
Increases the libuv thread pool size to improve I/O performance in the yarn-project. We have the AVM simulator and liblmdb stuff that can hold multiple threads, so the original count of 4 is seeming low.
This PR tracks rejected and aborted jobs as separate counters enabling us to setup alerts when any proofs fail. This PR has to be backported otherwise we'll get alerts when jobs get cancelled as well.
## Summary

- Fix a bug in `TxPoolV2.addPendingTxs` where evicted transactions could reappear after a node restart ("come back to life")
- Move all throwable I/O (`buildTxMetaData`, `getMinedBlockId`, `validateMeta`) out of the `transactionAsync` callback into a pre-computation phase, so that if any I/O fails, no in-memory or DB mutations have occurred

## Background

`addPendingTxs` processes a batch of transactions inside a single LMDB `transactionAsync`. When tx N causes nullifier-conflict evictions of earlier pool txs and then tx N+1 triggers a throw (e.g. `getTxEffect` I/O failure or validator crash), the LMDB transaction rolls back — but in-memory mutations from the eviction persist. On restart the pool rehydrates from DB where the soft-delete marker was never committed, and the evicted tx loads back into the pool.

Other pool methods (`prepareForSlot`, `handlePrunedBlocks`, `handleFinalizedBlock`, etc.) are not affected because they either perform throwable I/O *before* any deletions, or wrap throwable operations in try/catch via the EvictionManager.

## Approach (TDD)

The fix was developed test-first. Two failing tests were written that reproduce the inconsistency — one for each throwable path (`getMinedBlockId` and `validateMeta`) — by verifying that `getTxStatus` returns the same value before and after a pool restart. With the bug present, the status diverges (`'deleted'` in memory vs `'pending'` after restart). The implementation was then applied to make both tests pass.

## Implementation

`addPendingTxs` is now split into two phases:

1. **Pre-computation** (outside the transaction): For each tx, compute `buildTxMetaData`, `getMinedBlockId`, and `validateMeta`. If any of these throw, the call fails before any mutations happen.
2. **Transaction** (inside `transactionAsync`): Uses only pre-computed results, in-memory index reads, and buffered DB writes.

Supporting changes:
- `#addTx` accepts an optional `precomputedMeta` parameter (backward-compatible — other call sites unchanged)
- `#tryAddRegularPendingTx` receives pre-computed metadata directly instead of calling `buildTxMetaData`/`validateMeta`; validation rejection is handled by the caller

## Test plan

- [x] Two new persistence consistency tests pass (were failing before the fix)
- [x] All 210 `tx_pool_v2.test.ts` tests pass
- [x] Full p2p test suite passes (1292 tests)
#20791)

- When startingBlock is set, skip Loop 1 checkpoint emissions for checkpoints predating startingBlock. This prevents spam on stale/missing checkpoints.
alexghr and others added 2 commits February 24, 2026 12:13
Alignin with AztecProtocol/engineering-designs#100, setting the gas per epoch to be 3.6M, which is slightly above costs with unoptimized verifier.

Also changes the target to be 75M for multiple tests.
@AztecBot
Copy link
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/dfc9b81d35a7bb3c�dfc9b81d35a7bb3c8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/gossip_network.test.ts (201s) (code: 0) group:e2e-p2p-epoch-flakes
\033FLAKED\033 (8;;http://ci.aztec-labs.com/d28acc57532b1cb6�d28acc57532b1cb68;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/reqresp/reqresp.test.ts (235s) (code: 0) group:e2e-p2p-epoch-flakes

PhilWindle and others added 2 commits February 24, 2026 16:07
This PR simply modifies configurations to setup MBPS on our networks
… sends (#20819)

Fixes [A-577](https://linear.app/aztec-labs/issue/A-577/investigate-l1txutils-getting-stuck-on-nonces-in-v4-devnet-2)

When `sendRawTransaction` fails (e.g. network error / 429), viem's `NonceManager.consume()` has already stored the nonce in its internal `nonceMap`. The next `consume()` then returns `localNonce + 1` instead of re-fetching from the chain, creating an unrecoverable nonce gap. This is because `reset()` only clears `deltaMap` and `promiseMap` but not `nonceMap` — a bug in viem, reported [here](wevm/viem#4364)

`nonceManager` seems to be useful for concurrent sends which we don't do anyway so removing completely and replacing with `getTransactionCount` (nonce manager uses that as well anyway)

Adds a regression test that sends a successful tx, fails the next send at `sendRawTransaction`, and asserts the recovery send reuses the correct nonce.
PhilWindle and others added 2 commits February 24, 2026 17:28
This PR simply updates a comment around contract update delays.
Closes #20746.

I added both Noir and TS tests to make sure this works as expected. The TS tests are currently failing because we cannot create an `Fr` for a negative number, but I don't know enough about how the encoding works to fix it myself. @sirasistant?

I only added tests for `i64` as `i128` it not yet supported by Noir (noir-lang/noir#7591).
Just some clarifying notes that might help explain this.
This PR switches the poseidon hashing function to use the async barretenberg api. Profiling shows that generating a transaction hash takes ~22ms meaning the node needs to delegate this asynchronously to barretenberg.
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