@aztec/cli 3.0.0-canary.a9708bd → 3.0.0-manual.20251030
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/README.md +1 -427
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +9 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/aztec_node/get_logs.d.ts +6 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/infrastructure/index.d.ts +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -8
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +4 -3
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -25
- package/dest/cmds/l1/advance_epoch.d.ts +1 -1
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +6 -5
- package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +7 -6
- package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +2 -2
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +5 -5
- package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +4 -4
- package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +18 -34
- package/dest/cmds/l1/update_l1_validators.d.ts +5 -0
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +67 -6
- package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
- package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/config/cached_fetch.d.ts +18 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +54 -0
- package/dest/config/chain_l2_config.d.ts +39 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +452 -0
- package/dest/config/enrich_env.d.ts +4 -0
- package/dest/config/enrich_env.d.ts.map +1 -0
- package/dest/config/enrich_env.js +12 -0
- package/dest/config/get_l1_config.d.ts +8 -0
- package/dest/config/get_l1_config.d.ts.map +1 -0
- package/dest/config/get_l1_config.js +22 -0
- package/dest/config/index.d.ts +5 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +4 -0
- package/dest/config/network_config.d.ts +19 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +79 -0
- package/dest/utils/aztec.d.ts +3 -9
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +8 -32
- package/dest/utils/commands.d.ts +6 -7
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +5 -6
- package/dest/utils/inspect.d.ts +3 -10
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +13 -95
- package/dest/utils/setup_contracts.d.ts +1 -3
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +2 -22
- package/package.json +28 -25
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +10 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +8 -7
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/infrastructure/index.ts +7 -17
- package/src/cmds/infrastructure/sequencers.ts +6 -6
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -30
- package/src/cmds/l1/advance_epoch.ts +6 -5
- package/src/cmds/l1/assume_proven_through.ts +7 -6
- package/src/cmds/l1/bridge_erc20.ts +3 -1
- package/src/cmds/l1/deploy_l1_contracts.ts +6 -3
- package/src/cmds/l1/deploy_new_rollup.ts +4 -2
- package/src/cmds/l1/get_l1_addresses.ts +1 -1
- package/src/cmds/l1/index.ts +25 -53
- package/src/cmds/l1/update_l1_validators.ts +81 -6
- package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +597 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/get_l1_config.ts +28 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +102 -0
- package/src/utils/aztec.ts +8 -40
- package/src/utils/commands.ts +8 -10
- package/src/utils/inspect.ts +18 -111
- package/src/utils/setup_contracts.ts +4 -43
- package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
- package/dest/cmds/devnet/bootstrap_network.js +0 -216
- package/dest/cmds/devnet/faucet.d.ts +0 -4
- package/dest/cmds/devnet/faucet.d.ts.map +0 -1
- package/dest/cmds/devnet/faucet.js +0 -26
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts +0 -4
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/devnet/bootstrap_network.ts +0 -321
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
- /package/dest/cmds/{devnet → aztec_node}/index.d.ts +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
+
import { mkdir, readFile, stat, writeFile } from 'fs/promises';
|
|
3
|
+
import { dirname } from 'path';
|
|
4
|
+
/**
|
|
5
|
+
* Fetches data from a URL with file-based caching support.
|
|
6
|
+
* This utility can be used by both remote config and bootnodes fetching.
|
|
7
|
+
*
|
|
8
|
+
* @param url - The URL to fetch from
|
|
9
|
+
* @param networkName - Network name for cache directory structure
|
|
10
|
+
* @param options - Caching and error handling options
|
|
11
|
+
* @param cacheDir - Optional cache directory (defaults to no caching)
|
|
12
|
+
* @returns The fetched and parsed JSON data, or undefined if fetch fails and throwOnError is false
|
|
13
|
+
*/ export async function cachedFetch(url, options, fetch = globalThis.fetch, log = createLogger('cached_fetch')) {
|
|
14
|
+
const { cacheDurationMs, cacheFile } = options;
|
|
15
|
+
// Try to read from cache first
|
|
16
|
+
try {
|
|
17
|
+
if (cacheFile) {
|
|
18
|
+
const info = await stat(cacheFile);
|
|
19
|
+
if (info.mtimeMs + cacheDurationMs > Date.now()) {
|
|
20
|
+
const cachedData = JSON.parse(await readFile(cacheFile, 'utf-8'));
|
|
21
|
+
return cachedData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
log.trace('Failed to read data from cache');
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(url);
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
log.warn(`Failed to fetch from ${url}: ${response.status} ${response.statusText}`);
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const data = await response.json();
|
|
34
|
+
try {
|
|
35
|
+
if (cacheFile) {
|
|
36
|
+
await mkdir(dirname(cacheFile), {
|
|
37
|
+
recursive: true
|
|
38
|
+
});
|
|
39
|
+
await writeFile(cacheFile, JSON.stringify(data), 'utf-8');
|
|
40
|
+
}
|
|
41
|
+
} catch (err) {
|
|
42
|
+
log.warn('Failed to cache data on disk: ' + cacheFile, {
|
|
43
|
+
cacheFile,
|
|
44
|
+
err
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return data;
|
|
48
|
+
} catch (err) {
|
|
49
|
+
log.warn(`Failed to fetch from ${url}`, {
|
|
50
|
+
err
|
|
51
|
+
});
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
seqMinTxsPerBlock: number;
|
|
12
|
+
seqMaxTxsPerBlock: number;
|
|
13
|
+
realProofs: boolean;
|
|
14
|
+
snapshotsUrls: string[];
|
|
15
|
+
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
16
|
+
autoUpdateUrl?: string;
|
|
17
|
+
maxTxPoolSize: number;
|
|
18
|
+
publicIncludeMetrics?: string[];
|
|
19
|
+
publicMetricsCollectorUrl?: string;
|
|
20
|
+
publicMetricsCollectFrom?: string[];
|
|
21
|
+
skipArchiverInitialSync?: boolean;
|
|
22
|
+
blobAllowEmptySources?: boolean;
|
|
23
|
+
dbMapSizeKb: number;
|
|
24
|
+
archiverStoreMapSizeKb: number;
|
|
25
|
+
noteHashTreeMapSizeKb: number;
|
|
26
|
+
nullifierTreeMapSizeKb: number;
|
|
27
|
+
publicDataTreeMapSizeKb: number;
|
|
28
|
+
sentinelEnabled: boolean;
|
|
29
|
+
disableTransactions: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare const stagingIgnitionL2ChainConfig: L2ChainConfig;
|
|
32
|
+
export declare const stagingPublicL2ChainConfig: L2ChainConfig;
|
|
33
|
+
export declare const nextNetL2ChainConfig: L2ChainConfig;
|
|
34
|
+
export declare const testnetL2ChainConfig: L2ChainConfig;
|
|
35
|
+
export declare const mainnetL2ChainConfig: L2ChainConfig;
|
|
36
|
+
export declare const devnetL2ChainConfig: L2ChainConfig;
|
|
37
|
+
export declare function getL2ChainConfig(networkName: NetworkNames): L2ChainConfig | undefined;
|
|
38
|
+
export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): void;
|
|
39
|
+
//# sourceMappingURL=chain_l2_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/config/chain_l2_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAYrE,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,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,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;IACpC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAIhC,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAGhC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AA+CJ,eAAO,MAAM,4BAA4B,EAAE,aA+E1C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAmDxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAmDlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAuDlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAiFlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAmDjC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS,CAgBrF;AAMD,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,YAAY,QAoGzE"}
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
|
|
5
|
+
type: 'json'
|
|
6
|
+
};
|
|
7
|
+
import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
|
|
8
|
+
const SNAPSHOTS_URL = 'https://aztec-labs-snapshots.com';
|
|
9
|
+
const defaultDBMapSizeKb = 128 * 1_024 * 1_024; // 128 GB
|
|
10
|
+
const tbMapSizeKb = 1_024 * 1_024 * 1_024; // 1 TB
|
|
11
|
+
const DefaultSlashConfig = {
|
|
12
|
+
/** Tally-style slashing */ slasherFlavor: 'tally',
|
|
13
|
+
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
14
|
+
/** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
|
|
15
|
+
/** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
|
|
16
|
+
/** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
|
|
17
|
+
/** Use default disable duration */ slashingDisableDuration: DefaultL1ContractsConfig.slashingDisableDuration,
|
|
18
|
+
/** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
19
|
+
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
20
|
+
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
21
|
+
// Slashing stuff
|
|
22
|
+
slashMinPenaltyPercentage: 0.5,
|
|
23
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
24
|
+
slashInactivityTargetPercentage: 0.7,
|
|
25
|
+
slashInactivityConsecutiveEpochThreshold: 1,
|
|
26
|
+
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
27
|
+
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
28
|
+
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
29
|
+
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
30
|
+
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
31
|
+
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
32
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
33
|
+
slashMaxPayloadSize: 50,
|
|
34
|
+
slashGracePeriodL2Slots: 32 * 2,
|
|
35
|
+
slashOffenseExpirationRounds: 8,
|
|
36
|
+
sentinelEnabled: true,
|
|
37
|
+
slashExecuteRoundsLookBack: 4
|
|
38
|
+
};
|
|
39
|
+
const DefaultNetworkDBMapSizeConfig = {
|
|
40
|
+
dbMapSizeKb: defaultDBMapSizeKb,
|
|
41
|
+
archiverStoreMapSizeKb: tbMapSizeKb,
|
|
42
|
+
noteHashTreeMapSizeKb: tbMapSizeKb,
|
|
43
|
+
nullifierTreeMapSizeKb: tbMapSizeKb,
|
|
44
|
+
publicDataTreeMapSizeKb: tbMapSizeKb
|
|
45
|
+
};
|
|
46
|
+
export const stagingIgnitionL2ChainConfig = {
|
|
47
|
+
l1ChainId: 11155111,
|
|
48
|
+
testAccounts: false,
|
|
49
|
+
sponsoredFPC: false,
|
|
50
|
+
disableTransactions: true,
|
|
51
|
+
p2pEnabled: true,
|
|
52
|
+
p2pBootstrapNodes: [],
|
|
53
|
+
seqMinTxsPerBlock: 0,
|
|
54
|
+
seqMaxTxsPerBlock: 0,
|
|
55
|
+
realProofs: true,
|
|
56
|
+
snapshotsUrls: [
|
|
57
|
+
`${SNAPSHOTS_URL}/staging-ignition/`
|
|
58
|
+
],
|
|
59
|
+
autoUpdate: 'config-and-version',
|
|
60
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
|
|
61
|
+
maxTxPoolSize: 100_000_000,
|
|
62
|
+
publicIncludeMetrics,
|
|
63
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
64
|
+
publicMetricsCollectFrom: [
|
|
65
|
+
'sequencer'
|
|
66
|
+
],
|
|
67
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
68
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
69
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
70
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
71
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
72
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
73
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
74
|
+
slashingRoundSizeInEpochs: 4,
|
|
75
|
+
slashingLifetimeInRounds: 40,
|
|
76
|
+
slashingExecutionDelayInRounds: 28,
|
|
77
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
78
|
+
slashAmountMedium: 10_000n * 10n ** 18n,
|
|
79
|
+
slashAmountLarge: 50_000n * 10n ** 18n,
|
|
80
|
+
slashingOffsetInRounds: 2,
|
|
81
|
+
slasherFlavor: 'tally',
|
|
82
|
+
slashingVetoer: EthAddress.ZERO,
|
|
83
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
84
|
+
exitDelaySeconds: 5 * 24 * 60 * 60,
|
|
85
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
86
|
+
localEjectionThreshold: 196_000n * 10n ** 18n,
|
|
87
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
88
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
89
|
+
governanceProposerRoundSize: 300,
|
|
90
|
+
governanceProposerQuorum: 151,
|
|
91
|
+
// Node slashing config
|
|
92
|
+
// TODO TMNT-330
|
|
93
|
+
slashMinPenaltyPercentage: 0.5,
|
|
94
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
95
|
+
slashInactivityTargetPercentage: 0.7,
|
|
96
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
97
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
98
|
+
slashPrunePenalty: 0n,
|
|
99
|
+
slashDataWithholdingPenalty: 0n,
|
|
100
|
+
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
101
|
+
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
102
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
103
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
104
|
+
slashMaxPayloadSize: 50,
|
|
105
|
+
slashGracePeriodL2Slots: 32 * 4,
|
|
106
|
+
slashOffenseExpirationRounds: 8,
|
|
107
|
+
sentinelEnabled: true,
|
|
108
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
109
|
+
slashExecuteRoundsLookBack: 4,
|
|
110
|
+
...DefaultNetworkDBMapSizeConfig
|
|
111
|
+
};
|
|
112
|
+
export const stagingPublicL2ChainConfig = {
|
|
113
|
+
l1ChainId: 11155111,
|
|
114
|
+
testAccounts: false,
|
|
115
|
+
sponsoredFPC: true,
|
|
116
|
+
disableTransactions: false,
|
|
117
|
+
p2pEnabled: true,
|
|
118
|
+
p2pBootstrapNodes: [],
|
|
119
|
+
seqMinTxsPerBlock: 0,
|
|
120
|
+
seqMaxTxsPerBlock: 20,
|
|
121
|
+
realProofs: true,
|
|
122
|
+
snapshotsUrls: [
|
|
123
|
+
`${SNAPSHOTS_URL}/staging-public/`
|
|
124
|
+
],
|
|
125
|
+
autoUpdate: 'config-and-version',
|
|
126
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
|
|
127
|
+
publicIncludeMetrics,
|
|
128
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
129
|
+
publicMetricsCollectFrom: [
|
|
130
|
+
'sequencer'
|
|
131
|
+
],
|
|
132
|
+
maxTxPoolSize: 100_000_000,
|
|
133
|
+
// Deployment stuff
|
|
134
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
135
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
136
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
137
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
138
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
139
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
140
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
141
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
142
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
143
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
144
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
145
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
146
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
147
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
148
|
+
...DefaultSlashConfig,
|
|
149
|
+
...DefaultNetworkDBMapSizeConfig
|
|
150
|
+
};
|
|
151
|
+
export const nextNetL2ChainConfig = {
|
|
152
|
+
l1ChainId: 11155111,
|
|
153
|
+
testAccounts: true,
|
|
154
|
+
sponsoredFPC: true,
|
|
155
|
+
p2pEnabled: true,
|
|
156
|
+
disableTransactions: false,
|
|
157
|
+
p2pBootstrapNodes: [],
|
|
158
|
+
seqMinTxsPerBlock: 0,
|
|
159
|
+
seqMaxTxsPerBlock: 8,
|
|
160
|
+
realProofs: true,
|
|
161
|
+
snapshotsUrls: [],
|
|
162
|
+
autoUpdate: 'config-and-version',
|
|
163
|
+
autoUpdateUrl: '',
|
|
164
|
+
publicIncludeMetrics,
|
|
165
|
+
publicMetricsCollectorUrl: '',
|
|
166
|
+
publicMetricsCollectFrom: [
|
|
167
|
+
''
|
|
168
|
+
],
|
|
169
|
+
maxTxPoolSize: 100_000_000,
|
|
170
|
+
// Deployment stuff
|
|
171
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
172
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
173
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
174
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
175
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
176
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
177
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
178
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
179
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
180
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
181
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
182
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
183
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
184
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
185
|
+
...DefaultSlashConfig,
|
|
186
|
+
...DefaultNetworkDBMapSizeConfig
|
|
187
|
+
};
|
|
188
|
+
export const testnetL2ChainConfig = {
|
|
189
|
+
l1ChainId: 11155111,
|
|
190
|
+
testAccounts: false,
|
|
191
|
+
sponsoredFPC: true,
|
|
192
|
+
p2pEnabled: true,
|
|
193
|
+
disableTransactions: true,
|
|
194
|
+
p2pBootstrapNodes: [],
|
|
195
|
+
seqMinTxsPerBlock: 0,
|
|
196
|
+
seqMaxTxsPerBlock: 0,
|
|
197
|
+
realProofs: true,
|
|
198
|
+
snapshotsUrls: [
|
|
199
|
+
`${SNAPSHOTS_URL}/testnet/`
|
|
200
|
+
],
|
|
201
|
+
autoUpdate: 'config-and-version',
|
|
202
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
|
|
203
|
+
maxTxPoolSize: 100_000_000,
|
|
204
|
+
publicIncludeMetrics,
|
|
205
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
206
|
+
publicMetricsCollectFrom: [
|
|
207
|
+
'sequencer'
|
|
208
|
+
],
|
|
209
|
+
skipArchiverInitialSync: true,
|
|
210
|
+
blobAllowEmptySources: true,
|
|
211
|
+
// Deployment stuff
|
|
212
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
213
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
214
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
215
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
216
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
217
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
218
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
219
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
220
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
221
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
222
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
223
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
224
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
225
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
226
|
+
...DefaultSlashConfig,
|
|
227
|
+
slashPrunePenalty: 0n,
|
|
228
|
+
slashDataWithholdingPenalty: 0n,
|
|
229
|
+
...DefaultNetworkDBMapSizeConfig
|
|
230
|
+
};
|
|
231
|
+
export const mainnetL2ChainConfig = {
|
|
232
|
+
l1ChainId: 1,
|
|
233
|
+
testAccounts: false,
|
|
234
|
+
sponsoredFPC: false,
|
|
235
|
+
p2pEnabled: true,
|
|
236
|
+
disableTransactions: true,
|
|
237
|
+
p2pBootstrapNodes: [],
|
|
238
|
+
seqMinTxsPerBlock: 0,
|
|
239
|
+
seqMaxTxsPerBlock: 0,
|
|
240
|
+
realProofs: true,
|
|
241
|
+
snapshotsUrls: [
|
|
242
|
+
`${SNAPSHOTS_URL}/mainnet/`
|
|
243
|
+
],
|
|
244
|
+
autoUpdate: 'notify',
|
|
245
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
|
|
246
|
+
maxTxPoolSize: 100_000_000,
|
|
247
|
+
publicIncludeMetrics,
|
|
248
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
249
|
+
publicMetricsCollectFrom: [
|
|
250
|
+
'sequencer'
|
|
251
|
+
],
|
|
252
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
253
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
254
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
255
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
256
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
257
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
258
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
259
|
+
localEjectionThreshold: 196_000n * 10n ** 18n,
|
|
260
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
261
|
+
slashingRoundSizeInEpochs: 4,
|
|
262
|
+
slashingLifetimeInRounds: 40,
|
|
263
|
+
slashingExecutionDelayInRounds: 28,
|
|
264
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
265
|
+
slashAmountMedium: 10_000n * 10n ** 18n,
|
|
266
|
+
slashAmountLarge: 50_000n * 10n ** 18n,
|
|
267
|
+
slashingOffsetInRounds: 2,
|
|
268
|
+
slasherFlavor: 'tally',
|
|
269
|
+
slashingVetoer: EthAddress.ZERO,
|
|
270
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
271
|
+
exitDelaySeconds: 5 * 24 * 60 * 60,
|
|
272
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
273
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
274
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
275
|
+
governanceProposerRoundSize: 300,
|
|
276
|
+
governanceProposerQuorum: 151,
|
|
277
|
+
// Node slashing config
|
|
278
|
+
// TODO TMNT-330
|
|
279
|
+
slashMinPenaltyPercentage: 0.5,
|
|
280
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
281
|
+
slashInactivityTargetPercentage: 0.7,
|
|
282
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
283
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
284
|
+
slashPrunePenalty: 0n,
|
|
285
|
+
slashDataWithholdingPenalty: 0n,
|
|
286
|
+
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
287
|
+
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
288
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
289
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
290
|
+
slashMaxPayloadSize: 50,
|
|
291
|
+
slashGracePeriodL2Slots: 32 * 4,
|
|
292
|
+
slashOffenseExpirationRounds: 8,
|
|
293
|
+
sentinelEnabled: true,
|
|
294
|
+
slashExecuteRoundsLookBack: 4,
|
|
295
|
+
...DefaultNetworkDBMapSizeConfig
|
|
296
|
+
};
|
|
297
|
+
export const devnetL2ChainConfig = {
|
|
298
|
+
l1ChainId: 11155111,
|
|
299
|
+
testAccounts: true,
|
|
300
|
+
sponsoredFPC: true,
|
|
301
|
+
p2pEnabled: true,
|
|
302
|
+
disableTransactions: false,
|
|
303
|
+
p2pBootstrapNodes: [],
|
|
304
|
+
seqMinTxsPerBlock: 0,
|
|
305
|
+
seqMaxTxsPerBlock: 8,
|
|
306
|
+
realProofs: false,
|
|
307
|
+
snapshotsUrls: [],
|
|
308
|
+
autoUpdate: 'config-and-version',
|
|
309
|
+
autoUpdateUrl: '',
|
|
310
|
+
publicIncludeMetrics,
|
|
311
|
+
publicMetricsCollectorUrl: '',
|
|
312
|
+
publicMetricsCollectFrom: [
|
|
313
|
+
''
|
|
314
|
+
],
|
|
315
|
+
maxTxPoolSize: 100_000_000,
|
|
316
|
+
// Deployment stuff
|
|
317
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
318
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
319
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 8,
|
|
320
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 1,
|
|
321
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 1,
|
|
322
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
323
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
324
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
325
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
326
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
327
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
328
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
329
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
330
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
331
|
+
...DefaultSlashConfig,
|
|
332
|
+
...DefaultNetworkDBMapSizeConfig
|
|
333
|
+
};
|
|
334
|
+
export function getL2ChainConfig(networkName) {
|
|
335
|
+
let config;
|
|
336
|
+
if (networkName === 'staging-public') {
|
|
337
|
+
config = {
|
|
338
|
+
...stagingPublicL2ChainConfig
|
|
339
|
+
};
|
|
340
|
+
} else if (networkName === 'testnet') {
|
|
341
|
+
config = {
|
|
342
|
+
...testnetL2ChainConfig
|
|
343
|
+
};
|
|
344
|
+
} else if (networkName === 'staging-ignition') {
|
|
345
|
+
config = {
|
|
346
|
+
...stagingIgnitionL2ChainConfig
|
|
347
|
+
};
|
|
348
|
+
} else if (networkName === 'mainnet') {
|
|
349
|
+
config = {
|
|
350
|
+
...mainnetL2ChainConfig
|
|
351
|
+
};
|
|
352
|
+
} else if (networkName === 'next-net') {
|
|
353
|
+
config = {
|
|
354
|
+
...nextNetL2ChainConfig
|
|
355
|
+
};
|
|
356
|
+
} else if (networkName === 'devnet') {
|
|
357
|
+
config = {
|
|
358
|
+
...devnetL2ChainConfig
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return config;
|
|
362
|
+
}
|
|
363
|
+
function getDefaultDataDir(networkName) {
|
|
364
|
+
return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
|
|
365
|
+
}
|
|
366
|
+
export function enrichEnvironmentWithChainConfig(networkName) {
|
|
367
|
+
if (networkName === 'local') {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
|
|
371
|
+
const config = getL2ChainConfig(networkName);
|
|
372
|
+
if (!config) {
|
|
373
|
+
throw new Error(`Unknown network name: ${networkName}`);
|
|
374
|
+
}
|
|
375
|
+
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
376
|
+
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
377
|
+
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
378
|
+
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
379
|
+
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
380
|
+
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
381
|
+
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
382
|
+
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
383
|
+
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
384
|
+
enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
|
|
385
|
+
enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
|
|
386
|
+
enrichVar('DATA_STORE_MAP_SIZE_KB', config.dbMapSizeKb.toString());
|
|
387
|
+
enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
|
|
388
|
+
enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
|
|
389
|
+
enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
|
|
390
|
+
enrichVar('PUBLIC_DATA_TREE_MAP_SIZE_KB', config.publicDataTreeMapSizeKb.toString());
|
|
391
|
+
if (config.skipArchiverInitialSync !== undefined) {
|
|
392
|
+
enrichVar('SKIP_ARCHIVER_INITIAL_SYNC', config.skipArchiverInitialSync.toString());
|
|
393
|
+
}
|
|
394
|
+
if (config.blobAllowEmptySources !== undefined) {
|
|
395
|
+
enrichVar('BLOB_ALLOW_EMPTY_SOURCES', config.blobAllowEmptySources.toString());
|
|
396
|
+
}
|
|
397
|
+
if (config.autoUpdate) {
|
|
398
|
+
enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
|
|
399
|
+
}
|
|
400
|
+
if (config.autoUpdateUrl) {
|
|
401
|
+
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
402
|
+
}
|
|
403
|
+
if (config.publicIncludeMetrics) {
|
|
404
|
+
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
405
|
+
}
|
|
406
|
+
if (config.publicMetricsCollectorUrl) {
|
|
407
|
+
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
408
|
+
}
|
|
409
|
+
if (config.publicMetricsCollectFrom) {
|
|
410
|
+
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
411
|
+
}
|
|
412
|
+
// Deployment stuff
|
|
413
|
+
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
414
|
+
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
415
|
+
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
416
|
+
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
417
|
+
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
418
|
+
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
419
|
+
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
420
|
+
enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
|
|
421
|
+
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
422
|
+
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
423
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
|
424
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
|
|
425
|
+
enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
|
|
426
|
+
enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
|
|
427
|
+
enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
|
|
428
|
+
enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
|
|
429
|
+
enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
|
|
430
|
+
enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
|
|
431
|
+
enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
|
|
432
|
+
enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
|
|
433
|
+
enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
|
|
434
|
+
enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
|
|
435
|
+
enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
|
|
436
|
+
// Slashing
|
|
437
|
+
enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
|
|
438
|
+
enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
|
|
439
|
+
enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
|
|
440
|
+
enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
|
|
441
|
+
enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
|
|
442
|
+
enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
|
|
443
|
+
enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
|
|
444
|
+
enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
|
|
445
|
+
enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
|
|
446
|
+
enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
|
|
447
|
+
enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
|
|
448
|
+
enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
|
|
449
|
+
enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
|
|
450
|
+
enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
|
|
451
|
+
enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
|
|
452
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrich_env.d.ts","sourceRoot":"","sources":["../../src/config/enrich_env.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,QAMlE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAGhE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
export function enrichVar(envVar, value) {
|
|
3
|
+
// Don't override
|
|
4
|
+
if (process.env[envVar] || value === undefined) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
process.env[envVar] = value;
|
|
8
|
+
}
|
|
9
|
+
export function enrichEthAddressVar(envVar, value) {
|
|
10
|
+
// EthAddress doesn't like being given empty strings
|
|
11
|
+
enrichVar(envVar, value || EthAddress.ZERO.toString());
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type L1ContractAddresses, getL1ContractsConfig } from '@aztec/ethereum';
|
|
2
|
+
import { 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
|
+
export declare function getL1RollupAddressFromEnv(l1RpcUrls: string[], l1ChainId: number): Promise<EthAddress>;
|
|
8
|
+
//# sourceMappingURL=get_l1_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/config/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,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;AAED,wBAAsB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,uBAOrF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId, rollupVersion = 'canonical') {
|
|
4
|
+
const publicClient = getPublicClient({
|
|
5
|
+
l1RpcUrls,
|
|
6
|
+
l1ChainId
|
|
7
|
+
});
|
|
8
|
+
const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
|
|
9
|
+
const config = await getL1ContractsConfig(publicClient, addresses);
|
|
10
|
+
return {
|
|
11
|
+
addresses,
|
|
12
|
+
config
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export async function getL1RollupAddressFromEnv(l1RpcUrls, l1ChainId) {
|
|
16
|
+
const registryAddress = process.env.REGISTRY_CONTRACT_ADDRESS;
|
|
17
|
+
if (!registryAddress || !EthAddress.isAddress(registryAddress)) {
|
|
18
|
+
throw new Error(`Failed to extract registry address`);
|
|
19
|
+
}
|
|
20
|
+
const { addresses } = await getL1Config(EthAddress.fromString(registryAddress), l1RpcUrls, l1ChainId);
|
|
21
|
+
return addresses.rollupAddress;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type NetworkConfig, type NetworkNames } from '@aztec/foundation/config';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches remote network configuration from GitHub with caching support.
|
|
4
|
+
* Uses the reusable cachedFetch utility.
|
|
5
|
+
*
|
|
6
|
+
* @param networkName - The network name to fetch config for
|
|
7
|
+
* @param cacheDir - Optional cache directory for storing fetched config
|
|
8
|
+
* @returns Remote configuration for the specified network, or undefined if not found/error
|
|
9
|
+
*/
|
|
10
|
+
export declare function getNetworkConfig(networkName: NetworkNames, cacheDir?: string): Promise<NetworkConfig | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Enriches environment variables with remote network configuration.
|
|
13
|
+
* This function is called before node config initialization to set env vars
|
|
14
|
+
* from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
|
|
15
|
+
*
|
|
16
|
+
* @param networkName - The network name to fetch remote config for
|
|
17
|
+
*/
|
|
18
|
+
export declare function enrichEnvironmentWithNetworkConfig(networkName: NetworkNames): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=network_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network_config.d.ts","sourceRoot":"","sources":["../../src/config/network_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA0B,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAYzG;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAiDpC;AAED;;;;;;GAMG;AACH,wBAAsB,kCAAkC,CAAC,WAAW,EAAE,YAAY,iBAoBjF"}
|