Skip to content

feat(p2p): enforce minimum tx pool age for block building#20384

Merged
PhilWindle merged 9 commits intomerge-train/spartanfrom
pw/min-age
Feb 11, 2026
Merged

feat(p2p): enforce minimum tx pool age for block building#20384
PhilWindle merged 9 commits intomerge-train/spartanfrom
pw/min-age

Conversation

@PhilWindle
Copy link
Collaborator

Summary

  • Adds a receivedAt timestamp to TxMetaData so the pool knows when each tx was first received
  • Adds getEligiblePendingTxHashes(maxReceivedAt) to the pool interface, filtering out txs that are too new
  • Adds iterateEligiblePendingTxs() to the P2P client, which computes the cutoff from minTxPoolAgeMs config (default 2000ms, env P2P_MIN_TX_POOL_AGE_MS)
  • Updates the sequencer's CheckpointProposalJob to use iterateEligiblePendingTxs() instead of iteratePendingTxs()
  • Existing iteratePendingTxs is unchanged — still used by AztecNode.getMaxPriorityFees() which should see all pending txs

This gives the network time to propagate transactions before a proposer includes them in a block. Hydrated txs get receivedAt: 0 so they're always eligible immediately on restart.

Test plan

  • yarn build passes
  • yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/tx_pool_v2.test.ts — 164 tests pass
  • yarn workspace @aztec/sequencer-client test src/sequencer/checkpoint_proposal_job.test.ts — 26 tests pass

🤖 Generated with Claude Code

@PhilWindle PhilWindle changed the base branch from next to merge-train/spartan February 11, 2026 09:25
PhilWindle and others added 3 commits February 11, 2026 09:37
const sortedHashes = [...hashesAtFee].sort(hashCompareFn);
for (const hash of sortedHashes) {
const meta = this.#metadata.get(hash);
if (meta && meta.receivedAt <= maxReceivedAt) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove duplicate code from above

Copy link
Contributor

@alexghr alexghr left a comment

Choose a reason for hiding this comment

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

looks good, just a note on a iteratePendingByLifetime sharing code with the prior iterate fn

@PhilWindle PhilWindle enabled auto-merge February 11, 2026 17:35
@PhilWindle PhilWindle merged commit 1021126 into merge-train/spartan Feb 11, 2026
11 checks passed
@PhilWindle PhilWindle deleted the pw/min-age branch February 11, 2026 18:32
github-merge-queue bot pushed a commit that referenced this pull request Feb 12, 2026
BEGIN_COMMIT_OVERRIDE
chore: Should fix proving benchmarks by reducing committee lag (#20381)
chore: standalone forge broadcast wrapper with retry, timeout, and anvil
detection (#19824)
chore: benchmark tx val (#20227)
fix: cloudflare terraform API (#20387)
fix: HA e2e test order & retries (#20383)
fix: incorporate forge broadcast review feedback (#20390)
refactor(p2p): rewrite FileStoreTxCollection with retry, backoff, and
shared worker pool (#20317)
chore(ci): run ci job on draft PRs (#20395)
feat(bot): allow anchoring txs to proposed chain (#20392)
feat(p2p): slot-based soft deletion for TxPoolV2 (#20388)
chore: add setup-container script (#20309)
feat: build aztec-prover-agent with baked-in CRS (#20391)
fix!: change protocol contracts deployer to be the contract address
(#20396)
feat(p2p): enforce minimum tx pool age for block building (#20384)
refactor(sentinel): update validator statuses to checkpoint-based naming
(#20372)
chore: log tx hash (#20413)
chore: update l1 fee analysis to measure blob count in L1 blocks
(#20414)
chore: set up tx file store in next-net (#20418)
chore(ci): gate draft PRs from CI, allow override with ci-draft label
(#20426)
fix: stabilize writing_an_account_contract.test.ts (#20420)
END_COMMIT_OVERRIDE
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.

2 participants