@aztec/constants 4.0.0-nightly.20250907 → 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.
package/dest/constants.js CHANGED
@@ -1,4 +1,18 @@
1
+ import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ // Re-export L2 block number constants with proper BlockNumber type
4
+ // Note: The generated constants are plain numbers, but we provide typed versions here
5
+ import { GENESIS_BLOCK_HEADER_HASH as GENESIS_BLOCK_HEADER_HASH_BIGINT, INITIAL_CHECKPOINT_NUMBER as INITIAL_CHECKPOINT_NUM_RAW, INITIAL_L2_BLOCK_NUM as INITIAL_L2_BLOCK_NUM_RAW } from './constants.gen.js';
1
6
  // Typescript-land-only constants
2
7
  export const SPONSORED_FPC_SALT = BigInt(0);
3
8
  // Autogenerated constants loaded from noir-land
9
+ // eslint-disable-next-line import/export
4
10
  export * from './constants.gen.js';
11
+ /** The initial L2 block number (typed as BlockNumber). This is the first block number in the Aztec L2 chain. */ // Shadow the export from constants.gen above
12
+ // eslint-disable-next-line import/export
13
+ export const INITIAL_L2_BLOCK_NUM = BlockNumber(INITIAL_L2_BLOCK_NUM_RAW);
14
+ /** The initial L2 checkpoint number (typed as CheckpointNumber). This is the first checkpoint number in the Aztec L2 chain. */ // Shadow the export from constants.gen above
15
+ export const INITIAL_L2_CHECKPOINT_NUM = CheckpointNumber(INITIAL_CHECKPOINT_NUM_RAW);
16
+ /** The block header hash for the genesis block 0. */ // Shadow the export from constants.gen above
17
+ // eslint-disable-next-line import/export
18
+ export const GENESIS_BLOCK_HEADER_HASH = new Fr(GENESIS_BLOCK_HEADER_HASH_BIGINT);
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=constants.in.d.ts.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmluLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2NyaXB0cy9jb25zdGFudHMuaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -30,8 +30,10 @@ const CPP_CONSTANTS = [
30
30
  'UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN',
31
31
  'PUBLIC_DATA_TREE_HEIGHT',
32
32
  'NULLIFIER_TREE_HEIGHT',
33
+ 'NULLIFIER_SUBTREE_HEIGHT',
33
34
  'NOTE_HASH_TREE_HEIGHT',
34
35
  'L1_TO_L2_MSG_TREE_HEIGHT',
36
+ 'ARCHIVE_HEIGHT',
35
37
  'TIMESTAMP_OF_CHANGE_BIT_SIZE',
36
38
  'UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE',
37
39
  'MAX_ENQUEUED_CALLS_PER_TX',
@@ -43,7 +45,6 @@ const CPP_CONSTANTS = [
43
45
  'MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS',
44
46
  'MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX',
45
47
  'MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX',
46
- 'PUBLIC_LOG_SIZE_IN_FIELDS',
47
48
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX',
48
49
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX',
49
50
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX',
@@ -53,6 +54,7 @@ const CPP_CONSTANTS = [
53
54
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX',
54
55
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX',
55
56
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX',
57
+ 'AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX',
56
58
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX',
57
59
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX',
58
60
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX',
@@ -100,12 +102,18 @@ const CPP_CONSTANTS = [
100
102
  'AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT',
101
103
  'AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE',
102
104
  'NOTE_HASH_TREE_LEAF_COUNT',
103
- 'L1_TO_L2_MSG_TREE_LEAF_COUNT'
105
+ 'L1_TO_L2_MSG_TREE_LEAF_COUNT',
106
+ 'FLAT_PUBLIC_LOGS_HEADER_LENGTH',
107
+ 'FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH',
108
+ 'PUBLIC_LOGS_LENGTH',
109
+ 'PUBLIC_LOG_HEADER_LENGTH',
110
+ 'MAX_PROTOCOL_CONTRACTS',
111
+ 'DEFAULT_MAX_DEBUG_LOG_MEMORY_READS'
104
112
  ];
105
113
  const CPP_GENERATORS = [
106
114
  'PARTIAL_ADDRESS',
107
115
  'CONTRACT_ADDRESS_V1',
108
- 'CONTRACT_LEAF',
116
+ 'CONTRACT_CLASS_ID',
109
117
  'PUBLIC_KEYS_HASH',
110
118
  'NOTE_HASH_NONCE',
111
119
  'UNIQUE_NOTE_HASH',
@@ -128,8 +136,12 @@ const PIL_CONSTANTS = [
128
136
  'AVM_BITWISE_XOR_OP_ID',
129
137
  'AVM_KECCAKF1600_NUM_ROUNDS',
130
138
  'AVM_KECCAKF1600_STATE_SIZE',
139
+ 'AVM_TX_PHASE_VALUE_START',
140
+ 'AVM_TX_PHASE_VALUE_SETUP',
141
+ 'AVM_TX_PHASE_VALUE_LAST',
131
142
  'AVM_HIGHEST_MEM_ADDRESS',
132
143
  'AVM_MEMORY_NUM_BITS',
144
+ 'AVM_MEMORY_SIZE',
133
145
  'MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS',
134
146
  'MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX',
135
147
  'MAX_NOTE_HASHES_PER_TX',
@@ -142,8 +154,12 @@ const PIL_CONSTANTS = [
142
154
  'L1_TO_L2_MSG_TREE_HEIGHT',
143
155
  'UPDATED_CLASS_IDS_SLOT',
144
156
  'UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN',
157
+ 'CANONICAL_AUTH_REGISTRY_ADDRESS',
145
158
  'CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS',
159
+ 'CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS',
160
+ 'MULTI_CALL_ENTRYPOINT_ADDRESS',
146
161
  'FEE_JUICE_ADDRESS',
162
+ 'ROUTER_ADDRESS',
147
163
  'FEE_JUICE_BALANCES_SLOT',
148
164
  'TIMESTAMP_OF_CHANGE_BIT_SIZE',
149
165
  'UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE',
@@ -156,7 +172,6 @@ const PIL_CONSTANTS = [
156
172
  'MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS',
157
173
  'MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX',
158
174
  'MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX',
159
- 'PUBLIC_LOG_SIZE_IN_FIELDS',
160
175
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX',
161
176
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX',
162
177
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX',
@@ -166,6 +181,7 @@ const PIL_CONSTANTS = [
166
181
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX',
167
182
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX',
168
183
  'AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX',
184
+ 'AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX',
169
185
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX',
170
186
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX',
171
187
  'AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX',
@@ -216,7 +232,7 @@ const PIL_CONSTANTS = [
216
232
  'AVM_SUBTRACE_ID_CAST',
217
233
  'AVM_SUBTRACE_ID_SET',
218
234
  'AVM_SUBTRACE_ID_BITWISE',
219
- 'AVM_SUBTRACE_ID_POSEIDON_PERM',
235
+ 'AVM_SUBTRACE_ID_POSEIDON2_PERM',
220
236
  'AVM_SUBTRACE_ID_TO_RADIX',
221
237
  'AVM_SUBTRACE_ID_ECC',
222
238
  'AVM_SUBTRACE_ID_KECCAKF1600',
@@ -271,12 +287,17 @@ const PIL_CONSTANTS = [
271
287
  'AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT',
272
288
  'AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE',
273
289
  'NOTE_HASH_TREE_LEAF_COUNT',
274
- 'L1_TO_L2_MSG_TREE_LEAF_COUNT'
290
+ 'L1_TO_L2_MSG_TREE_LEAF_COUNT',
291
+ 'FLAT_PUBLIC_LOGS_HEADER_LENGTH',
292
+ 'FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH',
293
+ 'PUBLIC_LOGS_LENGTH',
294
+ 'PUBLIC_LOG_HEADER_LENGTH',
295
+ 'MAX_PROTOCOL_CONTRACTS'
275
296
  ];
276
297
  const PIL_GENERATORS = [
277
298
  'PARTIAL_ADDRESS',
278
299
  'CONTRACT_ADDRESS_V1',
279
- 'CONTRACT_LEAF',
300
+ 'CONTRACT_CLASS_ID',
280
301
  'PUBLIC_KEYS_HASH',
281
302
  'NOTE_HASH_NONCE',
282
303
  'UNIQUE_NOTE_HASH',
@@ -292,11 +313,9 @@ const SOLIDITY_CONSTANTS = [
292
313
  'L1_TO_L2_MSG_SUBTREE_HEIGHT',
293
314
  'NUM_MSGS_PER_BASE_PARITY',
294
315
  'NUM_BASE_PARITY_PER_ROOT_PARITY',
295
- 'PROPOSED_BLOCK_HEADER_LENGTH_BYTES',
296
316
  'BLS12_POINT_COMPRESSED_BYTES',
297
317
  'ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH',
298
- 'BLOBS_PER_BLOCK',
299
- 'INITIAL_L2_BLOCK_NUM',
318
+ 'INITIAL_CHECKPOINT_NUMBER',
300
319
  'GENESIS_ARCHIVE_ROOT',
301
320
  'FEE_JUICE_ADDRESS',
302
321
  'AZTEC_MAX_EPOCH_DURATION'
@@ -322,7 +341,7 @@ const SOLIDITY_CONSTANTS = [
322
341
  */ function processConstantsCpp(constants, generatorIndices) {
323
342
  const code = [];
324
343
  Object.entries(constants).forEach(([key, value])=>{
325
- if (CPP_CONSTANTS.includes(key) || key.startsWith('AVM_') && key !== 'AVM_VK_INDEX') {
344
+ if (CPP_CONSTANTS.includes(key) || key.startsWith('AVM_')) {
326
345
  if (BigInt(value) <= 2n ** 31n - 1n) {
327
346
  code.push(`#define ${key} ${value}`);
328
347
  } else if (BigInt(value) <= 2n ** 64n - 1n) {
@@ -334,7 +353,7 @@ const SOLIDITY_CONSTANTS = [
334
353
  });
335
354
  Object.entries(generatorIndices).forEach(([key, value])=>{
336
355
  if (CPP_GENERATORS.includes(key)) {
337
- code.push(`#define GENERATOR_INDEX__${key} ${value}`);
356
+ code.push(`#define DOM_SEP__${key} ${value}`);
338
357
  }
339
358
  });
340
359
  return code.join('\n');
@@ -354,7 +373,7 @@ const SOLIDITY_CONSTANTS = [
354
373
  });
355
374
  Object.entries(generatorIndices).forEach(([key, value])=>{
356
375
  if (PIL_GENERATORS.includes(key)) {
357
- code.push(` pol GENERATOR_INDEX__${key} = ${value};`);
376
+ code.push(` pol DOM_SEP__${key} = ${value};`);
358
377
  }
359
378
  });
360
379
  return code.join('\n');
@@ -463,7 +482,7 @@ ${processConstantsSolidity(constants)}
463
482
  {
464
483
  const [, name, _type, value, end] = line.match(/global\s+(\w+)(\s*:\s*\w+)?\s*=\s*([^;]*)(;)?/) || [];
465
484
  if (name && value) {
466
- const [, indexName] = name.match(/GENERATOR_INDEX__(\w+)/) || [];
485
+ const [, indexName] = name.match(/DOM_SEP__(\w+)/) || [];
467
486
  if (indexName) {
468
487
  // Generator index.
469
488
  generatorIndexEnum[indexName] = +value;
@@ -535,8 +554,9 @@ ${processConstantsSolidity(constants)}
535
554
  // be a bigint, even the actual constant values!
536
555
  const prelude = expressions.map(([name, rhs])=>{
537
556
  const guardedRhs = rhs// Remove 'as u8', 'as u32' and 'as u64' castings
538
- .replaceAll(' as u8', '').replaceAll(' as u32', '').replaceAll(' as u64', '')// Remove the 'AztecAddress::from_field(...)' pattern
539
- .replace(/AztecAddress::from_field\((0x[a-fA-F0-9]+|[0-9]+)\)/g, '$1')// We make some space around the parentheses, so that constant numbers are still split.
557
+ .replaceAll(' as u8', '').replaceAll(' as u32', '').replaceAll(' as u64', '')// Remove the 'AztecAddress::from_field(...)' pattern.
558
+ // Also copes with the noir formatter re-formatting over multiple lines.
559
+ .replace(/AztecAddress::from_field\(\s*(0x[a-fA-F0-9]+|\d+)\s*,?\s*\)/gs, '$1')// We make some space around the parentheses, so that constant numbers are still split.
540
560
  .replace(/\(/g, '( ').replace(/\)/g, ' )')// We also make some space around common operators
541
561
  .replace(/\+/g, ' + ').replace(/(?<!\/)\*(?!\/)/, ' * ')// We split the expression into terms...
542
562
  .split(/\s+/)// ...and then we convert each term to a BigInt if it is a number.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/constants",
3
- "version": "4.0.0-nightly.20250907",
3
+ "version": "4.0.0-nightly.20260107",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json"
@@ -9,19 +9,21 @@
9
9
  ".": "./dest/constants.js"
10
10
  },
11
11
  "scripts": {
12
- "build": "yarn clean && tsc -b",
13
- "build:dev": "tsc -b --watch",
12
+ "build": "yarn clean && ../scripts/tsc.sh",
13
+ "build:dev": "../scripts/tsc.sh --watch",
14
14
  "clean": "rm -rf ./dest .tsbuildinfo",
15
15
  "remake-constants": "node --loader @swc-node/register/esm src/scripts/constants.in.ts && cd ../../l1-contracts && forge fmt",
16
16
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
17
17
  },
18
18
  "dependencies": {
19
+ "@aztec/foundation": "4.0.0-nightly.20260107",
19
20
  "tslib": "^2.4.0"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@jest/globals": "^30.0.0",
23
24
  "@types/jest": "^30.0.0",
24
25
  "@types/node": "^22.15.17",
26
+ "@typescript/native-preview": "7.0.0-dev.20251126.1",
25
27
  "eslint": "^9.26.0",
26
28
  "jest": "^30.0.0",
27
29
  "prettier": "^3.5.3",