Conversation
Fixes [A-355](https://linear.app/aztec-labs/issue/A-355/high-availability-setup-metrics) Also moves a bunch of types / interfaces from `validator-ha-signer` to `stdlib` to remove cyclic dependencies in `yarn-project`. It does make sense to **not** have `stdlib` import `validator-ha-signer`
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
Fixes [A-355](https://linear.app/aztec-labs/issue/A-355/high-availability-setup-metrics) Also adds `dateProvider` across the HA Signer codebase Also moves a bunch of types / interfaces from `validator-ha-signer` to `stdlib` to remove cyclic dependencies in `yarn-project`. It does make sense to **not** have `stdlib` import `validator-ha-signer`
- Rewires the tx dropping configuration for mempools - When enabled, txs will be omitted from the mempool based on configurable percentage but will return as accepted so that gossip can propagate Co-authored-by: danielntmd <danielntmd@nethermind.io>
## Summary Wraps all `TxPoolV2Impl` handler methods in `this.#store.transactionAsync()` to ensure DB atomicity. Without this, a failure mid-way through a handler can leave LMDB in a partially updated state (e.g., some txs marked as mined but not others), breaking pool invariants on restart. `transactionAsync` accumulates writes in memory and flushes atomically at commit — it does not hold a real LMDB write lock during callback execution, so including eviction (with its world-state I/O) inside the transaction is safe. **Handlers wrapped:** - **`addPendingTxs`**: already had a transaction for the add loop; moved `evictAfterNewTxs` inside it - **`protectTxs`**: wraps the loop that reads from `#txsDB` and calls `#addTx` - **`handleMinedBlock`**: wraps markAsMined/clearIfMinedHigher loop and `evictAfterNewBlock` - **`handleFailedExecution`**: wraps the `#deleteTxsBatch` call - **`handleFinalizedBlock`**: wraps steps 2-5 (archive collection, batch delete, finalize soft-deletes, archive writes) - **`prepareForSlot`**: wraps entire body from `cleanupSlotDeleted` through `evictAfterNewTxs` - **`handlePrunedBlocks`**: wraps entire body from `markFromPrunedBlock` through `evictAfterChainPrune` No operation reordering, no API changes, no new types. ## Test plan - `yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/tx_pool_v2.test.ts` passes - `yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/eviction/` passes - `yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/tx_pool_v2.compat.test.ts` passes - `yarn build` compiles Part of A-546
## Summary After a chain prune (reorg), `handlePrunedBlocks()` moves mined transactions back to pending, which can temporarily push the v2 pool over its configured size limit. The `EvictionManager` already dispatches a `CHAIN_PRUNED` event (via `evictAfterChainPrune()`), but `LowPriorityEvictionRule` only handled `TXS_ADDED` events — returning an empty result for `CHAIN_PRUNED` and leaving the pool over its limit until the next `addPendingTxs()` call. - Extended `LowPriorityEvictionRule.evict()` to also trigger on `CHAIN_PRUNED` events, so the pool size limit is enforced immediately after a reorg - Guarded `context.newTxHashes` access (only present on the `TXS_ADDED` variant of the discriminated union) with an event-type check, logging a distinct message for the chain-prune case - Added unit tests for `CHAIN_PRUNED` handling in `LowPriorityEvictionRule` (eviction when over limit, no-op when under limit, no-op when disabled, error handling) - Added integration tests in `tx_pool_v2.test.ts` exercising the full add → mine → set limit → prune → verify eviction flow ## Test plan - [x] Unit tests pass: `yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.test.ts` (14 tests) - [x] Integration tests pass: `yarn workspace @aztec/p2p test src/mem_pools/tx_pool_v2/tx_pool_v2.test.ts -t 'handlePrunedBlocks'` (12 tests) - [x] Lint and format pass Fixes A-560
Adds a new one-time-use PR label that triggers proving benchmarks in parallel. Results are published to
bench/pr-{NUMBER} on the benchmark dashboard, keeping nightly (bench/next) unaffected.
Adds a new one-time-use PR label that triggers proving benchmarks in
parallel. Results are published to bench/pr-{NUMBER} on the benchmark
dashboard, keeping nightly (bench/next) unaffected.
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
fix: flag stripping error (#20655)
chore: encode LOG_LEVEL (#20678)
chore: HA setup metrics (#20400)
chore: (A-544) reimplement tx dropping for testing (#20651)
chore(e2e): reload keystore with HA setup (#20685)
feat: adding mempool transactions (#20679)
feat: run low priority eviction rule on chain_pruned (#20687)
feat(ci): add ci-network-bench label for spartan benchmarks (#20698)
END_COMMIT_OVERRIDE