@aztec/foundation 0.0.1-commit.fce3e4f → 0.0.1-commit.ffe5b04ea
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/array/index.d.ts +2 -1
- package/dest/array/index.d.ts.map +1 -1
- package/dest/array/index.js +1 -0
- package/dest/array/sorted_array.d.ts +15 -0
- package/dest/array/sorted_array.d.ts.map +1 -0
- package/dest/array/sorted_array.js +109 -0
- package/dest/branded-types/block_number.d.ts +56 -0
- package/dest/branded-types/block_number.d.ts.map +1 -0
- package/dest/branded-types/block_number.js +78 -0
- package/dest/branded-types/checkpoint_number.d.ts +54 -0
- package/dest/branded-types/checkpoint_number.d.ts.map +1 -0
- package/dest/branded-types/checkpoint_number.js +77 -0
- package/dest/branded-types/index.d.ts +4 -1
- package/dest/branded-types/index.d.ts.map +1 -1
- package/dest/branded-types/index.js +3 -0
- package/dest/branded-types/index_within_checkpoint.d.ts +42 -0
- package/dest/branded-types/index_within_checkpoint.d.ts.map +1 -0
- package/dest/branded-types/index_within_checkpoint.js +59 -0
- package/dest/buffer/buffer16.d.ts +5 -2
- package/dest/buffer/buffer16.d.ts.map +1 -1
- package/dest/buffer/buffer16.js +4 -2
- package/dest/buffer/buffer32.d.ts +5 -2
- package/dest/buffer/buffer32.d.ts.map +1 -1
- package/dest/buffer/buffer32.js +4 -2
- package/dest/collection/array.d.ts +12 -1
- package/dest/collection/array.d.ts.map +1 -1
- package/dest/collection/array.js +51 -0
- package/dest/config/env_var.d.ts +2 -2
- package/dest/config/env_var.d.ts.map +1 -1
- package/dest/config/index.d.ts +15 -4
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +47 -9
- package/dest/config/network_config.d.ts +25 -1
- package/dest/config/network_config.d.ts.map +1 -1
- package/dest/config/network_config.js +5 -1
- package/dest/config/network_name.d.ts +2 -2
- package/dest/config/network_name.d.ts.map +1 -1
- package/dest/config/network_name.js +2 -0
- package/dest/config/parse-env.d.ts +3 -0
- package/dest/config/parse-env.d.ts.map +1 -0
- package/dest/config/parse-env.js +7 -0
- package/dest/config/secret_value.js +3 -1
- package/dest/crypto/bls/bn254_keystore.js +1 -1
- package/dest/crypto/bls/index.js +1 -1
- package/dest/crypto/bn254/index.d.ts +35 -51
- package/dest/crypto/bn254/index.d.ts.map +1 -1
- package/dest/crypto/bn254/index.js +51 -140
- package/dest/crypto/ecdsa/signature.d.ts +11 -2
- package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
- package/dest/crypto/ecdsa/signature.js +2 -2
- package/dest/crypto/grumpkin/index.d.ts +4 -2
- package/dest/crypto/grumpkin/index.d.ts.map +1 -1
- package/dest/crypto/grumpkin/index.js +2 -1
- package/dest/crypto/keys/index.d.ts +2 -2
- package/dest/crypto/keys/index.d.ts.map +1 -1
- package/dest/crypto/keys/index.js +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
- package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.js +1 -1
- package/dest/crypto/poseidon/index.d.ts +2 -3
- package/dest/crypto/poseidon/index.d.ts.map +1 -1
- package/dest/crypto/poseidon/index.js +14 -23
- package/dest/crypto/random/randomness_singleton.d.ts +4 -3
- package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
- package/dest/crypto/random/randomness_singleton.js +5 -5
- package/dest/crypto/schnorr/index.d.ts +3 -2
- package/dest/crypto/schnorr/index.d.ts.map +1 -1
- package/dest/crypto/schnorr/index.js +1 -1
- package/dest/crypto/schnorr/signature.d.ts +2 -2
- package/dest/crypto/schnorr/signature.d.ts.map +1 -1
- package/dest/crypto/schnorr/signature.js +2 -2
- package/dest/crypto/secp256k1-signer/utils.d.ts +12 -1
- package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
- package/dest/crypto/secp256k1-signer/utils.js +26 -0
- package/dest/crypto/sha256/index.d.ts +2 -2
- package/dest/crypto/sha256/index.d.ts.map +1 -1
- package/dest/crypto/sha256/index.js +1 -1
- package/dest/crypto/sha512/index.d.ts +2 -2
- package/dest/crypto/sha512/index.d.ts.map +1 -1
- package/dest/crypto/sha512/index.js +1 -1
- package/dest/crypto/signature/index.d.ts +2 -2
- package/dest/crypto/signature/index.d.ts.map +1 -1
- package/dest/crypto/sync/pedersen/index.d.ts +2 -2
- package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
- package/dest/crypto/sync/pedersen/index.js +1 -1
- package/dest/crypto/sync/poseidon/index.d.ts +2 -3
- package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
- package/dest/crypto/sync/poseidon/index.js +1 -9
- package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
- package/dest/curves/bls12/field.d.ts.map +1 -0
- package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
- package/dest/curves/bls12/index.d.ts +3 -0
- package/dest/curves/bls12/index.d.ts.map +1 -0
- package/dest/curves/bls12/index.js +2 -0
- package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +13 -4
- package/dest/curves/bls12/point.d.ts.map +1 -0
- package/dest/{fields/bls12_point.js → curves/bls12/point.js} +10 -8
- package/dest/{fields/fields.d.ts → curves/bn254/field.d.ts} +8 -15
- package/dest/curves/bn254/field.d.ts.map +1 -0
- package/dest/{fields/fields.js → curves/bn254/field.js} +38 -49
- package/dest/curves/bn254/index.d.ts +3 -0
- package/dest/curves/bn254/index.d.ts.map +1 -0
- package/dest/curves/bn254/index.js +2 -0
- package/dest/curves/bn254/point.d.ts +54 -0
- package/dest/curves/bn254/point.d.ts.map +1 -0
- package/dest/curves/bn254/point.js +143 -0
- package/dest/curves/grumpkin/index.d.ts +10 -0
- package/dest/curves/grumpkin/index.d.ts.map +1 -0
- package/dest/curves/grumpkin/index.js +3 -0
- package/dest/{fields → curves/grumpkin}/point.d.ts +13 -4
- package/dest/curves/grumpkin/point.d.ts.map +1 -0
- package/dest/{fields → curves/grumpkin}/point.js +7 -7
- package/dest/error/index.d.ts +4 -4
- package/dest/error/index.d.ts.map +1 -1
- package/dest/eth-address/index.d.ts +3 -2
- package/dest/eth-address/index.d.ts.map +1 -1
- package/dest/eth-address/index.js +10 -3
- package/dest/eth-signature/eth_signature.d.ts +5 -1
- package/dest/eth-signature/eth_signature.d.ts.map +1 -1
- package/dest/eth-signature/eth_signature.js +7 -2
- package/dest/iterator/filter.d.ts +3 -0
- package/dest/iterator/filter.d.ts.map +1 -0
- package/dest/iterator/filter.js +7 -0
- package/dest/iterator/index.d.ts +2 -0
- package/dest/iterator/index.d.ts.map +1 -0
- package/dest/iterator/index.js +1 -0
- package/dest/jest/setup.js +28 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts +2 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.js +1 -1
- package/dest/json-rpc/client/undici.d.ts +1 -1
- package/dest/json-rpc/client/undici.d.ts.map +1 -1
- package/dest/json-rpc/client/undici.js +21 -4
- package/dest/json-rpc/fixtures/class_a.d.ts +3 -3
- package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
- package/dest/json-rpc/fixtures/class_b.d.ts +3 -3
- package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
- package/dest/json-rpc/server/api_key_auth.d.ts +19 -0
- package/dest/json-rpc/server/api_key_auth.d.ts.map +1 -0
- package/dest/json-rpc/server/api_key_auth.js +57 -0
- package/dest/json-rpc/server/index.d.ts +2 -1
- package/dest/json-rpc/server/index.d.ts.map +1 -1
- package/dest/json-rpc/server/index.js +1 -0
- package/dest/json-rpc/server/safe_json_rpc_server.js +1 -1
- package/dest/log/bigint-utils.d.ts +5 -0
- package/dest/log/bigint-utils.d.ts.map +1 -0
- package/dest/log/bigint-utils.js +21 -0
- package/dest/log/gcloud-logger-config.d.ts +1 -1
- package/dest/log/gcloud-logger-config.d.ts.map +1 -1
- package/dest/log/gcloud-logger-config.js +3 -0
- package/dest/log/libp2p_logger.d.ts +5 -2
- package/dest/log/libp2p_logger.d.ts.map +1 -1
- package/dest/log/libp2p_logger.js +14 -4
- package/dest/log/log-filters.d.ts +17 -4
- package/dest/log/log-filters.d.ts.map +1 -1
- package/dest/log/log-filters.js +26 -12
- package/dest/log/pino-logger-server.d.ts +9 -0
- package/dest/log/pino-logger-server.d.ts.map +1 -0
- package/dest/log/pino-logger-server.js +18 -0
- package/dest/log/pino-logger.d.ts +37 -8
- package/dest/log/pino-logger.d.ts.map +1 -1
- package/dest/log/pino-logger.js +122 -29
- package/dest/queue/base_memory_queue.d.ts +2 -2
- package/dest/queue/base_memory_queue.d.ts.map +1 -1
- package/dest/queue/semaphore.d.ts +5 -1
- package/dest/queue/semaphore.d.ts.map +1 -1
- package/dest/retry/index.d.ts +11 -1
- package/dest/retry/index.d.ts.map +1 -1
- package/dest/retry/index.js +11 -0
- package/dest/schemas/schemas.d.ts +7 -3
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +9 -3
- package/dest/schemas/types.d.ts +31 -1
- package/dest/schemas/types.d.ts.map +1 -1
- package/dest/schemas/types.js +25 -1
- package/dest/serialize/buffer_reader.d.ts +14 -4
- package/dest/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/serialize/buffer_reader.js +26 -4
- package/dest/serialize/field_reader.d.ts +2 -2
- package/dest/serialize/field_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.js +1 -1
- package/dest/serialize/free_funcs.d.ts +2 -2
- package/dest/serialize/free_funcs.d.ts.map +1 -1
- package/dest/serialize/free_funcs.js +1 -1
- package/dest/serialize/serialize.d.ts +20 -2
- package/dest/serialize/serialize.d.ts.map +1 -1
- package/dest/serialize/serialize.js +32 -1
- package/dest/sleep/index.d.ts +4 -1
- package/dest/sleep/index.d.ts.map +1 -1
- package/dest/sleep/index.js +14 -1
- package/dest/timer/date.d.ts +26 -1
- package/dest/timer/date.d.ts.map +1 -1
- package/dest/timer/date.js +36 -0
- package/dest/transport/transport_client.js +2 -2
- package/dest/trees/balanced_merkle_tree_root.d.ts +17 -0
- package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -0
- package/dest/trees/{balanced_merkle_tree.js → balanced_merkle_tree_root.js} +2 -15
- package/dest/trees/hasher.d.ts +3 -1
- package/dest/trees/hasher.d.ts.map +1 -1
- package/dest/trees/hasher.js +10 -5
- package/dest/trees/index.d.ts +4 -4
- package/dest/trees/index.d.ts.map +1 -1
- package/dest/trees/index.js +3 -3
- package/dest/trees/indexed_merkle_tree.js +1 -1
- package/dest/trees/membership_witness.d.ts +12 -2
- package/dest/trees/membership_witness.d.ts.map +1 -1
- package/dest/trees/membership_witness.js +10 -1
- package/dest/trees/merkle_tree_calculator.d.ts +1 -1
- package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/merkle_tree_calculator.js +2 -2
- package/dest/trees/sibling_path.d.ts +3 -2
- package/dest/trees/sibling_path.d.ts.map +1 -1
- package/dest/trees/sibling_path.js +3 -3
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +2 -3
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/unbalanced_merkle_tree_calculator.js +1 -5
- package/dest/trees/{unbalanced_merkle_tree.d.ts → unbalanced_merkle_tree_root.d.ts} +3 -5
- package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -0
- package/dest/trees/{unbalanced_merkle_tree.js → unbalanced_merkle_tree_root.js} +11 -49
- package/dest/trees/unbalanced_tree_store.d.ts +5 -1
- package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
- package/dest/trees/unbalanced_tree_store.js +49 -1
- package/dest/types/index.d.ts +6 -2
- package/dest/types/index.d.ts.map +1 -1
- package/dest/types/index.js +6 -0
- package/package.json +48 -9
- package/src/array/index.ts +1 -0
- package/src/array/sorted_array.ts +138 -0
- package/src/branded-types/block_number.ts +117 -0
- package/src/branded-types/checkpoint_number.ts +115 -0
- package/src/branded-types/index.ts +3 -0
- package/src/branded-types/index_within_checkpoint.ts +88 -0
- package/src/buffer/buffer16.ts +2 -2
- package/src/buffer/buffer32.ts +2 -2
- package/src/collection/array.ts +52 -0
- package/src/config/env_var.ts +81 -17
- package/src/config/index.ts +54 -6
- package/src/config/network_config.ts +4 -0
- package/src/config/network_name.ts +4 -1
- package/src/config/parse-env.ts +4 -0
- package/src/crypto/bls/bn254_keystore.ts +1 -1
- package/src/crypto/bls/index.ts +1 -1
- package/src/crypto/bn254/index.ts +50 -159
- package/src/crypto/ecdsa/signature.ts +2 -2
- package/src/crypto/grumpkin/index.ts +3 -1
- package/src/crypto/keys/index.ts +1 -1
- package/src/crypto/pedersen/pedersen.wasm.ts +1 -1
- package/src/crypto/poseidon/index.ts +14 -24
- package/src/crypto/random/randomness_singleton.ts +6 -4
- package/src/crypto/schnorr/index.ts +2 -1
- package/src/crypto/schnorr/signature.ts +2 -2
- package/src/crypto/secp256k1-signer/utils.ts +32 -0
- package/src/crypto/sha256/index.ts +1 -1
- package/src/crypto/sha512/index.ts +1 -1
- package/src/crypto/signature/index.ts +1 -1
- package/src/crypto/sync/pedersen/index.ts +1 -1
- package/src/crypto/sync/poseidon/index.ts +1 -10
- package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
- package/src/curves/bls12/index.ts +2 -0
- package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +7 -7
- package/src/{fields/fields.ts → curves/bn254/field.ts} +37 -56
- package/src/curves/bn254/index.ts +2 -0
- package/src/curves/bn254/point.ts +170 -0
- package/src/curves/grumpkin/index.ts +11 -0
- package/src/{fields → curves/grumpkin}/point.ts +7 -7
- package/src/eth-address/index.ts +8 -2
- package/src/eth-signature/eth_signature.ts +7 -1
- package/src/iterator/filter.ts +11 -0
- package/src/iterator/index.ts +1 -0
- package/src/jest/setup.mjs +31 -1
- package/src/json-rpc/client/safe_json_rpc_client.ts +2 -0
- package/src/json-rpc/client/undici.ts +21 -3
- package/src/json-rpc/server/api_key_auth.ts +63 -0
- package/src/json-rpc/server/index.ts +1 -0
- package/src/json-rpc/server/safe_json_rpc_server.ts +1 -1
- package/src/log/bigint-utils.ts +25 -0
- package/src/log/gcloud-logger-config.ts +5 -0
- package/src/log/libp2p_logger.ts +12 -5
- package/src/log/log-filters.ts +29 -11
- package/src/log/pino-logger-server.ts +25 -0
- package/src/log/pino-logger.ts +144 -39
- package/src/queue/base_memory_queue.ts +1 -1
- package/src/queue/semaphore.ts +5 -0
- package/src/retry/index.ts +18 -0
- package/src/schemas/schemas.ts +14 -3
- package/src/schemas/types.ts +33 -0
- package/src/serialize/buffer_reader.ts +36 -9
- package/src/serialize/field_reader.ts +1 -1
- package/src/serialize/free_funcs.ts +1 -1
- package/src/serialize/serialize.ts +33 -1
- package/src/sleep/index.ts +16 -1
- package/src/timer/date.ts +52 -0
- package/src/transport/transport_client.ts +2 -2
- package/src/trees/{balanced_merkle_tree.ts → balanced_merkle_tree_root.ts} +2 -16
- package/src/trees/hasher.ts +9 -0
- package/src/trees/index.ts +3 -3
- package/src/trees/indexed_merkle_tree.ts +1 -1
- package/src/trees/membership_witness.ts +9 -1
- package/src/trees/merkle_tree_calculator.ts +2 -2
- package/src/trees/sibling_path.ts +3 -3
- package/src/trees/unbalanced_merkle_tree_calculator.ts +1 -12
- package/src/trees/{unbalanced_merkle_tree.ts → unbalanced_merkle_tree_root.ts} +17 -61
- package/src/trees/unbalanced_tree_store.ts +57 -2
- package/src/types/index.ts +11 -1
- package/dest/crypto/bn254/bn254_utils.d.ts +0 -39
- package/dest/crypto/bn254/bn254_utils.d.ts.map +0 -1
- package/dest/crypto/bn254/bn254_utils.js +0 -56
- package/dest/crypto/index.d.ts +0 -17
- package/dest/crypto/index.d.ts.map +0 -1
- package/dest/crypto/index.js +0 -16
- package/dest/fields/bls12_fields.d.ts.map +0 -1
- package/dest/fields/bls12_point.d.ts.map +0 -1
- package/dest/fields/coordinate.d.ts +0 -63
- package/dest/fields/coordinate.d.ts.map +0 -1
- package/dest/fields/coordinate.js +0 -96
- package/dest/fields/fields.d.ts.map +0 -1
- package/dest/fields/index.d.ts +0 -6
- package/dest/fields/index.d.ts.map +0 -1
- package/dest/fields/index.js +0 -5
- package/dest/fields/point.d.ts.map +0 -1
- package/dest/index.d.ts +0 -31
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -31
- package/dest/json-rpc/server/telemetry.d.ts +0 -2
- package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
- package/dest/json-rpc/server/telemetry.js +0 -0
- package/dest/trees/balanced_merkle_tree.d.ts +0 -22
- package/dest/trees/balanced_merkle_tree.d.ts.map +0 -1
- package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
- package/src/crypto/bn254/bn254_utils.ts +0 -64
- package/src/crypto/index.ts +0 -16
- package/src/fields/coordinate.ts +0 -104
- package/src/fields/index.ts +0 -5
- package/src/index.ts +0 -31
- package/src/json-rpc/server/telemetry.ts +0 -0
package/src/config/env_var.ts
CHANGED
|
@@ -12,6 +12,9 @@ export type EnvVar =
|
|
|
12
12
|
| 'ARCHIVER_VIEM_POLLING_INTERVAL_MS'
|
|
13
13
|
| 'ARCHIVER_BATCH_SIZE'
|
|
14
14
|
| 'AZTEC_ADMIN_PORT'
|
|
15
|
+
| 'AZTEC_ADMIN_API_KEY_HASH'
|
|
16
|
+
| 'AZTEC_DISABLE_ADMIN_API_KEY'
|
|
17
|
+
| 'AZTEC_RESET_ADMIN_API_KEY'
|
|
15
18
|
| 'AZTEC_NODE_ADMIN_URL'
|
|
16
19
|
| 'AZTEC_NODE_URL'
|
|
17
20
|
| 'AZTEC_PORT'
|
|
@@ -21,12 +24,13 @@ export type EnvVar =
|
|
|
21
24
|
| 'BB_NUM_IVC_VERIFIERS'
|
|
22
25
|
| 'BB_IVC_CONCURRENCY'
|
|
23
26
|
| 'BOOTSTRAP_NODES'
|
|
24
|
-
| '
|
|
25
|
-
| '
|
|
26
|
-
| '
|
|
27
|
+
| 'BLOB_ARCHIVE_API_URL'
|
|
28
|
+
| 'BLOB_FILE_STORE_URLS'
|
|
29
|
+
| 'BLOB_FILE_STORE_UPLOAD_URL'
|
|
30
|
+
| 'BLOB_HEALTHCHECK_UPLOAD_INTERVAL_MINUTES'
|
|
27
31
|
| 'BOT_DA_GAS_LIMIT'
|
|
28
32
|
| 'BOT_FEE_PAYMENT_METHOD'
|
|
29
|
-
| '
|
|
33
|
+
| 'BOT_MIN_FEE_PADDING'
|
|
30
34
|
| 'BOT_FLUSH_SETUP_TRANSACTIONS'
|
|
31
35
|
| 'BOT_FOLLOW_CHAIN'
|
|
32
36
|
| 'BOT_L2_GAS_LIMIT'
|
|
@@ -46,7 +50,10 @@ export type EnvVar =
|
|
|
46
50
|
| 'BOT_TX_MINED_WAIT_SECONDS'
|
|
47
51
|
| 'BOT_MAX_CONSECUTIVE_ERRORS'
|
|
48
52
|
| 'BOT_STOP_WHEN_UNHEALTHY'
|
|
49
|
-
| '
|
|
53
|
+
| 'BOT_MODE'
|
|
54
|
+
| 'BOT_L2_TO_L1_MESSAGES_PER_TX'
|
|
55
|
+
| 'BOT_L1_TO_L2_SEED_COUNT'
|
|
56
|
+
| 'BOT_L1_TO_L2_SEED_INTERVAL'
|
|
50
57
|
| 'COINBASE'
|
|
51
58
|
| 'CRS_PATH'
|
|
52
59
|
| 'DATA_DIRECTORY'
|
|
@@ -55,6 +62,7 @@ export type EnvVar =
|
|
|
55
62
|
| 'BLOB_SINK_MAP_SIZE_KB'
|
|
56
63
|
| 'P2P_STORE_MAP_SIZE_KB'
|
|
57
64
|
| 'PROVER_BROKER_STORE_MAP_SIZE_KB'
|
|
65
|
+
| 'SIGNING_PROTECTION_MAP_SIZE_KB'
|
|
58
66
|
| 'WS_DB_MAP_SIZE_KB'
|
|
59
67
|
| 'ARCHIVE_TREE_MAP_SIZE_KB'
|
|
60
68
|
| 'NULLIFIER_TREE_MAP_SIZE_KB'
|
|
@@ -63,8 +71,10 @@ export type EnvVar =
|
|
|
63
71
|
| 'PUBLIC_DATA_TREE_MAP_SIZE_KB'
|
|
64
72
|
| 'DEBUG'
|
|
65
73
|
| 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
|
|
66
|
-
| '
|
|
74
|
+
| 'ENABLE_PROVER_NODE'
|
|
67
75
|
| 'ETHEREUM_HOSTS'
|
|
76
|
+
| 'ETHEREUM_DEBUG_HOSTS'
|
|
77
|
+
| 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS'
|
|
68
78
|
| 'FEE_RECIPIENT'
|
|
69
79
|
| 'FORCE_COLOR'
|
|
70
80
|
| 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS'
|
|
@@ -73,8 +83,10 @@ export type EnvVar =
|
|
|
73
83
|
| 'L1_CONSENSUS_HOST_URLS'
|
|
74
84
|
| 'L1_CONSENSUS_HOST_API_KEYS'
|
|
75
85
|
| 'L1_CONSENSUS_HOST_API_KEY_HEADERS'
|
|
86
|
+
| 'L1_TX_FAILED_STORE'
|
|
76
87
|
| 'LOG_JSON'
|
|
77
88
|
| 'LOG_MULTILINE'
|
|
89
|
+
| 'LOG_NO_COLOR_PER_ACTOR'
|
|
78
90
|
| 'LOG_LEVEL'
|
|
79
91
|
| 'MNEMONIC'
|
|
80
92
|
| 'NETWORK'
|
|
@@ -92,7 +104,12 @@ export type EnvVar =
|
|
|
92
104
|
| 'PUBLIC_OTEL_INCLUDE_METRICS'
|
|
93
105
|
| 'PUBLIC_OTEL_COLLECT_FROM'
|
|
94
106
|
| 'PUBLIC_OTEL_OPT_OUT'
|
|
107
|
+
| 'P2P_BATCH_TX_REQUESTER_SMART_PARALLEL_WORKER_COUNT'
|
|
108
|
+
| 'P2P_BATCH_TX_REQUESTER_DUMB_PARALLEL_WORKER_COUNT'
|
|
109
|
+
| 'P2P_BATCH_TX_REQUESTER_TX_BATCH_SIZE'
|
|
110
|
+
| 'P2P_BATCH_TX_REQUESTER_BAD_PEER_THRESHOLD'
|
|
95
111
|
| 'P2P_BLOCK_CHECK_INTERVAL_MS'
|
|
112
|
+
| 'P2P_SLOT_CHECK_INTERVAL_MS'
|
|
96
113
|
| 'P2P_BLOCK_REQUEST_BATCH_SIZE'
|
|
97
114
|
| 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK'
|
|
98
115
|
| 'P2P_BOOTSTRAP_NODES_AS_FULL_PEERS'
|
|
@@ -131,12 +148,12 @@ export type EnvVar =
|
|
|
131
148
|
| 'P2P_TRUSTED_PEERS'
|
|
132
149
|
| 'P2P_PRIVATE_PEERS'
|
|
133
150
|
| 'P2P_PREFERRED_PEERS'
|
|
134
|
-
| '
|
|
135
|
-
| 'P2P_TX_POOL_OVERFLOW_FACTOR'
|
|
151
|
+
| 'P2P_MAX_PENDING_TX_COUNT'
|
|
136
152
|
| 'P2P_SEEN_MSG_CACHE_SIZE'
|
|
137
|
-
| 'P2P_DROP_TX'
|
|
138
153
|
| 'P2P_DROP_TX_CHANCE'
|
|
139
154
|
| 'P2P_TX_POOL_DELETE_TXS_AFTER_REORG'
|
|
155
|
+
| 'P2P_MIN_TX_POOL_AGE_MS'
|
|
156
|
+
| 'P2P_RPC_PRICE_BUMP_PERCENTAGE'
|
|
140
157
|
| 'DEBUG_P2P_INSTRUMENT_MESSAGES'
|
|
141
158
|
| 'PEER_ID_PRIVATE_KEY'
|
|
142
159
|
| 'PEER_ID_PRIVATE_KEY_PATH'
|
|
@@ -150,7 +167,10 @@ export type EnvVar =
|
|
|
150
167
|
| 'PROVER_BROKER_BATCH_INTERVAL_MS'
|
|
151
168
|
| 'PROVER_BROKER_BATCH_SIZE'
|
|
152
169
|
| 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
|
|
170
|
+
| 'PROVER_BROKER_DEBUG_REPLAY_ENABLED'
|
|
171
|
+
| 'PROVER_CANCEL_JOBS_ON_STOP'
|
|
153
172
|
| 'PROVER_COORDINATION_NODE_URLS'
|
|
173
|
+
| 'PROVER_PROOF_STORE'
|
|
154
174
|
| 'PROVER_FAILED_PROOF_STORE'
|
|
155
175
|
| 'PROVER_NODE_FAILED_EPOCH_STORE'
|
|
156
176
|
| 'PROVER_NODE_DISABLE_PROOF_PUBLISH'
|
|
@@ -166,6 +186,7 @@ export type EnvVar =
|
|
|
166
186
|
| 'PROVER_PUBLISHER_PRIVATE_KEYS'
|
|
167
187
|
| 'PROVER_PUBLISHER_ADDRESSES'
|
|
168
188
|
| 'PROVER_PUBLISHER_ALLOW_INVALID_STATES'
|
|
189
|
+
| 'PROVER_PUBLISHER_FORWARDER_ADDRESS'
|
|
169
190
|
| 'PROVER_REAL_PROOFS'
|
|
170
191
|
| 'PROVER_TEST_DELAY_FACTOR'
|
|
171
192
|
| 'PROVER_TEST_DELAY_MS'
|
|
@@ -173,6 +194,7 @@ export type EnvVar =
|
|
|
173
194
|
| 'PROVER_TEST_VERIFICATION_DELAY_MS'
|
|
174
195
|
| 'PXE_L2_BLOCK_BATCH_SIZE'
|
|
175
196
|
| 'PXE_PROVER_ENABLED'
|
|
197
|
+
| 'PXE_SYNC_CHAIN_TIP'
|
|
176
198
|
| 'RPC_MAX_BATCH_SIZE'
|
|
177
199
|
| 'RPC_MAX_BODY_SIZE'
|
|
178
200
|
| 'RPC_SIMULATE_PUBLIC_MAX_GAS_LIMIT'
|
|
@@ -180,22 +202,28 @@ export type EnvVar =
|
|
|
180
202
|
| 'SENTINEL_ENABLED'
|
|
181
203
|
| 'SENTINEL_HISTORY_LENGTH_IN_EPOCHS'
|
|
182
204
|
| 'SENTINEL_HISTORIC_PROVEN_PERFORMANCE_LENGTH_IN_EPOCHS'
|
|
183
|
-
| 'SEQ_MAX_BLOCK_SIZE_IN_BYTES'
|
|
184
205
|
| 'SEQ_MAX_TX_PER_BLOCK'
|
|
206
|
+
| 'SEQ_MAX_TX_PER_CHECKPOINT'
|
|
185
207
|
| 'SEQ_MIN_TX_PER_BLOCK'
|
|
186
208
|
| 'SEQ_PUBLISH_TXS_WITH_PROPOSALS'
|
|
187
209
|
| 'SEQ_MAX_DA_BLOCK_GAS'
|
|
188
210
|
| 'SEQ_MAX_L2_BLOCK_GAS'
|
|
211
|
+
| 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER'
|
|
189
212
|
| 'SEQ_PUBLISHER_PRIVATE_KEY'
|
|
190
213
|
| 'SEQ_PUBLISHER_PRIVATE_KEYS'
|
|
191
214
|
| 'SEQ_PUBLISHER_ADDRESSES'
|
|
192
215
|
| 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
|
|
193
|
-
| '
|
|
216
|
+
| 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
|
|
217
|
+
| 'SEQ_POLLING_INTERVAL_MS'
|
|
194
218
|
| 'SEQ_ENFORCE_TIME_TABLE'
|
|
195
|
-
| '
|
|
219
|
+
| 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
|
|
196
220
|
| 'SEQ_ATTESTATION_PROPAGATION_TIME'
|
|
221
|
+
| 'SEQ_BLOCK_DURATION_MS'
|
|
222
|
+
| 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT'
|
|
223
|
+
| 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
|
|
197
224
|
| 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
|
|
198
225
|
| 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
|
|
226
|
+
| 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT'
|
|
199
227
|
| 'SLASH_MIN_PENALTY_PERCENTAGE'
|
|
200
228
|
| 'SLASH_MAX_PENALTY_PERCENTAGE'
|
|
201
229
|
| 'SLASH_VALIDATORS_ALWAYS'
|
|
@@ -206,6 +234,8 @@ export type EnvVar =
|
|
|
206
234
|
| 'SLASH_INACTIVITY_TARGET_PERCENTAGE'
|
|
207
235
|
| 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD'
|
|
208
236
|
| 'SLASH_INVALID_BLOCK_PENALTY'
|
|
237
|
+
| 'SLASH_DUPLICATE_PROPOSAL_PENALTY'
|
|
238
|
+
| 'SLASH_DUPLICATE_ATTESTATION_PENALTY'
|
|
209
239
|
| 'SLASH_OVERRIDE_PAYLOAD'
|
|
210
240
|
| 'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY'
|
|
211
241
|
| 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY'
|
|
@@ -220,6 +250,7 @@ export type EnvVar =
|
|
|
220
250
|
| 'TELEMETRY'
|
|
221
251
|
| 'TEST_ACCOUNTS'
|
|
222
252
|
| 'SPONSORED_FPC'
|
|
253
|
+
| 'PREFUND_ADDRESSES'
|
|
223
254
|
| 'TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS'
|
|
224
255
|
| 'TX_COLLECTION_SLOW_NODES_INTERVAL_MS'
|
|
225
256
|
| 'TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS'
|
|
@@ -230,21 +261,39 @@ export type EnvVar =
|
|
|
230
261
|
| 'TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE'
|
|
231
262
|
| 'TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE'
|
|
232
263
|
| 'TX_COLLECTION_NODE_RPC_URLS'
|
|
264
|
+
| 'TX_COLLECTION_MISSING_TXS_COLLECTOR_TYPE'
|
|
265
|
+
| 'TX_COLLECTION_FILE_STORE_URLS'
|
|
266
|
+
| 'TX_COLLECTION_FILE_STORE_SLOW_DELAY_MS'
|
|
267
|
+
| 'TX_COLLECTION_FILE_STORE_FAST_DELAY_MS'
|
|
268
|
+
| 'TX_COLLECTION_FILE_STORE_FAST_WORKER_COUNT'
|
|
269
|
+
| 'TX_COLLECTION_FILE_STORE_SLOW_WORKER_COUNT'
|
|
270
|
+
| 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_BASE_MS'
|
|
271
|
+
| 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_BASE_MS'
|
|
272
|
+
| 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_MAX_MS'
|
|
273
|
+
| 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_MAX_MS'
|
|
274
|
+
| 'TX_FILE_STORE_URL'
|
|
275
|
+
| 'TX_FILE_STORE_UPLOAD_CONCURRENCY'
|
|
276
|
+
| 'TX_FILE_STORE_MAX_QUEUE_SIZE'
|
|
277
|
+
| 'TX_FILE_STORE_ENABLED'
|
|
233
278
|
| 'TX_PUBLIC_SETUP_ALLOWLIST'
|
|
234
279
|
| 'TXE_PORT'
|
|
235
280
|
| 'TRANSACTIONS_DISABLED'
|
|
236
281
|
| 'VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS'
|
|
237
282
|
| 'VALIDATOR_DISABLED'
|
|
283
|
+
| 'VALIDATOR_MAX_DA_BLOCK_GAS'
|
|
284
|
+
| 'VALIDATOR_MAX_L2_BLOCK_GAS'
|
|
285
|
+
| 'VALIDATOR_MAX_TX_PER_BLOCK'
|
|
286
|
+
| 'VALIDATOR_MAX_TX_PER_CHECKPOINT'
|
|
238
287
|
| 'VALIDATOR_PRIVATE_KEYS'
|
|
239
288
|
| 'VALIDATOR_PRIVATE_KEY'
|
|
240
289
|
| 'VALIDATOR_REEXECUTE'
|
|
241
290
|
| 'VALIDATOR_ADDRESSES'
|
|
242
291
|
| 'ROLLUP_VERSION'
|
|
243
292
|
| 'WS_BLOCK_CHECK_INTERVAL_MS'
|
|
244
|
-
| 'WS_PROVEN_BLOCKS_ONLY'
|
|
245
293
|
| 'WS_BLOCK_REQUEST_BATCH_SIZE'
|
|
246
294
|
| 'L1_READER_VIEM_POLLING_INTERVAL_MS'
|
|
247
295
|
| 'WS_DATA_DIRECTORY'
|
|
296
|
+
| 'WS_NUM_HISTORIC_CHECKPOINTS'
|
|
248
297
|
| 'WS_NUM_HISTORIC_BLOCKS'
|
|
249
298
|
| 'ETHEREUM_SLOT_DURATION'
|
|
250
299
|
| 'AZTEC_SLOT_DURATION'
|
|
@@ -252,12 +301,14 @@ export type EnvVar =
|
|
|
252
301
|
| 'AZTEC_TARGET_COMMITTEE_SIZE'
|
|
253
302
|
| 'AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET'
|
|
254
303
|
| 'AZTEC_LAG_IN_EPOCHS_FOR_RANDAO'
|
|
304
|
+
| 'AZTEC_INBOX_LAG'
|
|
255
305
|
| 'AZTEC_PROOF_SUBMISSION_EPOCHS'
|
|
256
306
|
| 'AZTEC_ACTIVATION_THRESHOLD'
|
|
257
307
|
| 'AZTEC_EJECTION_THRESHOLD'
|
|
258
308
|
| 'AZTEC_LOCAL_EJECTION_THRESHOLD'
|
|
259
309
|
| 'AZTEC_MANA_TARGET'
|
|
260
310
|
| 'AZTEC_PROVING_COST_PER_MANA'
|
|
311
|
+
| 'AZTEC_INITIAL_ETH_PER_FEE_ASSET'
|
|
261
312
|
| 'AZTEC_SLASHING_QUORUM'
|
|
262
313
|
| 'AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS'
|
|
263
314
|
| 'AZTEC_SLASHING_LIFETIME_IN_ROUNDS'
|
|
@@ -271,6 +322,7 @@ export type EnvVar =
|
|
|
271
322
|
| 'AZTEC_SLASHER_FLAVOR'
|
|
272
323
|
| 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
|
|
273
324
|
| 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
|
|
325
|
+
| 'AZTEC_GOVERNANCE_VOTING_DURATION'
|
|
274
326
|
| 'AZTEC_EXIT_DELAY_SECONDS'
|
|
275
327
|
| 'L1_GAS_LIMIT_BUFFER_PERCENTAGE'
|
|
276
328
|
| 'L1_GAS_PRICE_MAX'
|
|
@@ -279,6 +331,7 @@ export type EnvVar =
|
|
|
279
331
|
| 'L1_BLOB_FEE_PER_GAS_GWEI_MAX'
|
|
280
332
|
| 'L1_PRIORITY_FEE_BUMP_PERCENTAGE'
|
|
281
333
|
| 'L1_PRIORITY_FEE_RETRY_BUMP_PERCENTAGE'
|
|
334
|
+
| 'L1_MINIMUM_PRIORITY_FEE_PER_GAS_GWEI'
|
|
282
335
|
| 'L1_FIXED_PRIORITY_FEE_PER_GAS'
|
|
283
336
|
| 'L1_FIXED_PRIORITY_FEE_PER_GAS_GWEI'
|
|
284
337
|
| 'L1_TX_MONITOR_MAX_ATTEMPTS'
|
|
@@ -295,13 +348,24 @@ export type EnvVar =
|
|
|
295
348
|
| 'K8S_POD_NAME'
|
|
296
349
|
| 'K8S_POD_UID'
|
|
297
350
|
| 'K8S_NAMESPACE_NAME'
|
|
351
|
+
| 'ENABLE_VERSION_CHECK'
|
|
298
352
|
| 'VALIDATOR_REEXECUTE_DEADLINE_MS'
|
|
299
|
-
| 'ALWAYS_REEXECUTE_BLOCK_PROPOSALS'
|
|
300
|
-
| 'AUTO_UPDATE'
|
|
301
|
-
| 'AUTO_UPDATE_URL'
|
|
302
353
|
| 'WEB3_SIGNER_URL'
|
|
303
354
|
| 'SKIP_ARCHIVER_INITIAL_SYNC'
|
|
304
355
|
| 'BLOB_ALLOW_EMPTY_SOURCES'
|
|
305
356
|
| 'FISHERMAN_MODE'
|
|
306
357
|
| 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
|
|
307
|
-
| 'LEGACY_BLS_CLI'
|
|
358
|
+
| 'LEGACY_BLS_CLI'
|
|
359
|
+
| 'DEBUG_FORCE_TX_PROOF_VERIFICATION'
|
|
360
|
+
| 'VALIDATOR_HA_SIGNING_ENABLED'
|
|
361
|
+
| 'VALIDATOR_HA_NODE_ID'
|
|
362
|
+
| 'VALIDATOR_HA_POLLING_INTERVAL_MS'
|
|
363
|
+
| 'VALIDATOR_HA_SIGNING_TIMEOUT_MS'
|
|
364
|
+
| 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS'
|
|
365
|
+
| 'VALIDATOR_HA_OLD_DUTIES_MAX_AGE_H'
|
|
366
|
+
| 'VALIDATOR_HA_DATABASE_URL'
|
|
367
|
+
| 'VALIDATOR_HA_RUN_MIGRATIONS'
|
|
368
|
+
| 'VALIDATOR_HA_POOL_MAX'
|
|
369
|
+
| 'VALIDATOR_HA_POOL_MIN'
|
|
370
|
+
| 'VALIDATOR_HA_POOL_IDLE_TIMEOUT_MS'
|
|
371
|
+
| 'VALIDATOR_HA_POOL_CONNECTION_TIMEOUT_MS';
|
package/src/config/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Fq, Fr } from '../
|
|
1
|
+
import { Fq, Fr } from '../curves/bn254/field.js';
|
|
2
|
+
import { createConsoleLogger } from '../log/console.js';
|
|
2
3
|
import type { EnvVar } from './env_var.js';
|
|
3
4
|
import { type NetworkNames, getActiveNetworkName } from './network_name.js';
|
|
5
|
+
import { parseBooleanEnv } from './parse-env.js';
|
|
4
6
|
import { SecretValue } from './secret_value.js';
|
|
5
7
|
|
|
6
8
|
export { SecretValue, getActiveNetworkName };
|
|
@@ -17,6 +19,11 @@ export interface ConfigMapping {
|
|
|
17
19
|
isBoolean?: boolean;
|
|
18
20
|
nested?: Record<string, ConfigMapping>;
|
|
19
21
|
fallback?: EnvVar[];
|
|
22
|
+
/**
|
|
23
|
+
* List of deprecated env vars that are still supported but will log a warning.
|
|
24
|
+
* These should also be included in the fallback array for parsing.
|
|
25
|
+
*/
|
|
26
|
+
deprecatedFallback?: { env: EnvVar; message?: string }[];
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
export function isBooleanConfigValue<T>(obj: T, key: keyof T): boolean {
|
|
@@ -72,12 +79,24 @@ export function getConfigFromMappings<T>(configMappings: ConfigMappingsType<T>):
|
|
|
72
79
|
const config = {} as T;
|
|
73
80
|
|
|
74
81
|
for (const key in configMappings) {
|
|
75
|
-
const { env, parseEnv, defaultValue, nested, fallback } = configMappings[key];
|
|
82
|
+
const { env, parseEnv, defaultValue, nested, fallback, deprecatedFallback } = configMappings[key];
|
|
76
83
|
if (nested) {
|
|
77
84
|
(config as any)[key] = getConfigFromMappings(nested);
|
|
78
85
|
} else {
|
|
79
86
|
// Use the shared utility function
|
|
80
87
|
(config as any)[key] = getValueFromEnvWithFallback(env, parseEnv, defaultValue, fallback);
|
|
88
|
+
|
|
89
|
+
// Check for deprecated env vars and warn if logger is set
|
|
90
|
+
if (deprecatedFallback?.length) {
|
|
91
|
+
const userLog = createConsoleLogger('[DEPRECATED]');
|
|
92
|
+
for (const { env: deprecatedEnv, message } of deprecatedFallback) {
|
|
93
|
+
if (process.env[deprecatedEnv]) {
|
|
94
|
+
const warningMessage =
|
|
95
|
+
message ?? `Environment variable ${deprecatedEnv} is deprecated. Please use ${env} instead.`;
|
|
96
|
+
userLog(warningMessage, { deprecatedEnvVar: deprecatedEnv, newEnvVar: env });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
81
100
|
}
|
|
82
101
|
}
|
|
83
102
|
|
|
@@ -130,6 +149,23 @@ export function floatConfigHelper(
|
|
|
130
149
|
};
|
|
131
150
|
}
|
|
132
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Parses an environment variable to a 0-1 percentage value
|
|
154
|
+
*/
|
|
155
|
+
export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
|
|
156
|
+
return {
|
|
157
|
+
parseEnv: (val: string): number => {
|
|
158
|
+
const parsed = safeParseFloat(val, defaultVal);
|
|
159
|
+
if (parsed < 0 || parsed > 1) {
|
|
160
|
+
throw new TypeError(`Invalid percentage value: ${parsed} should be between 0 and 1`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return parsed;
|
|
164
|
+
},
|
|
165
|
+
defaultValue: defaultVal,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
133
169
|
/**
|
|
134
170
|
* Generates parseEnv and default values for a numerical config value.
|
|
135
171
|
* @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
|
|
@@ -141,6 +177,21 @@ export function bigintConfigHelper(defaultVal?: bigint): Pick<ConfigMapping, 'pa
|
|
|
141
177
|
if (val === '') {
|
|
142
178
|
return defaultVal;
|
|
143
179
|
}
|
|
180
|
+
// Handle scientific notation (e.g. "1e+23", "2E23") which BigInt() doesn't accept directly.
|
|
181
|
+
// We parse it losslessly using bigint arithmetic instead of going through float64.
|
|
182
|
+
if (/[eE]/.test(val)) {
|
|
183
|
+
const match = val.match(/^(-?\d+(?:\.(\d+))?)[eE]([+-]?\d+)$/);
|
|
184
|
+
if (!match) {
|
|
185
|
+
throw new Error(`Cannot convert '${val}' to a BigInt`);
|
|
186
|
+
}
|
|
187
|
+
const digits = match[1].replace('.', '');
|
|
188
|
+
const decimalPlaces = match[2]?.length ?? 0;
|
|
189
|
+
const exponent = parseInt(match[3], 10) - decimalPlaces;
|
|
190
|
+
if (exponent < 0) {
|
|
191
|
+
throw new Error(`Cannot convert '${val}' to a BigInt: result is not an integer`);
|
|
192
|
+
}
|
|
193
|
+
return BigInt(digits) * 10n ** BigInt(exponent);
|
|
194
|
+
}
|
|
144
195
|
return BigInt(val);
|
|
145
196
|
},
|
|
146
197
|
defaultValue: defaultVal,
|
|
@@ -213,10 +264,7 @@ export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T
|
|
|
213
264
|
};
|
|
214
265
|
}
|
|
215
266
|
|
|
216
|
-
|
|
217
|
-
export function parseBooleanEnv(val: string | undefined): boolean {
|
|
218
|
-
return val !== undefined && ['1', 'true', 'TRUE'].includes(val);
|
|
219
|
-
}
|
|
267
|
+
export { parseBooleanEnv } from './parse-env.js';
|
|
220
268
|
|
|
221
269
|
export function secretStringConfigHelper(): Required<
|
|
222
270
|
Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
|
|
@@ -4,9 +4,13 @@ export const NetworkConfigSchema = z
|
|
|
4
4
|
.object({
|
|
5
5
|
bootnodes: z.array(z.string()),
|
|
6
6
|
snapshots: z.array(z.string()),
|
|
7
|
+
blobFileStoreUrls: z.array(z.string()).optional(),
|
|
7
8
|
registryAddress: z.string(),
|
|
8
9
|
feeAssetHandlerAddress: z.string().optional(),
|
|
9
10
|
l1ChainId: z.number(),
|
|
11
|
+
blockDurationMs: z.number().positive().optional(),
|
|
12
|
+
txPublicSetupAllowListExtend: z.string().optional(),
|
|
13
|
+
nodeVersion: z.string().optional(),
|
|
10
14
|
})
|
|
11
15
|
.passthrough(); // Allow additional unknown fields to pass through
|
|
12
16
|
|
|
@@ -5,7 +5,8 @@ export type NetworkNames =
|
|
|
5
5
|
| 'testnet'
|
|
6
6
|
| 'mainnet'
|
|
7
7
|
| 'next-net'
|
|
8
|
-
| 'devnet'
|
|
8
|
+
| 'devnet'
|
|
9
|
+
| `v${number}-devnet-${number}`;
|
|
9
10
|
|
|
10
11
|
export function getActiveNetworkName(name?: string): NetworkNames {
|
|
11
12
|
const network = name || process.env.NETWORK;
|
|
@@ -23,6 +24,8 @@ export function getActiveNetworkName(name?: string): NetworkNames {
|
|
|
23
24
|
return 'next-net';
|
|
24
25
|
} else if (network === 'devnet') {
|
|
25
26
|
return 'devnet';
|
|
27
|
+
} else if (/^v\d+-devnet-\d+$/.test(network)) {
|
|
28
|
+
return network as `v${number}-devnet-${number}`;
|
|
26
29
|
}
|
|
27
30
|
throw new Error(`Unknown network: ${network}`);
|
|
28
31
|
}
|
package/src/crypto/bls/index.ts
CHANGED
|
@@ -1,173 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
BN254_G2_GENERATOR,
|
|
4
|
-
BarretenbergSync,
|
|
5
|
-
type Bn254G1Point as BbApiBn254G1Point,
|
|
6
|
-
type Bn254G2Point as BbApiBn254G2Point,
|
|
7
|
-
} from '@aztec/bb.js';
|
|
8
|
-
|
|
9
|
-
import { Fq, Fr } from '../../fields/fields.js';
|
|
1
|
+
import { Fr } from '../../curves/bn254/field.js';
|
|
2
|
+
import { Bn254G1Point, Bn254G2Point } from '../../curves/bn254/point.js';
|
|
10
3
|
|
|
11
4
|
/**
|
|
12
|
-
* BN254
|
|
13
|
-
*
|
|
5
|
+
* BN254 utility functions for point operations.
|
|
6
|
+
* Provides compression, decompression, and public key generation for the BN254 curve.
|
|
7
|
+
* Uses the bb.js Barretenberg backend for point operations.
|
|
14
8
|
*/
|
|
15
|
-
export class Bn254G1Point {
|
|
16
|
-
constructor(
|
|
17
|
-
public readonly x: Fq,
|
|
18
|
-
public readonly y: Fq,
|
|
19
|
-
) {}
|
|
20
|
-
|
|
21
|
-
private toBbApiPoint(): BbApiBn254G1Point {
|
|
22
|
-
return {
|
|
23
|
-
x: this.x.toBuffer(),
|
|
24
|
-
y: this.y.toBuffer(),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private static fromBbApiPoint(point: BbApiBn254G1Point): Bn254G1Point {
|
|
29
|
-
return new Bn254G1Point(Fq.fromBuffer(Buffer.from(point.x)), Fq.fromBuffer(Buffer.from(point.y)));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async isOnCurve(): Promise<boolean> {
|
|
33
|
-
await BarretenbergSync.initSingleton();
|
|
34
|
-
const api = BarretenbergSync.getSingleton();
|
|
35
|
-
|
|
36
|
-
const apiPoint = this.toBbApiPoint();
|
|
37
|
-
const response = api.bn254G1IsOnCurve({ point: apiPoint });
|
|
38
|
-
return response.isOnCurve;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Get the generator point for BN254 G1, or perform scalar multiplication.
|
|
43
|
-
* When called without arguments, returns the base generator point.
|
|
44
|
-
* When called with a scalar, returns scalar * generator (useful for public key derivation).
|
|
45
|
-
*/
|
|
46
|
-
static async generator(scalar?: Fr): Promise<Bn254G1Point> {
|
|
47
|
-
if (!scalar) {
|
|
48
|
-
return new Bn254G1Point(
|
|
49
|
-
Fq.fromBuffer(Buffer.from(BN254_G1_GENERATOR.x)),
|
|
50
|
-
Fq.fromBuffer(Buffer.from(BN254_G1_GENERATOR.y)),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
await BarretenbergSync.initSingleton();
|
|
55
|
-
const api = BarretenbergSync.getSingleton();
|
|
56
|
-
|
|
57
|
-
const response = api.bn254G1Mul({
|
|
58
|
-
point: BN254_G1_GENERATOR,
|
|
59
|
-
scalar: scalar.toBuffer(),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
return Bn254G1Point.fromBbApiPoint(response.point);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Decompress a BN254 G1 point from compressed form (32 bytes).
|
|
67
|
-
* The compressed format encodes the x-coordinate and the sign bit of the y-coordinate
|
|
68
|
-
* in the most significant bit.
|
|
69
|
-
*/
|
|
70
|
-
static async fromCompressed(compressed: Buffer): Promise<Bn254G1Point> {
|
|
71
|
-
if (compressed.length !== 32) {
|
|
72
|
-
throw new Error('Invalid compressed point length');
|
|
73
|
-
}
|
|
74
|
-
await BarretenbergSync.initSingleton();
|
|
75
|
-
const api = BarretenbergSync.getSingleton();
|
|
76
|
-
|
|
77
|
-
const response = api.bn254G1FromCompressed({
|
|
78
|
-
compressed: new Uint8Array(compressed),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
return Bn254G1Point.fromBbApiPoint(response.point);
|
|
82
|
-
}
|
|
83
9
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// If y is odd, set the most significant bit (bit 255) of the output
|
|
94
|
-
if (yLsb === 1n) {
|
|
95
|
-
xBytes[0] |= 0x80;
|
|
96
|
-
}
|
|
97
|
-
return xBytes;
|
|
98
|
-
}
|
|
10
|
+
/**
|
|
11
|
+
* Generate a compressed BN254 G1 public key from a private key.
|
|
12
|
+
*
|
|
13
|
+
* @param privateKeyHex - Private key as 0x-prefixed hex string
|
|
14
|
+
* @returns Compressed G1 point (32 bytes with sign bit in MSB)
|
|
15
|
+
*/
|
|
16
|
+
export async function computeBn254G1PublicKeyCompressed(privateKeyHex: string): Promise<string> {
|
|
17
|
+
const sk = BigInt(privateKeyHex);
|
|
18
|
+
const skReduced = sk % Fr.MODULUS;
|
|
99
19
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
20
|
+
// Generate G1 point on BN254 curve using bb.js
|
|
21
|
+
const scalar = Fr.fromString(skReduced.toString());
|
|
22
|
+
const pk1 = await Bn254G1Point.generator(scalar);
|
|
103
23
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
24
|
+
// Compress the point using the primitive method
|
|
25
|
+
return '0x' + pk1.compress().toString('hex');
|
|
107
26
|
}
|
|
108
27
|
|
|
109
28
|
/**
|
|
110
|
-
* BN254
|
|
111
|
-
*
|
|
112
|
-
*
|
|
29
|
+
* Generate uncompressed BN254 G1 public key from a private key.
|
|
30
|
+
*
|
|
31
|
+
* @param privateKeyHex - Private key as 0x-prefixed hex string
|
|
32
|
+
* @returns G1 point in affine coordinates
|
|
113
33
|
*/
|
|
114
|
-
export
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
public readonly y: [Fq, Fq],
|
|
118
|
-
) {}
|
|
119
|
-
|
|
120
|
-
private toBbApiPoint(): BbApiBn254G2Point {
|
|
121
|
-
return {
|
|
122
|
-
x: [this.x[0].toBuffer(), this.x[1].toBuffer()],
|
|
123
|
-
y: [this.y[0].toBuffer(), this.y[1].toBuffer()],
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
private static fromBbApiPoint(point: BbApiBn254G2Point): Bn254G2Point {
|
|
128
|
-
return new Bn254G2Point(
|
|
129
|
-
[Fq.fromBuffer(Buffer.from(point.x[0])), Fq.fromBuffer(Buffer.from(point.x[1]))],
|
|
130
|
-
[Fq.fromBuffer(Buffer.from(point.y[0])), Fq.fromBuffer(Buffer.from(point.y[1]))],
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Get the generator point for BN254 G2, or perform scalar multiplication.
|
|
136
|
-
* When called without arguments, returns the base generator point.
|
|
137
|
-
* When called with a scalar, returns scalar * generator.
|
|
138
|
-
*/
|
|
139
|
-
static async generator(scalar?: Fr): Promise<Bn254G2Point> {
|
|
140
|
-
if (!scalar) {
|
|
141
|
-
return new Bn254G2Point(
|
|
142
|
-
[Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.x[0])), Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.x[1]))],
|
|
143
|
-
[Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.y[0])), Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.y[1]))],
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
await BarretenbergSync.initSingleton();
|
|
148
|
-
const api = BarretenbergSync.getSingleton();
|
|
34
|
+
export async function computeBn254G1PublicKey(privateKeyHex: string): Promise<{ x: bigint; y: bigint }> {
|
|
35
|
+
const sk = BigInt(privateKeyHex);
|
|
36
|
+
const skReduced = sk % Fr.MODULUS;
|
|
149
37
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
scalar: scalar.toBuffer(),
|
|
153
|
-
});
|
|
38
|
+
const scalar = Fr.fromString(skReduced.toString());
|
|
39
|
+
const pk1 = await Bn254G1Point.generator(scalar);
|
|
154
40
|
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
equals(other: Bn254G2Point): boolean {
|
|
159
|
-
return (
|
|
160
|
-
this.x[0].equals(other.x[0]) &&
|
|
161
|
-
this.x[1].equals(other.x[1]) &&
|
|
162
|
-
this.y[0].equals(other.y[0]) &&
|
|
163
|
-
this.y[1].equals(other.y[1])
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
toString(): string {
|
|
168
|
-
return `Bn254G2Point(x: (${this.x[0].toString()}, ${this.x[1].toString()}), y: (${this.y[0].toString()}, ${this.y[1].toString()}))`;
|
|
169
|
-
}
|
|
41
|
+
return { x: pk1.x.toBigInt(), y: pk1.y.toBigInt() };
|
|
170
42
|
}
|
|
171
43
|
|
|
172
|
-
|
|
173
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Generate BN254 G2 public key from a private key.
|
|
46
|
+
*
|
|
47
|
+
* @param privateKeyHex - Private key as 0x-prefixed hex string
|
|
48
|
+
* @returns G2 point in affine coordinates
|
|
49
|
+
*/
|
|
50
|
+
export async function computeBn254G2PublicKey(privateKeyHex: string): Promise<{
|
|
51
|
+
x: { c0: bigint; c1: bigint };
|
|
52
|
+
y: { c0: bigint; c1: bigint };
|
|
53
|
+
}> {
|
|
54
|
+
const sk = BigInt(privateKeyHex);
|
|
55
|
+
const skReduced = sk % Fr.MODULUS;
|
|
56
|
+
|
|
57
|
+
const scalar = Fr.fromString(skReduced.toString());
|
|
58
|
+
const pk2 = await Bn254G2Point.generator(scalar);
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
x: { c0: pk2.x[0].toBigInt(), c1: pk2.x[1].toBigInt() },
|
|
62
|
+
y: { c0: pk2.y[0].toBigInt(), c1: pk2.y[1].toBigInt() },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { mapTuple } from '@aztec/foundation/serialize';
|
|
5
5
|
|
|
6
6
|
import type { Signature } from '../signature/index.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BarretenbergSync } from '@aztec/bb.js';
|
|
2
|
-
import { Fr
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
4
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Grumpkin elliptic curve operations.
|