@aztec/aztec 2.0.0-rc.8 → 2.0.2-rc.2

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
@@ -2,6 +2,7 @@
2
2
  //
3
3
  import { injectCommands as injectBuilderCommands } from '@aztec/builder';
4
4
  import { injectCommands as injectWalletCommands } from '@aztec/cli-wallet';
5
+ import { enrichEnvironmentWithChainConfig } from '@aztec/cli/config';
5
6
  import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
6
7
  import { injectCommands as injectDevnetCommands } from '@aztec/cli/devnet';
7
8
  import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
@@ -12,7 +13,6 @@ import { getActiveNetworkName } from '@aztec/foundation/config';
12
13
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
13
14
  import { Command } from 'commander';
14
15
  import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
15
- import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
16
16
  import { injectAztecCommands } from '../cli/index.js';
17
17
  import { getCliVersion } from '../cli/release_version.js';
18
18
  const userLog = createConsoleLogger();
@@ -1 +1 @@
1
- {"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAQlF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhD,oCAAoC;AACpC,wBAAsB,aAAa,CACjC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,GAAG,eAAe,CAAA;CAAE,CAAC,CAmCvD"}
1
+ {"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAOlF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhD,oCAAoC;AACpC,wBAAsB,aAAa,CACjC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,GAAG,eAAe,CAAA;CAAE,CAAC,CAmCvD"}
@@ -1,11 +1,11 @@
1
1
  import { Archiver, KVArchiverDataStore, archiverConfigMappings, getArchiverConfigFromEnv } from '@aztec/archiver';
2
2
  import { createLogger } from '@aztec/aztec.js';
3
3
  import { blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
4
+ import { getL1Config } from '@aztec/cli/config';
4
5
  import { dataConfigMappings } from '@aztec/kv-store/config';
5
6
  import { createStore } from '@aztec/kv-store/lmdb-v2';
6
7
  import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
7
8
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
8
- import { getL1Config } from '../get_l1_config.js';
9
9
  import { extractRelevantOptions } from '../util.js';
10
10
  /** Starts a standalone archiver. */ export async function startArchiver(options, signalHandlers, services) {
11
11
  const envConfig = getArchiverConfigFromEnv();
@@ -1 +1 @@
1
- {"version":3,"file":"start_blob_sink.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_blob_sink.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,wBAAsB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,iBA4CxG"}
1
+ {"version":3,"file":"start_blob_sink.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_blob_sink.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,iBA4CxG"}
@@ -1,6 +1,6 @@
1
1
  import { blobSinkConfigMappings, createBlobSinkServer, getBlobSinkConfigFromEnv } from '@aztec/blob-sink/server';
2
+ import { getL1Config } from '@aztec/cli/config';
2
3
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
3
- import { getL1Config } from '../get_l1_config.js';
4
4
  import { extractRelevantOptions } from '../util.js';
5
5
  export async function startBlobSink(options, signalHandlers, userLog) {
6
6
  if (options.prover || options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
@@ -1,6 +1,6 @@
1
1
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
- import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
3
+ import { type AztecNode, type PXE } from '@aztec/stdlib/interfaces/client';
4
4
  import type { TelemetryClient } from '@aztec/telemetry-client';
5
5
  export declare function startBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<void>;
6
6
  export declare function addBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, deps: {
@@ -1 +1 @@
1
- {"version":3,"file":"start_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK/D,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBAkBf;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,iBAWlE"}
1
+ {"version":3,"file":"start_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAyB,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAU/D,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBA2Bf;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,iBAWlE"}
@@ -1,22 +1,37 @@
1
1
  import { BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
2
- import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
2
+ import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
3
+ import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient, makeTracedFetch } from '@aztec/telemetry-client';
3
4
  import { extractRelevantOptions } from '../util.js';
5
+ import { getVersions } from '../versioning.js';
4
6
  export async function startBot(options, signalHandlers, services, userLog) {
5
7
  const { proverNode, archiver, sequencer, p2pBootstrap, txe, prover } = options;
6
8
  if (proverNode || archiver || sequencer || p2pBootstrap || txe || prover) {
7
9
  userLog(`Starting a bot with --prover-node, --prover, --archiver, --sequencer, --p2p-bootstrap, or --txe is not supported.`);
8
10
  process.exit(1);
9
11
  }
12
+ const fetch = makeTracedFetch([
13
+ 1,
14
+ 2,
15
+ 3
16
+ ], true);
17
+ const config = extractRelevantOptions(options, botConfigMappings, 'bot');
18
+ if (!config.nodeUrl) {
19
+ throw new Error('The bot requires access to a Node');
20
+ }
21
+ const node = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
10
22
  // Start a PXE client that is used by the bot if required
11
23
  let pxe;
12
24
  if (options.pxe) {
13
25
  const { addPXE } = await import('./start_pxe.js');
14
- ({ pxe } = await addPXE(options, signalHandlers, services, userLog));
26
+ ({ pxe } = await addPXE(options, signalHandlers, services, userLog, {
27
+ node
28
+ }));
15
29
  }
16
30
  const telemetry = initTelemetryClient(getTelemetryClientConfig());
17
31
  await addBot(options, signalHandlers, services, {
18
32
  pxe,
19
- telemetry
33
+ telemetry,
34
+ node
20
35
  });
21
36
  }
22
37
  export function addBot(options, signalHandlers, services, deps) {
@@ -1 +1 @@
1
- {"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAKpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAmBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CA4HtC"}
1
+ {"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAMpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAkBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CA4HtC"}
@@ -2,6 +2,7 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
2
  import { aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node';
3
3
  import { Fr } from '@aztec/aztec.js';
4
4
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
5
+ import { getL1Config } from '@aztec/cli/config';
5
6
  import { getPublicClient } from '@aztec/ethereum';
6
7
  import { SecretValue } from '@aztec/foundation/config';
7
8
  import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
@@ -9,7 +10,6 @@ import { P2PApiSchema } from '@aztec/stdlib/interfaces/server';
9
10
  import { initTelemetryClient, telemetryClientConfigMappings } from '@aztec/telemetry-client';
10
11
  import { getGenesisValues } from '@aztec/world-state/testing';
11
12
  import { createAztecNode } from '../../sandbox/index.js';
12
- import { getL1Config } from '../get_l1_config.js';
13
13
  import { extractNamespacedOptions, extractRelevantOptions, preloadCrsDataForVerifying, setupUpdateMonitor } from '../util.js';
14
14
  export async function startNode(options, signalHandlers, services, adminServices, userLog) {
15
15
  // All options set from environment variables
@@ -1 +1 @@
1
- {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA+BnE"}
1
+ {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKxE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA+BnE"}
@@ -1,7 +1,7 @@
1
+ import { getL1Config } from '@aztec/cli/config';
1
2
  import { ProvingJobBrokerSchema, createAndStartProvingBroker, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
2
3
  import { getProverNodeBrokerConfigFromEnv } from '@aztec/prover-node';
3
4
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
4
- import { getL1Config } from '../get_l1_config.js';
5
5
  import { extractRelevantOptions } from '../util.js';
6
6
  export async function startProverBroker(options, signalHandlers, services, userLog) {
7
7
  if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
@@ -1 +1 @@
1
- {"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAU5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CA0FvC"}
1
+ {"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAS5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CA0FvC"}
@@ -1,6 +1,7 @@
1
1
  import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
2
  import { Fr } from '@aztec/aztec.js';
3
3
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
4
+ import { getL1Config } from '@aztec/cli/config';
4
5
  import { getPublicClient } from '@aztec/ethereum';
5
6
  import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
6
7
  import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
@@ -8,7 +9,6 @@ import { createProverNode, getProverNodeConfigFromEnv, proverNodeConfigMappings
8
9
  import { P2PApiSchema, ProverNodeApiSchema } from '@aztec/stdlib/interfaces/server';
9
10
  import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
10
11
  import { getGenesisValues } from '@aztec/world-state/testing';
11
- import { getL1Config } from '../get_l1_config.js';
12
12
  import { extractRelevantOptions, preloadCrsDataForVerifying, setupUpdateMonitor } from '../util.js';
13
13
  import { getVersions } from '../versioning.js';
14
14
  import { startProverBroker } from './start_prover_broker.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/aztec",
3
- "version": "2.0.0-rc.8",
3
+ "version": "2.0.2-rc.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -28,37 +28,37 @@
28
28
  "../package.common.json"
29
29
  ],
30
30
  "dependencies": {
31
- "@aztec/accounts": "2.0.0-rc.8",
32
- "@aztec/archiver": "2.0.0-rc.8",
33
- "@aztec/aztec-faucet": "2.0.0-rc.8",
34
- "@aztec/aztec-node": "2.0.0-rc.8",
35
- "@aztec/aztec.js": "2.0.0-rc.8",
36
- "@aztec/bb-prover": "2.0.0-rc.8",
37
- "@aztec/bb.js": "2.0.0-rc.8",
38
- "@aztec/blob-sink": "2.0.0-rc.8",
39
- "@aztec/bot": "2.0.0-rc.8",
40
- "@aztec/builder": "2.0.0-rc.8",
41
- "@aztec/cli": "2.0.0-rc.8",
42
- "@aztec/cli-wallet": "2.0.0-rc.8",
43
- "@aztec/constants": "2.0.0-rc.8",
44
- "@aztec/entrypoints": "2.0.0-rc.8",
45
- "@aztec/ethereum": "2.0.0-rc.8",
46
- "@aztec/foundation": "2.0.0-rc.8",
47
- "@aztec/kv-store": "2.0.0-rc.8",
48
- "@aztec/l1-artifacts": "2.0.0-rc.8",
49
- "@aztec/node-lib": "2.0.0-rc.8",
50
- "@aztec/noir-contracts.js": "2.0.0-rc.8",
51
- "@aztec/noir-protocol-circuits-types": "2.0.0-rc.8",
52
- "@aztec/p2p": "2.0.0-rc.8",
53
- "@aztec/p2p-bootstrap": "2.0.0-rc.8",
54
- "@aztec/protocol-contracts": "2.0.0-rc.8",
55
- "@aztec/prover-client": "2.0.0-rc.8",
56
- "@aztec/prover-node": "2.0.0-rc.8",
57
- "@aztec/pxe": "2.0.0-rc.8",
58
- "@aztec/stdlib": "2.0.0-rc.8",
59
- "@aztec/telemetry-client": "2.0.0-rc.8",
60
- "@aztec/txe": "2.0.0-rc.8",
61
- "@aztec/world-state": "2.0.0-rc.8",
31
+ "@aztec/accounts": "2.0.2-rc.2",
32
+ "@aztec/archiver": "2.0.2-rc.2",
33
+ "@aztec/aztec-faucet": "2.0.2-rc.2",
34
+ "@aztec/aztec-node": "2.0.2-rc.2",
35
+ "@aztec/aztec.js": "2.0.2-rc.2",
36
+ "@aztec/bb-prover": "2.0.2-rc.2",
37
+ "@aztec/bb.js": "2.0.2-rc.2",
38
+ "@aztec/blob-sink": "2.0.2-rc.2",
39
+ "@aztec/bot": "2.0.2-rc.2",
40
+ "@aztec/builder": "2.0.2-rc.2",
41
+ "@aztec/cli": "2.0.2-rc.2",
42
+ "@aztec/cli-wallet": "2.0.2-rc.2",
43
+ "@aztec/constants": "2.0.2-rc.2",
44
+ "@aztec/entrypoints": "2.0.2-rc.2",
45
+ "@aztec/ethereum": "2.0.2-rc.2",
46
+ "@aztec/foundation": "2.0.2-rc.2",
47
+ "@aztec/kv-store": "2.0.2-rc.2",
48
+ "@aztec/l1-artifacts": "2.0.2-rc.2",
49
+ "@aztec/node-lib": "2.0.2-rc.2",
50
+ "@aztec/noir-contracts.js": "2.0.2-rc.2",
51
+ "@aztec/noir-protocol-circuits-types": "2.0.2-rc.2",
52
+ "@aztec/p2p": "2.0.2-rc.2",
53
+ "@aztec/p2p-bootstrap": "2.0.2-rc.2",
54
+ "@aztec/protocol-contracts": "2.0.2-rc.2",
55
+ "@aztec/prover-client": "2.0.2-rc.2",
56
+ "@aztec/prover-node": "2.0.2-rc.2",
57
+ "@aztec/pxe": "2.0.2-rc.2",
58
+ "@aztec/stdlib": "2.0.2-rc.2",
59
+ "@aztec/telemetry-client": "2.0.2-rc.2",
60
+ "@aztec/txe": "2.0.2-rc.2",
61
+ "@aztec/world-state": "2.0.2-rc.2",
62
62
  "@types/chalk": "^2.2.0",
63
63
  "abitype": "^0.8.11",
64
64
  "chalk": "^5.3.0",
package/src/bin/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  //
3
3
  import { injectCommands as injectBuilderCommands } from '@aztec/builder';
4
4
  import { injectCommands as injectWalletCommands } from '@aztec/cli-wallet';
5
+ import { enrichEnvironmentWithChainConfig } from '@aztec/cli/config';
5
6
  import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
6
7
  import { injectCommands as injectDevnetCommands } from '@aztec/cli/devnet';
7
8
  import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
@@ -14,7 +15,6 @@ import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
14
15
  import { Command } from 'commander';
15
16
 
16
17
  import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
17
- import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
18
18
  import { injectAztecCommands } from '../cli/index.js';
19
19
  import { getCliVersion } from '../cli/release_version.js';
20
20
 
@@ -7,13 +7,13 @@ import {
7
7
  } from '@aztec/archiver';
8
8
  import { createLogger } from '@aztec/aztec.js';
9
9
  import { type BlobSinkConfig, blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
10
+ import { getL1Config } from '@aztec/cli/config';
10
11
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
11
12
  import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
12
13
  import { createStore } from '@aztec/kv-store/lmdb-v2';
13
14
  import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
14
15
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
15
16
 
16
- import { getL1Config } from '../get_l1_config.js';
17
17
  import { extractRelevantOptions } from '../util.js';
18
18
 
19
19
  export type { ArchiverConfig, DataStoreConfig };
@@ -4,10 +4,10 @@ import {
4
4
  createBlobSinkServer,
5
5
  getBlobSinkConfigFromEnv,
6
6
  } from '@aztec/blob-sink/server';
7
+ import { getL1Config } from '@aztec/cli/config';
7
8
  import type { LogFn } from '@aztec/foundation/log';
8
9
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
9
10
 
10
- import { getL1Config } from '../get_l1_config.js';
11
11
  import { extractRelevantOptions } from '../util.js';
12
12
 
13
13
  export async function startBlobSink(options: any, signalHandlers: (() => Promise<void>)[], userLog: LogFn) {
@@ -1,11 +1,16 @@
1
1
  import { type BotConfig, BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
2
2
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
- import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
4
+ import { type AztecNode, type PXE, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
5
5
  import type { TelemetryClient } from '@aztec/telemetry-client';
6
- import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
6
+ import {
7
+ getConfigEnvVars as getTelemetryClientConfig,
8
+ initTelemetryClient,
9
+ makeTracedFetch,
10
+ } from '@aztec/telemetry-client';
7
11
 
8
12
  import { extractRelevantOptions } from '../util.js';
13
+ import { getVersions } from '../versioning.js';
9
14
 
10
15
  export async function startBot(
11
16
  options: any,
@@ -20,15 +25,24 @@ export async function startBot(
20
25
  );
21
26
  process.exit(1);
22
27
  }
28
+
29
+ const fetch = makeTracedFetch([1, 2, 3], true);
30
+ const config = extractRelevantOptions<BotConfig>(options, botConfigMappings, 'bot');
31
+ if (!config.nodeUrl) {
32
+ throw new Error('The bot requires access to a Node');
33
+ }
34
+
35
+ const node = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
36
+
23
37
  // Start a PXE client that is used by the bot if required
24
38
  let pxe: PXE | undefined;
25
39
  if (options.pxe) {
26
40
  const { addPXE } = await import('./start_pxe.js');
27
- ({ pxe } = await addPXE(options, signalHandlers, services, userLog));
41
+ ({ pxe } = await addPXE(options, signalHandlers, services, userLog, { node }));
28
42
  }
29
43
 
30
44
  const telemetry = initTelemetryClient(getTelemetryClientConfig());
31
- await addBot(options, signalHandlers, services, { pxe, telemetry });
45
+ await addBot(options, signalHandlers, services, { pxe, telemetry, node });
32
46
  }
33
47
 
34
48
  export function addBot(
@@ -2,6 +2,7 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
2
  import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node';
3
3
  import { Fr } from '@aztec/aztec.js';
4
4
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
5
+ import { getL1Config } from '@aztec/cli/config';
5
6
  import { getPublicClient } from '@aztec/ethereum';
6
7
  import { SecretValue } from '@aztec/foundation/config';
7
8
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
@@ -16,7 +17,6 @@ import {
16
17
  import { getGenesisValues } from '@aztec/world-state/testing';
17
18
 
18
19
  import { createAztecNode } from '../../sandbox/index.js';
19
- import { getL1Config } from '../get_l1_config.js';
20
20
  import {
21
21
  extractNamespacedOptions,
22
22
  extractRelevantOptions,
@@ -1,3 +1,4 @@
1
+ import { getL1Config } from '@aztec/cli/config';
1
2
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
2
3
  import type { LogFn } from '@aztec/foundation/log';
3
4
  import {
@@ -10,7 +11,6 @@ import { getProverNodeBrokerConfigFromEnv } from '@aztec/prover-node';
10
11
  import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
11
12
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
12
13
 
13
- import { getL1Config } from '../get_l1_config.js';
14
14
  import { extractRelevantOptions } from '../util.js';
15
15
 
16
16
  export async function startProverBroker(
@@ -1,6 +1,7 @@
1
1
  import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
2
  import { Fr } from '@aztec/aztec.js';
3
3
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
4
+ import { getL1Config } from '@aztec/cli/config';
4
5
  import { getPublicClient } from '@aztec/ethereum';
5
6
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
6
7
  import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
@@ -16,7 +17,6 @@ import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker } from '@aztec
16
17
  import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
17
18
  import { getGenesisValues } from '@aztec/world-state/testing';
18
19
 
19
- import { getL1Config } from '../get_l1_config.js';
20
20
  import { extractRelevantOptions, preloadCrsDataForVerifying, setupUpdateMonitor } from '../util.js';
21
21
  import { getVersions } from '../versioning.js';
22
22
  import { startProverBroker } from './start_prover_broker.js';
@@ -1,31 +0,0 @@
1
- import { type L1ContractsConfig } from '@aztec/ethereum';
2
- import type { NetworkNames } from '@aztec/foundation/config';
3
- import type { SharedNodeConfig } from '@aztec/node-lib/config';
4
- import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
5
- export type L2ChainConfig = L1ContractsConfig & Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways'> & {
6
- l1ChainId: number;
7
- testAccounts: boolean;
8
- sponsoredFPC: boolean;
9
- p2pEnabled: boolean;
10
- p2pBootstrapNodes: string[];
11
- registryAddress: string;
12
- slashFactoryAddress: string;
13
- feeAssetHandlerAddress: string;
14
- seqMinTxsPerBlock: number;
15
- seqMaxTxsPerBlock: number;
16
- realProofs: boolean;
17
- snapshotsUrl: string;
18
- autoUpdate: SharedNodeConfig['autoUpdate'];
19
- autoUpdateUrl?: string;
20
- maxTxPoolSize: number;
21
- publicIncludeMetrics?: string[];
22
- publicMetricsCollectorUrl?: string;
23
- publicMetricsCollectFrom?: string[];
24
- sentinelEnabled: boolean;
25
- };
26
- export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
27
- export declare const alphaTestnetL2ChainConfig: L2ChainConfig;
28
- export declare function getBootnodes(networkName: NetworkNames, cacheDir?: string): Promise<any>;
29
- export declare function getL2ChainConfig(networkName: NetworkNames, cacheDir?: string): Promise<L2ChainConfig | undefined>;
30
- export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): Promise<void>;
31
- //# sourceMappingURL=chain_l2_config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOrE,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,aAAa,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,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;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEJ,eAAO,MAAM,4BAA4B,EAAE,aAqD1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aA4EvC,CAAC;AAIF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,gBAgC9E;AAED,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpC;AAgCD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAyF/E"}
@@ -1,261 +0,0 @@
1
- import { EthAddress } from '@aztec/aztec.js';
2
- import { DefaultL1ContractsConfig } from '@aztec/ethereum';
3
- import { mkdir, readFile, stat, writeFile } from 'fs/promises';
4
- import path, { dirname, join } from 'path';
5
- import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
6
- type: 'json'
7
- };
8
- export const testnetIgnitionL2ChainConfig = {
9
- l1ChainId: 11155111,
10
- testAccounts: true,
11
- sponsoredFPC: false,
12
- p2pEnabled: true,
13
- p2pBootstrapNodes: [],
14
- registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
15
- slashFactoryAddress: '',
16
- feeAssetHandlerAddress: '',
17
- seqMinTxsPerBlock: 0,
18
- seqMaxTxsPerBlock: 0,
19
- realProofs: true,
20
- snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
21
- autoUpdate: 'disabled',
22
- autoUpdateUrl: undefined,
23
- maxTxPoolSize: 100_000_000,
24
- ...DefaultL1ContractsConfig,
25
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
26
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
27
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
28
- /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
29
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
30
- /** The mana target for the rollup */ manaTarget: 0n,
31
- /** The proving cost per mana */ provingCostPerMana: 0n,
32
- slasherFlavor: 'none',
33
- slashAmountSmall: 0n,
34
- slashAmountMedium: 0n,
35
- slashAmountLarge: 0n,
36
- slashMinPenaltyPercentage: 0.5,
37
- slashMaxPenaltyPercentage: 200,
38
- slashInactivityTargetPercentage: 0,
39
- slashInactivityConsecutiveEpochThreshold: 1,
40
- slashInactivityPenalty: 0n,
41
- slashPrunePenalty: 0n,
42
- slashDataWithholdingPenalty: 0n,
43
- slashProposeInvalidAttestationsPenalty: 0n,
44
- slashAttestDescendantOfInvalidPenalty: 0n,
45
- slashBroadcastedInvalidBlockPenalty: 0n,
46
- slashMaxPayloadSize: 50,
47
- slashGracePeriodL2Slots: 0,
48
- slashUnknownPenalty: 0n,
49
- slashOffenseExpirationRounds: 10,
50
- sentinelEnabled: false
51
- };
52
- export const alphaTestnetL2ChainConfig = {
53
- l1ChainId: 11155111,
54
- testAccounts: false,
55
- sponsoredFPC: true,
56
- p2pEnabled: true,
57
- p2pBootstrapNodes: [],
58
- registryAddress: '0xec4156431d0f3df66d4e24ba3d30dcb4c85fa309',
59
- slashFactoryAddress: '0x8b1566249dc8fb47234037538ce491f9500480b1',
60
- feeAssetHandlerAddress: '0x4f0376b8bcbdf72ddb38c38f48317c00e9c9aec3',
61
- seqMinTxsPerBlock: 0,
62
- seqMaxTxsPerBlock: 20,
63
- realProofs: true,
64
- snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
65
- autoUpdate: 'config-and-version',
66
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/alpha-testnet.json',
67
- maxTxPoolSize: 100_000_000,
68
- publicIncludeMetrics,
69
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
70
- publicMetricsCollectFrom: [
71
- 'sequencer'
72
- ],
73
- // Deployment stuff
74
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
75
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
76
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
77
- /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
78
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
79
- /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
80
- /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
81
- /** The slashing round size */ slashingRoundSizeInEpochs: 4,
82
- /** Governance proposing round size */ governanceProposerRoundSize: 300,
83
- /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
84
- /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
85
- /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
86
- /** Tally-style slashing */ slasherFlavor: 'tally',
87
- /** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
88
- /** How long for a slash payload to be executed */ slashingLifetimeInRounds: 4,
89
- /** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
90
- /** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
91
- /** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
92
- slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
93
- slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
94
- // Slashing stuff
95
- slashMinPenaltyPercentage: 0.5,
96
- slashMaxPenaltyPercentage: 2.0,
97
- slashInactivityTargetPercentage: 0.7,
98
- slashInactivityConsecutiveEpochThreshold: 1,
99
- slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
100
- slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
101
- slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
102
- slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
103
- slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
104
- slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
105
- slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
106
- slashMaxPayloadSize: 50,
107
- slashGracePeriodL2Slots: 32 * 2,
108
- slashOffenseExpirationRounds: 8,
109
- sentinelEnabled: true
110
- };
111
- const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
112
- export async function getBootnodes(networkName, cacheDir) {
113
- const cacheFile = cacheDir ? join(cacheDir, networkName, 'bootnodes.json') : undefined;
114
- try {
115
- if (cacheFile) {
116
- const info = await stat(cacheFile);
117
- if (info.mtimeMs + BOOTNODE_CACHE_DURATION_MS > Date.now()) {
118
- return JSON.parse(await readFile(cacheFile, 'utf-8'))['bootnodes'];
119
- }
120
- }
121
- } catch {
122
- // no-op. Get the remote-file
123
- }
124
- const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
125
- const response = await fetch(url);
126
- if (!response.ok) {
127
- throw new Error(`Failed to fetch basic contract addresses from ${url}. Check you are using a correct network name.`);
128
- }
129
- const json = await response.json();
130
- try {
131
- if (cacheFile) {
132
- await mkdir(dirname(cacheFile), {
133
- recursive: true
134
- });
135
- await writeFile(cacheFile, JSON.stringify(json), 'utf-8');
136
- }
137
- } catch {
138
- // no-op
139
- }
140
- return json['bootnodes'];
141
- }
142
- export async function getL2ChainConfig(networkName, cacheDir) {
143
- if (networkName === 'testnet-ignition') {
144
- const config = {
145
- ...testnetIgnitionL2ChainConfig
146
- };
147
- config.p2pBootstrapNodes = await getBootnodes(networkName, cacheDir);
148
- return config;
149
- } else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
150
- const config = {
151
- ...alphaTestnetL2ChainConfig
152
- };
153
- config.p2pBootstrapNodes = await getBootnodes('alpha-testnet', cacheDir);
154
- return config;
155
- }
156
- return undefined;
157
- }
158
- function enrichVar(envVar, value) {
159
- // Don't override
160
- if (process.env[envVar] || value === undefined) {
161
- return;
162
- }
163
- process.env[envVar] = value;
164
- }
165
- function enrichEthAddressVar(envVar, value) {
166
- // EthAddress doesn't like being given empty strings
167
- if (value === '') {
168
- enrichVar(envVar, EthAddress.ZERO.toString());
169
- return;
170
- }
171
- enrichVar(envVar, value);
172
- }
173
- function getDefaultDataDir(networkName) {
174
- let prefix;
175
- if (networkName === 'testnet-ignition') {
176
- prefix = 'testnet-ignition';
177
- } else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
178
- prefix = 'alpha-testnet';
179
- } else {
180
- prefix = networkName;
181
- }
182
- return path.join(process.env.HOME || '~', '.aztec', prefix, 'data');
183
- }
184
- export async function enrichEnvironmentWithChainConfig(networkName) {
185
- if (networkName === 'local') {
186
- return;
187
- }
188
- enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
189
- const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
190
- const config = await getL2ChainConfig(networkName, cacheDir);
191
- if (!config) {
192
- throw new Error(`Unknown network name: ${networkName}`);
193
- }
194
- enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
195
- enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
196
- enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
197
- enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
198
- enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
199
- enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
200
- enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
201
- enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
202
- enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
203
- enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
204
- enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
205
- if (config.autoUpdate) {
206
- enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
207
- }
208
- if (config.autoUpdateUrl) {
209
- enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
210
- }
211
- if (config.publicIncludeMetrics) {
212
- enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
213
- }
214
- if (config.publicMetricsCollectorUrl) {
215
- enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
216
- }
217
- if (config.publicMetricsCollectFrom) {
218
- enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
219
- }
220
- enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
221
- enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
222
- enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
223
- // Deployment stuff
224
- enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
225
- enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
226
- enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
227
- enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
228
- enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
229
- enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
230
- enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
231
- enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
232
- enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
233
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
234
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
235
- enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
236
- enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
237
- enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
238
- enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
239
- enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
240
- enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
241
- enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
242
- enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
243
- enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
244
- enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
245
- enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
246
- // Slashing
247
- enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
248
- enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
249
- enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
250
- enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
251
- enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
252
- enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
253
- enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
254
- enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
255
- enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
256
- enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
257
- enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
258
- enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
259
- enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
260
- enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
261
- }
@@ -1,7 +0,0 @@
1
- import { type L1ContractAddresses, getL1ContractsConfig } from '@aztec/ethereum';
2
- import type { EthAddress } from '@aztec/foundation/eth-address';
3
- export declare function getL1Config(registryAddress: EthAddress, l1RpcUrls: string[], l1ChainId: number, rollupVersion?: number | 'canonical'): Promise<{
4
- addresses: L1ContractAddresses;
5
- config: Awaited<ReturnType<typeof getL1ContractsConfig>>;
6
- }>;
7
- //# sourceMappingURL=get_l1_config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/cli/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,wBAAsB,WAAW,CAC/B,eAAe,EAAE,UAAU,EAC3B,SAAS,EAAE,MAAM,EAAE,EACnB,SAAS,EAAE,MAAM,EACjB,aAAa,GAAE,MAAM,GAAG,WAAyB,GAChD,OAAO,CAAC;IAAE,SAAS,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA;CAAE,CAAC,CAUvG"}
@@ -1,13 +0,0 @@
1
- import { RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
2
- export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId, rollupVersion = 'canonical') {
3
- const publicClient = getPublicClient({
4
- l1RpcUrls,
5
- l1ChainId
6
- });
7
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
8
- const config = await getL1ContractsConfig(publicClient, addresses);
9
- return {
10
- addresses,
11
- config
12
- };
13
- }
@@ -1,341 +0,0 @@
1
- import { EthAddress } from '@aztec/aztec.js';
2
- import { DefaultL1ContractsConfig, type L1ContractsConfig } from '@aztec/ethereum';
3
- import type { EnvVar, NetworkNames } from '@aztec/foundation/config';
4
- import type { SharedNodeConfig } from '@aztec/node-lib/config';
5
- import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
6
-
7
- import { mkdir, readFile, stat, writeFile } from 'fs/promises';
8
- import path, { dirname, join } from 'path';
9
-
10
- import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with { type: 'json' };
11
-
12
- export type L2ChainConfig = L1ContractsConfig &
13
- Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways'> & {
14
- l1ChainId: number;
15
- testAccounts: boolean;
16
- sponsoredFPC: boolean;
17
- p2pEnabled: boolean;
18
- p2pBootstrapNodes: string[];
19
- registryAddress: string;
20
- slashFactoryAddress: string;
21
- feeAssetHandlerAddress: string;
22
- seqMinTxsPerBlock: number;
23
- seqMaxTxsPerBlock: number;
24
- realProofs: boolean;
25
- snapshotsUrl: string;
26
- autoUpdate: SharedNodeConfig['autoUpdate'];
27
- autoUpdateUrl?: string;
28
- maxTxPoolSize: number;
29
- publicIncludeMetrics?: string[];
30
- publicMetricsCollectorUrl?: string;
31
- publicMetricsCollectFrom?: string[];
32
-
33
- // Control whether sentinel is enabled or not. Needed for slashing
34
- sentinelEnabled: boolean;
35
- };
36
-
37
- export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
38
- l1ChainId: 11155111,
39
- testAccounts: true,
40
- sponsoredFPC: false,
41
- p2pEnabled: true,
42
- p2pBootstrapNodes: [],
43
- registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
44
- slashFactoryAddress: '',
45
- feeAssetHandlerAddress: '',
46
- seqMinTxsPerBlock: 0,
47
- seqMaxTxsPerBlock: 0,
48
- realProofs: true,
49
- snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
50
- autoUpdate: 'disabled',
51
- autoUpdateUrl: undefined,
52
- maxTxPoolSize: 100_000_000, // 100MB
53
-
54
- ...DefaultL1ContractsConfig,
55
-
56
- /** How many seconds an L1 slot lasts. */
57
- ethereumSlotDuration: 12,
58
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
59
- aztecSlotDuration: 36,
60
- /** How many L2 slots an epoch lasts. */
61
- aztecEpochDuration: 32,
62
- /** The target validator committee size. */
63
- aztecTargetCommitteeSize: 48,
64
- /** The number of epochs after an epoch ends that proofs are still accepted. */
65
- aztecProofSubmissionEpochs: 1,
66
- /** The mana target for the rollup */
67
- manaTarget: 0n,
68
- /** The proving cost per mana */
69
- provingCostPerMana: 0n,
70
-
71
- slasherFlavor: 'none',
72
- slashAmountSmall: 0n,
73
- slashAmountMedium: 0n,
74
- slashAmountLarge: 0n,
75
- slashMinPenaltyPercentage: 0.5,
76
- slashMaxPenaltyPercentage: 200,
77
- slashInactivityTargetPercentage: 0,
78
- slashInactivityConsecutiveEpochThreshold: 1,
79
- slashInactivityPenalty: 0n,
80
- slashPrunePenalty: 0n,
81
- slashDataWithholdingPenalty: 0n,
82
- slashProposeInvalidAttestationsPenalty: 0n,
83
- slashAttestDescendantOfInvalidPenalty: 0n,
84
- slashBroadcastedInvalidBlockPenalty: 0n,
85
- slashMaxPayloadSize: 50,
86
- slashGracePeriodL2Slots: 0,
87
- slashUnknownPenalty: 0n,
88
- slashOffenseExpirationRounds: 10,
89
- sentinelEnabled: false,
90
- };
91
-
92
- export const alphaTestnetL2ChainConfig: L2ChainConfig = {
93
- l1ChainId: 11155111,
94
- testAccounts: false,
95
- sponsoredFPC: true,
96
- p2pEnabled: true,
97
- p2pBootstrapNodes: [],
98
- registryAddress: '0xec4156431d0f3df66d4e24ba3d30dcb4c85fa309',
99
- slashFactoryAddress: '0x8b1566249dc8fb47234037538ce491f9500480b1',
100
- feeAssetHandlerAddress: '0x4f0376b8bcbdf72ddb38c38f48317c00e9c9aec3',
101
- seqMinTxsPerBlock: 0,
102
- seqMaxTxsPerBlock: 20,
103
- realProofs: true,
104
- snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
105
- autoUpdate: 'config-and-version',
106
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/alpha-testnet.json',
107
- maxTxPoolSize: 100_000_000, // 100MB
108
- publicIncludeMetrics,
109
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
110
- publicMetricsCollectFrom: ['sequencer'],
111
-
112
- // Deployment stuff
113
- /** How many seconds an L1 slot lasts. */
114
- ethereumSlotDuration: 12,
115
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
116
- aztecSlotDuration: 36,
117
- /** How many L2 slots an epoch lasts. */
118
- aztecEpochDuration: 32,
119
- /** The target validator committee size. */
120
- aztecTargetCommitteeSize: 48,
121
- /** The number of epochs after an epoch ends that proofs are still accepted. */
122
- aztecProofSubmissionEpochs: 1,
123
- /** The deposit amount for a validator */
124
- activationThreshold: DefaultL1ContractsConfig.activationThreshold,
125
- /** The minimum stake for a validator. */
126
- ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
127
- /** The slashing round size */
128
- slashingRoundSizeInEpochs: 4,
129
- /** Governance proposing round size */
130
- governanceProposerRoundSize: 300,
131
- /** The mana target for the rollup */
132
- manaTarget: DefaultL1ContractsConfig.manaTarget,
133
- /** The proving cost per mana */
134
- provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
135
- /** Exit delay for stakers */
136
- exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
137
- /** Tally-style slashing */
138
- slasherFlavor: 'tally',
139
- /** Allow one round for vetoing */
140
- slashingExecutionDelayInRounds: 1,
141
- /** How long for a slash payload to be executed */
142
- slashingLifetimeInRounds: 4,
143
- /** Allow 2 rounds to discover faults */
144
- slashingOffsetInRounds: 2,
145
- /** No slash vetoer */
146
- slashingVetoer: EthAddress.ZERO,
147
- /** Use default slash amounts */
148
- slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
149
- slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
150
- slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
151
-
152
- // Slashing stuff
153
- slashMinPenaltyPercentage: 0.5,
154
- slashMaxPenaltyPercentage: 2.0,
155
- slashInactivityTargetPercentage: 0.7,
156
- slashInactivityConsecutiveEpochThreshold: 1,
157
- slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
158
- slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
159
- slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
160
- slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
161
- slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
162
- slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
163
- slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
164
- slashMaxPayloadSize: 50,
165
- slashGracePeriodL2Slots: 32 * 2, // Two epochs from genesis
166
- slashOffenseExpirationRounds: 8,
167
- sentinelEnabled: true,
168
- };
169
-
170
- const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
171
-
172
- export async function getBootnodes(networkName: NetworkNames, cacheDir?: string) {
173
- const cacheFile = cacheDir ? join(cacheDir, networkName, 'bootnodes.json') : undefined;
174
- try {
175
- if (cacheFile) {
176
- const info = await stat(cacheFile);
177
- if (info.mtimeMs + BOOTNODE_CACHE_DURATION_MS > Date.now()) {
178
- return JSON.parse(await readFile(cacheFile, 'utf-8'))['bootnodes'];
179
- }
180
- }
181
- } catch {
182
- // no-op. Get the remote-file
183
- }
184
-
185
- const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
186
- const response = await fetch(url);
187
- if (!response.ok) {
188
- throw new Error(
189
- `Failed to fetch basic contract addresses from ${url}. Check you are using a correct network name.`,
190
- );
191
- }
192
- const json = await response.json();
193
-
194
- try {
195
- if (cacheFile) {
196
- await mkdir(dirname(cacheFile), { recursive: true });
197
- await writeFile(cacheFile, JSON.stringify(json), 'utf-8');
198
- }
199
- } catch {
200
- // no-op
201
- }
202
-
203
- return json['bootnodes'];
204
- }
205
-
206
- export async function getL2ChainConfig(
207
- networkName: NetworkNames,
208
- cacheDir?: string,
209
- ): Promise<L2ChainConfig | undefined> {
210
- if (networkName === 'testnet-ignition') {
211
- const config = { ...testnetIgnitionL2ChainConfig };
212
- config.p2pBootstrapNodes = await getBootnodes(networkName, cacheDir);
213
- return config;
214
- } else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
215
- const config = { ...alphaTestnetL2ChainConfig };
216
- config.p2pBootstrapNodes = await getBootnodes('alpha-testnet', cacheDir);
217
- return config;
218
- }
219
- return undefined;
220
- }
221
-
222
- function enrichVar(envVar: EnvVar, value: string | undefined) {
223
- // Don't override
224
- if (process.env[envVar] || value === undefined) {
225
- return;
226
- }
227
- process.env[envVar] = value;
228
- }
229
-
230
- function enrichEthAddressVar(envVar: EnvVar, value: string) {
231
- // EthAddress doesn't like being given empty strings
232
- if (value === '') {
233
- enrichVar(envVar, EthAddress.ZERO.toString());
234
- return;
235
- }
236
- enrichVar(envVar, value);
237
- }
238
-
239
- function getDefaultDataDir(networkName: NetworkNames): string {
240
- let prefix: string;
241
- if (networkName === 'testnet-ignition') {
242
- prefix = 'testnet-ignition';
243
- } else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
244
- prefix = 'alpha-testnet';
245
- } else {
246
- prefix = networkName;
247
- }
248
-
249
- return path.join(process.env.HOME || '~', '.aztec', prefix, 'data');
250
- }
251
-
252
- export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
253
- if (networkName === 'local') {
254
- return;
255
- }
256
-
257
- enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
258
- const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
259
- const config = await getL2ChainConfig(networkName, cacheDir);
260
-
261
- if (!config) {
262
- throw new Error(`Unknown network name: ${networkName}`);
263
- }
264
-
265
- enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
266
- enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
267
- enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
268
- enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
269
- enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
270
- enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
271
- enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
272
- enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
273
- enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
274
- enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
275
- enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
276
-
277
- if (config.autoUpdate) {
278
- enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
279
- }
280
-
281
- if (config.autoUpdateUrl) {
282
- enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
283
- }
284
-
285
- if (config.publicIncludeMetrics) {
286
- enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
287
- }
288
-
289
- if (config.publicMetricsCollectorUrl) {
290
- enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
291
- }
292
-
293
- if (config.publicMetricsCollectFrom) {
294
- enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
295
- }
296
-
297
- enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
298
- enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
299
- enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
300
-
301
- // Deployment stuff
302
- enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
303
- enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
304
- enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
305
- enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
306
- enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
307
- enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
308
- enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
309
- enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
310
- enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
311
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
312
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
313
- enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
314
- enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
315
- enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
316
- enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
317
- enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
318
- enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
319
- enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
320
- enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
321
- enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
322
- enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
323
- enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
324
-
325
- // Slashing
326
- enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
327
- enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
328
- enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
329
- enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
330
- enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
331
- enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
332
- enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
333
- enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
334
- enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
335
- enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
336
- enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
337
- enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
338
- enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
339
-
340
- enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
341
- }
@@ -1,19 +0,0 @@
1
- import { type L1ContractAddresses, RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
2
- import type { EthAddress } from '@aztec/foundation/eth-address';
3
-
4
- export async function getL1Config(
5
- registryAddress: EthAddress,
6
- l1RpcUrls: string[],
7
- l1ChainId: number,
8
- rollupVersion: number | 'canonical' = 'canonical',
9
- ): Promise<{ addresses: L1ContractAddresses; config: Awaited<ReturnType<typeof getL1ContractsConfig>> }> {
10
- const publicClient = getPublicClient({ l1RpcUrls, l1ChainId });
11
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
12
-
13
- const config = await getL1ContractsConfig(publicClient, addresses);
14
-
15
- return {
16
- addresses,
17
- config,
18
- };
19
- }