@aztec/aztec 0.82.2-alpha-testnet.4 → 0.82.2-alpha-testnet.5

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/bin/index.js CHANGED
@@ -10,11 +10,10 @@ import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
10
10
  import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
11
11
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
  import { Command } from 'commander';
13
- import { NETWORK_FLAG, aztecStartOptions } from '../cli/aztec_start_options.js';
13
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
14
14
  import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
15
15
  import { injectAztecCommands } from '../cli/index.js';
16
16
  import { getCliVersion } from '../cli/release_version.js';
17
- import { addOptions } from '../cli/util.js';
18
17
  const userLog = createConsoleLogger();
19
18
  const debugLogger = createLogger('cli');
20
19
  /** CLI & full node main entrypoint */ async function main() {
@@ -23,12 +22,14 @@ const debugLogger = createLogger('cli');
23
22
  };
24
23
  process.once('SIGINT', shutdown);
25
24
  process.once('SIGTERM', shutdown);
26
- // We create a temp command object to detect the presence of the network option
27
- // If it has been given then we enrich the environment with the chain config
28
- const tempCmd = new Command('aztec').allowUnknownOption();
29
- addOptions(tempCmd, aztecStartOptions['NETWORK']);
30
- tempCmd.parse(process.argv);
31
- const networkValue = tempCmd.getOptionValue(NETWORK_FLAG);
25
+ // Intercept the setting of a network and enrich the environment with defaults for that network
26
+ let networkValue;
27
+ const args = process.argv.slice(2);
28
+ const networkIndex = args.findIndex((arg)=>arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
29
+ if (networkIndex !== -1) {
30
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
31
+ }
32
+ networkValue = networkValue || process.env.NETWORK;
32
33
  if (networkValue !== undefined) {
33
34
  await enrichEnvironmentWithChainConfig(networkValue);
34
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAgB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAgBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAUD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAsB/E"}
1
+ {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAgB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAgBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAmBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAuB/E"}
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import path from 'path';
2
3
  export const testnetIgnitionL2ChainConfig = {
3
4
  l1ChainId: 11155111,
@@ -22,12 +23,12 @@ export const alphaTestnetL2ChainConfig = {
22
23
  aztecSlotDuration: 36,
23
24
  aztecEpochDuration: 32,
24
25
  aztecProofSubmissionWindow: 64,
25
- testAccounts: true,
26
- sponsoredFPC: false,
26
+ testAccounts: false,
27
+ sponsoredFPC: true,
27
28
  p2pEnabled: true,
28
29
  p2pBootstrapNodes: [],
29
30
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
30
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
31
+ slashFactoryAddress: '',
31
32
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
32
33
  seqMinTxsPerBlock: 0,
33
34
  seqMaxTxsPerBlock: 4,
@@ -65,6 +66,14 @@ function enrichVar(envVar, value) {
65
66
  }
66
67
  process.env[envVar] = value;
67
68
  }
69
+ function enrichEthAddressVar(envVar, value) {
70
+ // EthAddress doesn't like being given empty strings
71
+ if (value === '') {
72
+ enrichVar(envVar, EthAddress.ZERO.toString());
73
+ return;
74
+ }
75
+ enrichVar(envVar, value);
76
+ }
68
77
  export async function enrichEnvironmentWithChainConfig(networkName) {
69
78
  const config = await getL2ChainConfig(networkName);
70
79
  if (!config) {
@@ -79,12 +88,12 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
79
88
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
80
89
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
81
90
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
82
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
83
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
84
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
85
91
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
86
92
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
87
93
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
88
94
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
89
95
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
96
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
97
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
98
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
90
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/aztec",
3
- "version": "0.82.2-alpha-testnet.4",
3
+ "version": "0.82.2-alpha-testnet.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js"
@@ -29,35 +29,35 @@
29
29
  "../package.common.json"
30
30
  ],
31
31
  "dependencies": {
32
- "@aztec/accounts": "0.82.2-alpha-testnet.4",
33
- "@aztec/archiver": "0.82.2-alpha-testnet.4",
34
- "@aztec/aztec-faucet": "0.82.2-alpha-testnet.4",
35
- "@aztec/aztec-node": "0.82.2-alpha-testnet.4",
36
- "@aztec/aztec.js": "0.82.2-alpha-testnet.4",
37
- "@aztec/bb-prover": "0.82.2-alpha-testnet.4",
38
- "@aztec/bb.js": "0.82.2-alpha-testnet.4",
39
- "@aztec/blob-sink": "0.82.2-alpha-testnet.4",
40
- "@aztec/bot": "0.82.2-alpha-testnet.4",
41
- "@aztec/builder": "0.82.2-alpha-testnet.4",
42
- "@aztec/cli": "0.82.2-alpha-testnet.4",
43
- "@aztec/cli-wallet": "0.82.2-alpha-testnet.4",
44
- "@aztec/constants": "0.82.2-alpha-testnet.4",
45
- "@aztec/entrypoints": "0.82.2-alpha-testnet.4",
46
- "@aztec/ethereum": "0.82.2-alpha-testnet.4",
47
- "@aztec/foundation": "0.82.2-alpha-testnet.4",
48
- "@aztec/kv-store": "0.82.2-alpha-testnet.4",
49
- "@aztec/noir-contracts.js": "0.82.2-alpha-testnet.4",
50
- "@aztec/noir-protocol-circuits-types": "0.82.2-alpha-testnet.4",
51
- "@aztec/p2p": "0.82.2-alpha-testnet.4",
52
- "@aztec/p2p-bootstrap": "0.82.2-alpha-testnet.4",
53
- "@aztec/protocol-contracts": "0.82.2-alpha-testnet.4",
54
- "@aztec/prover-client": "0.82.2-alpha-testnet.4",
55
- "@aztec/prover-node": "0.82.2-alpha-testnet.4",
56
- "@aztec/pxe": "0.82.2-alpha-testnet.4",
57
- "@aztec/stdlib": "0.82.2-alpha-testnet.4",
58
- "@aztec/telemetry-client": "0.82.2-alpha-testnet.4",
59
- "@aztec/txe": "0.82.2-alpha-testnet.4",
60
- "@aztec/world-state": "0.82.2-alpha-testnet.4",
32
+ "@aztec/accounts": "0.82.2-alpha-testnet.5",
33
+ "@aztec/archiver": "0.82.2-alpha-testnet.5",
34
+ "@aztec/aztec-faucet": "0.82.2-alpha-testnet.5",
35
+ "@aztec/aztec-node": "0.82.2-alpha-testnet.5",
36
+ "@aztec/aztec.js": "0.82.2-alpha-testnet.5",
37
+ "@aztec/bb-prover": "0.82.2-alpha-testnet.5",
38
+ "@aztec/bb.js": "0.82.2-alpha-testnet.5",
39
+ "@aztec/blob-sink": "0.82.2-alpha-testnet.5",
40
+ "@aztec/bot": "0.82.2-alpha-testnet.5",
41
+ "@aztec/builder": "0.82.2-alpha-testnet.5",
42
+ "@aztec/cli": "0.82.2-alpha-testnet.5",
43
+ "@aztec/cli-wallet": "0.82.2-alpha-testnet.5",
44
+ "@aztec/constants": "0.82.2-alpha-testnet.5",
45
+ "@aztec/entrypoints": "0.82.2-alpha-testnet.5",
46
+ "@aztec/ethereum": "0.82.2-alpha-testnet.5",
47
+ "@aztec/foundation": "0.82.2-alpha-testnet.5",
48
+ "@aztec/kv-store": "0.82.2-alpha-testnet.5",
49
+ "@aztec/noir-contracts.js": "0.82.2-alpha-testnet.5",
50
+ "@aztec/noir-protocol-circuits-types": "0.82.2-alpha-testnet.5",
51
+ "@aztec/p2p": "0.82.2-alpha-testnet.5",
52
+ "@aztec/p2p-bootstrap": "0.82.2-alpha-testnet.5",
53
+ "@aztec/protocol-contracts": "0.82.2-alpha-testnet.5",
54
+ "@aztec/prover-client": "0.82.2-alpha-testnet.5",
55
+ "@aztec/prover-node": "0.82.2-alpha-testnet.5",
56
+ "@aztec/pxe": "0.82.2-alpha-testnet.5",
57
+ "@aztec/stdlib": "0.82.2-alpha-testnet.5",
58
+ "@aztec/telemetry-client": "0.82.2-alpha-testnet.5",
59
+ "@aztec/txe": "0.82.2-alpha-testnet.5",
60
+ "@aztec/world-state": "0.82.2-alpha-testnet.5",
61
61
  "@types/chalk": "^2.2.0",
62
62
  "abitype": "^0.8.11",
63
63
  "chalk": "^5.3.0",
package/src/bin/index.ts CHANGED
@@ -12,11 +12,10 @@ import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
 
13
13
  import { Command } from 'commander';
14
14
 
15
- import { NETWORK_FLAG, aztecStartOptions } from '../cli/aztec_start_options.js';
16
- import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
15
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
16
+ import { type NetworkNames, enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
17
17
  import { injectAztecCommands } from '../cli/index.js';
18
18
  import { getCliVersion } from '../cli/release_version.js';
19
- import { addOptions } from '../cli/util.js';
20
19
 
21
20
  const userLog = createConsoleLogger();
22
21
  const debugLogger = createLogger('cli');
@@ -29,15 +28,20 @@ async function main() {
29
28
  process.once('SIGINT', shutdown);
30
29
  process.once('SIGTERM', shutdown);
31
30
 
32
- // We create a temp command object to detect the presence of the network option
33
- // If it has been given then we enrich the environment with the chain config
34
- const tempCmd = new Command('aztec').allowUnknownOption();
35
- addOptions(tempCmd, aztecStartOptions['NETWORK']);
36
- tempCmd.parse(process.argv);
37
- const networkValue = tempCmd.getOptionValue(NETWORK_FLAG);
31
+ // Intercept the setting of a network and enrich the environment with defaults for that network
32
+ let networkValue: string | undefined;
33
+
34
+ const args = process.argv.slice(2);
35
+ const networkIndex = args.findIndex(arg => arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
36
+
37
+ if (networkIndex !== -1) {
38
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
39
+ }
40
+
41
+ networkValue = networkValue || process.env.NETWORK;
38
42
 
39
43
  if (networkValue !== undefined) {
40
- await enrichEnvironmentWithChainConfig(networkValue);
44
+ await enrichEnvironmentWithChainConfig(networkValue as NetworkNames);
41
45
  }
42
46
 
43
47
  const cliVersion = getCliVersion();
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import type { EnvVar } from '@aztec/foundation/config';
2
3
 
3
4
  import path from 'path';
@@ -46,12 +47,12 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
46
47
  aztecSlotDuration: 36,
47
48
  aztecEpochDuration: 32,
48
49
  aztecProofSubmissionWindow: 64,
49
- testAccounts: true,
50
- sponsoredFPC: false,
50
+ testAccounts: false,
51
+ sponsoredFPC: true,
51
52
  p2pEnabled: true,
52
53
  p2pBootstrapNodes: [],
53
54
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
54
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
55
+ slashFactoryAddress: '',
55
56
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
56
57
  seqMinTxsPerBlock: 0,
57
58
  seqMaxTxsPerBlock: 4,
@@ -92,6 +93,15 @@ function enrichVar(envVar: EnvVar, value: string) {
92
93
  process.env[envVar] = value;
93
94
  }
94
95
 
96
+ function enrichEthAddressVar(envVar: EnvVar, value: string) {
97
+ // EthAddress doesn't like being given empty strings
98
+ if (value === '') {
99
+ enrichVar(envVar, EthAddress.ZERO.toString());
100
+ return;
101
+ }
102
+ enrichVar(envVar, value);
103
+ }
104
+
95
105
  export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
96
106
  const config = await getL2ChainConfig(networkName);
97
107
  if (!config) {
@@ -106,12 +116,13 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
106
116
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
107
117
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
108
118
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
109
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
110
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
111
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
112
119
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
113
120
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
114
121
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
115
122
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
116
123
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
124
+
125
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
126
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
127
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
117
128
  }