@aztec/constants 0.0.1-commit.b9865e97 → 0.0.1-commit.be03c316

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/constants",
3
- "version": "0.0.1-commit.b9865e97",
3
+ "version": "0.0.1-commit.be03c316",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json"
@@ -19,14 +19,15 @@
19
19
  "build": "yarn clean && ../scripts/tsc.sh",
20
20
  "build:dev": "../scripts/tsc.sh --watch",
21
21
  "clean": "rm -rf ./dest .tsbuildinfo",
22
- "remake-constants": "node --loader @swc-node/register/esm src/scripts/constants.in.ts && cd ../../l1-contracts && forge fmt",
22
+ "generate": "./scripts/remake-constants.sh",
23
23
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
24
24
  },
25
25
  "dependencies": {
26
- "@aztec/foundation": "0.0.1-commit.b9865e97",
26
+ "@aztec/foundation": "0.0.1-commit.be03c316",
27
27
  "tslib": "^2.4.0"
28
28
  },
29
29
  "devDependencies": {
30
+ "@aztec/constants-codegen": "0.0.1-commit.be03c316",
30
31
  "@jest/globals": "^30.0.0",
31
32
  "@types/jest": "^30.0.0",
32
33
  "@types/node": "^22.15.17",
@@ -1,4 +1,4 @@
1
- // GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants
1
+ // GENERATED FILE - DO NOT EDIT
2
2
  export const MAX_FIELD_VALUE = 21888242871839275222246405745257275088548364400416034343698204186575808495616n;
3
3
  export const MAX_ETH_ADDRESS_BIT_SIZE = 160;
4
4
  export const MAX_ETH_ADDRESS_VALUE = 1461501637330902918203684832716283019655932542975n;
@@ -57,8 +57,6 @@ export const MAX_KEY_VALIDATION_REQUESTS_PER_CALL = 16;
57
57
  export const NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP = 1024;
58
58
  export const PRIVATE_KERNEL_INIT_VK_INDEX = 0;
59
59
  export const PRIVATE_KERNEL_INNER_VK_INDEX = 1;
60
- export const PRIVATE_KERNEL_TAIL_VK_INDEX = 2;
61
- export const PRIVATE_KERNEL_TAIL_TO_PUBLIC_VK_INDEX = 3;
62
60
  export const HIDING_KERNEL_TO_ROLLUP_VK_INDEX = 4;
63
61
  export const HIDING_KERNEL_TO_PUBLIC_VK_INDEX = 5;
64
62
  export const PUBLIC_CHONK_VERIFIER_VK_INDEX = 6;
@@ -79,11 +77,18 @@ export const ROOT_ROLLUP_VK_INDEX = 20;
79
77
  export const PARITY_BASE_VK_INDEX = 21;
80
78
  export const PARITY_ROOT_VK_INDEX = 22;
81
79
  export const PRIVATE_KERNEL_RESET_VK_INDEX = 23;
82
- export const PRIVATE_KERNEL_INIT_3_VK_INDEX = 65;
83
- export const PRIVATE_KERNEL_INIT_2_VK_INDEX = 66;
84
- export const PRIVATE_KERNEL_INNER_2_VK_INDEX = 67;
85
- export const PRIVATE_KERNEL_INNER_3_VK_INDEX = 68;
86
- export const MAX_APPS_PER_KERNEL = 3;
80
+ export const PRIVATE_KERNEL_RESET_TAIL_VK_INDEX = 31;
81
+ export const PRIVATE_KERNEL_RESET_TAIL_TO_PUBLIC_VK_INDEX = 37;
82
+ export const PRIVATE_KERNEL_RESET_BLOCK_END = 43;
83
+ export const PRIVATE_KERNEL_INIT_2_VK_INDEX = 65;
84
+ export const PRIVATE_KERNEL_INIT_3_VK_INDEX = 66;
85
+ export const PRIVATE_KERNEL_INIT_4_VK_INDEX = 67;
86
+ export const PRIVATE_KERNEL_INIT_5_VK_INDEX = 68;
87
+ export const PRIVATE_KERNEL_INNER_2_VK_INDEX = 69;
88
+ export const PRIVATE_KERNEL_INNER_3_VK_INDEX = 70;
89
+ export const PRIVATE_KERNEL_INNER_4_VK_INDEX = 71;
90
+ export const PRIVATE_KERNEL_INNER_5_VK_INDEX = 72;
91
+ export const MAX_APPS_PER_KERNEL = 5;
87
92
  export const GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET = 0;
88
93
  export const GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET = 16;
89
94
  export const GLOBAL_INDEX_NOTE_HASH_OFFSET = 32;
@@ -207,11 +212,11 @@ export const TX_REQUEST_LENGTH = 15;
207
212
  export const TOTAL_FEES_LENGTH = 1;
208
213
  export const TOTAL_MANA_USED_LENGTH = 1;
209
214
  export const BLOCK_HEADER_LENGTH = 22;
210
- export const CHECKPOINT_HEADER_LENGTH = 12;
211
- export const CHECKPOINT_HEADER_SIZE_IN_BYTES = 316;
215
+ export const CHECKPOINT_HEADER_LENGTH = 13;
216
+ export const CHECKPOINT_HEADER_SIZE_IN_BYTES = 348;
212
217
  export const SCOPED_READ_REQUEST_LEN = 3;
213
- export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 838;
214
- export const PRIVATE_CONTEXT_INPUTS_LENGTH = 37;
218
+ export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 839;
219
+ export const PRIVATE_CONTEXT_INPUTS_LENGTH = 38;
215
220
  export const FEE_RECIPIENT_LENGTH = 2;
216
221
  export const HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE = 28;
217
222
  export const PAIRING_POINTS_SIZE = 8;
@@ -247,14 +252,17 @@ export const IPA_PROOF_LENGTH = 64;
247
252
  export const ULTRA_KECCAK_PROOF_LENGTH = 331;
248
253
  export const RECURSIVE_ROLLUP_HONK_PROOF_LENGTH = 480;
249
254
  export const NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH = 480;
250
- export const CHONK_HIDING_OINK_LENGTH = 108;
251
- export const CHONK_MERGE_PROOF_SIZE = 42;
252
- export const CHONK_ECCVM_PROOF_LENGTH = 608;
253
- export const CHONK_JOINT_PROOF_LENGTH = 499;
254
- export const CHONK_PROOF_LENGTH = 1349;
255
+ export const CHONK_HIDING_OINK_LENGTH = 48;
256
+ export const CHONK_MERGE_PROOF_SIZE = 41;
257
+ export const CHONK_ECCVM_PROOF_LENGTH = 556;
258
+ export const CHONK_TRIPLE_IPA_PROOF_LENGTH = 70;
259
+ export const CHONK_JOINT_PROOF_LENGTH = 478;
260
+ export const CHONK_PROOF_LENGTH = 1221;
255
261
  export const ULTRA_VK_LENGTH_IN_FIELDS = 115;
256
- export const MEGA_VK_LENGTH_IN_FIELDS = 143;
257
- export const CHONK_VK_LENGTH_IN_FIELDS = 143;
262
+ export const MEGA_APP_VK_LENGTH_IN_FIELDS = 151;
263
+ export const MEGA_KERNEL_VK_LENGTH_IN_FIELDS = 151;
264
+ export const MEGA_ZK_VK_LENGTH_IN_FIELDS = 119;
265
+ export const CHONK_VK_LENGTH_IN_FIELDS = 119;
258
266
  export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 86;
259
267
  export const MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES = 96000;
260
268
  export const MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS = 21;
@@ -293,9 +301,8 @@ export const AVM_SUBTRACE_ID_TO_RADIX = 8192;
293
301
  export const AVM_DYN_GAS_ID_CALLDATACOPY = 1;
294
302
  export const AVM_DYN_GAS_ID_RETURNDATACOPY = 2;
295
303
  export const AVM_DYN_GAS_ID_TORADIX = 4;
296
- export const AVM_DYN_GAS_ID_BITWISE = 8;
297
- export const AVM_DYN_GAS_ID_EMITPUBLICLOG = 16;
298
- export const AVM_DYN_GAS_ID_SSTORE = 32;
304
+ export const AVM_DYN_GAS_ID_EMITPUBLICLOG = 8;
305
+ export const AVM_DYN_GAS_ID_SSTORE = 16;
299
306
  export const AVM_EXEC_OP_ID_GETENVVAR = 1;
300
307
  export const AVM_EXEC_OP_ID_MOV = 2;
301
308
  export const AVM_EXEC_OP_ID_JUMP = 4;
@@ -397,13 +404,17 @@ export const AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX = 4683;
397
404
  export const AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX = 4684;
398
405
  export const AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH = 4685;
399
406
  export const AVM_NUM_PUBLIC_INPUT_COLUMNS = 4;
400
- export const AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH = 18740;
401
- export const AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED = 16400;
402
- export const AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED = 1000;
407
+ export const AVM_PUBLIC_INPUTS_COLUMN_0_LENGTH = 4685;
408
+ export const AVM_PUBLIC_INPUTS_COLUMN_1_LENGTH = 4683;
409
+ export const AVM_PUBLIC_INPUTS_COLUMN_2_LENGTH = 522;
410
+ export const AVM_PUBLIC_INPUTS_COLUMN_3_LENGTH = 99;
411
+ export const AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH = 9989;
412
+ export const AVM_V2_PROOF_LENGTH_IN_FIELDS = 14532;
403
413
  export const DA_BYTES_PER_FIELD = 32;
404
414
  export const DA_GAS_PER_BYTE = 1;
405
415
  export const DA_GAS_PER_FIELD = 32;
406
416
  export const TX_DA_GAS_OVERHEAD = 96;
417
+ export const MAX_TX_BLOB_DATA_SIZE_IN_FIELDS = 8475;
407
418
  export const PUBLIC_TX_L2_GAS_OVERHEAD = 540000;
408
419
  export const PRIVATE_TX_L2_GAS_OVERHEAD = 440000;
409
420
  export const FIXED_AVM_STARTUP_L2_GAS = 20000;
@@ -412,8 +423,8 @@ export const MAX_PROCESSABLE_L2_GAS = 6540000;
412
423
  export const MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT = 786432;
413
424
  export const L2_GAS_DISTRIBUTED_STORAGE_PREMIUM = 1024;
414
425
  export const AVM_PC_SIZE_IN_BITS = 32;
415
- export const AVM_MAX_OPERANDS = 7;
416
- export const AVM_MAX_REGISTERS = 6;
426
+ export const AVM_MAX_OPERANDS = 5;
427
+ export const AVM_MAX_REGISTERS = 4;
417
428
  export const AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS = 3;
418
429
  export const AVM_ADDRESSING_INDIRECT_L2_GAS = 3;
419
430
  export const AVM_ADDRESSING_RELATIVE_L2_GAS = 3;
@@ -468,10 +479,9 @@ export const AVM_SHA256COMPRESSION_BASE_L2_GAS = 12288;
468
479
  export const AVM_KECCAKF1600_BASE_L2_GAS = 58176;
469
480
  export const AVM_ECADD_BASE_L2_GAS = 180;
470
481
  export const AVM_TORADIXBE_BASE_L2_GAS = 24;
471
- export const AVM_CALLDATACOPY_DYN_L2_GAS = 3;
472
- export const AVM_RETURNDATACOPY_DYN_L2_GAS = 3;
482
+ export const AVM_CALLDATACOPY_DYN_L2_GAS = 6;
483
+ export const AVM_RETURNDATACOPY_DYN_L2_GAS = 6;
473
484
  export const AVM_TORADIXBE_DYN_L2_GAS = 3;
474
- export const AVM_BITWISE_DYN_L2_GAS = 3;
475
485
  export const AVM_EMITPUBLICLOG_DYN_L2_GAS = 3;
476
486
  export const AVM_EMITNOTEHASH_BASE_DA_GAS = 32;
477
487
  export const AVM_EMITNULLIFIER_BASE_DA_GAS = 32;
@@ -489,8 +499,7 @@ export const PROOF_TYPE_AVM = 3;
489
499
  export const PROOF_TYPE_ROLLUP_HONK = 4;
490
500
  export const PROOF_TYPE_ROOT_ROLLUP_HONK = 5;
491
501
  export const PROOF_TYPE_HN_FINAL = 7;
492
- export const PROOF_TYPE_HN_TAIL = 8;
493
- export const PROOF_TYPE_CHONK = 9;
502
+ export const PROOF_TYPE_CHONK = 8;
494
503
  export const TWO_POW_64 = 18446744073709551616n;
495
504
  export const AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT = 6;
496
505
  export const AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT = 8857725174171741160013581538021104168730942281584695363072221389187184558934n;
@@ -524,7 +533,11 @@ export enum DomainSeparator {
524
533
  NOTE_COMPLETION_LOG_TAG = 3372669888,
525
534
  UNCONSTRAINED_MSG_LOG_TAG = 1485357192,
526
535
  CONSTRAINED_MSG_LOG_TAG = 3715244738,
536
+ CONSTRAINED_MSG_NULLIFIER = 3723577546,
537
+ CONSTRAINED_MSG_SENDER_SECRET = 1182889476,
527
538
  NON_INTERACTIVE_HANDSHAKE_LOG_TAG = 4046403018,
539
+ INTERACTIVE_HANDSHAKE_SIGNATURE = 3098455647,
540
+ HANDSHAKE_FORGERY_PROTECTION = 2291983127,
528
541
  PRIVATE_LOG_FIRST_FIELD = 2769976252,
529
542
  PUBLIC_LEAF_SLOT = 1247650290,
530
543
  PUBLIC_STORAGE_MAP_SLOT = 4015149901,
@@ -542,6 +555,8 @@ export enum DomainSeparator {
542
555
  IVSK_M = 2747825907,
543
556
  OVSK_M = 4272201051,
544
557
  TSK_M = 1546190975,
558
+ MSSK_M = 617962565,
559
+ FBSK_M = 787738027,
545
560
  PUBLIC_KEYS_HASH = 777457226,
546
561
  SINGLE_PUBLIC_KEY_HASH = 3452068255,
547
562
  PARTIAL_ADDRESS = 2103633018,
package/src/constants.ts CHANGED
@@ -4,14 +4,38 @@ import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  // Re-export L2 block number constants with proper BlockNumber type
5
5
  // Note: The generated constants are plain numbers, but we provide typed versions here
6
6
  import {
7
+ DA_GAS_PER_FIELD,
7
8
  GENESIS_BLOCK_HEADER_HASH as GENESIS_BLOCK_HEADER_HASH_BIGINT,
8
9
  INITIAL_CHECKPOINT_NUMBER as INITIAL_CHECKPOINT_NUM_RAW,
9
10
  INITIAL_L2_BLOCK_NUM as INITIAL_L2_BLOCK_NUM_RAW,
11
+ MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT as MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT_RAW,
12
+ MAX_TX_BLOB_DATA_SIZE_IN_FIELDS,
10
13
  } from './constants.gen.js';
11
14
 
12
15
  // Typescript-land-only constants
13
16
  export const SPONSORED_FPC_SALT = BigInt(0);
14
17
 
18
+ /**
19
+ * Network-minimum per-block budget multiplier for L2 gas / tx count. Operators may configure a higher value,
20
+ * but never lower: a node admitting txs under a smaller multiplier would accept work it can never pack.
21
+ */
22
+ export const MIN_PER_BLOCK_ALLOCATION_MULTIPLIER = 1.2;
23
+
24
+ /**
25
+ * Network-minimum per-block budget multiplier for DA gas / blob fields. See
26
+ * {@link MIN_PER_BLOCK_ALLOCATION_MULTIPLIER}. The DA-specific operator knob and its runtime enforcement land
27
+ * with the network tx admission limits (#23947); until then this constant is documentation of the network
28
+ * minimum only.
29
+ */
30
+ export const MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER = 1.5;
31
+
32
+ /**
33
+ * The most DA gas a single tx can consume. A tx's effects cannot encode more than
34
+ * MAX_TX_BLOB_DATA_SIZE_IN_FIELDS fields in a blob, each costing DA_GAS_PER_FIELD, so this is the maximum
35
+ * DA gas a tx could ever use; declaring a higher limit is rejected by inbound validation.
36
+ */
37
+ export const MAX_TX_DA_GAS = MAX_TX_BLOB_DATA_SIZE_IN_FIELDS * DA_GAS_PER_FIELD;
38
+
15
39
  // Autogenerated constants loaded from noir-land
16
40
  // eslint-disable-next-line import-x/export
17
41
  export * from './constants.gen.js';
@@ -27,3 +51,15 @@ export const INITIAL_CHECKPOINT_NUMBER: CheckpointNumber = CheckpointNumber(INIT
27
51
  /** The block header hash for the genesis block 0. */
28
52
  // eslint-disable-next-line import-x/export
29
53
  export const GENESIS_BLOCK_HEADER_HASH = new Fr(GENESIS_BLOCK_HEADER_HASH_BIGINT);
54
+
55
+ /**
56
+ * The RAW DA capacity of a checkpoint's blobs: `BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB * DA_GAS_PER_FIELD`.
57
+ * This value is NOT attainable by transactions. The blob encoding reserves overhead fields that no tx pays
58
+ * DA gas for: a checkpoint-end marker field plus per-block block-end fields (7 for the first block in a
59
+ * checkpoint, 6 for each subsequent block — see `@aztec/blob-lib` encoding). The true tx-usable DA budget
60
+ * is lower and block-count-dependent; consumers budgeting tx data should subtract the encoding overhead (as
61
+ * `CheckpointBuilder` and the network tx gas limits in `@aztec/stdlib/gas` do) rather than use this value
62
+ * directly.
63
+ */
64
+ // eslint-disable-next-line import-x/export
65
+ export const MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT_RAW;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmluLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2NyaXB0cy9jb25zdGFudHMuaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.in.d.ts","sourceRoot":"","sources":["../../src/scripts/constants.in.ts"],"names":[],"mappings":""}