@aztec/cli 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa

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 (191) hide show
  1. package/README.md +1 -1
  2. package/dest/cmds/aztec_node/block_number.d.ts +1 -1
  3. package/dest/cmds/aztec_node/block_number.js +1 -1
  4. package/dest/cmds/aztec_node/get_block.d.ts +1 -1
  5. package/dest/cmds/aztec_node/get_block.d.ts.map +1 -1
  6. package/dest/cmds/aztec_node/get_block.js +2 -1
  7. package/dest/cmds/aztec_node/get_current_min_fee.d.ts +3 -0
  8. package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
  9. package/dest/cmds/aztec_node/{get_current_base_fee.js → get_current_min_fee.js} +2 -2
  10. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +1 -1
  11. package/dest/cmds/aztec_node/get_logs.d.ts +30 -3
  12. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
  13. package/dest/cmds/aztec_node/get_logs.js +39 -29
  14. package/dest/cmds/aztec_node/get_node_info.d.ts +1 -1
  15. package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -1
  16. package/dest/cmds/aztec_node/get_node_info.js +0 -2
  17. package/dest/cmds/aztec_node/index.d.ts +1 -1
  18. package/dest/cmds/aztec_node/index.d.ts.map +1 -1
  19. package/dest/cmds/aztec_node/index.js +16 -6
  20. package/dest/cmds/contracts/index.d.ts +1 -1
  21. package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
  22. package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
  23. package/dest/cmds/contracts/inspect_contract.js +4 -10
  24. package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
  25. package/dest/cmds/infrastructure/index.d.ts +1 -1
  26. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  27. package/dest/cmds/infrastructure/index.js +0 -1
  28. package/dest/cmds/infrastructure/sequencers.d.ts +1 -2
  29. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  30. package/dest/cmds/infrastructure/sequencers.js +11 -4
  31. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  32. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  33. package/dest/cmds/infrastructure/setup_l2_contract.js +12 -7
  34. package/dest/cmds/l1/advance_epoch.d.ts +1 -1
  35. package/dest/cmds/l1/assume_proven_through.d.ts +3 -2
  36. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  37. package/dest/cmds/l1/assume_proven_through.js +3 -4
  38. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  39. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  40. package/dest/cmds/l1/bridge_erc20.js +2 -1
  41. package/dest/cmds/l1/compute_genesis_values.d.ts +4 -0
  42. package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
  43. package/dest/cmds/l1/compute_genesis_values.js +17 -0
  44. package/dest/cmds/l1/create_l1_account.d.ts +1 -1
  45. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  46. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  47. package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +39 -5
  48. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
  49. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  50. package/dest/cmds/l1/deploy_new_rollup.js +4 -6
  51. package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
  52. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  53. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  54. package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
  55. package/dest/cmds/l1/get_l1_balance.js +4 -2
  56. package/dest/cmds/l1/governance_utils.d.ts +5 -5
  57. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  58. package/dest/cmds/l1/governance_utils.js +3 -1
  59. package/dest/cmds/l1/index.d.ts +1 -2
  60. package/dest/cmds/l1/index.d.ts.map +1 -1
  61. package/dest/cmds/l1/index.js +17 -10
  62. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  63. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  64. package/dest/cmds/l1/prover_stats.js +32 -30
  65. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +2 -2
  66. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
  67. package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
  68. package/dest/cmds/l1/update_l1_validators.d.ts +7 -7
  69. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  70. package/dest/cmds/l1/update_l1_validators.js +58 -20
  71. package/dest/cmds/misc/compute_selector.d.ts +1 -1
  72. package/dest/cmds/misc/example_contracts.d.ts +1 -1
  73. package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
  74. package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
  75. package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
  76. package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
  77. package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
  78. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +1 -1
  79. package/dest/cmds/misc/index.d.ts +1 -1
  80. package/dest/cmds/misc/index.d.ts.map +1 -1
  81. package/dest/cmds/misc/index.js +1 -1
  82. package/dest/cmds/misc/update/common.d.ts +1 -1
  83. package/dest/cmds/misc/update/github.d.ts +1 -1
  84. package/dest/cmds/misc/update/noir.d.ts +1 -1
  85. package/dest/cmds/misc/update/npm.d.ts +1 -1
  86. package/dest/cmds/misc/update/npm.js +1 -1
  87. package/dest/cmds/misc/update/utils.d.ts +1 -1
  88. package/dest/cmds/misc/update.d.ts +1 -1
  89. package/dest/cmds/validator_keys/add.d.ts +1 -1
  90. package/dest/cmds/validator_keys/add.d.ts.map +1 -1
  91. package/dest/cmds/validator_keys/add.js +20 -7
  92. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts +2 -0
  93. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts.map +1 -0
  94. package/dest/cmds/validator_keys/eth_json_v3_worker.js +27 -0
  95. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +1 -1
  96. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -1
  97. package/dest/cmds/validator_keys/generate_bls_keypair.js +3 -2
  98. package/dest/cmds/validator_keys/index.d.ts +1 -1
  99. package/dest/cmds/validator_keys/index.d.ts.map +1 -1
  100. package/dest/cmds/validator_keys/index.js +17 -4
  101. package/dest/cmds/validator_keys/new.d.ts +12 -4
  102. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  103. package/dest/cmds/validator_keys/new.js +163 -19
  104. package/dest/cmds/validator_keys/shared.d.ts +4 -4
  105. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  106. package/dest/cmds/validator_keys/shared.js +97 -51
  107. package/dest/cmds/validator_keys/staker.d.ts +38 -0
  108. package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
  109. package/dest/cmds/validator_keys/staker.js +210 -0
  110. package/dest/cmds/validator_keys/utils.d.ts +25 -0
  111. package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
  112. package/dest/cmds/validator_keys/utils.js +52 -0
  113. package/dest/config/cached_fetch.d.ts +19 -10
  114. package/dest/config/cached_fetch.d.ts.map +1 -1
  115. package/dest/config/cached_fetch.js +110 -32
  116. package/dest/config/chain_l2_config.d.ts +18 -38
  117. package/dest/config/chain_l2_config.d.ts.map +1 -1
  118. package/dest/config/chain_l2_config.js +48 -463
  119. package/dest/config/enrich_env.d.ts +1 -1
  120. package/dest/config/generated/networks.d.ts +239 -0
  121. package/dest/config/generated/networks.d.ts.map +1 -0
  122. package/dest/config/generated/networks.js +240 -0
  123. package/dest/config/get_l1_config.d.ts +3 -2
  124. package/dest/config/get_l1_config.d.ts.map +1 -1
  125. package/dest/config/get_l1_config.js +3 -1
  126. package/dest/config/index.d.ts +1 -1
  127. package/dest/config/network_config.d.ts +7 -4
  128. package/dest/config/network_config.d.ts.map +1 -1
  129. package/dest/config/network_config.js +70 -30
  130. package/dest/utils/aztec.d.ts +7 -14
  131. package/dest/utils/aztec.d.ts.map +1 -1
  132. package/dest/utils/aztec.js +19 -41
  133. package/dest/utils/commands.d.ts +20 -11
  134. package/dest/utils/commands.d.ts.map +1 -1
  135. package/dest/utils/commands.js +26 -15
  136. package/dest/utils/encoding.d.ts +1 -1
  137. package/dest/utils/encoding.js +1 -1
  138. package/dest/utils/github.d.ts +1 -1
  139. package/dest/utils/index.d.ts +1 -1
  140. package/dest/utils/inspect.d.ts +3 -2
  141. package/dest/utils/inspect.d.ts.map +1 -1
  142. package/dest/utils/inspect.js +15 -12
  143. package/dest/utils/setup_contracts.d.ts +1 -1
  144. package/package.json +44 -31
  145. package/public_include_metric_prefixes.json +1 -0
  146. package/src/cmds/aztec_node/block_number.ts +1 -1
  147. package/src/cmds/aztec_node/get_block.ts +2 -1
  148. package/src/cmds/aztec_node/{get_current_base_fee.ts → get_current_min_fee.ts} +2 -2
  149. package/src/cmds/aztec_node/get_logs.ts +70 -37
  150. package/src/cmds/aztec_node/get_node_info.ts +0 -2
  151. package/src/cmds/aztec_node/index.ts +16 -11
  152. package/src/cmds/contracts/inspect_contract.ts +4 -11
  153. package/src/cmds/infrastructure/index.ts +0 -1
  154. package/src/cmds/infrastructure/sequencers.ts +7 -5
  155. package/src/cmds/infrastructure/setup_l2_contract.ts +12 -7
  156. package/src/cmds/l1/assume_proven_through.ts +4 -4
  157. package/src/cmds/l1/bridge_erc20.ts +2 -1
  158. package/src/cmds/l1/compute_genesis_values.ts +29 -0
  159. package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +39 -23
  160. package/src/cmds/l1/deploy_new_rollup.ts +5 -12
  161. package/src/cmds/l1/get_l1_addresses.ts +4 -2
  162. package/src/cmds/l1/get_l1_balance.ts +2 -2
  163. package/src/cmds/l1/governance_utils.ts +3 -8
  164. package/src/cmds/l1/index.ts +30 -21
  165. package/src/cmds/l1/prover_stats.ts +42 -31
  166. package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
  167. package/src/cmds/l1/update_l1_validators.ts +52 -32
  168. package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
  169. package/src/cmds/misc/index.ts +1 -1
  170. package/src/cmds/misc/update/npm.ts +1 -1
  171. package/src/cmds/validator_keys/add.ts +20 -10
  172. package/src/cmds/validator_keys/eth_json_v3_worker.ts +30 -0
  173. package/src/cmds/validator_keys/generate_bls_keypair.ts +3 -2
  174. package/src/cmds/validator_keys/index.ts +85 -25
  175. package/src/cmds/validator_keys/new.ts +211 -25
  176. package/src/cmds/validator_keys/shared.ts +117 -60
  177. package/src/cmds/validator_keys/staker.ts +301 -0
  178. package/src/cmds/validator_keys/utils.ts +81 -0
  179. package/src/config/cached_fetch.ts +119 -31
  180. package/src/config/chain_l2_config.ts +47 -602
  181. package/src/config/generated/networks.ts +244 -0
  182. package/src/config/get_l1_config.ts +4 -1
  183. package/src/config/network_config.ts +80 -31
  184. package/src/utils/aztec.ts +30 -95
  185. package/src/utils/commands.ts +29 -15
  186. package/src/utils/encoding.ts +1 -1
  187. package/src/utils/inspect.ts +13 -10
  188. package/dest/cmds/aztec_node/get_current_base_fee.d.ts +0 -3
  189. package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +0 -1
  190. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  191. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "0.0.1-commit.b655e406",
3
+ "version": "0.0.1-commit.b8a057fa",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
7
7
  "./devnet": "./dest/cmds/devnet/index.js",
8
8
  "./infrastructure": "./dest/cmds/infrastructure/index.js",
9
9
  "./l1": "./dest/cmds/l1/index.js",
10
+ "./l1/validators": "./dest/cmds/l1/update_l1_validators.js",
10
11
  "./aztec_node": "./dest/cmds/aztec_node/index.js",
11
12
  "./cli-utils": "./dest/utils/index.js",
12
13
  "./misc": "./dest/cmds/misc/index.js",
@@ -14,7 +15,9 @@
14
15
  "./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
15
16
  "./utils": "./dest/utils/index.js",
16
17
  "./inspect": "./dest/utils/inspect.js",
17
- "./config": "./dest/config/index.js"
18
+ "./config": "./dest/config/index.js",
19
+ "./config/chain": "./dest/config/chain_l2_config.js",
20
+ "./config/network": "./dest/config/network_config.js"
18
21
  },
19
22
  "typedocOptions": {
20
23
  "entryPoints": [
@@ -24,13 +27,16 @@
24
27
  "tsconfig": "./tsconfig.json"
25
28
  },
26
29
  "scripts": {
27
- "build": "yarn clean && tsc -b",
28
- "build:dev": "tsc -b --watch",
30
+ "build": "yarn clean && ../scripts/tsc.sh",
31
+ "build:dev": "../scripts/tsc.sh --watch",
29
32
  "clean": "rm -rf ./dest .tsbuildinfo",
33
+ "copy-generated": "mkdir -p dest/config/generated/networks && cp src/config/generated/networks/*.json dest/config/generated/networks/",
34
+ "generate": "./scripts/generate.sh",
30
35
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
31
36
  },
32
37
  "inherits": [
33
- "../package.common.json"
38
+ "../package.common.json",
39
+ "./package.local.json"
34
40
  ],
35
41
  "jest": {
36
42
  "preset": "ts-jest/presets/default-esm",
@@ -71,21 +77,23 @@
71
77
  ]
72
78
  },
73
79
  "dependencies": {
74
- "@aztec/accounts": "0.0.1-commit.b655e406",
75
- "@aztec/archiver": "0.0.1-commit.b655e406",
76
- "@aztec/aztec.js": "0.0.1-commit.b655e406",
77
- "@aztec/constants": "0.0.1-commit.b655e406",
78
- "@aztec/entrypoints": "0.0.1-commit.b655e406",
79
- "@aztec/ethereum": "0.0.1-commit.b655e406",
80
- "@aztec/foundation": "0.0.1-commit.b655e406",
81
- "@aztec/l1-artifacts": "0.0.1-commit.b655e406",
82
- "@aztec/node-keystore": "0.0.1-commit.b655e406",
83
- "@aztec/node-lib": "0.0.1-commit.b655e406",
84
- "@aztec/p2p": "0.0.1-commit.b655e406",
85
- "@aztec/protocol-contracts": "0.0.1-commit.b655e406",
86
- "@aztec/stdlib": "0.0.1-commit.b655e406",
87
- "@aztec/test-wallet": "0.0.1-commit.b655e406",
88
- "@aztec/world-state": "0.0.1-commit.b655e406",
80
+ "@aztec/accounts": "0.0.1-commit.b8a057fa",
81
+ "@aztec/archiver": "0.0.1-commit.b8a057fa",
82
+ "@aztec/aztec.js": "0.0.1-commit.b8a057fa",
83
+ "@aztec/constants": "0.0.1-commit.b8a057fa",
84
+ "@aztec/entrypoints": "0.0.1-commit.b8a057fa",
85
+ "@aztec/ethereum": "0.0.1-commit.b8a057fa",
86
+ "@aztec/foundation": "0.0.1-commit.b8a057fa",
87
+ "@aztec/l1-artifacts": "0.0.1-commit.b8a057fa",
88
+ "@aztec/node-keystore": "0.0.1-commit.b8a057fa",
89
+ "@aztec/node-lib": "0.0.1-commit.b8a057fa",
90
+ "@aztec/p2p": "0.0.1-commit.b8a057fa",
91
+ "@aztec/protocol-contracts": "0.0.1-commit.b8a057fa",
92
+ "@aztec/sequencer-client": "0.0.1-commit.b8a057fa",
93
+ "@aztec/slasher": "0.0.1-commit.b8a057fa",
94
+ "@aztec/stdlib": "0.0.1-commit.b8a057fa",
95
+ "@aztec/wallets": "0.0.1-commit.b8a057fa",
96
+ "@aztec/world-state": "0.0.1-commit.b8a057fa",
89
97
  "@ethersproject/wallet": "^5.8.0",
90
98
  "@iarna/toml": "^2.2.5",
91
99
  "@libp2p/peer-id-factory": "^3.0.4",
@@ -96,9 +104,12 @@
96
104
  "semver": "^7.5.4",
97
105
  "source-map-support": "^0.5.21",
98
106
  "tslib": "^2.4.0",
99
- "viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
107
+ "viem": "npm:@aztec/viem@2.38.2"
100
108
  },
101
109
  "devDependencies": {
110
+ "@aztec/aztec-node": "0.0.1-commit.b8a057fa",
111
+ "@aztec/kv-store": "0.0.1-commit.b8a057fa",
112
+ "@aztec/telemetry-client": "0.0.1-commit.b8a057fa",
102
113
  "@jest/globals": "^30.0.0",
103
114
  "@types/jest": "^30.0.0",
104
115
  "@types/lodash.chunk": "^4.2.9",
@@ -107,6 +118,7 @@
107
118
  "@types/node": "^22.15.17",
108
119
  "@types/semver": "^7.5.2",
109
120
  "@types/source-map-support": "^0.5.10",
121
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
110
122
  "jest": "^30.0.0",
111
123
  "jest-mock-extended": "^4.0.0",
112
124
  "ts-jest": "^29.4.0",
@@ -114,20 +126,21 @@
114
126
  "typescript": "^5.3.3"
115
127
  },
116
128
  "peerDependencies": {
117
- "@aztec/accounts": "0.0.1-commit.b655e406",
118
- "@aztec/bb-prover": "0.0.1-commit.b655e406",
119
- "@aztec/ethereum": "0.0.1-commit.b655e406",
120
- "@aztec/l1-artifacts": "0.0.1-commit.b655e406",
121
- "@aztec/noir-contracts.js": "0.0.1-commit.b655e406",
122
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.b655e406",
123
- "@aztec/noir-test-contracts.js": "0.0.1-commit.b655e406",
124
- "@aztec/protocol-contracts": "0.0.1-commit.b655e406",
125
- "@aztec/stdlib": "0.0.1-commit.b655e406"
129
+ "@aztec/accounts": "0.0.1-commit.b8a057fa",
130
+ "@aztec/bb-prover": "0.0.1-commit.b8a057fa",
131
+ "@aztec/ethereum": "0.0.1-commit.b8a057fa",
132
+ "@aztec/l1-artifacts": "0.0.1-commit.b8a057fa",
133
+ "@aztec/noir-contracts.js": "0.0.1-commit.b8a057fa",
134
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.b8a057fa",
135
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.b8a057fa",
136
+ "@aztec/protocol-contracts": "0.0.1-commit.b8a057fa",
137
+ "@aztec/stdlib": "0.0.1-commit.b8a057fa"
126
138
  },
127
139
  "files": [
128
140
  "dest",
129
141
  "src",
130
- "!*.test.*"
142
+ "!*.test.*",
143
+ "public_include_metric_prefixes.json"
131
144
  ],
132
145
  "types": "./dest/index.d.ts",
133
146
  "engines": {
@@ -0,0 +1 @@
1
+ ["aztec.validator", "aztec.tx_collector", "aztec.mempool", "aztec.p2p.gossip.agg_", "aztec.ivc_verifier.agg_"]
@@ -3,7 +3,7 @@ import type { LogFn } from '@aztec/foundation/log';
3
3
 
4
4
  export async function blockNumber(nodeUrl: string, log: LogFn) {
5
5
  const aztecNode = createAztecNodeClient(nodeUrl);
6
- const [latestNum, provenNum] = await Promise.all([aztecNode.getBlockNumber(), aztecNode.getProvenBlockNumber()]);
6
+ const [latestNum, provenNum] = await Promise.all([aztecNode.getBlockNumber(), aztecNode.getBlockNumber('proven')]);
7
7
  log(`Latest block: ${latestNum}`);
8
8
  log(`Proven block: ${provenNum}`);
9
9
  }
@@ -1,10 +1,11 @@
1
1
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import { BlockNumber } from '@aztec/foundation/branded-types';
2
3
  import type { LogFn } from '@aztec/foundation/log';
3
4
 
4
5
  import { inspectBlock } from '../../utils/inspect.js';
5
6
 
6
7
  export async function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn) {
7
8
  const aztecNode = createAztecNodeClient(nodeUrl);
8
- const blockNumber = maybeBlockNumber ?? (await aztecNode.getBlockNumber());
9
+ const blockNumber: BlockNumber = maybeBlockNumber ? BlockNumber(maybeBlockNumber) : await aztecNode.getBlockNumber();
9
10
  await inspectBlock(aztecNode, blockNumber, log, { showTxs: true });
10
11
  }
@@ -2,8 +2,8 @@ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
2
  import { jsonStringify } from '@aztec/foundation/json-rpc';
3
3
  import type { LogFn, Logger } from '@aztec/foundation/log';
4
4
 
5
- export async function getCurrentBaseFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
5
+ export async function getCurrentMinFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
6
6
  const node = createAztecNodeClient(nodeUrl);
7
- const fees = await node.getCurrentBaseFees();
7
+ const fees = await node.getCurrentMinFees();
8
8
  log(`Current fees: ${jsonStringify(fees)}`);
9
9
  }
@@ -1,21 +1,47 @@
1
1
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
- import type { LogFilter, LogId } from '@aztec/aztec.js/log';
3
2
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
4
3
  import type { TxHash } from '@aztec/aztec.js/tx';
4
+ import type { BlockNumber } from '@aztec/foundation/branded-types';
5
5
  import type { LogFn } from '@aztec/foundation/log';
6
6
  import { sleep } from '@aztec/foundation/sleep';
7
+ import {
8
+ LogCursor,
9
+ type PublicLogsQuery,
10
+ type Tag,
11
+ logResultToHumanReadable,
12
+ queryAllPublicLogsByTags,
13
+ } from '@aztec/stdlib/logs';
7
14
 
8
- export async function getLogs(
9
- txHash: TxHash,
10
- fromBlock: number,
11
- toBlock: number,
12
- afterLog: LogId,
13
- contractAddress: AztecAddress,
14
- nodeUrl: string,
15
- follow: boolean,
16
- log: LogFn,
17
- ) {
18
- const node = createAztecNodeClient(nodeUrl);
15
+ /** Options for the `get-logs` CLI command. */
16
+ export type GetLogsOptions = {
17
+ /** Contract address that emitted the logs (required). */
18
+ contractAddress: AztecAddress;
19
+ /** Tag to filter logs by (required). */
20
+ tag: Tag;
21
+ /** Restrict the search to this tx hash. Mutually exclusive with `fromBlock`/`toBlock`. */
22
+ txHash?: TxHash;
23
+ /** Lower block bound, inclusive. */
24
+ fromBlock?: BlockNumber;
25
+ /** Upper block bound, exclusive. */
26
+ toBlock?: BlockNumber;
27
+ /** Log cursor to resume pagination strictly after a previously-seen log. */
28
+ afterLog?: LogCursor;
29
+ /** Node RPC URL. */
30
+ nodeUrl: string;
31
+ /** When set, polls indefinitely for new logs. Incompatible with `txHash` and `toBlock`. */
32
+ follow: boolean;
33
+ /** Log function. */
34
+ log: LogFn;
35
+ };
36
+
37
+ /**
38
+ * Fetches public logs for a (contract, tag) pair, draining all pages via the stdlib pagination helper.
39
+ * In `--follow` mode, polls indefinitely: each round drains all currently-available logs, then sleeps
40
+ * until the next poll if nothing new was found.
41
+ */
42
+ export async function getLogs(options: GetLogsOptions): Promise<void> {
43
+ const { txHash, fromBlock, toBlock, contractAddress, tag, nodeUrl, follow, log } = options;
44
+ let afterLog = options.afterLog;
19
45
 
20
46
  if (follow) {
21
47
  if (txHash) {
@@ -25,43 +51,50 @@ export async function getLogs(
25
51
  throw Error('Cannot use --follow with --to-block');
26
52
  }
27
53
  }
54
+ if (txHash !== undefined && (fromBlock !== undefined || toBlock !== undefined)) {
55
+ throw Error('Cannot combine --tx-hash with --from-block / --to-block');
56
+ }
28
57
 
29
- const filter: LogFilter = { txHash, fromBlock, toBlock, afterLog, contractAddress };
30
-
31
- const fetchLogs = async () => {
32
- const response = await node.getPublicLogs(filter);
33
- const logs = response.logs;
58
+ const node = createAztecNodeClient(nodeUrl);
34
59
 
35
- if (!logs.length) {
36
- const filterOptions = Object.entries(filter)
37
- .filter(([, value]) => value !== undefined)
38
- .map(([key, value]) => `${key}: ${value}`)
39
- .join(', ');
40
- if (!follow) {
41
- log(`No logs found for filter: {${filterOptions}}`);
42
- }
43
- } else {
44
- if (!follow && !filter.afterLog) {
45
- log('Logs found: \n');
46
- }
47
- logs.forEach(publicLog => log(publicLog.toHumanReadable()));
48
- // Set the continuation parameter for the following requests
49
- filter.afterLog = logs[logs.length - 1].id;
60
+ const drainLogs = async () => {
61
+ const query: PublicLogsQuery = {
62
+ contractAddress,
63
+ tags: [afterLog !== undefined ? { tag, afterLog } : tag],
64
+ fromBlock,
65
+ toBlock,
66
+ txHash,
67
+ };
68
+ const [logsForTag] = await queryAllPublicLogsByTags(node, query);
69
+ if (logsForTag.length > 0) {
70
+ afterLog = LogCursor.fromLog(logsForTag[logsForTag.length - 1]);
50
71
  }
51
- return response.maxLogsHit;
72
+ return logsForTag;
52
73
  };
53
74
 
54
75
  if (follow) {
55
76
  log('Fetching logs...');
56
77
  while (true) {
57
- const maxLogsHit = await fetchLogs();
58
- if (!maxLogsHit) {
78
+ const results = await drainLogs();
79
+ if (results.length === 0) {
59
80
  await sleep(1000);
81
+ } else {
82
+ results.forEach(r => log(logResultToHumanReadable(r)));
60
83
  }
61
84
  }
62
85
  } else {
63
- while (await fetchLogs()) {
64
- // Keep fetching logs until we reach the end.
86
+ const results = await drainLogs();
87
+ if (results.length === 0) {
88
+ log(
89
+ `No logs found for {contractAddress: ${contractAddress.toString()}, tag: ${tag.toString()}` +
90
+ `${txHash ? `, txHash: ${txHash.toString()}` : ''}` +
91
+ `${fromBlock !== undefined ? `, fromBlock: ${fromBlock}` : ''}` +
92
+ `${toBlock !== undefined ? `, toBlock: ${toBlock}` : ''}` +
93
+ `${afterLog ? `, afterLog: ${afterLog.toString()}` : ''}}`,
94
+ );
95
+ } else {
96
+ log('Logs found: \n');
97
+ results.forEach(r => log(logResultToHumanReadable(r)));
65
98
  }
66
99
  }
67
100
  }
@@ -23,7 +23,6 @@ export async function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, lo
23
23
  rewardDistributor: info.l1ContractAddresses.rewardDistributorAddress.toString(),
24
24
  governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(),
25
25
  governance: info.l1ContractAddresses.governanceAddress.toString(),
26
- slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString(),
27
26
  feeAssetHandler: info.l1ContractAddresses.feeAssetHandlerAddress?.toString(),
28
27
  stakingAssetHandler: info.l1ContractAddresses.stakingAssetHandlerAddress?.toString(),
29
28
  },
@@ -51,7 +50,6 @@ export async function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, lo
51
50
  log(` RewardDistributor Address: ${info.l1ContractAddresses.rewardDistributorAddress.toString()}`);
52
51
  log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`);
53
52
  log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`);
54
- log(` SlashFactory Address: ${info.l1ContractAddresses.slashFactoryAddress?.toString()}`);
55
53
  log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
56
54
  log(` StakingAssetHandler Address: ${info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
57
55
  log(`L2 Contract Addresses:`);
@@ -7,10 +7,10 @@ import {
7
7
  nodeOption,
8
8
  parseAztecAddress,
9
9
  parseField,
10
- parseOptionalAztecAddress,
11
10
  parseOptionalInteger,
12
- parseOptionalLogId,
11
+ parseOptionalLogCursor,
13
12
  parseOptionalTxHash,
13
+ parseTag,
14
14
  } from '../../utils/commands.js';
15
15
 
16
16
  export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
@@ -25,12 +25,12 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
25
25
  });
26
26
 
27
27
  program
28
- .command('get-current-base-fee')
28
+ .command('get-current-min-fee')
29
29
  .description('Gets the current base fee.')
30
30
  .addOption(nodeOption)
31
31
  .action(async options => {
32
- const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
33
- await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
32
+ const { getCurrentMinFee } = await import('./get_current_min_fee.js');
33
+ await getCurrentMinFee(options.rpcUrl, debugLogger, log);
34
34
  });
35
35
 
36
36
  program
@@ -47,21 +47,26 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
47
47
 
48
48
  program
49
49
  .command('get-logs')
50
- .description('Gets all the public logs from an intersection of all the filter params.')
51
- .option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
50
+ .description('Gets public logs for a contract and tag, optionally restricted by block range or tx hash.')
51
+ .requiredOption('-ca, --contract-address <address>', 'Contract address that emitted the logs.', parseAztecAddress)
52
+ .requiredOption('--tag <tag>', 'Tag (Fr value) to filter logs by.', parseTag)
53
+ .option('-tx, --tx-hash <txHash>', 'A transaction hash to restrict the search to.', parseOptionalTxHash)
52
54
  .option(
53
55
  '-fb, --from-block <blockNum>',
54
56
  'Initial block number for getting logs (defaults to 1).',
55
57
  parseOptionalInteger,
56
58
  )
57
59
  .option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
58
- .option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
59
- .option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
60
+ .option(
61
+ '-al --after-log <cursor>',
62
+ 'Log cursor of the form <blockNumber>-<txIndexWithinBlock>-<logIndexWithinTx> to resume pagination after.',
63
+ parseOptionalLogCursor,
64
+ )
60
65
  .addOption(nodeOption)
61
66
  .option('--follow', 'If set, will keep polling for new logs until interrupted.')
62
- .action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow }) => {
67
+ .action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, tag, nodeUrl, follow }) => {
63
68
  const { getLogs } = await import('./get_logs.js');
64
- await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
69
+ await getLogs({ txHash, fromBlock, toBlock, afterLog, contractAddress, tag, nodeUrl, follow, log });
65
70
  });
66
71
 
67
72
  program
@@ -1,4 +1,4 @@
1
- import { sha256 } from '@aztec/foundation/crypto';
1
+ import { sha256 } from '@aztec/foundation/crypto/sha256';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
3
  import {
4
4
  type FunctionArtifact,
@@ -29,16 +29,9 @@ export async function inspectContract(contractArtifactFile: string, debugLogger:
29
29
  log(`\tpublic bytecode commitment: ${contractClass.publicBytecodeCommitment.toString()}`);
30
30
  log(`\tpublic bytecode length: ${contractClass.packedBytecode.length} bytes (${bytecodeLengthInFields} fields)`);
31
31
 
32
- const externalFunctions = contractFns.filter(f => !f.isInternal);
33
- if (externalFunctions.length > 0) {
34
- log(`\nExternal functions:`);
35
- await Promise.all(externalFunctions.map(f => logFunction(f, log)));
36
- }
37
-
38
- const internalFunctions = contractFns.filter(f => f.isInternal);
39
- if (internalFunctions.length > 0) {
40
- log(`\nInternal functions:`);
41
- await Promise.all(internalFunctions.map(f => logFunction(f, log)));
32
+ if (contractFns.length > 0) {
33
+ log(`\nExternal contract functions:`);
34
+ await Promise.all(contractFns.map(f => logFunction(f, log)));
42
35
  }
43
36
  }
44
37
 
@@ -44,7 +44,6 @@ export function injectCommands(program: Command, log: LogFn) {
44
44
  nodeUrl: options.nodeUrl,
45
45
  l1RpcUrls: options.l1RpcUrls,
46
46
  chainId: options.l1ChainId,
47
- blockNumber: options.blockNumber,
48
47
  log,
49
48
  });
50
49
  });
@@ -1,6 +1,8 @@
1
1
  import { Fr } from '@aztec/aztec.js/fields';
2
2
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
3
- import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
+ import { createEthereumChain } from '@aztec/ethereum/chain';
4
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
5
+ import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
4
6
  import type { LogFn } from '@aztec/foundation/log';
5
7
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
6
8
 
@@ -15,7 +17,6 @@ export async function sequencers(opts: {
15
17
  nodeUrl: string;
16
18
  l1RpcUrls: string[];
17
19
  chainId: number;
18
- blockNumber?: number;
19
20
  log: LogFn;
20
21
  }) {
21
22
  const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
@@ -25,14 +26,14 @@ export async function sequencers(opts: {
25
26
  const chain = createEthereumChain(l1RpcUrls, chainId);
26
27
  const publicClient = createPublicClient({
27
28
  chain: chain.chainInfo,
28
- transport: fallback(l1RpcUrls.map(url => http(url))),
29
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
29
30
  });
30
31
 
31
32
  const walletClient = mnemonic
32
33
  ? createWalletClient({
33
34
  account: mnemonicToAccount(mnemonic),
34
35
  chain: chain.chainInfo,
35
- transport: fallback(l1RpcUrls.map(url => http(url))),
36
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
36
37
  })
37
38
  : undefined;
38
39
 
@@ -65,8 +66,9 @@ export async function sequencers(opts: {
65
66
 
66
67
  log(`Adding ${who} as sequencer`);
67
68
 
69
+ const stakingAssetAddress = await rollup.getStakingAsset();
68
70
  const stakingAsset = getContract({
69
- address: await rollup.getStakingAsset(),
71
+ address: stakingAssetAddress.toString(),
70
72
  abi: TestERC20Abi,
71
73
  client: walletClient,
72
74
  });
@@ -1,33 +1,38 @@
1
1
  import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
- import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
3
3
  import type { WaitOpts } from '@aztec/aztec.js/contracts';
4
4
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
5
+ import { TxStatus } from '@aztec/aztec.js/tx';
5
6
  import { AccountManager } from '@aztec/aztec.js/wallet';
6
7
  import { jsonStringify } from '@aztec/foundation/json-rpc';
7
8
  import type { LogFn } from '@aztec/foundation/log';
8
9
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
9
- import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
10
+ import { EmbeddedWallet } from '@aztec/wallets/embedded';
11
+ import { createFundedInitializerlessAccounts } from '@aztec/wallets/testing';
10
12
 
11
13
  export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn) {
12
14
  const waitOpts: WaitOpts = {
13
15
  timeout: 180,
14
16
  interval: 1,
17
+ // The embedded wallet defaults to PROPOSED, which can be dropped if its proposed block is pruned
18
+ // before the checkpoint lands. Wait for the checkpoint so serial setup is reliable.
19
+ waitForStatus: TxStatus.CHECKPOINTED,
15
20
  };
16
21
  log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
17
22
  log('setupL2Contracts: Creating PXE client...');
18
23
  const node = createAztecNodeClient(nodeUrl);
19
- const wallet = await TestWallet.create(node);
24
+ const wallet = await EmbeddedWallet.create(node);
20
25
 
21
- let deployedAccountManagers: AccountManager[] = [];
26
+ let accountManagers: AccountManager[] = [];
22
27
  if (testAccounts) {
23
- log('setupL2Contracts: Deploying test accounts...');
28
+ log('setupL2Contracts: Creating test accounts...');
24
29
  const initialAccountsData = await getInitialTestAccountsData();
25
- deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, node, initialAccountsData, waitOpts);
30
+ accountManagers = await createFundedInitializerlessAccounts(wallet, initialAccountsData);
26
31
  }
27
32
 
28
33
  if (json) {
29
34
  const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
30
- deployedAccountManagers.forEach((a, i) => {
35
+ accountManagers.forEach((a, i) => {
31
36
  toPrint[`testAccount${i}`] = a.address;
32
37
  });
33
38
  log(JSON.stringify(toPrint, null, 2));
@@ -1,20 +1,20 @@
1
1
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
2
  import { RollupCheatCodes } from '@aztec/ethereum/test';
3
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
3
4
  import type { LogFn } from '@aztec/foundation/log';
4
5
  import { DateProvider } from '@aztec/foundation/timer';
5
6
 
6
7
  export async function assumeProvenThrough(
7
- blockNumberOrLatest: number | undefined,
8
+ checkpointOrLatest: CheckpointNumber | undefined,
8
9
  l1RpcUrls: string[],
9
10
  nodeUrl: string,
10
11
  log: LogFn,
11
12
  ) {
12
13
  const aztecNode = createAztecNodeClient(nodeUrl);
13
14
  const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
14
- const blockNumber = blockNumberOrLatest ?? (await aztecNode.getBlockNumber());
15
15
 
16
16
  const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
17
17
 
18
- await rollupCheatCodes.markAsProven(blockNumber);
19
- log(`Assumed proven through block ${blockNumber}`);
18
+ await rollupCheatCodes.markAsProven(checkpointOrLatest);
19
+ log(`Assumed proven through checkpoint ${checkpointOrLatest ?? 'latest'}`);
20
20
  }
@@ -1,7 +1,8 @@
1
1
  import type { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
2
2
  import { L1ToL2TokenPortalManager } from '@aztec/aztec.js/ethereum';
3
3
  import type { Fr } from '@aztec/aztec.js/fields';
4
- import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
4
+ import { createEthereumChain } from '@aztec/ethereum/chain';
5
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
5
6
  import type { LogFn, Logger } from '@aztec/foundation/log';
6
7
 
7
8
  import { prettyPrintJSON } from '../../utils/commands.js';
@@ -0,0 +1,29 @@
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
4
+ import { getGenesisValues } from '@aztec/world-state/testing';
5
+
6
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
7
+
8
+ /** Computes and prints genesis values needed for L1 contract deployment. */
9
+ export async function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn) {
10
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
11
+ const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
12
+ const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddresses);
13
+ const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
14
+
15
+ const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
16
+ const vkTreeRoot = getVKTreeRoot();
17
+
18
+ log(
19
+ JSON.stringify(
20
+ {
21
+ vkTreeRoot: vkTreeRoot.toString(),
22
+ protocolContractsHash: protocolContractsHash.toString(),
23
+ genesisArchiveRoot: genesisArchiveRoot.toString(),
24
+ },
25
+ null,
26
+ 2,
27
+ ),
28
+ );
29
+ }