@aztec/p2p 0.0.1-commit.7ac86ea28 → 0.0.1-commit.7b86788

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dest/client/factory.d.ts +4 -5
  2. package/dest/client/factory.d.ts.map +1 -1
  3. package/dest/client/factory.js +15 -26
  4. package/dest/client/interface.d.ts +6 -13
  5. package/dest/client/interface.d.ts.map +1 -1
  6. package/dest/client/p2p_client.d.ts +5 -13
  7. package/dest/client/p2p_client.d.ts.map +1 -1
  8. package/dest/client/p2p_client.js +3 -58
  9. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +1 -2
  10. package/dest/config.d.ts +2 -5
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +0 -5
  13. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +1 -1
  14. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +1 -1
  15. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
  16. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +2 -0
  17. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
  18. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +2 -2
  19. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
  20. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +10 -6
  21. package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
  22. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
  23. package/dest/mem_pools/tx_pool_v2/index.js +1 -1
  24. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +7 -5
  25. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
  26. package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
  27. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +26 -4
  28. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
  29. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +48 -7
  30. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -1
  31. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
  32. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +9 -10
  33. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +2 -2
  34. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
  35. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +2 -2
  36. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
  37. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +173 -146
  38. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +2 -2
  39. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  40. package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
  41. package/dest/msg_validators/tx_validator/factory.d.ts +114 -6
  42. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  43. package/dest/msg_validators/tx_validator/factory.js +219 -58
  44. package/dest/msg_validators/tx_validator/gas_validator.d.ts +58 -3
  45. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  46. package/dest/msg_validators/tx_validator/gas_validator.js +73 -36
  47. package/dest/msg_validators/tx_validator/index.d.ts +2 -1
  48. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  49. package/dest/msg_validators/tx_validator/index.js +1 -0
  50. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
  51. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
  52. package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
  53. package/dest/services/dummy_service.d.ts +2 -3
  54. package/dest/services/dummy_service.d.ts.map +1 -1
  55. package/dest/services/dummy_service.js +1 -4
  56. package/dest/services/encoding.d.ts +2 -2
  57. package/dest/services/encoding.d.ts.map +1 -1
  58. package/dest/services/encoding.js +7 -7
  59. package/dest/services/libp2p/libp2p_service.d.ts +15 -13
  60. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  61. package/dest/services/libp2p/libp2p_service.js +64 -80
  62. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +1 -1
  63. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
  64. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +14 -37
  65. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +17 -11
  66. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
  67. package/dest/services/reqresp/batch-tx-requester/peer_collection.js +49 -15
  68. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
  69. package/dest/services/reqresp/reqresp.d.ts +1 -1
  70. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  71. package/dest/services/reqresp/reqresp.js +2 -1
  72. package/dest/services/service.d.ts +2 -2
  73. package/dest/services/service.d.ts.map +1 -1
  74. package/dest/services/tx_provider.d.ts +3 -3
  75. package/dest/services/tx_provider.d.ts.map +1 -1
  76. package/dest/services/tx_provider.js +4 -4
  77. package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
  78. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  79. package/dest/test-helpers/make-test-p2p-clients.js +1 -2
  80. package/dest/test-helpers/mock-pubsub.d.ts +2 -3
  81. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  82. package/dest/test-helpers/mock-pubsub.js +2 -2
  83. package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
  84. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  85. package/dest/test-helpers/reqresp-nodes.js +2 -2
  86. package/dest/test-helpers/testbench-utils.d.ts +2 -2
  87. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  88. package/dest/testbench/p2p_client_testbench_worker.js +5 -5
  89. package/package.json +14 -14
  90. package/src/client/factory.ts +22 -46
  91. package/src/client/interface.ts +5 -19
  92. package/src/client/p2p_client.ts +4 -88
  93. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +1 -2
  94. package/src/config.ts +1 -9
  95. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +1 -1
  96. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +3 -0
  97. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +2 -2
  98. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +10 -6
  99. package/src/mem_pools/tx_pool_v2/index.ts +1 -1
  100. package/src/mem_pools/tx_pool_v2/interfaces.ts +7 -4
  101. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +65 -10
  102. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +11 -11
  103. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +1 -1
  104. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +179 -148
  105. package/src/msg_validators/tx_validator/README.md +115 -0
  106. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -3
  107. package/src/msg_validators/tx_validator/factory.ts +353 -77
  108. package/src/msg_validators/tx_validator/gas_validator.ts +90 -27
  109. package/src/msg_validators/tx_validator/index.ts +1 -0
  110. package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
  111. package/src/services/dummy_service.ts +1 -5
  112. package/src/services/encoding.ts +5 -6
  113. package/src/services/libp2p/libp2p_service.ts +75 -90
  114. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +14 -42
  115. package/src/services/reqresp/batch-tx-requester/peer_collection.ts +63 -24
  116. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
  117. package/src/services/reqresp/reqresp.ts +3 -1
  118. package/src/services/service.ts +1 -1
  119. package/src/services/tx_provider.ts +2 -2
  120. package/src/test-helpers/make-test-p2p-clients.ts +0 -2
  121. package/src/test-helpers/mock-pubsub.ts +3 -6
  122. package/src/test-helpers/reqresp-nodes.ts +2 -5
  123. package/src/test-helpers/testbench-utils.ts +1 -1
  124. package/src/testbench/p2p_client_testbench_worker.ts +2 -6
@@ -1 +1 @@
1
- {"version":3,"file":"tx_pool_v2_impl.d.ts","sourceRoot":"","sources":["../../../src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAIxE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAiB,MAAM,qBAAqB,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAoB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAoB/D,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAmB,KAAK,OAAO,EAA2C,MAAM,kBAAkB,CAAC;AAG1G;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,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,CAAC,IAAI,CAAC,CAM7D;IAEK,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC5D;IAIK,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAGzD;IAEK,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,CAOlE;IAED,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAKpC;IAED,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAW/C;IAED,kBAAkB,IAAI,MAAM,EAAE,CAE7B;IAED,0BAA0B,IAAI,MAAM,EAAE,CAKrC;IAED,iBAAiB,IAAI,MAAM,CAE1B;IAED,gBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAExC;IAED,eAAe,IAAI,MAAM,CAQxB;IAED,OAAO,IAAI,OAAO,CAEjB;IAED,UAAU,IAAI,MAAM,CAEnB;IAED,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAE3D;IAED,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhD;IAID,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAalD;IAID,iBAAiB,IAAI,cAAc,CAOlC;IAID,QAAQ,IAAI;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAKA;CAsTF"}
@@ -128,6 +128,28 @@ import { TxPoolIndices } from './tx_pool_indices.js';
128
128
  const rejected = [];
129
129
  const errors = new Map();
130
130
  const acceptedPending = new Set();
131
+ // Phase 1: Pre-compute all throwable I/O outside the transaction.
132
+ // If any pre-computation throws, the entire call fails before mutations happen.
133
+ const precomputed = new Map();
134
+ const validator = await this.#createTxValidator();
135
+ for (const tx of txs){
136
+ const txHash = tx.getTxHash();
137
+ const txHashStr = txHash.toString();
138
+ const meta = await buildTxMetaData(tx);
139
+ const minedBlockId = await this.#getMinedBlockId(txHash);
140
+ // Validate non-mined txs (mined and pre-protected txs bypass validation inside the transaction)
141
+ let isValid = true;
142
+ if (!minedBlockId) {
143
+ isValid = await this.#validateMeta(meta, validator);
144
+ }
145
+ precomputed.set(txHashStr, {
146
+ meta,
147
+ minedBlockId,
148
+ isValid
149
+ });
150
+ }
151
+ // Phase 2: Apply mutations inside the transaction using only pre-computed results,
152
+ // in-memory reads, and buffered DB writes. Nothing here can throw an unhandled exception.
131
153
  const poolAccess = this.#createPreAddPoolAccess();
132
154
  const preAddContext = opts.feeComparisonOnly !== undefined ? {
133
155
  feeComparisonOnly: opts.feeComparisonOnly
@@ -141,33 +163,41 @@ import { TxPoolIndices } from './tx_pool_indices.js';
141
163
  ignored.push(txHash);
142
164
  continue;
143
165
  }
144
- // Check mined status first (applies to all paths)
145
- const minedBlockId = await this.#getMinedBlockId(txHash);
166
+ const { meta, minedBlockId, isValid } = precomputed.get(txHashStr);
146
167
  const preProtectedSlot = this.#indices.getProtectionSlot(txHashStr);
147
168
  if (minedBlockId) {
148
169
  // Already mined - add directly (protection already set if pre-protected)
149
170
  await this.#addTx(tx, {
150
171
  mined: minedBlockId
151
- }, opts);
172
+ }, opts, meta);
152
173
  accepted.push(txHash);
153
174
  } else if (preProtectedSlot !== undefined) {
154
175
  // Pre-protected and not mined - add as protected (bypass validation)
155
176
  await this.#addTx(tx, {
156
177
  protected: preProtectedSlot
157
- }, opts);
178
+ }, opts, meta);
158
179
  accepted.push(txHash);
180
+ } else if (!isValid) {
181
+ // Failed pre-computed validation
182
+ rejected.push(txHash);
159
183
  } else {
160
- // Regular pending tx - validate and run pre-add rules
161
- const result = await this.#tryAddRegularPendingTx(tx, opts, poolAccess, acceptedPending, ignored, errors, preAddContext);
184
+ // Regular pending tx - run pre-add rules using pre-computed metadata
185
+ const result = await this.#tryAddRegularPendingTx(tx, meta, opts, poolAccess, acceptedPending, ignored, errors, preAddContext);
162
186
  if (result.status === 'accepted') {
163
187
  acceptedPending.add(txHashStr);
164
- } else if (result.status === 'rejected') {
165
- rejected.push(txHash);
166
188
  } else {
167
189
  ignored.push(txHash);
168
190
  }
169
191
  }
170
192
  }
193
+ // Run post-add eviction rules for pending txs (inside transaction for atomicity)
194
+ if (acceptedPending.size > 0) {
195
+ const feePayers = Array.from(acceptedPending).map((txHash)=>this.#indices.getMetadata(txHash).feePayer);
196
+ const uniqueFeePayers = new Set(feePayers);
197
+ await this.#evictionManager.evictAfterNewTxs(Array.from(acceptedPending), [
198
+ ...uniqueFeePayers
199
+ ]);
200
+ }
171
201
  });
172
202
  // Build final accepted list for pending txs (excludes intra-batch evictions)
173
203
  for (const txHashStr of acceptedPending){
@@ -180,14 +210,6 @@ import { TxPoolIndices } from './tx_pool_indices.js';
180
210
  if (rejected.length > 0) {
181
211
  this.#instrumentation.recordRejected(rejected.length);
182
212
  }
183
- // Run post-add eviction rules for pending txs
184
- if (acceptedPending.size > 0) {
185
- const feePayers = Array.from(acceptedPending).map((txHash)=>this.#indices.getMetadata(txHash).feePayer);
186
- const uniqueFeePayers = new Set(feePayers);
187
- await this.#evictionManager.evictAfterNewTxs(Array.from(acceptedPending), [
188
- ...uniqueFeePayers
189
- ]);
190
- }
191
213
  return {
192
214
  accepted,
193
215
  ignored,
@@ -197,18 +219,10 @@ import { TxPoolIndices } from './tx_pool_indices.js';
197
219
  } : {}
198
220
  };
199
221
  }
200
- /** Validates and adds a regular pending tx. Returns status. */ async #tryAddRegularPendingTx(tx, opts, poolAccess, acceptedPending, ignored, errors, preAddContext) {
201
- const txHash = tx.getTxHash();
202
- const txHashStr = txHash.toString();
203
- // Build metadata and validate using metadata
204
- const meta = await buildTxMetaData(tx);
205
- if (!await this.#validateMeta(meta)) {
206
- return {
207
- status: 'rejected'
208
- };
209
- }
222
+ /** Adds a validated pending tx, running pre-add rules and evicting conflicts. */ async #tryAddRegularPendingTx(tx, precomputedMeta, opts, poolAccess, acceptedPending, ignored, errors, preAddContext) {
223
+ const txHashStr = tx.getTxHash().toString();
210
224
  // Run pre-add rules
211
- const preAddResult = await this.#evictionManager.runPreAddRules(meta, poolAccess, preAddContext);
225
+ const preAddResult = await this.#evictionManager.runPreAddRules(precomputedMeta, poolAccess, preAddContext);
212
226
  if (preAddResult.shouldIgnore) {
213
227
  this.#log.debug(`Ignoring tx ${txHashStr}: ${preAddResult.reason?.message ?? 'unknown reason'}`);
214
228
  if (preAddResult.reason && preAddResult.reason.code !== TxPoolRejectionCode.INTERNAL_ERROR) {
@@ -246,8 +260,15 @@ import { TxPoolIndices } from './tx_pool_indices.js';
246
260
  }
247
261
  }
248
262
  }
263
+ // Randomly drop the transaction for testing purposes (report as accepted so it propagates)
264
+ if (this.#config.dropTransactionsProbability > 0 && Math.random() < this.#config.dropTransactionsProbability) {
265
+ this.#log.debug(`Dropping tx ${txHashStr} (simulated drop for testing)`);
266
+ return {
267
+ status: 'accepted'
268
+ };
269
+ }
249
270
  // Add the transaction
250
- await this.#addTx(tx, 'pending', opts);
271
+ await this.#addTx(tx, 'pending', opts, precomputedMeta);
251
272
  return {
252
273
  status: 'accepted'
253
274
  };
@@ -258,13 +279,8 @@ import { TxPoolIndices } from './tx_pool_indices.js';
258
279
  if (this.#indices.has(txHashStr)) {
259
280
  return 'ignored';
260
281
  }
261
- // Build metadata and validate using metadata
282
+ // Build metadata and check pre-add rules
262
283
  const meta = await buildTxMetaData(tx);
263
- const validationResult = await this.#validateMeta(meta, undefined, 'can add pending');
264
- if (validationResult !== true) {
265
- return 'rejected';
266
- }
267
- // Use pre-add rules
268
284
  const poolAccess = this.#createPreAddPoolAccess();
269
285
  const preAddResult = await this.#evictionManager.runPreAddRules(meta, poolAccess);
270
286
  return preAddResult.shouldIgnore ? 'ignored' : 'accepted';
@@ -305,34 +321,36 @@ import { TxPoolIndices } from './tx_pool_indices.js';
305
321
  const missing = [];
306
322
  let softDeletedHits = 0;
307
323
  let missingPreviouslyEvicted = 0;
308
- for (const txHash of txHashes){
309
- const txHashStr = txHash.toString();
310
- if (this.#indices.has(txHashStr)) {
311
- // Update protection for existing tx
312
- this.#indices.updateProtection(txHashStr, slotNumber);
313
- } else if (this.#deletedPool.isSoftDeleted(txHashStr)) {
314
- // Resurrect soft-deleted tx as protected
315
- const buffer = await this.#txsDB.getAsync(txHashStr);
316
- if (buffer) {
317
- const tx = Tx.fromBuffer(buffer);
318
- await this.#addTx(tx, {
319
- protected: slotNumber
320
- });
321
- softDeletedHits++;
324
+ await this.#store.transactionAsync(async ()=>{
325
+ for (const txHash of txHashes){
326
+ const txHashStr = txHash.toString();
327
+ if (this.#indices.has(txHashStr)) {
328
+ // Update protection for existing tx
329
+ this.#indices.updateProtection(txHashStr, slotNumber);
330
+ } else if (this.#deletedPool.isSoftDeleted(txHashStr)) {
331
+ // Resurrect soft-deleted tx as protected
332
+ const buffer = await this.#txsDB.getAsync(txHashStr);
333
+ if (buffer) {
334
+ const tx = Tx.fromBuffer(buffer);
335
+ await this.#addTx(tx, {
336
+ protected: slotNumber
337
+ });
338
+ softDeletedHits++;
339
+ } else {
340
+ // Data missing despite soft-delete flag — treat as truly missing
341
+ this.#indices.setProtection(txHashStr, slotNumber);
342
+ missing.push(txHash);
343
+ }
322
344
  } else {
323
- // Data missing despite soft-delete flag treat as truly missing
345
+ // Truly missing pre-record protection for tx we don't have yet
324
346
  this.#indices.setProtection(txHashStr, slotNumber);
325
347
  missing.push(txHash);
326
- }
327
- } else {
328
- // Truly missing — pre-record protection for tx we don't have yet
329
- this.#indices.setProtection(txHashStr, slotNumber);
330
- missing.push(txHash);
331
- if (this.#evictedTxHashes.has(txHashStr)) {
332
- missingPreviouslyEvicted++;
348
+ if (this.#evictedTxHashes.has(txHashStr)) {
349
+ missingPreviouslyEvicted++;
350
+ }
333
351
  }
334
352
  }
335
- }
353
+ });
336
354
  // Record metrics
337
355
  if (softDeletedHits > 0) {
338
356
  this.#instrumentation.recordSoftDeletedHits(softDeletedHits);
@@ -383,44 +401,48 @@ import { TxPoolIndices } from './tx_pool_indices.js';
383
401
  found.push(meta);
384
402
  }
385
403
  }
386
- // Step 4: Mark txs as mined (only those we have in the pool)
387
- for (const meta of found){
388
- this.#indices.markAsMined(meta, blockId);
389
- await this.#deletedPool.clearIfMinedHigher(meta.txHash, blockId.number);
390
- }
391
- // Step 5: Run eviction rules (remove pending txs with conflicting nullifiers/expired timestamps)
392
- await this.#evictionManager.evictAfterNewBlock(block.header, nullifiers, feePayers);
404
+ await this.#store.transactionAsync(async ()=>{
405
+ // Step 4: Mark txs as mined (only those we have in the pool)
406
+ for (const meta of found){
407
+ this.#indices.markAsMined(meta, blockId);
408
+ await this.#deletedPool.clearIfMinedHigher(meta.txHash, blockId.number);
409
+ }
410
+ // Step 5: Run post-event eviction rules (inside transaction for atomicity)
411
+ await this.#evictionManager.evictAfterNewBlock(block.header, nullifiers, feePayers);
412
+ });
393
413
  this.#log.info(`Marked ${found.length} txs as mined in block ${blockId.number}`);
394
414
  }
395
415
  async prepareForSlot(slotNumber) {
396
- // Step 0: Clean up slot-deleted txs from previous slots
397
- await this.#deletedPool.cleanupSlotDeleted(slotNumber);
398
- // Step 1: Find expired protected txs
399
- const expiredProtected = this.#indices.findExpiredProtectedTxs(slotNumber);
400
- // Step 2: Clear protection for all expired entries (including those without metadata)
401
- this.#indices.clearProtection(expiredProtected);
402
- // Step 3: Filter to only txs that have metadata and are not mined
403
- const txsToRestore = this.#indices.filterRestorable(expiredProtected);
404
- if (txsToRestore.length === 0) {
405
- this.#log.debug(`Preparing for slot ${slotNumber}, no txs to unprotect`);
406
- return;
407
- }
408
- this.#log.info(`Preparing for slot ${slotNumber}: unprotecting ${txsToRestore.length} txs`);
409
- // Step 4: Validate for pending pool
410
- const { valid, invalid } = await this.#revalidateMetadata(txsToRestore, 'during prepareForSlot');
411
- // Step 5: Resolve nullifier conflicts and add winners to pending indices
412
- const { added, toEvict } = this.#applyNullifierConflictResolution(valid);
413
- // Step 6: Delete invalid txs and evict conflict losers
414
- await this.#deleteTxsBatch(invalid);
415
- await this.#evictTxs(toEvict, 'NullifierConflict');
416
- // Step 7: Run eviction rules (enforce pool size limit)
417
- if (added.length > 0) {
418
- const feePayers = added.map((meta)=>meta.feePayer);
419
- const uniqueFeePayers = new Set(feePayers);
420
- await this.#evictionManager.evictAfterNewTxs(added.map((m)=>m.txHash), [
421
- ...uniqueFeePayers
422
- ]);
423
- }
416
+ await this.#store.transactionAsync(async ()=>{
417
+ // Step 0: Clean up slot-deleted txs from previous slots
418
+ await this.#deletedPool.cleanupSlotDeleted(slotNumber);
419
+ // Step 1: Find expired protected txs
420
+ const expiredProtected = this.#indices.findExpiredProtectedTxs(slotNumber);
421
+ // Step 2: Clear protection for all expired entries (including those without metadata)
422
+ this.#indices.clearProtection(expiredProtected);
423
+ // Step 3: Filter to only txs that have metadata and are not mined
424
+ const txsToRestore = this.#indices.filterRestorable(expiredProtected);
425
+ if (txsToRestore.length === 0) {
426
+ this.#log.debug(`Preparing for slot ${slotNumber}, no txs to unprotect`);
427
+ return;
428
+ }
429
+ this.#log.info(`Preparing for slot ${slotNumber}: unprotecting ${txsToRestore.length} txs`);
430
+ // Step 4: Validate for pending pool
431
+ const { valid, invalid } = await this.#revalidateMetadata(txsToRestore, 'during prepareForSlot');
432
+ // Step 5: Resolve nullifier conflicts and add winners to pending indices
433
+ const { added, toEvict } = this.#applyNullifierConflictResolution(valid);
434
+ // Step 6: Delete invalid txs and evict conflict losers
435
+ await this.#deleteTxsBatch(invalid);
436
+ await this.#evictTxs(toEvict, 'NullifierConflict');
437
+ // Step 7: Run eviction rules (enforce pool size limit)
438
+ if (added.length > 0) {
439
+ const feePayers = added.map((meta)=>meta.feePayer);
440
+ const uniqueFeePayers = new Set(feePayers);
441
+ await this.#evictionManager.evictAfterNewTxs(added.map((m)=>m.txHash), [
442
+ ...uniqueFeePayers
443
+ ]);
444
+ }
445
+ });
424
446
  }
425
447
  async handlePrunedBlocks(latestBlock, options) {
426
448
  // Step 1: Find transactions mined after the prune point
@@ -430,45 +452,48 @@ import { TxPoolIndices } from './tx_pool_indices.js';
430
452
  return;
431
453
  }
432
454
  this.#log.info(`Handling prune to block ${latestBlock.number}: un-mining ${txsToUnmine.length} txs`);
433
- // Step 2: Mark ALL un-mined txs with their original mined block number
434
- // This ensures they get soft-deleted if removed later, and only hard-deleted
435
- // when their original mined block is finalized
436
- await this.#deletedPool.markFromPrunedBlock(txsToUnmine.map((m)=>({
437
- txHash: m.txHash,
438
- minedAtBlock: BlockNumber(m.minedL2BlockId.number)
439
- })));
440
- // Step 3: Unmine - clear mined status from metadata
441
- for (const meta of txsToUnmine){
442
- this.#indices.markAsUnmined(meta);
443
- }
444
- // If deleteAllTxs is set (epoch prune), delete all un-mined txs and return early
445
- if (options?.deleteAllTxs) {
446
- const allTxHashes = txsToUnmine.map((m)=>m.txHash);
447
- await this.#deleteTxsBatch(allTxHashes);
448
- this.#log.info(`Handled prune to block ${latestBlock.number} with deleteAllTxs: deleted ${allTxHashes.length} txs`);
449
- return;
450
- }
451
- // Step 4: Filter out protected txs (they'll be handled by prepareForSlot)
452
- const unprotectedTxs = this.#indices.filterUnprotected(txsToUnmine);
453
- // Step 5: Validate for pending pool
454
- const { valid, invalid } = await this.#revalidateMetadata(unprotectedTxs, 'during handlePrunedBlocks');
455
- // Step 6: Resolve nullifier conflicts and add winners to pending indices
456
- const { toEvict } = this.#applyNullifierConflictResolution(valid);
457
- // Step 7: Delete invalid txs and evict conflict losers
458
- await this.#deleteTxsBatch(invalid);
459
- await this.#evictTxs(toEvict, 'NullifierConflict');
460
- this.#log.info(`Handled prune to block ${latestBlock.number}: ${valid.length} txs restored to pending, ${invalid.length} invalid, ${toEvict.length} evicted due to nullifier conflicts`, {
461
- txHashesRestored: valid.map((m)=>m.txHash),
462
- txHashesInvalid: invalid,
463
- txHashesEvicted: toEvict
455
+ await this.#store.transactionAsync(async ()=>{
456
+ // Step 2: Mark ALL un-mined txs with their original mined block number
457
+ // This ensures they get soft-deleted if removed later, and only hard-deleted
458
+ // when their original mined block is finalized
459
+ await this.#deletedPool.markFromPrunedBlock(txsToUnmine.map((m)=>({
460
+ txHash: m.txHash,
461
+ minedAtBlock: BlockNumber(m.minedL2BlockId.number)
462
+ })));
463
+ // Step 3: Unmine - clear mined status from metadata
464
+ for (const meta of txsToUnmine){
465
+ this.#indices.markAsUnmined(meta);
466
+ }
467
+ // If deleteAllTxs is set (epoch prune), delete all un-mined txs and return early
468
+ if (options?.deleteAllTxs) {
469
+ const allTxHashes = txsToUnmine.map((m)=>m.txHash);
470
+ await this.#deleteTxsBatch(allTxHashes);
471
+ this.#log.info(`Handled prune to block ${latestBlock.number} with deleteAllTxs: deleted ${allTxHashes.length} txs`);
472
+ return;
473
+ }
474
+ // Step 4: Filter out protected txs (they'll be handled by prepareForSlot)
475
+ const unprotectedTxs = this.#indices.filterUnprotected(txsToUnmine);
476
+ // Step 5: Validate for pending pool
477
+ const { valid, invalid } = await this.#revalidateMetadata(unprotectedTxs, 'during handlePrunedBlocks');
478
+ // Step 6: Resolve nullifier conflicts and add winners to pending indices
479
+ const { toEvict } = this.#applyNullifierConflictResolution(valid);
480
+ // Step 7: Delete invalid txs and evict conflict losers
481
+ await this.#deleteTxsBatch(invalid);
482
+ await this.#evictTxs(toEvict, 'NullifierConflict');
483
+ this.#log.info(`Handled prune to block ${latestBlock.number}: ${valid.length} txs restored to pending, ${invalid.length} invalid, ${toEvict.length} evicted due to nullifier conflicts`, {
484
+ txHashesRestored: valid.map((m)=>m.txHash),
485
+ txHashesInvalid: invalid,
486
+ txHashesEvicted: toEvict
487
+ });
488
+ // Step 8: Run eviction rules for ALL pending txs (not just restored ones)
489
+ // This handles cases like existing pending txs with invalid fee payer balances
490
+ await this.#evictionManager.evictAfterChainPrune(latestBlock.number);
464
491
  });
465
- // Step 8: Run eviction rules for ALL pending txs (not just restored ones)
466
- // This handles cases like existing pending txs with invalid fee payer balances
467
- await this.#evictionManager.evictAfterChainPrune(latestBlock.number);
468
492
  }
469
493
  async handleFailedExecution(txHashes) {
470
- // Delete failed txs
471
- await this.#deleteTxsBatch(txHashes.map((h)=>h.toString()));
494
+ await this.#store.transactionAsync(async ()=>{
495
+ await this.#deleteTxsBatch(txHashes.map((h)=>h.toString()));
496
+ });
472
497
  this.#log.info(`Deleted ${txHashes.length} failed txs`, {
473
498
  txHashes: txHashes.map((h)=>h.toString())
474
499
  });
@@ -477,24 +502,26 @@ import { TxPoolIndices } from './tx_pool_indices.js';
477
502
  const blockNumber = block.globalVariables.blockNumber;
478
503
  // Step 1: Find mined txs at or before finalized block
479
504
  const minedTxsToFinalize = this.#indices.findTxsMinedAtOrBefore(blockNumber);
480
- // Step 2: Collect mined txs for archiving (before deletion)
481
- const txsToArchive = [];
482
- if (this.#archive.isEnabled()) {
483
- for (const txHashStr of minedTxsToFinalize){
484
- const buffer = await this.#txsDB.getAsync(txHashStr);
485
- if (buffer) {
486
- txsToArchive.push(Tx.fromBuffer(buffer));
505
+ await this.#store.transactionAsync(async ()=>{
506
+ // Step 2: Collect mined txs for archiving (before deletion)
507
+ const txsToArchive = [];
508
+ if (this.#archive.isEnabled()) {
509
+ for (const txHashStr of minedTxsToFinalize){
510
+ const buffer = await this.#txsDB.getAsync(txHashStr);
511
+ if (buffer) {
512
+ txsToArchive.push(Tx.fromBuffer(buffer));
513
+ }
487
514
  }
488
515
  }
489
- }
490
- // Step 3: Delete mined txs from active pool
491
- await this.#deleteTxsBatch(minedTxsToFinalize);
492
- // Step 4: Finalize soft-deleted txs
493
- await this.#deletedPool.finalizeBlock(blockNumber);
494
- // Step 5: Archive mined txs
495
- if (txsToArchive.length > 0) {
496
- await this.#archive.archiveTxs(txsToArchive);
497
- }
516
+ // Step 3: Delete mined txs from active pool
517
+ await this.#deleteTxsBatch(minedTxsToFinalize);
518
+ // Step 4: Finalize soft-deleted txs
519
+ await this.#deletedPool.finalizeBlock(blockNumber);
520
+ // Step 5: Archive mined txs
521
+ if (txsToArchive.length > 0) {
522
+ await this.#archive.archiveTxs(txsToArchive);
523
+ }
524
+ });
498
525
  if (minedTxsToFinalize.length > 0) {
499
526
  this.#log.info(`Finalized ${minedTxsToFinalize.length} mined txs from blocks up to ${blockNumber}`, {
500
527
  txHashes: minedTxsToFinalize
@@ -610,9 +637,9 @@ import { TxPoolIndices } from './tx_pool_indices.js';
610
637
  /**
611
638
  * Adds a new transaction to the pool with the specified state.
612
639
  * Emits onTxsAdded callback immediately after DB write.
613
- */ async #addTx(tx, state, opts = {}) {
640
+ */ async #addTx(tx, state, opts = {}, precomputedMeta) {
614
641
  const txHashStr = tx.getTxHash().toString();
615
- const meta = await buildTxMetaData(tx);
642
+ const meta = precomputedMeta ?? await buildTxMetaData(tx);
616
643
  meta.receivedAt = this.#dateProvider.now();
617
644
  await this.#txsDB.set(txHashStr, tx.toBuffer());
618
645
  await this.#deletedPool.clearSoftDeleted(txHashStr);
@@ -1,7 +1,7 @@
1
1
  import type { TxValidationResult, TxValidator } from '@aztec/stdlib/tx';
2
2
  export declare class AggregateTxValidator<T> implements TxValidator<T> {
3
- #private;
3
+ readonly validators: TxValidator<T>[];
4
4
  constructor(...validators: TxValidator<T>[]);
5
5
  validateTx(tx: T): Promise<TxValidationResult>;
6
6
  }
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdncmVnYXRlX3R4X3ZhbGlkYXRvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL21zZ192YWxpZGF0b3JzL3R4X3ZhbGlkYXRvci9hZ2dyZWdhdGVfdHhfdmFsaWRhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU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../../src/msg_validators/tx_validator/aggregate_tx_validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExE,qBAAa,oBAAoB,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;;IAE5D,YAAY,GAAG,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAM1C;IAEK,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkBnD;CACF"}
1
+ {"version":3,"file":"aggregate_tx_validator.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/tx_validator/aggregate_tx_validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExE,qBAAa,oBAAoB,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,YAAY,GAAG,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAM1C;IAEK,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkBnD;CACF"}
@@ -1,17 +1,17 @@
1
1
  export class AggregateTxValidator {
2
- #validators;
2
+ validators;
3
3
  constructor(...validators){
4
4
  if (validators.length === 0) {
5
5
  throw new Error('At least one validator must be provided');
6
6
  }
7
- this.#validators = validators;
7
+ this.validators = validators;
8
8
  }
9
9
  async validateTx(tx) {
10
10
  const aggregate = {
11
11
  result: 'valid',
12
12
  reason: []
13
13
  };
14
- for (const validator of this.#validators){
14
+ for (const validator of this.validators){
15
15
  const result = await validator.validateTx(tx);
16
16
  if (result.result === 'invalid') {
17
17
  aggregate.result = 'invalid';