@aztec/constants 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0

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,16 +1,41 @@
1
- import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  // Re-export L2 block number constants with proper BlockNumber type
4
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_L2_BLOCK_NUM as INITIAL_L2_BLOCK_NUM_RAW } from './constants.gen.js';
5
+ import { DA_GAS_PER_FIELD, 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, MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT as MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT_RAW, MAX_TX_BLOB_DATA_SIZE_IN_FIELDS } from './constants.gen.js';
6
6
  // Typescript-land-only constants
7
7
  export const SPONSORED_FPC_SALT = BigInt(0);
8
+ /**
9
+ * Network-minimum per-block budget multiplier for L2 gas / tx count. Operators may configure a higher value,
10
+ * but never lower: a node admitting txs under a smaller multiplier would accept work it can never pack.
11
+ */ export const MIN_PER_BLOCK_ALLOCATION_MULTIPLIER = 1.2;
12
+ /**
13
+ * Network-minimum per-block budget multiplier for DA gas / blob fields. See
14
+ * {@link MIN_PER_BLOCK_ALLOCATION_MULTIPLIER}. The DA-specific operator knob and its runtime enforcement land
15
+ * with the network tx admission limits (#23947); until then this constant is documentation of the network
16
+ * minimum only.
17
+ */ export const MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER = 1.5;
18
+ /**
19
+ * The most DA gas a single tx can consume. A tx's effects cannot encode more than
20
+ * MAX_TX_BLOB_DATA_SIZE_IN_FIELDS fields in a blob, each costing DA_GAS_PER_FIELD, so this is the maximum
21
+ * DA gas a tx could ever use; declaring a higher limit is rejected by inbound validation.
22
+ */ export const MAX_TX_DA_GAS = MAX_TX_BLOB_DATA_SIZE_IN_FIELDS * DA_GAS_PER_FIELD;
8
23
  // Autogenerated constants loaded from noir-land
9
- // eslint-disable-next-line import/export
24
+ // eslint-disable-next-line import-x/export
10
25
  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
26
+ /** The initial L2 block number (typed as BlockNumber). This is the first block number in the Aztec L2 chain. */ // eslint-disable-next-line import-x/export
13
27
  export const INITIAL_L2_BLOCK_NUM = BlockNumber(INITIAL_L2_BLOCK_NUM_RAW);
14
- /** The block header hash for the genesis block 0. */ // Shadow the export from constants.gen above
15
- // eslint-disable-next-line import/export
28
+ /** The initial L2 checkpoint number (typed as CheckpointNumber). This is the first checkpoint number in the Aztec L2 chain. */ // eslint-disable-next-line import-x/export
29
+ export const INITIAL_CHECKPOINT_NUMBER = CheckpointNumber(INITIAL_CHECKPOINT_NUM_RAW);
30
+ /** The block header hash for the genesis block 0. */ // eslint-disable-next-line import-x/export
16
31
  export const GENESIS_BLOCK_HEADER_HASH = new Fr(GENESIS_BLOCK_HEADER_HASH_BIGINT);
32
+ /**
33
+ * The RAW DA capacity of a checkpoint's blobs: `BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB * DA_GAS_PER_FIELD`.
34
+ * This value is NOT attainable by transactions. The blob encoding reserves overhead fields that no tx pays
35
+ * DA gas for: a checkpoint-end marker field plus per-block block-end fields (7 for the first block in a
36
+ * checkpoint, 6 for each subsequent block — see `@aztec/blob-lib` encoding). The true tx-usable DA budget
37
+ * is lower and block-count-dependent; consumers budgeting tx data should subtract the encoding overhead (as
38
+ * `CheckpointBuilder` and the network tx gas limits in `@aztec/stdlib/gas` do) rather than use this value
39
+ * directly.
40
+ */ // eslint-disable-next-line import-x/export
41
+ export const MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT_RAW;
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@aztec/constants",
3
- "version": "0.0.1-commit.d3ec352c",
3
+ "version": "0.0.1-commit.d58ff9d0",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json"
7
7
  ],
8
+ "typedocOptions": {
9
+ "entryPoints": [
10
+ "./src/constants.gen.ts"
11
+ ],
12
+ "name": "Constants",
13
+ "tsconfig": "./tsconfig.json"
14
+ },
8
15
  "exports": {
9
16
  ".": "./dest/constants.js"
10
17
  },
@@ -12,18 +19,18 @@
12
19
  "build": "yarn clean && ../scripts/tsc.sh",
13
20
  "build:dev": "../scripts/tsc.sh --watch",
14
21
  "clean": "rm -rf ./dest .tsbuildinfo",
15
- "remake-constants": "node --loader @swc-node/register/esm src/scripts/constants.in.ts && cd ../../l1-contracts && forge fmt",
22
+ "generate": "./scripts/remake-constants.sh",
16
23
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
17
24
  },
18
25
  "dependencies": {
19
- "@aztec/foundation": "0.0.1-commit.d3ec352c",
26
+ "@aztec/foundation": "0.0.1-commit.d58ff9d0",
20
27
  "tslib": "^2.4.0"
21
28
  },
22
29
  "devDependencies": {
23
30
  "@jest/globals": "^30.0.0",
24
31
  "@types/jest": "^30.0.0",
25
32
  "@types/node": "^22.15.17",
26
- "@typescript/native-preview": "7.0.0-dev.20251126.1",
33
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
27
34
  "eslint": "^9.26.0",
28
35
  "jest": "^30.0.0",
29
36
  "prettier": "^3.5.3",