Skip to content

Conversation

@PhilWindle
Copy link
Collaborator

Summary

  • Introduces a new transaction pool implementation (TxPoolV2) with explicit state management
  • Transactions flow through states: pending → protected → mined → deleted
  • Implements a pluggable eviction rules system for managing pool size and transaction validity
  • Adds transaction validation using pendingTxValidator before adding to pending pool
  • Includes archive support for finalized transactions

Key Components

  • State Management: Transactions have explicit states (pending, protected, mined) with clear transitions
  • Eviction Rules: Modular rules for nullifier conflicts, fee payer balance limits, pool size limits, and post-reorg validation
  • Pre-add Rules: Validation before adding transactions (duplicates, nullifier conflicts, fee payer balance)
  • Archive: Optional archiving of finalized transactions for historical queries

Test Coverage

  • 131 unit tests covering all state transitions and edge cases
  • Compatibility tests ensuring feature parity with existing pool
  • Benchmarks for performance measurement (addPendingTxs, canAddPendingTx, handlePrunedBlocks, etc.)

Test plan

  • Unit tests pass: yarn test src/mem_pools/tx_pool_v2/tx_pool_v2.test.ts (131 tests)
  • Compatibility tests pass: yarn test src/mem_pools/tx_pool_v2/tx_pool_v2.compat.test.ts (25 tests)
  • Eviction rule tests pass: yarn test src/mem_pools/tx_pool_v2/eviction/ (86 tests)
  • Benchmarks run: yarn test src/mem_pools/tx_pool_v2/tx_pool_v2_bench.test.ts

🤖 Generated with Claude Code

const invalid: string[] = [];

for (const meta of txs) {
const buffer = await this.#txsDB.getAsync(meta.txHash);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The only place we hydrate transactions from the DB, except when requested over the API. Will remove this in a follow up PR when we refactor transaction validation.

@PhilWindle PhilWindle changed the title feat(p2p): add TxPoolV2 with explicit state management and eviction rules feat(p2p): New transaction pool implementation Jan 30, 2026
@AztecBot
Copy link
Collaborator

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/90225d9a219310b6�90225d9a219310b68;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_bot.test.ts (259s) (code: 1) (\033Phil Windle\033: More tests)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/a2d66d33b1d6a800�a2d66d33b1d6a8008;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/reqresp/reqresp.test.ts (337s) (code: 1) group:e2e-p2p-epoch-flakes (\033Phil Windle\033: More tests)

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.

3 participants