@aztec/stdlib 3.0.0-rc.5 → 4.0.0-nightly.20260107

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 (267) hide show
  1. package/dest/abi/abi.d.ts +602 -4
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +7 -7
  4. package/dest/abi/function_selector.d.ts +2 -1
  5. package/dest/abi/function_selector.d.ts.map +1 -1
  6. package/dest/abi/function_selector.js +7 -0
  7. package/dest/abi/selector.js +3 -1
  8. package/dest/avm/avm.js +1 -1
  9. package/dest/avm/avm_accumulated_data.js +5 -2
  10. package/dest/avm/avm_circuit_public_inputs.js +3 -1
  11. package/dest/avm/public_data_update_request.js +3 -1
  12. package/dest/avm/public_inner_call_request.js +3 -1
  13. package/dest/avm/revert_code.js +3 -1
  14. package/dest/aztec-address/index.js +4 -2
  15. package/dest/block/body.js +3 -1
  16. package/dest/block/checkpointed_l2_block.d.ts +267 -0
  17. package/dest/block/checkpointed_l2_block.d.ts.map +1 -0
  18. package/dest/block/{published_l2_block.js → checkpointed_l2_block.js} +40 -4
  19. package/dest/block/index.d.ts +2 -2
  20. package/dest/block/index.d.ts.map +1 -1
  21. package/dest/block/index.js +1 -1
  22. package/dest/block/l2_block_header.js +3 -1
  23. package/dest/block/l2_block_new.d.ts +8 -3
  24. package/dest/block/l2_block_new.d.ts.map +1 -1
  25. package/dest/block/l2_block_new.js +10 -9
  26. package/dest/block/l2_block_source.d.ts +69 -45
  27. package/dest/block/l2_block_source.d.ts.map +1 -1
  28. package/dest/block/l2_block_stream/interfaces.d.ts +2 -2
  29. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  30. package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -1
  31. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  32. package/dest/block/l2_block_stream/l2_block_stream.js +9 -1
  33. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  34. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  35. package/dest/block/test/l2_tips_store_test_suite.js +2 -5
  36. package/dest/checkpoint/checkpoint.d.ts +17 -2
  37. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  38. package/dest/checkpoint/checkpoint.js +42 -4
  39. package/dest/checkpoint/checkpoint_info.d.ts +9 -0
  40. package/dest/checkpoint/checkpoint_info.d.ts.map +1 -0
  41. package/dest/checkpoint/checkpoint_info.js +1 -0
  42. package/dest/checkpoint/published_checkpoint.d.ts +14 -8
  43. package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
  44. package/dest/checkpoint/published_checkpoint.js +11 -1
  45. package/dest/contract/contract_class_id.js +1 -1
  46. package/dest/contract/interfaces/contract_class.d.ts +11 -13
  47. package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
  48. package/dest/contract/interfaces/contract_class.js +18 -18
  49. package/dest/contract/interfaces/contract_instance.d.ts +12 -13
  50. package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
  51. package/dest/contract/interfaces/contract_instance.js +5 -5
  52. package/dest/contract/interfaces/contract_instance_update.d.ts +6 -7
  53. package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
  54. package/dest/contract/interfaces/contract_instance_update.js +5 -5
  55. package/dest/database-version/version_manager.js +3 -1
  56. package/dest/epoch-helpers/index.d.ts +1 -1
  57. package/dest/epoch-helpers/index.d.ts.map +1 -1
  58. package/dest/epoch-helpers/index.js +3 -3
  59. package/dest/gas/gas.js +3 -1
  60. package/dest/gas/gas_fees.js +3 -1
  61. package/dest/hash/hash.d.ts +1 -9
  62. package/dest/hash/hash.d.ts.map +1 -1
  63. package/dest/hash/hash.js +0 -12
  64. package/dest/interfaces/allowed_element.d.ts +7 -8
  65. package/dest/interfaces/allowed_element.d.ts.map +1 -1
  66. package/dest/interfaces/allowed_element.js +3 -3
  67. package/dest/interfaces/archiver.d.ts +1 -1
  68. package/dest/interfaces/archiver.d.ts.map +1 -1
  69. package/dest/interfaces/archiver.js +8 -3
  70. package/dest/interfaces/aztec-node-admin.d.ts +29 -11
  71. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  72. package/dest/interfaces/aztec-node-admin.js +1 -1
  73. package/dest/interfaces/aztec-node.d.ts +10 -10
  74. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  75. package/dest/interfaces/aztec-node.js +4 -4
  76. package/dest/interfaces/block-builder.d.ts +3 -2
  77. package/dest/interfaces/block-builder.d.ts.map +1 -1
  78. package/dest/interfaces/block-builder.js +9 -1
  79. package/dest/interfaces/configs.d.ts +47 -23
  80. package/dest/interfaces/configs.d.ts.map +1 -1
  81. package/dest/interfaces/configs.js +11 -6
  82. package/dest/interfaces/get_logs_response.d.ts +19 -4
  83. package/dest/interfaces/get_logs_response.d.ts.map +1 -1
  84. package/dest/interfaces/get_logs_response.js +5 -4
  85. package/dest/interfaces/l2_logs_source.d.ts +12 -8
  86. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  87. package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
  88. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  89. package/dest/interfaces/prover-client.d.ts +5 -3
  90. package/dest/interfaces/prover-client.d.ts.map +1 -1
  91. package/dest/interfaces/prover-client.js +5 -4
  92. package/dest/interfaces/proving-job.d.ts +168 -168
  93. package/dest/interfaces/server_circuit_prover.d.ts +2 -2
  94. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  95. package/dest/interfaces/slasher.d.ts +1 -1
  96. package/dest/interfaces/slasher.d.ts.map +1 -1
  97. package/dest/interfaces/slasher.js +3 -3
  98. package/dest/interfaces/validator.d.ts +7 -8
  99. package/dest/interfaces/validator.d.ts.map +1 -1
  100. package/dest/interfaces/validator.js +5 -5
  101. package/dest/interfaces/world_state.d.ts +17 -8
  102. package/dest/interfaces/world_state.d.ts.map +1 -1
  103. package/dest/kernel/claimed_length_array.js +3 -1
  104. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +1 -1
  105. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
  106. package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +1 -3
  107. package/dest/kernel/hints/transient_data_squashing_hint.js +3 -1
  108. package/dest/kernel/log_hash.js +3 -1
  109. package/dest/kernel/private_circuit_public_inputs.d.ts +47 -47
  110. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  111. package/dest/kernel/private_circuit_public_inputs.js +59 -59
  112. package/dest/kernel/private_log_data.js +5 -2
  113. package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
  114. package/dest/kernel/private_to_public_accumulated_data.js +3 -1
  115. package/dest/kernel/private_to_rollup_accumulated_data.js +3 -1
  116. package/dest/kernel/private_validation_requests.js +3 -1
  117. package/dest/kernel/public_call_request.js +5 -2
  118. package/dest/logs/contract_class_log.js +3 -1
  119. package/dest/logs/extended_public_log.d.ts +7 -1
  120. package/dest/logs/extended_public_log.d.ts.map +1 -1
  121. package/dest/logs/index.d.ts +3 -2
  122. package/dest/logs/index.d.ts.map +1 -1
  123. package/dest/logs/index.js +2 -1
  124. package/dest/logs/log_id.d.ts +9 -1
  125. package/dest/logs/log_id.d.ts.map +1 -1
  126. package/dest/logs/log_id.js +15 -8
  127. package/dest/logs/private_log.d.ts +1 -1
  128. package/dest/logs/private_log.d.ts.map +1 -1
  129. package/dest/logs/private_log.js +5 -2
  130. package/dest/logs/public_log.js +3 -1
  131. package/dest/logs/siloed_tag.d.ts +23 -0
  132. package/dest/logs/siloed_tag.d.ts.map +1 -0
  133. package/dest/logs/siloed_tag.js +30 -0
  134. package/dest/logs/tag.d.ts +21 -0
  135. package/dest/logs/tag.d.ts.map +1 -0
  136. package/dest/logs/tag.js +30 -0
  137. package/dest/logs/tx_scoped_l2_log.d.ts +24 -33
  138. package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
  139. package/dest/logs/tx_scoped_l2_log.js +37 -43
  140. package/dest/messaging/l1_to_l2_message.d.ts +1 -1
  141. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  142. package/dest/rollup/avm_proof_data.d.ts +1 -3
  143. package/dest/rollup/avm_proof_data.d.ts.map +1 -1
  144. package/dest/rollup/avm_proof_data.js +1 -9
  145. package/dest/rollup/block_rollup_public_inputs.d.ts +4 -9
  146. package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
  147. package/dest/rollup/block_rollup_public_inputs.js +6 -10
  148. package/dest/rollup/checkpoint_constant_data.d.ts +2 -1
  149. package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
  150. package/dest/rollup/checkpoint_constant_data.js +4 -1
  151. package/dest/rollup/checkpoint_header.d.ts +5 -1
  152. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  153. package/dest/rollup/checkpoint_header.js +7 -2
  154. package/dest/schemas/schemas.d.ts +4 -2
  155. package/dest/schemas/schemas.d.ts.map +1 -1
  156. package/dest/schemas/schemas.js +2 -1
  157. package/dest/slashing/types.d.ts +4 -5
  158. package/dest/slashing/types.d.ts.map +1 -1
  159. package/dest/slashing/types.js +5 -5
  160. package/dest/snapshots/types.d.ts +1 -1
  161. package/dest/snapshots/types.d.ts.map +1 -1
  162. package/dest/snapshots/types.js +5 -5
  163. package/dest/stats/stats.d.ts +10 -6
  164. package/dest/stats/stats.d.ts.map +1 -1
  165. package/dest/tests/factories.d.ts +24 -1
  166. package/dest/tests/factories.d.ts.map +1 -1
  167. package/dest/tests/factories.js +21 -1
  168. package/dest/tests/mocks.d.ts +5 -4
  169. package/dest/tests/mocks.d.ts.map +1 -1
  170. package/dest/tests/mocks.js +18 -5
  171. package/dest/trees/append_only_tree_snapshot.js +3 -1
  172. package/dest/tx/block_header.d.ts +8 -7
  173. package/dest/tx/block_header.d.ts.map +1 -1
  174. package/dest/tx/block_header.js +8 -2
  175. package/dest/tx/call_context.js +3 -1
  176. package/dest/tx/global_variable_builder.d.ts +4 -2
  177. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  178. package/dest/tx/global_variables.d.ts +6 -1
  179. package/dest/tx/global_variables.d.ts.map +1 -1
  180. package/dest/tx/global_variables.js +3 -1
  181. package/dest/tx/private_execution_result.d.ts +1 -1
  182. package/dest/tx/private_execution_result.js +1 -1
  183. package/dest/tx/public_call_request_with_calldata.js +3 -1
  184. package/dest/tx/simulated_tx.d.ts +1031 -7
  185. package/dest/tx/simulated_tx.d.ts.map +1 -1
  186. package/dest/tx/state_reference.js +3 -1
  187. package/dest/tx/tree_snapshots.js +3 -1
  188. package/dest/tx/tx.d.ts +10 -3
  189. package/dest/tx/tx.d.ts.map +1 -1
  190. package/dest/tx/tx.js +9 -2
  191. package/dest/tx/tx_effect.d.ts +1 -1
  192. package/dest/tx/tx_effect.d.ts.map +1 -1
  193. package/dest/tx/tx_effect.js +6 -2
  194. package/dest/tx/tx_execution_request.js +3 -1
  195. package/dest/tx/validator/tx_validator.d.ts +1 -4
  196. package/dest/tx/validator/tx_validator.d.ts.map +1 -1
  197. package/dest/tx/validator/tx_validator.js +4 -4
  198. package/dest/validators/schemas.d.ts +1 -1
  199. package/dest/validators/schemas.d.ts.map +1 -1
  200. package/dest/validators/schemas.js +13 -13
  201. package/package.json +8 -8
  202. package/src/abi/abi.ts +39 -33
  203. package/src/abi/function_selector.ts +8 -0
  204. package/src/avm/avm.ts +1 -1
  205. package/src/block/{published_l2_block.ts → checkpointed_l2_block.ts} +58 -3
  206. package/src/block/index.ts +1 -1
  207. package/src/block/l2_block_new.ts +17 -7
  208. package/src/block/l2_block_source.ts +78 -50
  209. package/src/block/l2_block_stream/interfaces.ts +1 -1
  210. package/src/block/l2_block_stream/l2_block_stream.ts +9 -0
  211. package/src/block/test/l2_tips_store_test_suite.ts +2 -1
  212. package/src/checkpoint/checkpoint.ts +51 -4
  213. package/src/checkpoint/checkpoint_info.ts +9 -0
  214. package/src/checkpoint/published_checkpoint.ts +19 -5
  215. package/src/contract/contract_class_id.ts +1 -1
  216. package/src/contract/interfaces/contract_class.ts +59 -46
  217. package/src/contract/interfaces/contract_instance.ts +15 -13
  218. package/src/contract/interfaces/contract_instance_update.ts +11 -9
  219. package/src/epoch-helpers/index.ts +11 -9
  220. package/src/hash/hash.ts +0 -11
  221. package/src/interfaces/allowed_element.ts +9 -7
  222. package/src/interfaces/archiver.ts +12 -4
  223. package/src/interfaces/aztec-node-admin.ts +2 -2
  224. package/src/interfaces/aztec-node.ts +18 -15
  225. package/src/interfaces/block-builder.ts +11 -1
  226. package/src/interfaces/configs.ts +64 -33
  227. package/src/interfaces/get_logs_response.ts +13 -9
  228. package/src/interfaces/l2_logs_source.ts +12 -7
  229. package/src/interfaces/merkle_tree_operations.ts +4 -1
  230. package/src/interfaces/prover-client.ts +13 -10
  231. package/src/interfaces/server_circuit_prover.ts +0 -1
  232. package/src/interfaces/slasher.ts +24 -22
  233. package/src/interfaces/validator.ts +22 -18
  234. package/src/interfaces/world_state.ts +16 -9
  235. package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +2 -4
  236. package/src/kernel/private_circuit_public_inputs.ts +85 -85
  237. package/src/logs/index.ts +2 -1
  238. package/src/logs/log_id.ts +16 -6
  239. package/src/logs/private_log.ts +2 -1
  240. package/src/logs/siloed_tag.ts +44 -0
  241. package/src/logs/tag.ts +42 -0
  242. package/src/logs/tx_scoped_l2_log.ts +45 -43
  243. package/src/messaging/l1_to_l2_message.ts +1 -0
  244. package/src/rollup/avm_proof_data.ts +0 -7
  245. package/src/rollup/block_rollup_public_inputs.ts +3 -9
  246. package/src/rollup/checkpoint_constant_data.ts +1 -0
  247. package/src/rollup/checkpoint_header.ts +4 -0
  248. package/src/schemas/schemas.ts +4 -0
  249. package/src/slashing/types.ts +24 -20
  250. package/src/snapshots/types.ts +33 -29
  251. package/src/stats/stats.ts +10 -5
  252. package/src/tests/factories.ts +45 -1
  253. package/src/tests/mocks.ts +15 -3
  254. package/src/tx/block_header.ts +12 -7
  255. package/src/tx/global_variable_builder.ts +8 -1
  256. package/src/tx/global_variables.ts +6 -0
  257. package/src/tx/private_execution_result.ts +1 -1
  258. package/src/tx/tx.ts +9 -2
  259. package/src/tx/tx_effect.ts +3 -1
  260. package/src/tx/validator/tx_validator.ts +8 -6
  261. package/src/validators/schemas.ts +54 -48
  262. package/dest/block/published_l2_block.d.ts +0 -130
  263. package/dest/block/published_l2_block.d.ts.map +0 -1
  264. package/dest/logs/log_with_tx_data.d.ts +0 -19
  265. package/dest/logs/log_with_tx_data.d.ts.map +0 -1
  266. package/dest/logs/log_with_tx_data.js +0 -49
  267. package/src/logs/log_with_tx_data.ts +0 -46
@@ -3,7 +3,7 @@ import type { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { z } from 'zod';
4
4
 
5
5
  import type { AztecAddress } from '../../aztec-address/index.js';
6
- import { type ZodFor, schemas } from '../../schemas/index.js';
6
+ import { schemas, zodFor } from '../../schemas/index.js';
7
7
  import type { UInt64 } from '../../types/shared.js';
8
8
 
9
9
  /**
@@ -20,12 +20,14 @@ export interface ContractInstanceUpdate {
20
20
 
21
21
  export type ContractInstanceUpdateWithAddress = ContractInstanceUpdate & { address: AztecAddress };
22
22
 
23
- export const ContractInstanceUpdateSchema = z.object({
24
- prevContractClassId: schemas.Fr,
25
- newContractClassId: schemas.Fr,
26
- timestampOfChange: schemas.BigInt,
27
- }) satisfies ZodFor<ContractInstanceUpdate>;
23
+ export const ContractInstanceUpdateSchema = zodFor<ContractInstanceUpdate>()(
24
+ z.object({
25
+ prevContractClassId: schemas.Fr,
26
+ newContractClassId: schemas.Fr,
27
+ timestampOfChange: schemas.BigInt,
28
+ }),
29
+ );
28
30
 
29
- export const ContractInstanceUpdateWithAddressSchema = ContractInstanceUpdateSchema.and(
30
- z.object({ address: schemas.AztecAddress }),
31
- ) satisfies ZodFor<ContractInstanceUpdateWithAddress>;
31
+ export const ContractInstanceUpdateWithAddressSchema = zodFor<ContractInstanceUpdateWithAddress>()(
32
+ ContractInstanceUpdateSchema.and(z.object({ address: schemas.AztecAddress })),
33
+ );
@@ -2,7 +2,7 @@ import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- import { type ZodFor, schemas } from '../schemas/index.js';
5
+ import { schemas, zodFor } from '../schemas/index.js';
6
6
 
7
7
  export type L1RollupConstants = {
8
8
  l1StartBlock: bigint;
@@ -22,14 +22,16 @@ export const EmptyL1RollupConstants: L1RollupConstants = {
22
22
  proofSubmissionEpochs: 1,
23
23
  };
24
24
 
25
- export const L1RollupConstantsSchema = z.object({
26
- l1StartBlock: schemas.BigInt,
27
- l1GenesisTime: schemas.BigInt,
28
- slotDuration: z.number(),
29
- epochDuration: z.number(),
30
- ethereumSlotDuration: z.number(),
31
- proofSubmissionEpochs: z.number(),
32
- }) satisfies ZodFor<L1RollupConstants>;
25
+ export const L1RollupConstantsSchema = zodFor<L1RollupConstants>()(
26
+ z.object({
27
+ l1StartBlock: schemas.BigInt,
28
+ l1GenesisTime: schemas.BigInt,
29
+ slotDuration: z.number(),
30
+ epochDuration: z.number(),
31
+ ethereumSlotDuration: z.number(),
32
+ proofSubmissionEpochs: z.number(),
33
+ }),
34
+ );
33
35
 
34
36
  /** Returns the timestamp for a given L2 slot. */
35
37
  export function getTimestampForSlot(
package/src/hash/hash.ts CHANGED
@@ -69,17 +69,6 @@ export function computeProtocolNullifier(txRequestHash: Fr): Promise<Fr> {
69
69
  return siloNullifier(AztecAddress.fromBigInt(NULL_MSG_SENDER_CONTRACT_ADDRESS), txRequestHash);
70
70
  }
71
71
 
72
- /**
73
- * Computes a siloed private log tag, given the contract address and the unsiloed tag.
74
- * A siloed private log tag effectively namespaces a log to a specific contract.
75
- * @param contract - The contract address.
76
- * @param unsiloedTag - The unsiloed tag.
77
- * @returns A siloed private log tag.
78
- */
79
- export function siloPrivateLog(contract: AztecAddress, unsiloedTag: Fr): Promise<Fr> {
80
- return poseidon2Hash([contract, unsiloedTag]);
81
- }
82
-
83
72
  /**
84
73
  * Computes a public data tree value ready for insertion.
85
74
  * @param value - Raw public data tree value to hash into a tree-insertion-ready value.
@@ -4,7 +4,7 @@ import { z } from 'zod';
4
4
 
5
5
  import type { FunctionSelector } from '../abi/function_selector.js';
6
6
  import type { AztecAddress } from '../aztec-address/index.js';
7
- import { type ZodFor, schemas } from '../schemas/index.js';
7
+ import { schemas, zodFor } from '../schemas/index.js';
8
8
 
9
9
  type AllowedInstance = { address: AztecAddress };
10
10
  type AllowedInstanceFunction = { address: AztecAddress; selector: FunctionSelector };
@@ -13,9 +13,11 @@ type AllowedClassFunction = { classId: Fr; selector: FunctionSelector };
13
13
 
14
14
  export type AllowedElement = AllowedInstance | AllowedInstanceFunction | AllowedClass | AllowedClassFunction;
15
15
 
16
- export const AllowedElementSchema = z.union([
17
- z.object({ address: schemas.AztecAddress, selector: schemas.FunctionSelector }),
18
- z.object({ address: schemas.AztecAddress }),
19
- z.object({ classId: schemas.Fr, selector: schemas.FunctionSelector }),
20
- z.object({ classId: schemas.Fr }),
21
- ]) satisfies ZodFor<AllowedElement>;
16
+ export const AllowedElementSchema = zodFor<AllowedElement>()(
17
+ z.union([
18
+ z.object({ address: schemas.AztecAddress, selector: schemas.FunctionSelector }),
19
+ z.object({ address: schemas.AztecAddress }),
20
+ z.object({ classId: schemas.Fr, selector: schemas.FunctionSelector }),
21
+ z.object({ classId: schemas.Fr }),
22
+ ]),
23
+ );
@@ -4,9 +4,10 @@ import type { ApiSchemaFor } from '@aztec/foundation/schemas';
4
4
 
5
5
  import { z } from 'zod';
6
6
 
7
+ import { CheckpointedL2Block, PublishedL2Block } from '../block/checkpointed_l2_block.js';
7
8
  import { L2Block } from '../block/l2_block.js';
9
+ import { L2BlockNew } from '../block/l2_block_new.js';
8
10
  import { type L2BlockSource, L2TipsSchema } from '../block/l2_block_source.js';
9
- import { PublishedL2Block } from '../block/published_l2_block.js';
10
11
  import { ValidateBlockResultSchema } from '../block/validate_block_result.js';
11
12
  import { Checkpoint } from '../checkpoint/checkpoint.js';
12
13
  import { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
@@ -17,6 +18,8 @@ import {
17
18
  } from '../contract/index.js';
18
19
  import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
19
20
  import { LogFilterSchema } from '../logs/log_filter.js';
21
+ import { SiloedTag } from '../logs/siloed_tag.js';
22
+ import { Tag } from '../logs/tag.js';
20
23
  import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
21
24
  import type { L1ToL2MessageSource } from '../messaging/l1_to_l2_message_source.js';
22
25
  import { optional, schemas } from '../schemas/schemas.js';
@@ -85,6 +88,7 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
85
88
  .function()
86
89
  .args(z.union([BlockNumberSchema, z.literal('latest')]))
87
90
  .returns(BlockHeader.schema.optional()),
91
+ getCheckpointedBlock: z.function().args(BlockNumberSchema).returns(CheckpointedL2Block.schema.optional()),
88
92
  getBlocks: z
89
93
  .function()
90
94
  .args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
@@ -93,7 +97,6 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
93
97
  .function()
94
98
  .args(CheckpointNumberSchema, schemas.Integer)
95
99
  .returns(z.array(PublishedCheckpoint.schema)),
96
- getCheckpointByArchive: z.function().args(schemas.Fr).returns(Checkpoint.schema.optional()),
97
100
  getPublishedBlocks: z
98
101
  .function()
99
102
  .args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
@@ -102,6 +105,7 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
102
105
  getPublishedBlockByArchive: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
103
106
  getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
104
107
  getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
108
+ getL2BlockNew: z.function().args(BlockNumberSchema).returns(L2BlockNew.schema.optional()),
105
109
  getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
106
110
  getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
107
111
  getL2SlotNumber: z.function().args().returns(schemas.SlotNumber.optional()),
@@ -111,9 +115,13 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
111
115
  getBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
112
116
  isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
113
117
  getL2Tips: z.function().args().returns(L2TipsSchema),
114
- getLogsByTags: z
118
+ getPrivateLogsByTags: z
115
119
  .function()
116
- .args(z.array(schemas.Fr))
120
+ .args(z.array(SiloedTag.schema))
121
+ .returns(z.array(z.array(TxScopedL2Log.schema))),
122
+ getPublicLogsByTagsFromContract: z
123
+ .function()
124
+ .args(schemas.AztecAddress, z.array(Tag.schema))
117
125
  .returns(z.array(z.array(TxScopedL2Log.schema))),
118
126
  getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
119
127
  getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
@@ -57,7 +57,7 @@ export type AztecNodeAdminConfig = ValidatorClientFullConfig &
57
57
  ProverConfig &
58
58
  SlasherConfig &
59
59
  Pick<ArchiverSpecificConfig, 'archiverPollingIntervalMS' | 'skipValidateBlockAttestations' | 'archiverBatchSize'> & {
60
- maxTxPoolSize: number;
60
+ maxPendingTxCount: number;
61
61
  };
62
62
 
63
63
  export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
@@ -70,7 +70,7 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
70
70
  archiverBatchSize: true,
71
71
  }),
72
72
  )
73
- .merge(z.object({ maxTxPoolSize: z.number() }));
73
+ .merge(z.object({ maxPendingTxCount: z.number() }));
74
74
 
75
75
  export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
76
76
  getConfig: z.function().returns(AztecNodeAdminConfigSchema),
@@ -21,10 +21,10 @@ import { z } from 'zod';
21
21
 
22
22
  import type { AztecAddress } from '../aztec-address/index.js';
23
23
  import { type BlockParameter, BlockParameterSchema } from '../block/block_parameter.js';
24
+ import { PublishedL2Block } from '../block/checkpointed_l2_block.js';
24
25
  import { type DataInBlock, dataInBlockSchemaFor } from '../block/in_block.js';
25
26
  import { L2Block } from '../block/l2_block.js';
26
27
  import { type L2BlockSource, type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
27
- import { PublishedL2Block } from '../block/published_l2_block.js';
28
28
  import {
29
29
  type ContractClassPublic,
30
30
  ContractClassPublicSchema,
@@ -36,8 +36,8 @@ import {
36
36
  ProtocolContractAddressesSchema,
37
37
  } from '../contract/index.js';
38
38
  import { GasFees } from '../gas/gas_fees.js';
39
+ import { SiloedTag, Tag, TxScopedL2Log } from '../logs/index.js';
39
40
  import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
40
- import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
41
41
  import { type ApiSchemaFor, optional, schemas } from '../schemas/schemas.js';
42
42
  import { MerkleTreeId } from '../trees/merkle_tree_id.js';
43
43
  import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
@@ -338,14 +338,16 @@ export interface AztecNode
338
338
  getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
339
339
 
340
340
  /**
341
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
342
- * @param tags - The tags to filter the logs by.
343
- * @param logsPerTag - How many logs to return per tag. Default 10 logs are returned for each tag
344
- * @returns For each received tag, an array of matching logs and metadata (e.g. tx hash) is returned. An empty
345
- * array implies no logs match that tag. There can be multiple logs for 1 tag because tag reuse can happen
346
- * --> e.g. when sending a note from multiple unsynched devices.
341
+ * Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
342
+ * array implies no logs match that tag.
347
343
  */
348
- getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
344
+ getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
345
+
346
+ /**
347
+ * Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
348
+ * logs is returned. An empty array implies no logs match that tag.
349
+ */
350
+ getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
349
351
 
350
352
  /**
351
353
  * Method to submit a transaction to the p2p pool.
@@ -481,7 +483,6 @@ export interface AztecNode
481
483
  getAllowedPublicSetup(): Promise<AllowedElement[]>;
482
484
  }
483
485
 
484
- export const MAX_LOGS_PER_TAG = 10;
485
486
  const MAX_SIGNATURES_PER_REGISTER_CALL = 100;
486
487
  const MAX_SIGNATURE_LEN = 10000;
487
488
 
@@ -601,12 +602,14 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
601
602
 
602
603
  getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
603
604
 
604
- getLogsByTags: z
605
+ getPrivateLogsByTags: z
605
606
  .function()
606
- .args(
607
- z.array(schemas.Fr).max(MAX_RPC_LEN),
608
- optional(z.number().gte(1).lte(MAX_LOGS_PER_TAG).default(MAX_LOGS_PER_TAG)),
609
- )
607
+ .args(z.array(SiloedTag.schema).max(MAX_RPC_LEN))
608
+ .returns(z.array(z.array(TxScopedL2Log.schema))),
609
+
610
+ getPublicLogsByTagsFromContract: z
611
+ .function()
612
+ .args(schemas.AztecAddress, z.array(Tag.schema).max(MAX_RPC_LEN))
610
613
  .returns(z.array(z.array(TxScopedL2Log.schema))),
611
614
 
612
615
  sendTx: z.function().args(Tx.schema).returns(z.void()),
@@ -60,7 +60,17 @@ export interface BuildBlockResult {
60
60
 
61
61
  export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'> &
62
62
  Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
63
- Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs'>;
63
+ Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs' | 'fakeThrowAfterProcessingTxCount'>;
64
+
65
+ export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[] = [
66
+ 'l1GenesisTime',
67
+ 'slotDuration',
68
+ 'l1ChainId',
69
+ 'rollupVersion',
70
+ 'txPublicSetupAllowList',
71
+ 'fakeProcessingDelayPerTxMs',
72
+ 'fakeThrowAfterProcessingTxCount',
73
+ ] as const;
64
74
 
65
75
  export interface IFullNodeBlockBuilder {
66
76
  getConfig(): FullNodeBlockBuilderConfig;
@@ -1,21 +1,22 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import type { Prettify } from '@aztec/foundation/types';
2
3
 
3
4
  import { z } from 'zod';
4
5
 
5
6
  import type { AztecAddress } from '../aztec-address/index.js';
6
- import { type ZodFor, schemas } from '../schemas/index.js';
7
+ import { schemas, zodFor } from '../schemas/index.js';
7
8
  import { type AllowedElement, AllowedElementSchema } from './allowed_element.js';
8
9
 
9
- /**
10
- * The sequencer configuration.
11
- */
10
+ /** Sequencer configuration */
12
11
  export interface SequencerConfig {
13
12
  /** The number of ms to wait between polling for pending txs. */
14
- transactionPollingIntervalMS?: number;
13
+ sequencerPollingIntervalMS?: number;
15
14
  /** The maximum number of txs to include in a block. */
16
15
  maxTxsPerBlock?: number;
17
16
  /** The minimum number of txs to include in a block. */
18
17
  minTxsPerBlock?: number;
18
+ /** The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock. */
19
+ minValidTxsPerBlock?: number;
19
20
  /** Whether to publish txs with the block proposals */
20
21
  publishTxsWithProposals?: boolean;
21
22
  /** The maximum L2 block gas. */
@@ -38,10 +39,12 @@ export interface SequencerConfig {
38
39
  governanceProposerPayload?: EthAddress;
39
40
  /** Whether to enforce the time table when building blocks */
40
41
  enforceTimeTable?: boolean;
41
- /** How many seconds into an L1 slot we can still send a tx and get it mined. */
42
- maxL1TxInclusionTimeIntoSlot?: number;
42
+ /** How much time (in seconds) we allow in the slot for publishing the L1 tx. */
43
+ l1PublishingTime?: number;
43
44
  /** Used for testing to introduce a fake delay after processing each tx */
44
45
  fakeProcessingDelayPerTxMs?: number;
46
+ /** Used for testing to throw an error after processing N txs */
47
+ fakeThrowAfterProcessingTxCount?: number;
45
48
  /** How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way) */
46
49
  attestationPropagationTime?: number;
47
50
  /** How many seconds before invalidating a block as a committee member (zero to never invalidate) */
@@ -60,31 +63,59 @@ export interface SequencerConfig {
60
63
  fishermanMode?: boolean;
61
64
  /** Shuffle attestation ordering to create invalid ordering (for testing only) */
62
65
  shuffleAttestationOrdering?: boolean;
66
+ /** Duration per block in milliseconds when building multiple blocks per slot (default: undefined = single block per slot) */
67
+ blockDurationMs?: number;
68
+ /** Have sequencer build and publish an empty checkpoint if there are no txs */
69
+ buildCheckpointIfEmpty?: boolean;
63
70
  }
64
71
 
65
- export const SequencerConfigSchema = z.object({
66
- transactionPollingIntervalMS: z.number().optional(),
67
- maxTxsPerBlock: z.number().optional(),
68
- minTxsPerBlock: z.number().optional(),
69
- maxL2BlockGas: z.number().optional(),
70
- publishTxsWithProposals: z.boolean().optional(),
71
- maxDABlockGas: z.number().optional(),
72
- coinbase: schemas.EthAddress.optional(),
73
- feeRecipient: schemas.AztecAddress.optional(),
74
- acvmWorkingDirectory: z.string().optional(),
75
- acvmBinaryPath: z.string().optional(),
76
- txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
77
- maxBlockSizeInBytes: z.number().optional(),
78
- governanceProposerPayload: schemas.EthAddress.optional(),
79
- maxL1TxInclusionTimeIntoSlot: z.number().optional(),
80
- enforceTimeTable: z.boolean().optional(),
81
- fakeProcessingDelayPerTxMs: z.number().optional(),
82
- attestationPropagationTime: z.number().optional(),
83
- skipCollectingAttestations: z.boolean().optional(),
84
- secondsBeforeInvalidatingBlockAsCommitteeMember: z.number(),
85
- secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.number(),
86
- broadcastInvalidBlockProposal: z.boolean().optional(),
87
- injectFakeAttestation: z.boolean().optional(),
88
- fishermanMode: z.boolean().optional(),
89
- shuffleAttestationOrdering: z.boolean().optional(),
90
- }) satisfies ZodFor<SequencerConfig>;
72
+ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
73
+ z.object({
74
+ sequencerPollingIntervalMS: z.number().optional(),
75
+ maxTxsPerBlock: z.number().optional(),
76
+ minValidTxsPerBlock: z.number().optional(),
77
+ minTxsPerBlock: z.number().optional(),
78
+ maxL2BlockGas: z.number().optional(),
79
+ publishTxsWithProposals: z.boolean().optional(),
80
+ maxDABlockGas: z.number().optional(),
81
+ coinbase: schemas.EthAddress.optional(),
82
+ feeRecipient: schemas.AztecAddress.optional(),
83
+ acvmWorkingDirectory: z.string().optional(),
84
+ acvmBinaryPath: z.string().optional(),
85
+ txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
86
+ maxBlockSizeInBytes: z.number().optional(),
87
+ governanceProposerPayload: schemas.EthAddress.optional(),
88
+ l1PublishingTime: z.number().optional(),
89
+ enforceTimeTable: z.boolean().optional(),
90
+ fakeProcessingDelayPerTxMs: z.number().optional(),
91
+ fakeThrowAfterProcessingTxCount: z.number().optional(),
92
+ attestationPropagationTime: z.number().optional(),
93
+ skipCollectingAttestations: z.boolean().optional(),
94
+ skipInvalidateBlockAsProposer: z.boolean().optional(),
95
+ secondsBeforeInvalidatingBlockAsCommitteeMember: z.number(),
96
+ secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.number(),
97
+ broadcastInvalidBlockProposal: z.boolean().optional(),
98
+ injectFakeAttestation: z.boolean().optional(),
99
+ fishermanMode: z.boolean().optional(),
100
+ shuffleAttestationOrdering: z.boolean().optional(),
101
+ blockDurationMs: z.number().positive().optional(),
102
+ buildCheckpointIfEmpty: z.boolean().optional(),
103
+ }),
104
+ );
105
+
106
+ type SequencerConfigOptionalKeys =
107
+ | 'governanceProposerPayload'
108
+ | 'blockDurationMs'
109
+ | 'coinbase'
110
+ | 'feeRecipient'
111
+ | 'acvmWorkingDirectory'
112
+ | 'acvmBinaryPath'
113
+ | 'fakeProcessingDelayPerTxMs'
114
+ | 'fakeThrowAfterProcessingTxCount'
115
+ | 'l1PublishingTime'
116
+ | 'txPublicSetupAllowList'
117
+ | 'minValidTxsPerBlock';
118
+
119
+ export type ResolvedSequencerConfig = Prettify<
120
+ Required<Omit<SequencerConfig, SequencerConfigOptionalKeys>> & Pick<SequencerConfig, SequencerConfigOptionalKeys>
121
+ >;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
 
3
3
  import { ExtendedContractClassLog } from '../logs/extended_contract_class_log.js';
4
4
  import { ExtendedPublicLog } from '../logs/extended_public_log.js';
5
- import type { ZodFor } from '../schemas/index.js';
5
+ import { zodFor } from '../schemas/index.js';
6
6
 
7
7
  /** Response for the getContractClassLogs archiver call. */
8
8
  export type GetContractClassLogsResponse = {
@@ -12,10 +12,12 @@ export type GetContractClassLogsResponse = {
12
12
  maxLogsHit: boolean;
13
13
  };
14
14
 
15
- export const GetContractClassLogsResponseSchema: ZodFor<GetContractClassLogsResponse> = z.object({
16
- logs: z.array(ExtendedContractClassLog.schema),
17
- maxLogsHit: z.boolean(),
18
- });
15
+ export const GetContractClassLogsResponseSchema = zodFor<GetContractClassLogsResponse>()(
16
+ z.object({
17
+ logs: z.array(ExtendedContractClassLog.schema),
18
+ maxLogsHit: z.boolean(),
19
+ }),
20
+ );
19
21
 
20
22
  /** Response for the getPublicLogs archiver call. */
21
23
  export type GetPublicLogsResponse = {
@@ -25,7 +27,9 @@ export type GetPublicLogsResponse = {
25
27
  maxLogsHit: boolean;
26
28
  };
27
29
 
28
- export const GetPublicLogsResponseSchema = z.object({
29
- logs: z.array(ExtendedPublicLog.schema),
30
- maxLogsHit: z.boolean(),
31
- }) satisfies ZodFor<GetPublicLogsResponse>;
30
+ export const GetPublicLogsResponseSchema = zodFor<GetPublicLogsResponse>()(
31
+ z.object({
32
+ logs: z.array(ExtendedPublicLog.schema),
33
+ maxLogsHit: z.boolean(),
34
+ }),
35
+ );
@@ -1,7 +1,9 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
- import type { Fr } from '@aztec/foundation/curves/bn254';
3
2
 
3
+ import type { AztecAddress } from '../aztec-address/index.js';
4
4
  import type { LogFilter } from '../logs/log_filter.js';
5
+ import type { SiloedTag } from '../logs/siloed_tag.js';
6
+ import type { Tag } from '../logs/tag.js';
5
7
  import type { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
6
8
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_logs_response.js';
7
9
 
@@ -10,13 +12,16 @@ import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_
10
12
  */
11
13
  export interface L2LogsSource {
12
14
  /**
13
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
14
- * @param tags - The tags to filter the logs by.
15
- * @param logsPerTag - The maximum number of logs to return for each tag. Default returns everything
16
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
17
- * that tag.
15
+ * Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
16
+ * array implies no logs match that tag.
18
17
  */
19
- getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
18
+ getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
19
+
20
+ /**
21
+ * Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
22
+ * logs is returned. An empty array implies no logs match that tag.
23
+ */
24
+ getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
20
25
 
21
26
  /**
22
27
  * Gets public logs based on the provided filter.
@@ -251,7 +251,10 @@ export interface MerkleTreeCheckpointOperations {
251
251
  revertAllCheckpoints(): Promise<void>;
252
252
  }
253
253
 
254
- export interface MerkleTreeWriteOperations extends MerkleTreeReadOperations, MerkleTreeCheckpointOperations {
254
+ export interface MerkleTreeWriteOperations
255
+ extends MerkleTreeReadOperations,
256
+ MerkleTreeCheckpointOperations,
257
+ Disposable {
255
258
  /**
256
259
  * Appends leaves to a given tree.
257
260
  * @param treeId - The tree to be updated.
@@ -3,7 +3,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
3
3
 
4
4
  import { z } from 'zod';
5
5
 
6
- import { type ZodFor, schemas } from '../schemas/index.js';
6
+ import { schemas, zodFor } from '../schemas/index.js';
7
7
  import type { TxHash } from '../tx/tx_hash.js';
8
8
  import type { EpochProver } from './epoch-prover.js';
9
9
  import type { ProvingJobConsumer } from './prover-broker.js';
@@ -33,15 +33,18 @@ export type ProverConfig = ActualProverConfig & {
33
33
  failedProofStore?: string;
34
34
  };
35
35
 
36
- export const ProverConfigSchema = z.object({
37
- nodeUrl: z.string().optional(),
38
- realProofs: z.boolean(),
39
- proverId: schemas.EthAddress.optional(),
40
- proverTestDelayType: z.enum(['fixed', 'realistic']),
41
- proverTestDelayMs: z.number(),
42
- proverTestDelayFactor: z.number(),
43
- proverAgentCount: z.number(),
44
- }) satisfies ZodFor<ProverConfig>;
36
+ export const ProverConfigSchema = zodFor<ProverConfig>()(
37
+ z.object({
38
+ nodeUrl: z.string().optional(),
39
+ realProofs: z.boolean(),
40
+ proverId: schemas.EthAddress.optional(),
41
+ proverTestDelayType: z.enum(['fixed', 'realistic']),
42
+ proverTestDelayMs: z.number(),
43
+ proverTestDelayFactor: z.number(),
44
+ proverAgentCount: z.number(),
45
+ failedProofStore: z.string().optional(),
46
+ }),
47
+ );
45
48
 
46
49
  export const proverConfigMappings: ConfigMappingsType<ProverConfig> = {
47
50
  nodeUrl: {
@@ -186,7 +186,6 @@ export interface ServerCircuitProver {
186
186
  */
187
187
  getAvmProof(
188
188
  inputs: AvmCircuitInputs,
189
- skipPublicInputsValidation?: boolean, // TODO(#14234)[Unconditional PIs validation]: Remove.
190
189
  signal?: AbortSignal,
191
190
  epochNumber?: number,
192
191
  ): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
@@ -1,5 +1,5 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
- import { type ZodFor, schemas } from '@aztec/foundation/schemas';
2
+ import { schemas, zodFor } from '@aztec/foundation/schemas';
3
3
 
4
4
  import { z } from 'zod';
5
5
 
@@ -27,24 +27,26 @@ export interface SlasherConfig {
27
27
  slashExecuteRoundsLookBack: number; // How many rounds to look back when searching for a round to execute
28
28
  }
29
29
 
30
- export const SlasherConfigSchema = z.object({
31
- slashOverridePayload: schemas.EthAddress.optional(),
32
- slashMinPenaltyPercentage: z.number(),
33
- slashMaxPenaltyPercentage: z.number(),
34
- slashValidatorsAlways: z.array(schemas.EthAddress),
35
- slashValidatorsNever: z.array(schemas.EthAddress),
36
- slashPrunePenalty: schemas.BigInt,
37
- slashDataWithholdingPenalty: schemas.BigInt,
38
- slashInactivityTargetPercentage: z.number(),
39
- slashInactivityConsecutiveEpochThreshold: z.number(),
40
- slashInactivityPenalty: schemas.BigInt,
41
- slashProposeInvalidAttestationsPenalty: schemas.BigInt,
42
- slashAttestDescendantOfInvalidPenalty: schemas.BigInt,
43
- slashUnknownPenalty: schemas.BigInt,
44
- slashOffenseExpirationRounds: z.number(),
45
- slashMaxPayloadSize: z.number(),
46
- slashGracePeriodL2Slots: z.number(),
47
- slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
48
- slashExecuteRoundsLookBack: z.number(),
49
- slashSelfAllowed: z.boolean().optional(),
50
- }) satisfies ZodFor<SlasherConfig>;
30
+ export const SlasherConfigSchema = zodFor<SlasherConfig>()(
31
+ z.object({
32
+ slashOverridePayload: schemas.EthAddress.optional(),
33
+ slashMinPenaltyPercentage: z.number(),
34
+ slashMaxPenaltyPercentage: z.number(),
35
+ slashValidatorsAlways: z.array(schemas.EthAddress),
36
+ slashValidatorsNever: z.array(schemas.EthAddress),
37
+ slashPrunePenalty: schemas.BigInt,
38
+ slashDataWithholdingPenalty: schemas.BigInt,
39
+ slashInactivityTargetPercentage: z.number(),
40
+ slashInactivityConsecutiveEpochThreshold: z.number(),
41
+ slashInactivityPenalty: schemas.BigInt,
42
+ slashProposeInvalidAttestationsPenalty: schemas.BigInt,
43
+ slashAttestDescendantOfInvalidPenalty: schemas.BigInt,
44
+ slashUnknownPenalty: schemas.BigInt,
45
+ slashOffenseExpirationRounds: z.number(),
46
+ slashMaxPayloadSize: z.number(),
47
+ slashGracePeriodL2Slots: z.number(),
48
+ slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
49
+ slashExecuteRoundsLookBack: z.number(),
50
+ slashSelfAllowed: z.boolean().optional(),
51
+ }),
52
+ );