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

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 (158) 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/get_block.d.ts +1 -1
  4. package/dest/cmds/aztec_node/get_block.d.ts.map +1 -1
  5. package/dest/cmds/aztec_node/get_block.js +2 -1
  6. package/dest/cmds/aztec_node/get_current_base_fee.d.ts +1 -1
  7. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +1 -1
  8. package/dest/cmds/aztec_node/get_logs.d.ts +3 -2
  9. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
  10. package/dest/cmds/aztec_node/get_node_info.d.ts +1 -1
  11. package/dest/cmds/aztec_node/index.d.ts +1 -1
  12. package/dest/cmds/contracts/index.d.ts +1 -1
  13. package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
  14. package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
  15. package/dest/cmds/contracts/inspect_contract.js +4 -10
  16. package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
  17. package/dest/cmds/infrastructure/index.d.ts +1 -1
  18. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  19. package/dest/cmds/infrastructure/index.js +0 -1
  20. package/dest/cmds/infrastructure/sequencers.d.ts +1 -2
  21. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  22. package/dest/cmds/infrastructure/sequencers.js +9 -3
  23. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  24. package/dest/cmds/l1/advance_epoch.d.ts +1 -1
  25. package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
  26. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  27. package/dest/cmds/l1/assume_proven_through.js +2 -1
  28. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  29. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  30. package/dest/cmds/l1/bridge_erc20.js +2 -1
  31. package/dest/cmds/l1/create_l1_account.d.ts +1 -1
  32. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  33. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  34. package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +39 -4
  35. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
  36. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  37. package/dest/cmds/l1/deploy_new_rollup.js +3 -3
  38. package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
  39. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  40. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  41. package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
  42. package/dest/cmds/l1/get_l1_balance.js +4 -2
  43. package/dest/cmds/l1/governance_utils.d.ts +5 -5
  44. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  45. package/dest/cmds/l1/governance_utils.js +3 -1
  46. package/dest/cmds/l1/index.d.ts +1 -2
  47. package/dest/cmds/l1/index.d.ts.map +1 -1
  48. package/dest/cmds/l1/index.js +10 -8
  49. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  50. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  51. package/dest/cmds/l1/prover_stats.js +32 -30
  52. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +2 -2
  53. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
  54. package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
  55. package/dest/cmds/l1/update_l1_validators.d.ts +6 -6
  56. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  57. package/dest/cmds/l1/update_l1_validators.js +7 -3
  58. package/dest/cmds/misc/compute_selector.d.ts +1 -1
  59. package/dest/cmds/misc/example_contracts.d.ts +1 -1
  60. package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
  61. package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
  62. package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
  63. package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
  64. package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
  65. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +1 -1
  66. package/dest/cmds/misc/index.d.ts +1 -1
  67. package/dest/cmds/misc/index.d.ts.map +1 -1
  68. package/dest/cmds/misc/index.js +1 -1
  69. package/dest/cmds/misc/update/common.d.ts +1 -1
  70. package/dest/cmds/misc/update/github.d.ts +1 -1
  71. package/dest/cmds/misc/update/noir.d.ts +1 -1
  72. package/dest/cmds/misc/update/npm.d.ts +1 -1
  73. package/dest/cmds/misc/update/npm.js +1 -1
  74. package/dest/cmds/misc/update/utils.d.ts +1 -1
  75. package/dest/cmds/misc/update.d.ts +1 -1
  76. package/dest/cmds/validator_keys/add.d.ts +1 -1
  77. package/dest/cmds/validator_keys/add.d.ts.map +1 -1
  78. package/dest/cmds/validator_keys/add.js +20 -7
  79. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +1 -1
  80. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -1
  81. package/dest/cmds/validator_keys/generate_bls_keypair.js +3 -2
  82. package/dest/cmds/validator_keys/index.d.ts +1 -1
  83. package/dest/cmds/validator_keys/index.d.ts.map +1 -1
  84. package/dest/cmds/validator_keys/index.js +16 -4
  85. package/dest/cmds/validator_keys/new.d.ts +7 -4
  86. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  87. package/dest/cmds/validator_keys/new.js +90 -16
  88. package/dest/cmds/validator_keys/shared.d.ts +4 -4
  89. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  90. package/dest/cmds/validator_keys/shared.js +31 -28
  91. package/dest/cmds/validator_keys/staker.d.ts +38 -0
  92. package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
  93. package/dest/cmds/validator_keys/staker.js +210 -0
  94. package/dest/cmds/validator_keys/utils.d.ts +25 -0
  95. package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
  96. package/dest/cmds/validator_keys/utils.js +52 -0
  97. package/dest/config/cached_fetch.d.ts +1 -1
  98. package/dest/config/chain_l2_config.d.ts +13 -11
  99. package/dest/config/chain_l2_config.d.ts.map +1 -1
  100. package/dest/config/chain_l2_config.js +110 -61
  101. package/dest/config/enrich_env.d.ts +1 -1
  102. package/dest/config/get_l1_config.d.ts +3 -2
  103. package/dest/config/get_l1_config.d.ts.map +1 -1
  104. package/dest/config/get_l1_config.js +3 -1
  105. package/dest/config/index.d.ts +1 -1
  106. package/dest/config/network_config.d.ts +6 -3
  107. package/dest/config/network_config.d.ts.map +1 -1
  108. package/dest/config/network_config.js +64 -28
  109. package/dest/utils/aztec.d.ts +7 -13
  110. package/dest/utils/aztec.d.ts.map +1 -1
  111. package/dest/utils/aztec.js +19 -40
  112. package/dest/utils/commands.d.ts +8 -7
  113. package/dest/utils/commands.d.ts.map +1 -1
  114. package/dest/utils/commands.js +6 -5
  115. package/dest/utils/encoding.d.ts +1 -1
  116. package/dest/utils/encoding.js +1 -1
  117. package/dest/utils/github.d.ts +1 -1
  118. package/dest/utils/index.d.ts +1 -1
  119. package/dest/utils/inspect.d.ts +3 -2
  120. package/dest/utils/inspect.d.ts.map +1 -1
  121. package/dest/utils/setup_contracts.d.ts +1 -1
  122. package/package.json +38 -30
  123. package/public_include_metric_prefixes.json +1 -0
  124. package/src/cmds/aztec_node/get_block.ts +2 -1
  125. package/src/cmds/aztec_node/get_logs.ts +3 -2
  126. package/src/cmds/contracts/inspect_contract.ts +4 -11
  127. package/src/cmds/infrastructure/index.ts +0 -1
  128. package/src/cmds/infrastructure/sequencers.ts +5 -4
  129. package/src/cmds/l1/assume_proven_through.ts +4 -1
  130. package/src/cmds/l1/bridge_erc20.ts +2 -1
  131. package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +39 -22
  132. package/src/cmds/l1/deploy_new_rollup.ts +4 -9
  133. package/src/cmds/l1/get_l1_addresses.ts +4 -2
  134. package/src/cmds/l1/get_l1_balance.ts +2 -2
  135. package/src/cmds/l1/governance_utils.ts +3 -8
  136. package/src/cmds/l1/index.ts +7 -17
  137. package/src/cmds/l1/prover_stats.ts +42 -31
  138. package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
  139. package/src/cmds/l1/update_l1_validators.ts +7 -12
  140. package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
  141. package/src/cmds/misc/index.ts +1 -1
  142. package/src/cmds/misc/update/npm.ts +1 -1
  143. package/src/cmds/validator_keys/add.ts +20 -10
  144. package/src/cmds/validator_keys/generate_bls_keypair.ts +3 -2
  145. package/src/cmds/validator_keys/index.ts +67 -21
  146. package/src/cmds/validator_keys/new.ts +110 -23
  147. package/src/cmds/validator_keys/shared.ts +32 -27
  148. package/src/cmds/validator_keys/staker.ts +301 -0
  149. package/src/cmds/validator_keys/utils.ts +81 -0
  150. package/src/config/chain_l2_config.ts +139 -72
  151. package/src/config/get_l1_config.ts +4 -1
  152. package/src/config/network_config.ts +74 -29
  153. package/src/utils/aztec.ts +24 -83
  154. package/src/utils/commands.ts +6 -5
  155. package/src/utils/encoding.ts +1 -1
  156. package/src/utils/inspect.ts +2 -1
  157. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  158. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
- import { type Operator, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
2
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
3
+ import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
3
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
4
- import type { LogFn, Logger } from '@aztec/foundation/log';
5
+ import type { LogFn } from '@aztec/foundation/log';
5
6
  import { getGenesisValues } from '@aztec/world-state/testing';
6
7
 
7
8
  import { deployNewRollupContracts } from '../../utils/aztec.js';
@@ -14,15 +15,12 @@ export async function deployNewRollup(
14
15
  privateKey: string | undefined,
15
16
  mnemonic: string,
16
17
  mnemonicIndex: number,
17
- salt: number | undefined,
18
18
  testAccounts: boolean,
19
19
  sponsoredFPC: boolean,
20
20
  json: boolean,
21
21
  initialValidators: Operator[],
22
22
  realVerifier: boolean,
23
- createVerificationJson: string | false,
24
23
  log: LogFn,
25
- debugLogger: Logger,
26
24
  ) {
27
25
  const config = getL1ContractsConfigEnvVars();
28
26
 
@@ -34,18 +32,15 @@ export async function deployNewRollup(
34
32
  const { rollup, slashFactoryAddress } = await deployNewRollupContracts(
35
33
  registryAddress,
36
34
  rpcUrls,
37
- chainId,
38
35
  privateKey,
36
+ chainId,
39
37
  mnemonic,
40
38
  mnemonicIndex,
41
- salt,
42
39
  initialValidators,
43
40
  genesisArchiveRoot,
44
41
  fundingNeeded,
45
42
  config,
46
43
  realVerifier,
47
- createVerificationJson,
48
- debugLogger,
49
44
  );
50
45
 
51
46
  if (json) {
@@ -1,5 +1,7 @@
1
1
  import { EthAddress } from '@aztec/aztec.js/addresses';
2
- import { RegistryContract, type ViemPublicClient, createEthereumChain } from '@aztec/ethereum';
2
+ import { createEthereumChain } from '@aztec/ethereum/chain';
3
+ import { RegistryContract } from '@aztec/ethereum/contracts';
4
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
3
5
  import type { LogFn } from '@aztec/foundation/log';
4
6
 
5
7
  import { createPublicClient, fallback, http } from 'viem';
@@ -15,7 +17,7 @@ export async function getL1Addresses(
15
17
  const chain = createEthereumChain(rpcUrls, chainId);
16
18
  const publicClient: ViemPublicClient = createPublicClient({
17
19
  chain: chain.chainInfo,
18
- transport: fallback(rpcUrls.map(url => http(url))),
20
+ transport: fallback(rpcUrls.map(url => http(url, { batch: false }))),
19
21
  pollingInterval: 100,
20
22
  });
21
23
  const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress.toString(), rollupVersion);
@@ -1,4 +1,4 @@
1
- import { createEthereumChain } from '@aztec/ethereum';
1
+ import { createEthereumChain } from '@aztec/ethereum/chain';
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
4
  import { TestERC20Abi } from '@aztec/l1-artifacts';
@@ -18,7 +18,7 @@ export async function getL1Balance(
18
18
  const chain = createEthereumChain(l1RpcUrls, chainId);
19
19
  const publicClient = createPublicClient({
20
20
  chain: chain.chainInfo,
21
- transport: fallback(l1RpcUrls.map(url => http(url))),
21
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
22
22
  });
23
23
 
24
24
  let balance = 0n;
@@ -1,11 +1,6 @@
1
- import {
2
- FeeJuiceContract,
3
- GovernanceContract,
4
- ProposalState,
5
- RegistryContract,
6
- createEthereumChain,
7
- createExtendedL1Client,
8
- } from '@aztec/ethereum';
1
+ import { createEthereumChain } from '@aztec/ethereum/chain';
2
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
3
+ import { FeeJuiceContract, GovernanceContract, ProposalState, RegistryContract } from '@aztec/ethereum/contracts';
9
4
  import type { LogFn, Logger } from '@aztec/foundation/log';
10
5
 
11
6
  export async function depositGovernanceTokens({
@@ -3,7 +3,6 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
3
3
 
4
4
  import { type Command, Option } from 'commander';
5
5
 
6
- import { getL1RollupAddressFromEnv } from '../../config/get_l1_config.js';
7
6
  import {
8
7
  ETHEREUM_HOSTS,
9
8
  MNEMONIC,
@@ -15,8 +14,6 @@ import {
15
14
  parseEthereumAddress,
16
15
  } from '../../utils/commands.js';
17
16
 
18
- export { addL1Validator } from './update_l1_validators.js';
19
-
20
17
  const l1RpcUrlsOption = new Option(
21
18
  '--l1-rpc-urls <string>',
22
19
  'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
@@ -42,31 +39,25 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
42
39
  )
43
40
  .option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
44
41
  .addOption(l1ChainIdOption)
45
- .option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
46
42
  .option('--json', 'Output the contract addresses in JSON format')
47
43
  .option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
48
44
  .option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
49
- .option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
50
45
  .option('--real-verifier', 'Deploy the real verifier', false)
51
46
  .option('--existing-token <address>', 'Use an existing ERC20 for both fee and staking', parseEthereumAddress)
52
- .option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
53
47
  .action(async options => {
54
- const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
48
+ const { deployL1ContractsCmd } = await import('./deploy_l1_contracts_cmd.js');
55
49
 
56
50
  const initialValidators =
57
51
  options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
58
- await deployL1Contracts(
52
+ await deployL1ContractsCmd(
59
53
  options.l1RpcUrls,
60
54
  options.l1ChainId,
61
55
  options.privateKey,
62
56
  options.mnemonic,
63
57
  options.mnemonicIndex,
64
- options.salt,
65
58
  options.testAccounts,
66
59
  options.sponsoredFpc,
67
- options.acceleratedTestDeployments,
68
60
  options.json,
69
- options.createVerificationJson,
70
61
  initialValidators,
71
62
  options.realVerifier,
72
63
  options.existingToken,
@@ -89,12 +80,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
89
80
  )
90
81
  .option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
91
82
  .addOption(l1ChainIdOption)
92
- .option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
93
83
  .option('--json', 'Output the contract addresses in JSON format')
94
84
  .option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
95
85
  .option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
96
86
  .option('--real-verifier', 'Deploy the real verifier', false)
97
- .option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
98
87
  .action(async options => {
99
88
  const { deployNewRollup } = await import('./deploy_new_rollup.js');
100
89
 
@@ -107,15 +96,12 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
107
96
  options.privateKey,
108
97
  options.mnemonic,
109
98
  options.mnemonicIndex,
110
- options.salt,
111
99
  options.testAccounts,
112
100
  options.sponsoredFpc,
113
101
  options.json,
114
102
  initialValidators,
115
103
  options.realVerifier,
116
- options.createVerificationJson,
117
104
  log,
118
- debugLogger,
119
105
  );
120
106
  });
121
107
 
@@ -313,7 +299,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
313
299
  .action(async options => {
314
300
  const { addL1ValidatorViaRollup } = await import('./update_l1_validators.js');
315
301
 
316
- const rollupAddress = options.rollup ?? (await getL1RollupAddressFromEnv(options.l1RpcUrls, options.l1ChainId));
302
+ let rollupAddress = options.rollup;
303
+ if (!rollupAddress) {
304
+ const { getL1RollupAddressFromEnv } = await import('../../config/get_l1_config.js');
305
+ rollupAddress = await getL1RollupAddressFromEnv(options.l1RpcUrls, options.l1ChainId);
306
+ }
317
307
 
318
308
  await addL1ValidatorViaRollup({
319
309
  rpcUrls: options.l1RpcUrls,
@@ -1,5 +1,6 @@
1
1
  import { retrieveL2ProofVerifiedEvents } from '@aztec/archiver';
2
- import { type ViemPublicClient, createEthereumChain } from '@aztec/ethereum';
2
+ import { createEthereumChain } from '@aztec/ethereum/chain';
3
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
3
4
  import { compactArray, mapValues, unique } from '@aztec/foundation/collection';
4
5
  import { EthAddress } from '@aztec/foundation/eth-address';
5
6
  import { type LogFn, type Logger, createLogger } from '@aztec/foundation/log';
@@ -46,7 +47,10 @@ export async function proverStats(opts: {
46
47
  .then(a => a.rollupAddress);
47
48
 
48
49
  const chain = createEthereumChain(l1RpcUrls, chainId).chainInfo;
49
- const publicClient = createPublicClient({ chain, transport: fallback(l1RpcUrls.map(url => http(url))) });
50
+ const publicClient = createPublicClient({
51
+ chain,
52
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
53
+ });
50
54
  const lastBlockNum = endBlock ?? (await publicClient.getBlockNumber());
51
55
  debugLog.verbose(`Querying events on rollup at ${rollup.toString()} from ${startBlock} up to ${lastBlockNum}`);
52
56
 
@@ -55,33 +59,40 @@ export async function proverStats(opts: {
55
59
 
56
60
  // If we only care for raw logs, output them
57
61
  if (rawLogs && !provingTimeout) {
58
- log(`l1_block_number, l2_block_number, prover_id, tx_hash`);
62
+ log(`l1_block_number, checkpoint_number, prover_id, tx_hash`);
59
63
  for (const event of events) {
60
- const { l1BlockNumber, l2BlockNumber, proverId, txHash } = event;
61
- log(`${l1BlockNumber}, ${l2BlockNumber}, ${proverId}, ${txHash}`);
64
+ const { l1BlockNumber, checkpointNumber, proverId, txHash } = event;
65
+ log(`${l1BlockNumber}, ${checkpointNumber}, ${proverId}, ${txHash}`);
62
66
  }
63
67
  return;
64
68
  }
65
69
 
66
- // If we don't have a proving timeout, we can just count the number of unique blocks per prover
70
+ // If we don't have a proving timeout, we can just count the number of unique checkpoints per prover
67
71
  if (!provingTimeout) {
68
72
  const stats = groupBy(events, 'proverId');
69
- log(`prover_id, total_blocks_proven`);
73
+ log(`prover_id, total_checkpoints_proven`);
70
74
  for (const proverId in stats) {
71
- const uniqueBlocks = new Set(stats[proverId].map(e => e.l2BlockNumber));
72
- log(`${proverId}, ${uniqueBlocks.size}`);
75
+ const uniqueCheckpoints = new Set(stats[proverId].map(e => e.checkpointNumber));
76
+ log(`${proverId}, ${uniqueCheckpoints.size}`);
73
77
  }
74
78
  return;
75
79
  }
76
80
 
77
- // But if we do, fetch the events for each block submitted, so we can look up their timestamp
78
- const blockEvents = await getL2BlockEvents(startBlock, lastBlockNum, batchSize, debugLog, publicClient, rollup);
81
+ // But if we do, fetch the events for each checkpoint submitted, so we can look up their timestamp
82
+ const checkpointEvents = await getCheckpointProposedEvents(
83
+ startBlock,
84
+ lastBlockNum,
85
+ batchSize,
86
+ debugLog,
87
+ publicClient,
88
+ rollup,
89
+ );
79
90
  debugLog.verbose(
80
- `First L2 block within range is ${blockEvents[0]?.args.blockNumber} at L1 block ${blockEvents[0]?.blockNumber}`,
91
+ `First checkpoint within range is ${checkpointEvents[0]?.args.checkpointNumber} at L1 block ${checkpointEvents[0]?.blockNumber}`,
81
92
  );
82
93
 
83
94
  // Get the timestamps for every block on every log, both for proof and block submissions
84
- const l1BlockNumbers = unique([...events.map(e => e.l1BlockNumber), ...blockEvents.map(e => e.blockNumber)]);
95
+ const l1BlockNumbers = unique([...events.map(e => e.l1BlockNumber), ...checkpointEvents.map(e => e.blockNumber)]);
85
96
  const l1BlockTimestamps: Record<string, bigint> = {};
86
97
  for (const l1Batch of chunk(l1BlockNumbers, Number(batchSize))) {
87
98
  const blocks = await Promise.all(
@@ -93,44 +104,44 @@ export async function proverStats(opts: {
93
104
  }
94
105
  }
95
106
 
96
- // Map from l2 block number to the l1 block in which it was submitted
97
- const l2BlockSubmissions: Record<string, bigint> = {};
98
- for (const blockEvent of blockEvents) {
99
- l2BlockSubmissions[blockEvent.args.blockNumber!.toString()] = blockEvent.blockNumber;
107
+ // Map from checkpoint number to the l1 block in which it was submitted
108
+ const checkpointSubmissions: Record<string, bigint> = {};
109
+ for (const checkpointEvent of checkpointEvents) {
110
+ checkpointSubmissions[checkpointEvent.args.checkpointNumber!.toString()] = checkpointEvent.blockNumber;
100
111
  }
101
112
 
102
113
  // If we want raw logs, output them
103
114
  if (rawLogs) {
104
- log(`l1_block_number, l2_block_number, l2_block_submission_timestamp, proof_timestamp, prover_id, tx_hash`);
115
+ log(`l1_block_number, checkpoint_number, checkpoint_submission_timestamp, proof_timestamp, prover_id, tx_hash`);
105
116
  for (const event of events) {
106
- const { l1BlockNumber, l2BlockNumber, proverId, txHash } = event;
107
- const uploadedBlockNumber = l2BlockSubmissions[l2BlockNumber.toString()];
117
+ const { l1BlockNumber, checkpointNumber, proverId, txHash } = event;
118
+ const uploadedBlockNumber = checkpointSubmissions[checkpointNumber.toString()];
108
119
  if (!uploadedBlockNumber) {
109
120
  continue;
110
121
  }
111
122
  const uploadedTimestamp = l1BlockTimestamps[uploadedBlockNumber.toString()];
112
123
  const provenTimestamp = l1BlockTimestamps[l1BlockNumber.toString()];
113
- log(`${l1BlockNumber}, ${l2BlockNumber}, ${uploadedTimestamp}, ${provenTimestamp}, ${proverId}, ${txHash}`);
124
+ log(`${l1BlockNumber}, ${checkpointNumber}, ${uploadedTimestamp}, ${provenTimestamp}, ${proverId}, ${txHash}`);
114
125
  }
115
126
  return;
116
127
  }
117
128
 
118
129
  // Or calculate stats per prover
119
- const stats = mapValues(groupBy(events, 'proverId'), (blocks, proverId) =>
130
+ const stats = mapValues(groupBy(events, 'proverId'), (checkpoints, proverId) =>
120
131
  compactArray(
121
- blocks.map(e => {
132
+ checkpoints.map(e => {
122
133
  const provenTimestamp = l1BlockTimestamps[e.l1BlockNumber.toString()];
123
- const uploadedBlockNumber = l2BlockSubmissions[e.l2BlockNumber.toString()];
134
+ const uploadedBlockNumber = checkpointSubmissions[e.checkpointNumber.toString()];
124
135
  if (!uploadedBlockNumber) {
125
136
  debugLog.verbose(
126
- `Skipping ${proverId}'s proof for L2 block ${e.l2BlockNumber} as it was before the start block`,
137
+ `Skipping ${proverId}'s proof for checkpoint ${e.checkpointNumber} as it was before the start block`,
127
138
  );
128
139
  return undefined;
129
140
  }
130
141
  const uploadedTimestamp = l1BlockTimestamps[uploadedBlockNumber.toString()];
131
142
  const provingTime = provenTimestamp - uploadedTimestamp;
132
143
  debugLog.debug(
133
- `prover=${e.proverId} blockNumber=${e.l2BlockNumber} uploaded=${uploadedTimestamp} proven=${provenTimestamp} time=${provingTime}`,
144
+ `prover=${e.proverId} checkpointNumber=${e.checkpointNumber} uploaded=${uploadedTimestamp} proven=${provenTimestamp} time=${provingTime}`,
134
145
  );
135
146
  return { provenTimestamp, uploadedTimestamp, provingTime, ...e };
136
147
  }),
@@ -141,8 +152,8 @@ export async function proverStats(opts: {
141
152
  for (const proverId in stats) {
142
153
  const blocks = stats[proverId];
143
154
  const withinTimeout = blocks.filter(b => b.provingTime <= provingTimeout);
144
- const uniqueBlocksWithinTimeout = new Set(withinTimeout.map(e => e.l2BlockNumber));
145
- const uniqueBlocks = new Set(blocks.map(e => e.l2BlockNumber));
155
+ const uniqueBlocksWithinTimeout = new Set(withinTimeout.map(e => e.checkpointNumber));
156
+ const uniqueBlocks = new Set(blocks.map(e => e.checkpointNumber));
146
157
  const avgProvingTime =
147
158
  blocks.length === 0 ? 0 : Math.ceil(Number(blocks.reduce((acc, b) => acc + b.provingTime, 0n)) / blocks.length);
148
159
 
@@ -171,7 +182,7 @@ async function getL2ProofVerifiedEvents(
171
182
  return events;
172
183
  }
173
184
 
174
- async function getL2BlockEvents(
185
+ async function getCheckpointProposedEvents(
175
186
  startBlock: bigint,
176
187
  lastBlockNum: bigint,
177
188
  batchSize: bigint,
@@ -188,14 +199,14 @@ async function getL2BlockEvents(
188
199
  address: getAddress(rollup.toString()),
189
200
  event: getAbiItem({
190
201
  abi: RollupAbi,
191
- name: 'L2BlockProposed',
202
+ name: 'CheckpointProposed',
192
203
  }),
193
204
  fromBlock: blockNum,
194
205
  toBlock: end,
195
206
  });
196
207
 
197
208
  events.push(...newEvents);
198
- debugLog.verbose(`Got ${newEvents.length} events querying l2 block submitted from block ${blockNum} to ${end}`);
209
+ debugLog.verbose(`Got ${newEvents.length} events querying checkpoints submitted from block ${blockNum} to ${end}`);
199
210
  blockNum += batchSize;
200
211
  }
201
212
  return events;
@@ -1,4 +1,5 @@
1
- import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
1
+ import { createEthereumChain } from '@aztec/ethereum/chain';
2
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
2
3
  import type { LogFn } from '@aztec/foundation/log';
3
4
  import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
4
5
 
@@ -1,13 +1,8 @@
1
- import {
2
- GSEContract,
3
- RollupContract,
4
- createEthereumChain,
5
- createExtendedL1Client,
6
- createL1TxUtilsFromViemWallet,
7
- getL1ContractsConfigEnvVars,
8
- getPublicClient,
9
- isAnvilTestChain,
10
- } from '@aztec/ethereum';
1
+ import { createEthereumChain, isAnvilTestChain } from '@aztec/ethereum/chain';
2
+ import { createExtendedL1Client, getPublicClient } from '@aztec/ethereum/client';
3
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
4
+ import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
5
+ import { createL1TxUtilsFromViemWallet } from '@aztec/ethereum/l1-tx-utils';
11
6
  import { EthCheatCodes } from '@aztec/ethereum/test';
12
7
  import type { EthAddress } from '@aztec/foundation/eth-address';
13
8
  import type { LogFn, Logger } from '@aztec/foundation/log';
@@ -299,9 +294,9 @@ export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }: Roll
299
294
  const publicClient = getPublicClient({ l1RpcUrls: rpcUrls, l1ChainId: chainId });
300
295
  const rollup = new RollupContract(publicClient, rollupAddress);
301
296
 
302
- const pendingNum = await rollup.getBlockNumber();
297
+ const pendingNum = await rollup.getCheckpointNumber();
303
298
  log(`Pending block num: ${pendingNum}`);
304
- const provenNum = await rollup.getProvenBlockNumber();
299
+ const provenNum = await rollup.getProvenCheckpointNumber();
305
300
  log(`Proven block num: ${provenNum}`);
306
301
  const validators = await rollup.getAttesters();
307
302
  log(`Validators: ${validators.map(v => v.toString()).join(', ')}`);
@@ -1,5 +1,5 @@
1
1
  import { computeSecretHash } from '@aztec/aztec.js/crypto';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
4
 
5
5
  export async function generateSecretAndHash(log: LogFn) {
@@ -1,5 +1,4 @@
1
1
  import type { LogFn } from '@aztec/foundation/log';
2
- import { printENR } from '@aztec/p2p/enr';
3
2
 
4
3
  import type { Command } from 'commander';
5
4
 
@@ -49,6 +48,7 @@ export function injectCommands(program: Command, log: LogFn) {
49
48
  .description('Decodes and ENR record')
50
49
  .argument('<enr>', 'The encoded ENR string')
51
50
  .action(async (enr: string) => {
51
+ const { printENR } = await import('@aztec/p2p/enr');
52
52
  await printENR(enr, log);
53
53
  });
54
54
 
@@ -9,7 +9,7 @@ import { type SemVer, parse } from 'semver';
9
9
  import type { DependencyChanges } from './common.js';
10
10
  import { atomicUpdateFile } from './utils.js';
11
11
 
12
- const deprecatedNpmPackages = new Set<string>(['@aztec/cli', '@aztec/aztec-sandbox']);
12
+ const deprecatedNpmPackages = new Set<string>(['@aztec/cli', '@aztec/aztec-local-network']);
13
13
  const npmDeprecationMessage = `
14
14
  The following packages have been deprecated and will no longer be updated on the npm registry:
15
15
  ${Array.from(deprecatedNpmPackages)
@@ -16,28 +16,35 @@ import {
16
16
  writeEthJsonV3ToFile,
17
17
  writeKeystoreFile,
18
18
  } from './shared.js';
19
+ import { validateBlsPathOptions, validatePublisherOptions, validateRemoteSignerOptions } from './utils.js';
19
20
 
20
21
  export type AddValidatorKeysOptions = NewValidatorKeystoreOptions;
21
22
 
22
23
  export async function addValidatorKeys(existing: string, options: AddValidatorKeysOptions, log: LogFn) {
24
+ // validate bls-path inputs before proceeding with key generation
25
+ validateBlsPathOptions(options);
26
+ // validate publisher options
27
+ validatePublisherOptions(options);
28
+ // validate remote signer options
29
+ validateRemoteSignerOptions(options);
30
+
23
31
  const {
24
32
  dataDir,
25
33
  file,
26
34
  count,
27
35
  publisherCount = 0,
36
+ publishers,
28
37
  mnemonic,
29
38
  accountIndex = 0,
30
39
  addressIndex,
31
40
  ikm,
32
41
  blsPath,
33
- blsOnly,
34
42
  json,
35
43
  feeRecipient: feeRecipientOpt,
36
44
  coinbase: coinbaseOpt,
37
- fundingAccount: fundingAccountOpt,
38
45
  remoteSigner: remoteSignerOpt,
39
46
  password,
40
- outDir,
47
+ encryptedKeystoreDir,
41
48
  } = options;
42
49
 
43
50
  const validatorCount = typeof count === 'number' && Number.isFinite(count) && count > 0 ? Math.floor(count) : 1;
@@ -55,8 +62,6 @@ export async function addValidatorKeys(existing: string, options: AddValidatorKe
55
62
  throw new Error('feeRecipient is required (either present in existing file or via --fee-recipient)');
56
63
  }
57
64
  const coinbase = (coinbaseOpt as EthAddress | undefined) ?? (first.coinbase as EthAddress | undefined);
58
- const fundingAccount =
59
- (fundingAccountOpt as EthAddress | undefined) ?? (first.fundingAccount as EthAddress | undefined);
60
65
  const derivedRemoteSigner = (first.attester as any)?.remoteSignerUrl || (first.attester as any)?.eth?.remoteSignerUrl;
61
66
  const remoteSigner = remoteSignerOpt ?? derivedRemoteSigner;
62
67
 
@@ -70,26 +75,31 @@ export async function addValidatorKeys(existing: string, options: AddValidatorKe
70
75
  const { validators, summaries } = await buildValidatorEntries({
71
76
  validatorCount,
72
77
  publisherCount,
78
+ publishers,
73
79
  accountIndex,
74
80
  baseAddressIndex: effectiveBaseAddressIndex,
75
81
  mnemonic: mnemonicToUse,
76
82
  ikm,
77
83
  blsPath,
78
- blsOnly,
79
84
  feeRecipient,
80
85
  coinbase,
81
86
  remoteSigner,
82
- fundingAccount,
83
87
  });
84
88
 
85
89
  keystore.validators.push(...validators);
86
90
 
87
91
  // If password provided, write ETH JSON V3 and BLS BN254 keystores and replace plaintext
88
92
  if (password !== undefined) {
89
- const targetDir =
90
- outDir && outDir.length > 0 ? outDir : dataDir && dataDir.length > 0 ? dataDir : dirname(existing);
93
+ let targetDir: string;
94
+ if (encryptedKeystoreDir && encryptedKeystoreDir.length > 0) {
95
+ targetDir = encryptedKeystoreDir;
96
+ } else if (dataDir && dataDir.length > 0) {
97
+ targetDir = dataDir;
98
+ } else {
99
+ targetDir = dirname(existing);
100
+ }
91
101
  await writeEthJsonV3ToFile(keystore.validators, { outDir: targetDir, password });
92
- await writeBlsBn254ToFile(keystore.validators, { outDir: targetDir, password });
102
+ await writeBlsBn254ToFile(keystore.validators, { outDir: targetDir, password, blsPath });
93
103
  }
94
104
 
95
105
  let outputPath = existing;
@@ -1,9 +1,10 @@
1
- import { deriveBlsPrivateKey } from '@aztec/foundation/crypto';
1
+ import { deriveBlsPrivateKey } from '@aztec/foundation/crypto/bls';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
3
 
4
4
  import { writeFile } from 'fs/promises';
5
5
 
6
6
  import { computeBlsPublicKeyCompressed, withValidatorIndex } from './shared.js';
7
+ import { defaultBlsPath } from './utils.js';
7
8
 
8
9
  export type GenerateBlsKeypairOptions = {
9
10
  mnemonic?: string;
@@ -17,7 +18,7 @@ export type GenerateBlsKeypairOptions = {
17
18
 
18
19
  export async function generateBlsKeypair(options: GenerateBlsKeypairOptions, log: LogFn) {
19
20
  const { mnemonic, ikm, blsPath, compressed = true, json, out } = options;
20
- const path = withValidatorIndex(blsPath ?? 'm/12381/3600/0/0/0', 0);
21
+ const path = withValidatorIndex(blsPath ?? defaultBlsPath, 0);
21
22
  const priv = deriveBlsPrivateKey(mnemonic, ikm, path);
22
23
  const pub = await computeBlsPublicKeyCompressed(priv);
23
24
  const result = { path, privateKey: priv, publicKey: pub, format: compressed ? 'compressed' : 'uncompressed' };