@aztec/p2p 4.0.0-devnet.2-patch.4 → 4.0.0-devnet.3-patch.0

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 (212) hide show
  1. package/README.md +129 -3
  2. package/dest/client/factory.d.ts +4 -5
  3. package/dest/client/factory.d.ts.map +1 -1
  4. package/dest/client/factory.js +30 -28
  5. package/dest/client/interface.d.ts +8 -13
  6. package/dest/client/interface.d.ts.map +1 -1
  7. package/dest/client/p2p_client.d.ts +6 -13
  8. package/dest/client/p2p_client.d.ts.map +1 -1
  9. package/dest/client/p2p_client.js +22 -88
  10. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +2 -4
  11. package/dest/config.d.ts +29 -10
  12. package/dest/config.d.ts.map +1 -1
  13. package/dest/config.js +80 -31
  14. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
  15. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
  16. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +2 -1
  17. package/dest/mem_pools/tx_pool/priority.d.ts +2 -2
  18. package/dest/mem_pools/tx_pool/priority.d.ts.map +1 -1
  19. package/dest/mem_pools/tx_pool/priority.js +4 -4
  20. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +1 -1
  21. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +1 -1
  22. package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +3 -1
  23. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
  24. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
  25. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +3 -2
  26. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +1 -1
  27. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
  28. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +2 -0
  29. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +7 -1
  30. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
  31. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
  32. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +2 -2
  33. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
  34. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +10 -6
  35. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +1 -1
  36. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
  37. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +8 -6
  38. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +2 -2
  39. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
  40. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
  41. package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
  42. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
  43. package/dest/mem_pools/tx_pool_v2/index.js +1 -1
  44. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +9 -5
  45. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
  46. package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
  47. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +46 -8
  48. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
  49. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +81 -17
  50. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -1
  51. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
  52. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +9 -10
  53. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +5 -3
  54. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
  55. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +3 -0
  56. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +2 -2
  57. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
  58. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +179 -151
  59. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +6 -4
  60. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
  61. package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
  62. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +6 -4
  63. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
  64. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
  65. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +13 -8
  66. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
  67. package/dest/msg_validators/proposal_validator/proposal_validator.js +48 -36
  68. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +2 -2
  69. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  70. package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
  71. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +2 -1
  72. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
  73. package/dest/msg_validators/tx_validator/allowed_public_setup.js +24 -20
  74. package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
  75. package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
  76. package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
  77. package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts +9 -0
  78. package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts.map +1 -0
  79. package/dest/msg_validators/tx_validator/contract_instance_validator.js +48 -0
  80. package/dest/msg_validators/tx_validator/data_validator.d.ts +1 -1
  81. package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
  82. package/dest/msg_validators/tx_validator/data_validator.js +35 -2
  83. package/dest/msg_validators/tx_validator/factory.d.ts +133 -6
  84. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  85. package/dest/msg_validators/tx_validator/factory.js +247 -60
  86. package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
  87. package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
  88. package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
  89. package/dest/msg_validators/tx_validator/gas_validator.d.ts +67 -3
  90. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  91. package/dest/msg_validators/tx_validator/gas_validator.js +104 -37
  92. package/dest/msg_validators/tx_validator/index.d.ts +3 -1
  93. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  94. package/dest/msg_validators/tx_validator/index.js +2 -0
  95. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
  96. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
  97. package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
  98. package/dest/msg_validators/tx_validator/phases_validator.d.ts +22 -2
  99. package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
  100. package/dest/msg_validators/tx_validator/phases_validator.js +72 -24
  101. package/dest/services/dummy_service.d.ts +4 -4
  102. package/dest/services/dummy_service.d.ts.map +1 -1
  103. package/dest/services/dummy_service.js +4 -4
  104. package/dest/services/encoding.d.ts +6 -2
  105. package/dest/services/encoding.d.ts.map +1 -1
  106. package/dest/services/encoding.js +14 -8
  107. package/dest/services/gossipsub/topic_score_params.d.ts +18 -6
  108. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
  109. package/dest/services/gossipsub/topic_score_params.js +32 -10
  110. package/dest/services/libp2p/libp2p_service.d.ts +16 -13
  111. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  112. package/dest/services/libp2p/libp2p_service.js +97 -93
  113. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
  114. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +5 -4
  115. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
  116. package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -8
  117. package/dest/services/reqresp/reqresp.d.ts +1 -1
  118. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  119. package/dest/services/reqresp/reqresp.js +16 -8
  120. package/dest/services/service.d.ts +5 -3
  121. package/dest/services/service.d.ts.map +1 -1
  122. package/dest/services/tx_collection/file_store_tx_source.d.ts +5 -4
  123. package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
  124. package/dest/services/tx_collection/file_store_tx_source.js +39 -29
  125. package/dest/services/tx_collection/tx_source.d.ts +6 -5
  126. package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
  127. package/dest/services/tx_collection/tx_source.js +9 -7
  128. package/dest/services/tx_provider.d.ts +3 -3
  129. package/dest/services/tx_provider.d.ts.map +1 -1
  130. package/dest/services/tx_provider.js +4 -4
  131. package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
  132. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  133. package/dest/test-helpers/make-test-p2p-clients.js +1 -2
  134. package/dest/test-helpers/mock-pubsub.d.ts +4 -4
  135. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  136. package/dest/test-helpers/mock-pubsub.js +8 -2
  137. package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
  138. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  139. package/dest/test-helpers/reqresp-nodes.js +2 -2
  140. package/dest/test-helpers/testbench-utils.d.ts +2 -2
  141. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  142. package/dest/test-helpers/testbench-utils.js +2 -1
  143. package/dest/testbench/p2p_client_testbench_worker.js +7 -6
  144. package/dest/testbench/worker_client_manager.d.ts +3 -1
  145. package/dest/testbench/worker_client_manager.d.ts.map +1 -1
  146. package/dest/testbench/worker_client_manager.js +4 -1
  147. package/dest/util.d.ts +2 -2
  148. package/dest/util.d.ts.map +1 -1
  149. package/package.json +14 -14
  150. package/src/client/factory.ts +49 -45
  151. package/src/client/interface.ts +8 -13
  152. package/src/client/p2p_client.ts +24 -117
  153. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +2 -3
  154. package/src/config.ts +115 -33
  155. package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +2 -1
  156. package/src/mem_pools/tx_pool/priority.ts +4 -4
  157. package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +3 -1
  158. package/src/mem_pools/tx_pool_v2/README.md +9 -1
  159. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +3 -2
  160. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +3 -0
  161. package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +11 -1
  162. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +2 -2
  163. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +10 -6
  164. package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +15 -6
  165. package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +2 -1
  166. package/src/mem_pools/tx_pool_v2/index.ts +1 -1
  167. package/src/mem_pools/tx_pool_v2/interfaces.ts +9 -4
  168. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +113 -18
  169. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +11 -11
  170. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +14 -2
  171. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +188 -153
  172. package/src/msg_validators/attestation_validator/README.md +49 -0
  173. package/src/msg_validators/proposal_validator/README.md +123 -0
  174. package/src/msg_validators/proposal_validator/block_proposal_validator.ts +14 -4
  175. package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +20 -7
  176. package/src/msg_validators/proposal_validator/proposal_validator.ts +63 -40
  177. package/src/msg_validators/tx_validator/README.md +119 -0
  178. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -3
  179. package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
  180. package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
  181. package/src/msg_validators/tx_validator/contract_instance_validator.ts +56 -0
  182. package/src/msg_validators/tx_validator/data_validator.ts +42 -1
  183. package/src/msg_validators/tx_validator/factory.ts +394 -78
  184. package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
  185. package/src/msg_validators/tx_validator/gas_validator.ts +123 -27
  186. package/src/msg_validators/tx_validator/index.ts +2 -0
  187. package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
  188. package/src/msg_validators/tx_validator/phases_validator.ts +82 -27
  189. package/src/services/dummy_service.ts +6 -6
  190. package/src/services/encoding.ts +14 -7
  191. package/src/services/gossipsub/README.md +29 -14
  192. package/src/services/gossipsub/topic_score_params.ts +49 -13
  193. package/src/services/libp2p/libp2p_service.ts +111 -101
  194. package/src/services/reqresp/README.md +229 -0
  195. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
  196. package/src/services/reqresp/rate-limiter/rate_limiter.ts +13 -9
  197. package/src/services/reqresp/reqresp.ts +18 -10
  198. package/src/services/service.ts +11 -2
  199. package/src/services/tx_collection/file_store_tx_source.ts +43 -31
  200. package/src/services/tx_collection/tx_source.ts +8 -7
  201. package/src/services/tx_provider.ts +2 -2
  202. package/src/test-helpers/make-test-p2p-clients.ts +0 -2
  203. package/src/test-helpers/mock-pubsub.ts +13 -6
  204. package/src/test-helpers/reqresp-nodes.ts +2 -5
  205. package/src/test-helpers/testbench-utils.ts +2 -1
  206. package/src/testbench/p2p_client_testbench_worker.ts +3 -6
  207. package/src/testbench/worker_client_manager.ts +11 -4
  208. package/src/util.ts +7 -1
  209. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
  210. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
  211. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
  212. package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
@@ -1,4 +1,34 @@
1
- import { Fr } from '@aztec/foundation/curves/bn254';
1
+ /**
2
+ * Transaction validator factories for each tx entry point.
3
+ *
4
+ * Unsolicited transactions (gossip and RPC) are fully validated before acceptance.
5
+ * Transactions received via req/resp or block proposals are only checked for
6
+ * well-formedness because we must include them for block re-execution — they may
7
+ * ultimately be invalid, which is caught during block building and reported as
8
+ * part of block validation/attestation. See the README in this directory for the
9
+ * full validation strategy.
10
+ *
11
+ * 1. **Gossip** — full validation in two stages with a pool pre-check in between.
12
+ * Stage 1 (fast): metadata, data, timestamps, double-spend, gas, phases, block header.
13
+ * Pool pre-check: `canAddPendingTx` — skips proof verification if pool would reject.
14
+ * Stage 2 (slow): proof verification.
15
+ * Orchestrated by `handleGossipedTx` in `libp2p_service.ts`.
16
+ *
17
+ * 2. **JSON-RPC** — full validation including all state-dependent checks.
18
+ * Proof verification and fee enforcement are configurable for testing purposes.
19
+ *
20
+ * 3. **Req/resp & block proposals** — well-formedness checks only (metadata, size,
21
+ * data, proof). Stored for re-execution; validity against state is not checked here.
22
+ *
23
+ * 4. **Block building** — re-validates against current state immediately before
24
+ * sequencing. Catches invalid txs that entered via req/resp or block proposals.
25
+ * Proof and data checks are skipped since they were verified on entry.
26
+ *
27
+ * 5. **Pending pool migration** — when unmined txs (e.g. from req/resp or block
28
+ * proposals) are migrated to the pending pool, the pool runs the state-dependent
29
+ * checks they missed: double-spend, block header, gas limits, and timestamps.
30
+ * This runs on every tx potentially entering the pending pool.
31
+ */ import { Fr } from '@aztec/foundation/curves/bn254';
2
32
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
3
33
  import { ProtocolContractAddress, protocolContractsHash } from '@aztec/protocol-contracts';
4
34
  import { PeerErrorSeverity } from '@aztec/stdlib/p2p';
@@ -6,79 +36,236 @@ import { DatabasePublicStateSource, MerkleTreeId } from '@aztec/stdlib/trees';
6
36
  import { AggregateTxValidator } from './aggregate_tx_validator.js';
7
37
  import { ArchiveCache } from './archive_cache.js';
8
38
  import { BlockHeaderTxValidator } from './block_header_validator.js';
39
+ import { ContractInstanceTxValidator } from './contract_instance_validator.js';
9
40
  import { DataTxValidator } from './data_validator.js';
10
41
  import { DoubleSpendTxValidator } from './double_spend_validator.js';
11
- import { GasTxValidator } from './gas_validator.js';
42
+ import { GasLimitsValidator, GasTxValidator } from './gas_validator.js';
12
43
  import { MetadataTxValidator } from './metadata_validator.js';
13
- import { PhasesTxValidator } from './phases_validator.js';
44
+ import { NullifierCache } from './nullifier_cache.js';
45
+ import { AllowedSetupCallsMetaValidator, PhasesTxValidator } from './phases_validator.js';
14
46
  import { SizeTxValidator } from './size_validator.js';
15
47
  import { TimestampTxValidator } from './timestamp_validator.js';
16
48
  import { TxPermittedValidator } from './tx_permitted_validator.js';
17
49
  import { TxProofValidator } from './tx_proof_validator.js';
18
- export function createTxMessageValidators(timestamp, blockNumber, worldStateSynchronizer, gasFees, l1ChainId, rollupVersion, protocolContractsHash, contractDataSource, proofVerifier, txsPermitted, allowedInSetup = [], bindings) {
50
+ /**
51
+ * First stage of gossip validation — fast checks run before the pool pre-check.
52
+ *
53
+ * If any validator fails, the peer is penalized and the tx is rejected immediately,
54
+ * without consulting the pool or running proof verification.
55
+ *
56
+ * The `doubleSpendValidator` failure is special-cased by the caller (`handleGossipedTx`)
57
+ * to determine severity based on how recently the nullifier appeared.
58
+ */ export function createFirstStageTxValidationsForGossipedTransactions(timestamp, blockNumber, worldStateSynchronizer, gasFees, l1ChainId, rollupVersion, protocolContractsHash, contractDataSource, txsPermitted, allowedInSetup = [], bindings, gasLimitOpts) {
19
59
  const merkleTree = worldStateSynchronizer.getCommitted();
20
- return [
21
- {
22
- txsPermittedValidator: {
23
- validator: new TxPermittedValidator(txsPermitted, bindings),
24
- severity: PeerErrorSeverity.MidToleranceError
25
- },
26
- dataValidator: {
27
- validator: new DataTxValidator(bindings),
28
- severity: PeerErrorSeverity.HighToleranceError
29
- },
30
- metadataValidator: {
31
- validator: new MetadataTxValidator({
32
- l1ChainId: new Fr(l1ChainId),
33
- rollupVersion: new Fr(rollupVersion),
34
- protocolContractsHash,
35
- vkTreeRoot: getVKTreeRoot()
36
- }, bindings),
37
- severity: PeerErrorSeverity.HighToleranceError
38
- },
39
- timestampValidator: {
40
- validator: new TimestampTxValidator({
41
- timestamp,
42
- blockNumber
43
- }, bindings),
44
- severity: PeerErrorSeverity.MidToleranceError
45
- },
46
- doubleSpendValidator: {
47
- validator: new DoubleSpendTxValidator({
48
- nullifiersExist: async (nullifiers)=>{
49
- const merkleTree = worldStateSynchronizer.getCommitted();
50
- const indices = await merkleTree.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, nullifiers);
51
- return indices.map((index)=>index !== undefined);
52
- }
53
- }, bindings),
54
- severity: PeerErrorSeverity.HighToleranceError
55
- },
56
- gasValidator: {
57
- validator: new GasTxValidator(new DatabasePublicStateSource(merkleTree), ProtocolContractAddress.FeeJuice, gasFees, bindings),
58
- severity: PeerErrorSeverity.HighToleranceError
59
- },
60
- phasesValidator: {
61
- validator: new PhasesTxValidator(contractDataSource, allowedInSetup, timestamp, bindings),
62
- severity: PeerErrorSeverity.MidToleranceError
63
- },
64
- blockHeaderValidator: {
65
- validator: new BlockHeaderTxValidator(new ArchiveCache(merkleTree), bindings),
66
- severity: PeerErrorSeverity.HighToleranceError
67
- }
60
+ return {
61
+ timestampValidator: {
62
+ validator: new TimestampTxValidator({
63
+ timestamp,
64
+ blockNumber
65
+ }, bindings),
66
+ severity: PeerErrorSeverity.HighToleranceError
68
67
  },
69
- {
70
- proofValidator: {
71
- validator: new TxProofValidator(proofVerifier, bindings),
72
- severity: PeerErrorSeverity.MidToleranceError
73
- }
68
+ txsPermittedValidator: {
69
+ validator: new TxPermittedValidator(txsPermitted, bindings),
70
+ severity: PeerErrorSeverity.MidToleranceError
71
+ },
72
+ txSizeValidator: {
73
+ validator: new SizeTxValidator(bindings),
74
+ severity: PeerErrorSeverity.MidToleranceError
75
+ },
76
+ metadataValidator: {
77
+ validator: new MetadataTxValidator({
78
+ l1ChainId: new Fr(l1ChainId),
79
+ rollupVersion: new Fr(rollupVersion),
80
+ protocolContractsHash,
81
+ vkTreeRoot: getVKTreeRoot()
82
+ }, bindings),
83
+ severity: PeerErrorSeverity.MidToleranceError
84
+ },
85
+ phasesValidator: {
86
+ validator: new PhasesTxValidator(contractDataSource, allowedInSetup, timestamp, bindings),
87
+ severity: PeerErrorSeverity.MidToleranceError
88
+ },
89
+ blockHeaderValidator: {
90
+ validator: new BlockHeaderTxValidator(new ArchiveCache(merkleTree), bindings),
91
+ severity: PeerErrorSeverity.HighToleranceError
92
+ },
93
+ doubleSpendValidator: {
94
+ validator: new DoubleSpendTxValidator({
95
+ nullifiersExist: async (nullifiers)=>{
96
+ const merkleTree = worldStateSynchronizer.getCommitted();
97
+ const indices = await merkleTree.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, nullifiers);
98
+ return indices.map((index)=>index !== undefined);
99
+ }
100
+ }, bindings),
101
+ severity: PeerErrorSeverity.MidToleranceError
102
+ },
103
+ gasValidator: {
104
+ validator: new GasTxValidator(new DatabasePublicStateSource(merkleTree), ProtocolContractAddress.FeeJuice, gasFees, bindings, gasLimitOpts),
105
+ severity: PeerErrorSeverity.MidToleranceError
106
+ },
107
+ dataValidator: {
108
+ validator: new DataTxValidator(bindings),
109
+ severity: PeerErrorSeverity.MidToleranceError
110
+ },
111
+ contractInstanceValidator: {
112
+ validator: new ContractInstanceTxValidator(bindings),
113
+ severity: PeerErrorSeverity.MidToleranceError
74
114
  }
75
- ];
115
+ };
116
+ }
117
+ /**
118
+ * Second stage of gossip validation — expensive proof verification.
119
+ *
120
+ * Only runs after the first stage passes AND `canAddPendingTx` confirms the pool would
121
+ * accept the tx. This avoids wasting CPU on proof verification for txs the pool would reject
122
+ * (e.g., duplicates, insufficient balance, pool full).
123
+ */ export function createSecondStageTxValidationsForGossipedTransactions(proofVerifier, bindings) {
124
+ return {
125
+ proofValidator: {
126
+ validator: new TxProofValidator(proofVerifier, bindings),
127
+ severity: PeerErrorSeverity.LowToleranceError
128
+ }
129
+ };
76
130
  }
77
- export function createTxReqRespValidator(verifier, { l1ChainId, rollupVersion }, bindings) {
131
+ /**
132
+ * Well-formedness checks only: metadata, size, data, and proof.
133
+ * Used for req/resp and block proposal txs. These txs must be accepted for block
134
+ * re-execution even though they may be invalid against current state — that is
135
+ * caught later by the block building validator.
136
+ */ function createTxValidatorForMinimumTxIntegrityChecks(verifier, { l1ChainId, rollupVersion }, bindings) {
78
137
  return new AggregateTxValidator(new MetadataTxValidator({
79
138
  l1ChainId: new Fr(l1ChainId),
80
139
  rollupVersion: new Fr(rollupVersion),
81
140
  protocolContractsHash,
82
141
  vkTreeRoot: getVKTreeRoot()
83
- }, bindings), new SizeTxValidator(bindings), new DataTxValidator(bindings), new TxProofValidator(verifier, bindings));
142
+ }, bindings), new SizeTxValidator(bindings), new DataTxValidator(bindings), new ContractInstanceTxValidator(bindings), new TxProofValidator(verifier, bindings));
143
+ }
144
+ /**
145
+ * Validators for txs received via req/resp or filestores.
146
+ * Checks well-formedness only — we must accept these for re-execution even if they
147
+ * are invalid against current state. State-dependent checks happen when the tx
148
+ * enters the pending pool or during block building.
149
+ */ export function createTxValidatorForReqResponseReceivedTxs(verifier, { l1ChainId, rollupVersion }, bindings) {
150
+ return createTxValidatorForMinimumTxIntegrityChecks(verifier, {
151
+ l1ChainId,
152
+ rollupVersion
153
+ }, bindings);
154
+ }
155
+ /**
156
+ * Validators for txs received in block proposals.
157
+ * Same as req/resp — well-formedness only. We must store these for block
158
+ * re-execution; their validity against state is checked during block building.
159
+ */ export function createTxValidatorForBlockProposalReceivedTxs(verifier, { l1ChainId, rollupVersion }, bindings) {
160
+ return createTxValidatorForMinimumTxIntegrityChecks(verifier, {
161
+ l1ChainId,
162
+ rollupVersion
163
+ }, bindings);
164
+ }
165
+ /**
166
+ * Validators for unsolicited txs received over JSON-RPC (from a local wallet/PXE).
167
+ * Full validation — all state-dependent checks are run. Proof verification is optional
168
+ * (can be skipped for testing purposes). Fee enforcement is also optional (skipped for testing/dev).
169
+ * Called from `AztecNodeService.isValidTx()`.
170
+ */ export function createTxValidatorForAcceptingTxsOverRPC(db, contractDataSource, verifier, { l1ChainId, rollupVersion, setupAllowList, gasFees, skipFeeEnforcement, timestamp, blockNumber, txsPermitted, rollupManaLimit, maxBlockL2Gas, maxBlockDAGas }, bindings) {
171
+ const validators = [
172
+ new TxPermittedValidator(txsPermitted, bindings),
173
+ new TimestampTxValidator({
174
+ timestamp,
175
+ blockNumber
176
+ }, bindings),
177
+ new SizeTxValidator(bindings),
178
+ new MetadataTxValidator({
179
+ l1ChainId: new Fr(l1ChainId),
180
+ rollupVersion: new Fr(rollupVersion),
181
+ protocolContractsHash,
182
+ vkTreeRoot: getVKTreeRoot()
183
+ }, bindings),
184
+ new PhasesTxValidator(contractDataSource, setupAllowList, timestamp, bindings),
185
+ new BlockHeaderTxValidator(new ArchiveCache(db), bindings),
186
+ new DoubleSpendTxValidator(new NullifierCache(db), bindings),
187
+ new DataTxValidator(bindings),
188
+ new ContractInstanceTxValidator(bindings)
189
+ ];
190
+ if (!skipFeeEnforcement) {
191
+ validators.push(new GasTxValidator(new DatabasePublicStateSource(db), ProtocolContractAddress.FeeJuice, gasFees, bindings, {
192
+ rollupManaLimit,
193
+ maxBlockL2Gas,
194
+ maxBlockDAGas
195
+ }));
196
+ }
197
+ if (verifier) {
198
+ validators.push(new TxProofValidator(verifier, bindings));
199
+ }
200
+ return new AggregateTxValidator(...validators);
201
+ }
202
+ /**
203
+ * Validators for txs about to be included in a block by the sequencer.
204
+ * Re-validates against current state. This is where invalid txs that entered via
205
+ * req/resp or block proposals are caught — their invalidity is reported as part
206
+ * of block validation/attestation. Proof and data checks are omitted since they
207
+ * were already verified on entry.
208
+ * Called from `CheckpointBuilder.makeBlockBuilderDeps()`.
209
+ */ export function createTxValidatorForBlockBuilding(db, contractDataSource, globalVariables, setupAllowList, bindings) {
210
+ const nullifierCache = new NullifierCache(db);
211
+ const archiveCache = new ArchiveCache(db);
212
+ const publicStateSource = new DatabasePublicStateSource(db);
213
+ return {
214
+ preprocessValidator: createTxValidatorForValidatingAgainstCurrentState(nullifierCache, archiveCache, publicStateSource, contractDataSource, globalVariables, setupAllowList, bindings),
215
+ nullifierCache
216
+ };
217
+ }
218
+ function createTxValidatorForValidatingAgainstCurrentState(nullifierSource, archiveSource, publicStateSource, contractDataSource, globalVariables, setupAllowList, bindings) {
219
+ // We don't include the TxProofValidator nor the DataTxValidator here because they are already checked by the time we get to block building.
220
+ return new AggregateTxValidator(new TimestampTxValidator({
221
+ timestamp: globalVariables.timestamp,
222
+ blockNumber: globalVariables.blockNumber
223
+ }, bindings), new PhasesTxValidator(contractDataSource, setupAllowList, globalVariables.timestamp, bindings), new BlockHeaderTxValidator(archiveSource, bindings), new DoubleSpendTxValidator(nullifierSource, bindings), new GasTxValidator(publicStateSource, ProtocolContractAddress.FeeJuice, globalVariables.gasFees, bindings));
224
+ }
225
+ /**
226
+ * Validators for txs migrating to the pending pool.
227
+ *
228
+ * Txs that arrived via req/resp or block proposals only had well-formedness checks
229
+ * on receipt. When they fail to be mined and are migrated to the pending pool, we
230
+ * run the state-dependent checks they missed: double-spend, block header, gas limits,
231
+ * and timestamp expiry. This is run on EVERY tx potentially entering the pending pool
232
+ * — called inside `TxPoolV2Impl` during `addPendingTxs`, `prepareForSlot` (unprotect),
233
+ * `handlePrunedBlocks` (unmine), and startup hydration.
234
+ *
235
+ * Operates on `TxMetaData` rather than full `Tx` since metadata is pre-built by the pool.
236
+ * Injected into `TxPoolV2` as the `createTxValidator` factory in `TxPoolV2Dependencies`.
237
+ */ export async function createTxValidatorForTransactionsEnteringPendingTxPool(worldStateSynchronizer, timestamp, blockNumber, gasLimitOpts, bindings) {
238
+ await worldStateSynchronizer.syncImmediate();
239
+ const merkleTree = worldStateSynchronizer.getCommitted();
240
+ const nullifierSource = {
241
+ nullifiersExist: async (nullifiers)=>{
242
+ const indices = await merkleTree.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, nullifiers);
243
+ return indices.map((index)=>index !== undefined);
244
+ }
245
+ };
246
+ const archiveSource = {
247
+ getArchiveIndices: (archives)=>{
248
+ return merkleTree.findLeafIndices(MerkleTreeId.ARCHIVE, archives);
249
+ }
250
+ };
251
+ return new AggregateTxValidator(new GasLimitsValidator({
252
+ ...gasLimitOpts,
253
+ bindings
254
+ }), new TimestampTxValidator({
255
+ timestamp,
256
+ blockNumber
257
+ }, bindings), new DoubleSpendTxValidator(nullifierSource, bindings), new BlockHeaderTxValidator(archiveSource, bindings), new AllowedSetupCallsMetaValidator(bindings));
258
+ }
259
+ /**
260
+ * Creates a function that checks whether a tx's setup-phase calls are on the allow list.
261
+ *
262
+ * Uses the `PhasesTxValidator` on the full Tx. The result is stored as a boolean
263
+ * flag in `TxMetaData.allowedSetupCalls` at receipt time, so the pending pool
264
+ * migration validator can check it without needing the full Tx or its dependencies.
265
+ */ export function createCheckAllowedSetupCalls(contractDataSource, setupAllowList, getTimestamp) {
266
+ return async (tx)=>{
267
+ const validator = new PhasesTxValidator(contractDataSource, setupAllowList, getTimestamp());
268
+ const result = await validator.validateTx(tx);
269
+ return result.result === 'valid';
270
+ };
84
271
  }
@@ -7,4 +7,4 @@ export type FeePayerBalanceDelta = {
7
7
  export declare function getTxFeeLimit(tx: Tx): bigint;
8
8
  export declare function getFeePayerClaimAmount(tx: Tx, feeJuiceAddress: AztecAddress): Promise<bigint>;
9
9
  export declare function getFeePayerBalanceDelta(tx: Tx, feeJuiceAddress: AztecAddress): Promise<FeePayerBalanceDelta>;
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3BheWVyX2JhbGFuY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tc2dfdmFsaWRhdG9ycy90eF92YWxpZGF0b3IvZmVlX3BheWVyX2JhbGFuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFvQixNQUFNLGtCQUFrQixDQUFDO0FBRTdELE1BQU0sTUFBTSxvQkFBb0IsR0FBRztJQUNqQyxRQUFRLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLFdBQVcsRUFBRSxNQUFNLENBQUM7Q0FDckIsQ0FBQztBQUlGLHdCQUFnQixhQUFhLENBQUMsRUFBRSxFQUFFLEVBQUUsR0FBRyxNQUFNLENBRTVDO0FBRUQsd0JBQXNCLHNCQUFzQixDQUFDLEVBQUUsRUFBRSxFQUFFLEVBQUUsZUFBZSxFQUFFLFlBQVksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBZ0JuRztBQUVELHdCQUFzQix1QkFBdUIsQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLGVBQWUsRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLG9CQUFvQixDQUFDLENBS2xIIn0=
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3BheWVyX2JhbGFuY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tc2dfdmFsaWRhdG9ycy90eF92YWxpZGF0b3IvZmVlX3BheWVyX2JhbGFuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFvQixNQUFNLGtCQUFrQixDQUFDO0FBRTdELE1BQU0sTUFBTSxvQkFBb0IsR0FBRztJQUNqQyxRQUFRLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLFdBQVcsRUFBRSxNQUFNLENBQUM7Q0FDckIsQ0FBQztBQU9GLHdCQUFnQixhQUFhLENBQUMsRUFBRSxFQUFFLEVBQUUsR0FBRyxNQUFNLENBRTVDO0FBRUQsd0JBQXNCLHNCQUFzQixDQUFDLEVBQUUsRUFBRSxFQUFFLEVBQUUsZUFBZSxFQUFFLFlBQVksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBZ0JuRztBQUVELHdCQUFzQix1QkFBdUIsQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLGVBQWUsRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLG9CQUFvQixDQUFDLENBS2xIIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"fee_payer_balance.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/tx_validator/fee_payer_balance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,CAE5C;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBnG;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAKlH"}
1
+ {"version":3,"file":"fee_payer_balance.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/tx_validator/fee_payer_balance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAOF,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,CAE5C;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBnG;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAKlH"}
@@ -1,7 +1,11 @@
1
+ import { FeeJuiceArtifact } from '@aztec/protocol-contracts/fee-juice';
1
2
  import { getCallRequestsWithCalldataByPhase } from '@aztec/simulator/server';
2
- import { FunctionSelector } from '@aztec/stdlib/abi';
3
+ import { FunctionSelector, getAllFunctionAbis } from '@aztec/stdlib/abi';
3
4
  import { TxExecutionPhase } from '@aztec/stdlib/tx';
4
- const increasePublicBalanceSelectorPromise = FunctionSelector.fromSignature('_increase_public_balance((Field),u128)');
5
+ const increasePublicBalanceSelectorPromise = (()=>{
6
+ const fn = getAllFunctionAbis(FeeJuiceArtifact).find((f)=>f.name === '_increase_public_balance');
7
+ return FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
8
+ })();
5
9
  export function getTxFeeLimit(tx) {
6
10
  return tx.data.constants.txContext.gasSettings.getFeeLimit().toBigInt();
7
11
  }
@@ -1,12 +1,76 @@
1
1
  import { type LoggerBindings } from '@aztec/foundation/log';
2
2
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import { GasFees } from '@aztec/stdlib/gas';
3
+ import { Gas, GasFees } from '@aztec/stdlib/gas';
4
4
  import type { PublicStateSource } from '@aztec/stdlib/trees';
5
5
  import { type Tx, type TxValidationResult, type TxValidator } from '@aztec/stdlib/tx';
6
+ /** Structural interface for types that carry gas limit data, used by {@link GasLimitsValidator}. */
7
+ export interface HasGasLimitData {
8
+ txHash: {
9
+ toString(): string;
10
+ };
11
+ data: {
12
+ forPublic?: unknown;
13
+ constants: {
14
+ txContext: {
15
+ gasSettings: {
16
+ gasLimits: Gas;
17
+ };
18
+ };
19
+ };
20
+ };
21
+ }
22
+ /**
23
+ * Validates that a transaction's gas limits are within acceptable bounds.
24
+ *
25
+ * Rejects transactions whose gas limits fall below the fixed minimums (FIXED_DA_GAS,
26
+ * FIXED_L2_GAS) or exceed the AVM's maximum processable L2 gas. This is a cheap,
27
+ * stateless check that operates on gas settings alone.
28
+ *
29
+ * Generic over T so it can validate both full {@link Tx} objects and {@link TxMetaData}
30
+ * (used during pending pool migration).
31
+ *
32
+ * Used by: pending pool migration (via factory), and indirectly by {@link GasTxValidator}.
33
+ */
34
+ export declare class GasLimitsValidator<T extends HasGasLimitData> implements TxValidator<T> {
35
+ #private;
36
+ constructor(opts?: {
37
+ rollupManaLimit?: number;
38
+ maxBlockL2Gas?: number;
39
+ maxBlockDAGas?: number;
40
+ bindings?: LoggerBindings;
41
+ });
42
+ validateTx(tx: T): Promise<TxValidationResult>;
43
+ /** Checks gas limits are >= fixed minimums and <= effective max gas (L2 and DA). */
44
+ validateGasLimit(tx: T): TxValidationResult;
45
+ }
46
+ /**
47
+ * Validates that a transaction can pay its gas fees.
48
+ *
49
+ * Runs three checks in order:
50
+ * 1. **Gas limits** (delegates to {@link GasLimitsValidator}) — rejects if limits are
51
+ * out of bounds.
52
+ * 2. **Max fee per gas** — skips (not rejects) the tx if its maxFeesPerGas is below
53
+ * the current block's gas fees. We skip rather than reject because the tx may
54
+ * become eligible in a later block with lower fees.
55
+ * 3. **Fee payer balance** — reads the fee payer's FeeJuice balance from public state,
56
+ * adds any pending claim from a setup-phase `_increase_public_balance` call, and
57
+ * rejects if the total is less than the tx's fee limit (gasLimits * maxFeePerGas).
58
+ *
59
+ * Used by: gossip (stage 1), RPC, and block building validators.
60
+ */
6
61
  export declare class GasTxValidator implements TxValidator<Tx> {
7
62
  #private;
8
- constructor(publicDataSource: PublicStateSource, feeJuiceAddress: AztecAddress, gasFees: GasFees, bindings?: LoggerBindings);
63
+ private bindings?;
64
+ constructor(publicDataSource: PublicStateSource, feeJuiceAddress: AztecAddress, gasFees: GasFees, bindings?: LoggerBindings | undefined, opts?: {
65
+ rollupManaLimit?: number;
66
+ maxBlockL2Gas?: number;
67
+ maxBlockDAGas?: number;
68
+ });
9
69
  validateTx(tx: Tx): Promise<TxValidationResult>;
70
+ /**
71
+ * Checks the fee payer has enough FeeJuice balance to cover the tx's fee limit.
72
+ * Accounts for any pending claim from a setup-phase `_increase_public_balance` call.
73
+ */
10
74
  validateTxFee(tx: Tx): Promise<TxValidationResult>;
11
75
  }
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2FzX3ZhbGlkYXRvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL21zZ192YWxpZGF0b3JzL3R4X3ZhbGlkYXRvci9nYXNfdmFsaWRhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBZSxLQUFLLG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QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,cAAc,CAAC;KAC3B,EAOA;IAED,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE7C;IAED,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAmC1C;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,cAAe,YAAW,WAAW,CAAC,EAAE,CAAC;;IAWlD,OAAO,CAAC,QAAQ,CAAC;IAJnB,YACE,gBAAgB,EAAE,iBAAiB,EACnC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,OAAO,EACR,QAAQ,CAAC,4BAAgB,EACjC,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,EAOpF;IAEK,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAYpD;IAyBD;;;OAGG;IACU,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyB9D;CACF"}
@@ -1,22 +1,119 @@
1
- import { AVM_MAX_PROCESSABLE_L2_GAS, FIXED_DA_GAS, FIXED_L2_GAS } from '@aztec/constants';
1
+ import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS, PRIVATE_TX_L2_GAS_OVERHEAD, PUBLIC_TX_L2_GAS_OVERHEAD, TX_DA_GAS_OVERHEAD } from '@aztec/constants';
2
2
  import { createLogger } from '@aztec/foundation/log';
3
3
  import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
4
4
  import { Gas } from '@aztec/stdlib/gas';
5
5
  import { TX_ERROR_GAS_LIMIT_TOO_HIGH, TX_ERROR_INSUFFICIENT_FEE_PAYER_BALANCE, TX_ERROR_INSUFFICIENT_FEE_PER_GAS, TX_ERROR_INSUFFICIENT_GAS_LIMIT } from '@aztec/stdlib/tx';
6
6
  import { getFeePayerClaimAmount, getTxFeeLimit } from './fee_payer_balance.js';
7
- export class GasTxValidator {
7
+ /**
8
+ * Validates that a transaction's gas limits are within acceptable bounds.
9
+ *
10
+ * Rejects transactions whose gas limits fall below the fixed minimums (FIXED_DA_GAS,
11
+ * FIXED_L2_GAS) or exceed the AVM's maximum processable L2 gas. This is a cheap,
12
+ * stateless check that operates on gas settings alone.
13
+ *
14
+ * Generic over T so it can validate both full {@link Tx} objects and {@link TxMetaData}
15
+ * (used during pending pool migration).
16
+ *
17
+ * Used by: pending pool migration (via factory), and indirectly by {@link GasTxValidator}.
18
+ */ export class GasLimitsValidator {
19
+ #log;
20
+ #effectiveMaxL2Gas;
21
+ #effectiveMaxDAGas;
22
+ #rollupManaLimit;
23
+ #maxBlockL2Gas;
24
+ #maxBlockDAGas;
25
+ constructor(opts){
26
+ this.#log = createLogger('sequencer:tx_validator:tx_gas', opts?.bindings);
27
+ this.#rollupManaLimit = opts?.rollupManaLimit ?? Infinity;
28
+ this.#maxBlockL2Gas = opts?.maxBlockL2Gas ?? Infinity;
29
+ this.#maxBlockDAGas = opts?.maxBlockDAGas ?? Infinity;
30
+ this.#effectiveMaxL2Gas = Math.min(MAX_PROCESSABLE_L2_GAS, this.#rollupManaLimit, this.#maxBlockL2Gas);
31
+ this.#effectiveMaxDAGas = Math.min(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, this.#maxBlockDAGas);
32
+ }
33
+ validateTx(tx) {
34
+ return Promise.resolve(this.validateGasLimit(tx));
35
+ }
36
+ /** Checks gas limits are >= fixed minimums and <= effective max gas (L2 and DA). */ validateGasLimit(tx) {
37
+ const gasLimits = tx.data.constants.txContext.gasSettings.gasLimits;
38
+ const minGasLimits = new Gas(TX_DA_GAS_OVERHEAD, tx.data.forPublic ? PUBLIC_TX_L2_GAS_OVERHEAD : PRIVATE_TX_L2_GAS_OVERHEAD);
39
+ if (minGasLimits.gtAny(gasLimits)) {
40
+ this.#log.verbose(`Rejecting transaction due to the gas limit(s) not being above the minimum gas limit`, {
41
+ gasLimits,
42
+ minGasLimits
43
+ });
44
+ return {
45
+ result: 'invalid',
46
+ reason: [
47
+ TX_ERROR_INSUFFICIENT_GAS_LIMIT
48
+ ]
49
+ };
50
+ }
51
+ if (gasLimits.l2Gas > this.#effectiveMaxL2Gas) {
52
+ this.#log.verbose(`Rejecting transaction due to the L2 gas limit being higher than the effective maximum`, {
53
+ gasLimits,
54
+ effectiveMaxL2Gas: this.#effectiveMaxL2Gas,
55
+ rollupManaLimit: this.#rollupManaLimit,
56
+ maxBlockL2Gas: this.#maxBlockL2Gas
57
+ });
58
+ return {
59
+ result: 'invalid',
60
+ reason: [
61
+ TX_ERROR_GAS_LIMIT_TOO_HIGH
62
+ ]
63
+ };
64
+ }
65
+ if (gasLimits.daGas > this.#effectiveMaxDAGas) {
66
+ this.#log.verbose(`Rejecting transaction due to the DA gas limit being higher than the effective maximum`, {
67
+ gasLimits,
68
+ effectiveMaxDAGas: this.#effectiveMaxDAGas,
69
+ maxBlockDAGas: this.#maxBlockDAGas
70
+ });
71
+ return {
72
+ result: 'invalid',
73
+ reason: [
74
+ TX_ERROR_GAS_LIMIT_TOO_HIGH
75
+ ]
76
+ };
77
+ }
78
+ return {
79
+ result: 'valid'
80
+ };
81
+ }
82
+ }
83
+ /**
84
+ * Validates that a transaction can pay its gas fees.
85
+ *
86
+ * Runs three checks in order:
87
+ * 1. **Gas limits** (delegates to {@link GasLimitsValidator}) — rejects if limits are
88
+ * out of bounds.
89
+ * 2. **Max fee per gas** — skips (not rejects) the tx if its maxFeesPerGas is below
90
+ * the current block's gas fees. We skip rather than reject because the tx may
91
+ * become eligible in a later block with lower fees.
92
+ * 3. **Fee payer balance** — reads the fee payer's FeeJuice balance from public state,
93
+ * adds any pending claim from a setup-phase `_increase_public_balance` call, and
94
+ * rejects if the total is less than the tx's fee limit (gasLimits * maxFeePerGas).
95
+ *
96
+ * Used by: gossip (stage 1), RPC, and block building validators.
97
+ */ export class GasTxValidator {
98
+ bindings;
8
99
  #log;
9
100
  #publicDataSource;
10
101
  #feeJuiceAddress;
11
102
  #gasFees;
12
- constructor(publicDataSource, feeJuiceAddress, gasFees, bindings){
103
+ #gasLimitOpts;
104
+ constructor(publicDataSource, feeJuiceAddress, gasFees, bindings, opts){
105
+ this.bindings = bindings;
13
106
  this.#log = createLogger('sequencer:tx_validator:tx_gas', bindings);
14
107
  this.#publicDataSource = publicDataSource;
15
108
  this.#feeJuiceAddress = feeJuiceAddress;
16
109
  this.#gasFees = gasFees;
110
+ this.#gasLimitOpts = opts;
17
111
  }
18
112
  async validateTx(tx) {
19
- const gasLimitValidation = this.#validateGasLimit(tx);
113
+ const gasLimitValidation = new GasLimitsValidator({
114
+ ...this.#gasLimitOpts,
115
+ bindings: this.bindings
116
+ }).validateGasLimit(tx);
20
117
  if (gasLimitValidation.result === 'invalid') {
21
118
  return Promise.resolve(gasLimitValidation);
22
119
  }
@@ -49,39 +146,9 @@ export class GasTxValidator {
49
146
  return notEnoughMaxFees;
50
147
  }
51
148
  /**
52
- * Check whether the tx's gas limit is above the minimum amount.
53
- */ #validateGasLimit(tx) {
54
- const gasLimits = tx.data.constants.txContext.gasSettings.gasLimits;
55
- const minGasLimits = new Gas(FIXED_DA_GAS, FIXED_L2_GAS);
56
- if (minGasLimits.gtAny(gasLimits)) {
57
- this.#log.verbose(`Rejecting transaction due to the gas limit(s) not being above the minimum gas limit`, {
58
- gasLimits,
59
- minGasLimits
60
- });
61
- return {
62
- result: 'invalid',
63
- reason: [
64
- TX_ERROR_INSUFFICIENT_GAS_LIMIT
65
- ]
66
- };
67
- }
68
- if (gasLimits.l2Gas > AVM_MAX_PROCESSABLE_L2_GAS) {
69
- this.#log.verbose(`Rejecting transaction due to the gas limit(s) being higher than the maximum processable gas`, {
70
- gasLimits,
71
- minGasLimits
72
- });
73
- return {
74
- result: 'invalid',
75
- reason: [
76
- TX_ERROR_GAS_LIMIT_TOO_HIGH
77
- ]
78
- };
79
- }
80
- return {
81
- result: 'valid'
82
- };
83
- }
84
- async validateTxFee(tx) {
149
+ * Checks the fee payer has enough FeeJuice balance to cover the tx's fee limit.
150
+ * Accounts for any pending claim from a setup-phase `_increase_public_balance` call.
151
+ */ async validateTxFee(tx) {
85
152
  const feePayer = tx.data.feePayer;
86
153
  // Compute the maximum fee that this tx may pay, based on its gasLimits and maxFeePerGas
87
154
  const feeLimit = getTxFeeLimit(tx);
@@ -8,8 +8,10 @@ export * from './gas_validator.js';
8
8
  export * from './phases_validator.js';
9
9
  export * from './test_utils.js';
10
10
  export * from './allowed_public_setup.js';
11
+ export * from './allowed_setup_helpers.js';
11
12
  export * from './archive_cache.js';
12
13
  export * from './tx_permitted_validator.js';
13
14
  export * from './timestamp_validator.js';
14
15
  export * from './size_validator.js';
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tc2dfdmFsaWRhdG9ycy90eF92YWxpZGF0b3IvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLHFCQUFxQixDQUFDIn0=
16
+ export * from './factory.js';
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tc2dfdmFsaWRhdG9ycy90eF92YWxpZGF0b3IvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxjQUFjLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/tx_validator/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/tx_validator/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
@@ -8,7 +8,9 @@ export * from './gas_validator.js';
8
8
  export * from './phases_validator.js';
9
9
  export * from './test_utils.js';
10
10
  export * from './allowed_public_setup.js';
11
+ export * from './allowed_setup_helpers.js';
11
12
  export * from './archive_cache.js';
12
13
  export * from './tx_permitted_validator.js';
13
14
  export * from './timestamp_validator.js';
14
15
  export * from './size_validator.js';
16
+ export * from './factory.js';