@aztec/cli 0.0.0-test.1 → 0.0.1-fake-ceab37513c
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/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +9 -5
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +3 -3
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -1
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +27 -15
- 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 +14 -12
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +3 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +3 -3
- 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 +4 -4
- 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 +22 -5
- package/dest/cmds/l1/deploy_new_rollup.d.ts +2 -1
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +16 -7
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +17 -17
- package/dest/cmds/l1/index.d.ts +1 -0
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +29 -39
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
- package/dest/cmds/l1/trigger_seed_snapshot.js +19 -0
- package/dest/cmds/l1/update_l1_validators.d.ts +17 -2
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +156 -101
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +7 -3
- package/dest/cmds/misc/update/github.d.ts +0 -1
- package/dest/cmds/misc/update/github.d.ts.map +1 -1
- package/dest/cmds/misc/update/github.js +0 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +2 -3
- package/dest/cmds/pxe/get_contract_data.js +1 -1
- package/dest/cmds/pxe/get_node_info.d.ts.map +1 -1
- package/dest/cmds/pxe/get_node_info.js +11 -7
- package/dest/cmds/pxe/get_pxe_info.js +2 -2
- 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 +38 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +376 -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 +12 -11
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +52 -22
- package/dest/utils/commands.d.ts +1 -1
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +5 -5
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/github.d.ts +0 -1
- package/dest/utils/github.d.ts.map +1 -1
- package/dest/utils/github.js +0 -1
- package/dest/utils/index.d.ts +1 -0
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -0
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +18 -26
- package/dest/utils/setup_contracts.d.ts +5 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +36 -0
- package/package.json +38 -32
- package/src/cmds/contracts/inspect_contract.ts +16 -6
- package/src/cmds/infrastructure/index.ts +10 -2
- package/src/cmds/infrastructure/sequencers.ts +32 -15
- package/src/cmds/infrastructure/setup_l2_contract.ts +16 -11
- package/src/cmds/l1/advance_epoch.ts +3 -2
- package/src/cmds/l1/assume_proven_through.ts +3 -3
- package/src/cmds/l1/bridge_erc20.ts +4 -3
- package/src/cmds/l1/deploy_l1_contracts.ts +30 -6
- package/src/cmds/l1/deploy_new_rollup.ts +22 -8
- package/src/cmds/l1/governance_utils.ts +18 -17
- package/src/cmds/l1/index.ts +69 -96
- package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
- package/src/cmds/l1/update_l1_validators.ts +191 -92
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
- package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
- package/src/cmds/misc/index.ts +13 -4
- package/src/cmds/misc/update/github.ts +0 -1
- package/src/cmds/misc/update.ts +1 -7
- package/src/cmds/pxe/get_contract_data.ts +1 -1
- package/src/cmds/pxe/get_node_info.ts +10 -7
- package/src/cmds/pxe/get_pxe_info.ts +2 -2
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +493 -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 +76 -27
- package/src/utils/commands.ts +5 -5
- package/src/utils/encoding.ts +1 -1
- package/src/utils/github.ts +0 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/inspect.ts +18 -25
- package/src/utils/setup_contracts.ts +58 -0
- 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 -196
- 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 +0 -4
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
- package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
- package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
- package/dest/cmds/misc/setup_contracts.d.ts +0 -7
- package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
- package/dest/cmds/misc/setup_contracts.js +0 -27
- package/src/cmds/devnet/bootstrap_network.ts +0 -318
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
- package/src/cmds/misc/setup_contracts.ts +0 -40
package/dest/cmds/misc/index.js
CHANGED
|
@@ -16,9 +16,9 @@ export function injectCommands(program, log) {
|
|
|
16
16
|
const { generateP2PPrivateKey } = await import('./generate_p2p_private_key.js');
|
|
17
17
|
await generateP2PPrivateKey(log);
|
|
18
18
|
});
|
|
19
|
-
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<
|
|
19
|
+
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<p2pIp>', 'The bootnode P2P IP address').argument('<p2pPort>', 'The bootnode P2P port').addOption(l1ChainIdOption).action(async (privateKey, p2pIp, p2pPort, options)=>{
|
|
20
20
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
21
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
21
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
22
22
|
});
|
|
23
23
|
program.command('decode-enr').summary('Decodes an ENR record').description('Decodes and ENR record').argument('<enr>', 'The encoded ENR string').action(async (enr)=>{
|
|
24
24
|
await printENR(enr, log);
|
|
@@ -33,7 +33,11 @@ export function injectCommands(program, log) {
|
|
|
33
33
|
});
|
|
34
34
|
program.command('generate-secret-and-hash').description('Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults)').action(async ()=>{
|
|
35
35
|
const { generateSecretAndHash } = await import('./generate_secret_and_hash.js');
|
|
36
|
-
generateSecretAndHash(log);
|
|
36
|
+
await generateSecretAndHash(log);
|
|
37
|
+
});
|
|
38
|
+
program.command('get-canonical-sponsored-fpc-address').description('Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI').action(async ()=>{
|
|
39
|
+
const { getCanonicalSponsoredFPCAddress } = await import('./get_canonical_sponsored_fpc_address.js');
|
|
40
|
+
await getCanonicalSponsoredFPCAddress(log);
|
|
37
41
|
});
|
|
38
42
|
program.command('update').description('Updates Nodejs and Noir dependencies').argument('[projectPath]', 'Path to the project directory', process.cwd()).option('--contract [paths...]', 'Paths to contracts to update dependencies', []).option('--aztec-version <semver>', 'The version to update Aztec packages to. Defaults to latest', 'latest').action(async (projectPath, options)=>{
|
|
39
43
|
const { updateProject } = await import('./update.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/cmds/misc/update/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/cmds/misc/update/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAYnD,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
|
package/dest/cmds/misc/update.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { relative, resolve } from 'path';
|
|
2
2
|
import { parse } from 'semver';
|
|
3
|
-
import { GITHUB_TAG_PREFIX } from './update/github.js';
|
|
4
3
|
import { updateAztecNr } from './update/noir.js';
|
|
5
4
|
import { getNewestVersion, updateAztecDeps, updateLockfile } from './update/npm.js';
|
|
6
5
|
const AZTECJS_PACKAGE = '@aztec/aztec.js';
|
|
@@ -26,7 +25,7 @@ export async function updateProject(projectPath, contracts, aztecVersion, log) {
|
|
|
26
25
|
}
|
|
27
26
|
for (const contract of contracts){
|
|
28
27
|
try {
|
|
29
|
-
projectDependencyChanges.push(await updateAztecNr(resolve(process.cwd(), projectPath, contract),
|
|
28
|
+
projectDependencyChanges.push(await updateAztecNr(resolve(process.cwd(), projectPath, contract), `v${targetAztecVersion.version}`, log));
|
|
30
29
|
} catch (err) {
|
|
31
30
|
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {
|
|
32
31
|
log(`No Nargo.toml found in ${relative(process.cwd(), contract)}. Skipping...`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
2
|
export async function getContractData(rpcUrl, contractAddress, includeBytecode, debugLogger, log) {
|
|
3
3
|
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const { contractInstance: instance, isContractInitialized: isInitialized,
|
|
4
|
+
const { contractInstance: instance, isContractInitialized: isInitialized, isContractPublished: isPubliclyDeployed } = await client.getContractMetadata(contractAddress);
|
|
5
5
|
const contractClass = includeBytecode && instance && (await client.getContractClassMetadata(instance?.currentContractClassId)).contractClass;
|
|
6
6
|
const isPrivatelyDeployed = !!instance;
|
|
7
7
|
const initStr = isInitialized ? 'initialized' : 'not initialized';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBAgE/B"}
|
|
@@ -11,7 +11,7 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
11
11
|
logJson({
|
|
12
12
|
nodeVersion: info.nodeVersion,
|
|
13
13
|
l1ChainId: info.l1ChainId,
|
|
14
|
-
|
|
14
|
+
rollupVersion: info.rollupVersion,
|
|
15
15
|
enr: info.enr,
|
|
16
16
|
l1ContractAddresses: {
|
|
17
17
|
rollup: info.l1ContractAddresses.rollupAddress.toString(),
|
|
@@ -25,19 +25,21 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
25
25
|
rewardDistributor: info.l1ContractAddresses.rewardDistributorAddress.toString(),
|
|
26
26
|
governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(),
|
|
27
27
|
governance: info.l1ContractAddresses.governanceAddress.toString(),
|
|
28
|
-
slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString()
|
|
28
|
+
slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString(),
|
|
29
|
+
feeAssetHandler: info.l1ContractAddresses.feeAssetHandlerAddress?.toString(),
|
|
30
|
+
stakingAssetHandler: info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()
|
|
29
31
|
},
|
|
30
32
|
protocolContractAddresses: {
|
|
31
|
-
|
|
33
|
+
classRegistry: info.protocolContractAddresses.classRegistry.toString(),
|
|
32
34
|
feeJuice: info.protocolContractAddresses.feeJuice.toString(),
|
|
33
|
-
|
|
35
|
+
instanceRegistry: info.protocolContractAddresses.instanceRegistry.toString(),
|
|
34
36
|
multiCallEntrypoint: info.protocolContractAddresses.multiCallEntrypoint.toString()
|
|
35
37
|
}
|
|
36
38
|
});
|
|
37
39
|
} else {
|
|
38
40
|
log(`Node Version: ${info.nodeVersion}`);
|
|
39
41
|
log(`Chain Id: ${info.l1ChainId}`);
|
|
40
|
-
log(`
|
|
42
|
+
log(`Rollup Version: ${info.rollupVersion}`);
|
|
41
43
|
log(`Node ENR: ${info.enr}`);
|
|
42
44
|
log(`L1 Contract Addresses:`);
|
|
43
45
|
log(` Rollup Address: ${info.l1ContractAddresses.rollupAddress.toString()}`);
|
|
@@ -52,10 +54,12 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
52
54
|
log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
53
55
|
log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`);
|
|
54
56
|
log(` SlashFactory Address: ${info.l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
57
|
+
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
58
|
+
log(` StakingAssetHandler Address: ${info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
|
|
55
59
|
log(`L2 Contract Addresses:`);
|
|
56
|
-
log(` Class
|
|
60
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
57
61
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
58
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
62
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
59
63
|
log(` MultiCall: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
@@ -4,8 +4,8 @@ export async function getPXEInfo(rpcUrl, debugLogger, log) {
|
|
|
4
4
|
const info = await client.getPXEInfo();
|
|
5
5
|
log(`PXE Version: ${info.pxeVersion}`);
|
|
6
6
|
log(`Protocol Contract Addresses:`);
|
|
7
|
-
log(` Class
|
|
7
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
8
8
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
9
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
9
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
10
10
|
log(` Multi Call Entrypoint: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
11
11
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface CachedFetchOptions {
|
|
2
|
+
/** Cache duration in milliseconds */
|
|
3
|
+
cacheDurationMs: number;
|
|
4
|
+
/** The cache file */
|
|
5
|
+
cacheFile?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Fetches data from a URL with file-based caching support.
|
|
9
|
+
* This utility can be used by both remote config and bootnodes fetching.
|
|
10
|
+
*
|
|
11
|
+
* @param url - The URL to fetch from
|
|
12
|
+
* @param networkName - Network name for cache directory structure
|
|
13
|
+
* @param options - Caching and error handling options
|
|
14
|
+
* @param cacheDir - Optional cache directory (defaults to no caching)
|
|
15
|
+
* @returns The fetched and parsed JSON data, or undefined if fetch fails and throwOnError is false
|
|
16
|
+
*/
|
|
17
|
+
export declare function cachedFetch<T = any>(url: string, options: CachedFetchOptions, fetch?: typeof globalThis.fetch, log?: import("@aztec/aztec.js").Logger): Promise<T | undefined>;
|
|
18
|
+
//# sourceMappingURL=cached_fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached_fetch.d.ts","sourceRoot":"","sources":["../../src/config/cached_fetch.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,GAAG,EACvC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,kBAAkB,EAC3B,KAAK,0BAAmB,EACxB,GAAG,mCAA+B,GACjC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAuCxB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/aztec.js';
|
|
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,38 @@
|
|
|
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 { P2PConfig } from '@aztec/p2p/config';
|
|
5
|
+
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
export type L2ChainConfig = L1ContractsConfig & Pick<P2PConfig, 'txPoolDeleteTxsAfterReorg'> & Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways'> & {
|
|
7
|
+
l1ChainId: number;
|
|
8
|
+
testAccounts: boolean;
|
|
9
|
+
sponsoredFPC: boolean;
|
|
10
|
+
p2pEnabled: boolean;
|
|
11
|
+
p2pBootstrapNodes: string[];
|
|
12
|
+
seqMinTxsPerBlock: number;
|
|
13
|
+
seqMaxTxsPerBlock: number;
|
|
14
|
+
realProofs: boolean;
|
|
15
|
+
snapshotsUrls: string[];
|
|
16
|
+
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
17
|
+
autoUpdateUrl?: string;
|
|
18
|
+
maxTxPoolSize: number;
|
|
19
|
+
publicIncludeMetrics?: string[];
|
|
20
|
+
publicMetricsCollectorUrl?: string;
|
|
21
|
+
publicMetricsCollectFrom?: string[];
|
|
22
|
+
skipArchiverInitialSync?: boolean;
|
|
23
|
+
blobAllowEmptySources?: boolean;
|
|
24
|
+
dbMapSizeKb: number;
|
|
25
|
+
archiverStoreMapSizeKb: number;
|
|
26
|
+
noteHashTreeMapSizeKb: number;
|
|
27
|
+
nullifierTreeMapSizeKb: number;
|
|
28
|
+
publicDataTreeMapSizeKb: number;
|
|
29
|
+
sentinelEnabled: boolean;
|
|
30
|
+
disableTransactions: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare const stagingIgnitionL2ChainConfig: L2ChainConfig;
|
|
33
|
+
export declare const stagingPublicL2ChainConfig: L2ChainConfig;
|
|
34
|
+
export declare const testnetL2ChainConfig: L2ChainConfig;
|
|
35
|
+
export declare const mainnetL2ChainConfig: L2ChainConfig;
|
|
36
|
+
export declare function getL2ChainConfig(networkName: NetworkNames): L2ChainConfig | undefined;
|
|
37
|
+
export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): void;
|
|
38
|
+
//# 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,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAYrE,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,GAC5C,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,aAiF1C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAoDxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAyDlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAgFlC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS,CAYrF;AAMD,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,YAAY,QAoGzE"}
|
|
@@ -0,0 +1,376 @@
|
|
|
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
|
+
txPoolDeleteTxsAfterReorg: false,
|
|
68
|
+
blobAllowEmptySources: true,
|
|
69
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
70
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
71
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
72
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
73
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
74
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
75
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
76
|
+
slashingRoundSizeInEpochs: 4,
|
|
77
|
+
slashingLifetimeInRounds: 40,
|
|
78
|
+
slashingExecutionDelayInRounds: 28,
|
|
79
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
80
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
81
|
+
slashAmountMedium: 10_000n * 10n ** 18n,
|
|
82
|
+
slashAmountLarge: 50_000n * 10n ** 18n,
|
|
83
|
+
slashingOffsetInRounds: 2,
|
|
84
|
+
slasherFlavor: 'tally',
|
|
85
|
+
slashingVetoer: EthAddress.ZERO,
|
|
86
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
87
|
+
exitDelaySeconds: 5 * 24 * 60 * 60,
|
|
88
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
89
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
90
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
91
|
+
localEjectionThreshold: 196_000n * 10n ** 18n,
|
|
92
|
+
governanceProposerRoundSize: 300,
|
|
93
|
+
governanceProposerQuorum: 151,
|
|
94
|
+
// Node slashing config
|
|
95
|
+
// TODO TMNT-330
|
|
96
|
+
slashMinPenaltyPercentage: 0.5,
|
|
97
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
98
|
+
slashInactivityTargetPercentage: 0.7,
|
|
99
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
100
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
101
|
+
slashPrunePenalty: 0n,
|
|
102
|
+
slashDataWithholdingPenalty: 0n,
|
|
103
|
+
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
104
|
+
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
105
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
106
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
107
|
+
slashMaxPayloadSize: 50,
|
|
108
|
+
slashGracePeriodL2Slots: 32 * 4,
|
|
109
|
+
slashOffenseExpirationRounds: 8,
|
|
110
|
+
sentinelEnabled: true,
|
|
111
|
+
slashExecuteRoundsLookBack: 4,
|
|
112
|
+
...DefaultNetworkDBMapSizeConfig
|
|
113
|
+
};
|
|
114
|
+
export const stagingPublicL2ChainConfig = {
|
|
115
|
+
l1ChainId: 11155111,
|
|
116
|
+
testAccounts: false,
|
|
117
|
+
sponsoredFPC: true,
|
|
118
|
+
disableTransactions: false,
|
|
119
|
+
p2pEnabled: true,
|
|
120
|
+
p2pBootstrapNodes: [],
|
|
121
|
+
seqMinTxsPerBlock: 0,
|
|
122
|
+
seqMaxTxsPerBlock: 20,
|
|
123
|
+
realProofs: true,
|
|
124
|
+
snapshotsUrls: [
|
|
125
|
+
`${SNAPSHOTS_URL}/staging-public/`
|
|
126
|
+
],
|
|
127
|
+
autoUpdate: 'config-and-version',
|
|
128
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
|
|
129
|
+
publicIncludeMetrics,
|
|
130
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
131
|
+
publicMetricsCollectFrom: [
|
|
132
|
+
'sequencer'
|
|
133
|
+
],
|
|
134
|
+
maxTxPoolSize: 100_000_000,
|
|
135
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
136
|
+
// Deployment stuff
|
|
137
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
138
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
139
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
140
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
141
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
142
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
143
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
144
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
145
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
146
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
147
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
148
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
149
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
150
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
151
|
+
...DefaultSlashConfig,
|
|
152
|
+
...DefaultNetworkDBMapSizeConfig
|
|
153
|
+
};
|
|
154
|
+
export const testnetL2ChainConfig = {
|
|
155
|
+
l1ChainId: 11155111,
|
|
156
|
+
testAccounts: false,
|
|
157
|
+
sponsoredFPC: true,
|
|
158
|
+
p2pEnabled: true,
|
|
159
|
+
disableTransactions: true,
|
|
160
|
+
p2pBootstrapNodes: [],
|
|
161
|
+
seqMinTxsPerBlock: 0,
|
|
162
|
+
seqMaxTxsPerBlock: 0,
|
|
163
|
+
realProofs: true,
|
|
164
|
+
snapshotsUrls: [
|
|
165
|
+
`${SNAPSHOTS_URL}/testnet/`
|
|
166
|
+
],
|
|
167
|
+
autoUpdate: 'config-and-version',
|
|
168
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
|
|
169
|
+
maxTxPoolSize: 100_000_000,
|
|
170
|
+
publicIncludeMetrics,
|
|
171
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
172
|
+
publicMetricsCollectFrom: [
|
|
173
|
+
'sequencer'
|
|
174
|
+
],
|
|
175
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
176
|
+
skipArchiverInitialSync: true,
|
|
177
|
+
blobAllowEmptySources: true,
|
|
178
|
+
// Deployment stuff
|
|
179
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
180
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
181
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
182
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
183
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
184
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
185
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
186
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
187
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
188
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
189
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
190
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
191
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
192
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
193
|
+
...DefaultSlashConfig,
|
|
194
|
+
slashPrunePenalty: 0n,
|
|
195
|
+
slashDataWithholdingPenalty: 0n,
|
|
196
|
+
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
197
|
+
...DefaultNetworkDBMapSizeConfig
|
|
198
|
+
};
|
|
199
|
+
export const mainnetL2ChainConfig = {
|
|
200
|
+
l1ChainId: 1,
|
|
201
|
+
testAccounts: false,
|
|
202
|
+
sponsoredFPC: false,
|
|
203
|
+
p2pEnabled: true,
|
|
204
|
+
disableTransactions: true,
|
|
205
|
+
p2pBootstrapNodes: [],
|
|
206
|
+
seqMinTxsPerBlock: 0,
|
|
207
|
+
seqMaxTxsPerBlock: 0,
|
|
208
|
+
realProofs: true,
|
|
209
|
+
snapshotsUrls: [
|
|
210
|
+
`${SNAPSHOTS_URL}/mainnet/`
|
|
211
|
+
],
|
|
212
|
+
autoUpdate: 'notify',
|
|
213
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
|
|
214
|
+
maxTxPoolSize: 100_000_000,
|
|
215
|
+
publicIncludeMetrics,
|
|
216
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
217
|
+
publicMetricsCollectFrom: [
|
|
218
|
+
'sequencer'
|
|
219
|
+
],
|
|
220
|
+
txPoolDeleteTxsAfterReorg: false,
|
|
221
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
222
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
223
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
224
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
225
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
226
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
227
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
228
|
+
slashingRoundSizeInEpochs: 4,
|
|
229
|
+
slashingLifetimeInRounds: 40,
|
|
230
|
+
slashingExecutionDelayInRounds: 28,
|
|
231
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
232
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
233
|
+
slashAmountMedium: 10_000n * 10n ** 18n,
|
|
234
|
+
slashAmountLarge: 50_000n * 10n ** 18n,
|
|
235
|
+
slashingOffsetInRounds: 2,
|
|
236
|
+
slasherFlavor: 'tally',
|
|
237
|
+
slashingVetoer: EthAddress.ZERO,
|
|
238
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
239
|
+
exitDelaySeconds: 5 * 24 * 60 * 60,
|
|
240
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
241
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
242
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
243
|
+
localEjectionThreshold: 196_000n * 10n ** 18n,
|
|
244
|
+
governanceProposerRoundSize: 300,
|
|
245
|
+
governanceProposerQuorum: 151,
|
|
246
|
+
// Node slashing config
|
|
247
|
+
// TODO TMNT-330
|
|
248
|
+
slashMinPenaltyPercentage: 0.5,
|
|
249
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
250
|
+
slashInactivityTargetPercentage: 0.7,
|
|
251
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
252
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
253
|
+
slashPrunePenalty: 0n,
|
|
254
|
+
slashDataWithholdingPenalty: 0n,
|
|
255
|
+
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
256
|
+
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
257
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
258
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
259
|
+
slashMaxPayloadSize: 50,
|
|
260
|
+
slashGracePeriodL2Slots: 32 * 4,
|
|
261
|
+
slashOffenseExpirationRounds: 8,
|
|
262
|
+
sentinelEnabled: true,
|
|
263
|
+
slashExecuteRoundsLookBack: 4,
|
|
264
|
+
...DefaultNetworkDBMapSizeConfig
|
|
265
|
+
};
|
|
266
|
+
export function getL2ChainConfig(networkName) {
|
|
267
|
+
let config;
|
|
268
|
+
if (networkName === 'staging-public') {
|
|
269
|
+
config = {
|
|
270
|
+
...stagingPublicL2ChainConfig
|
|
271
|
+
};
|
|
272
|
+
} else if (networkName === 'testnet') {
|
|
273
|
+
config = {
|
|
274
|
+
...testnetL2ChainConfig
|
|
275
|
+
};
|
|
276
|
+
} else if (networkName === 'staging-ignition') {
|
|
277
|
+
config = {
|
|
278
|
+
...stagingIgnitionL2ChainConfig
|
|
279
|
+
};
|
|
280
|
+
} else if (networkName === 'mainnet') {
|
|
281
|
+
config = {
|
|
282
|
+
...mainnetL2ChainConfig
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
return config;
|
|
286
|
+
}
|
|
287
|
+
function getDefaultDataDir(networkName) {
|
|
288
|
+
return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
|
|
289
|
+
}
|
|
290
|
+
export function enrichEnvironmentWithChainConfig(networkName) {
|
|
291
|
+
if (networkName === 'local') {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
|
|
295
|
+
const config = getL2ChainConfig(networkName);
|
|
296
|
+
if (!config) {
|
|
297
|
+
throw new Error(`Unknown network name: ${networkName}`);
|
|
298
|
+
}
|
|
299
|
+
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
300
|
+
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
301
|
+
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
302
|
+
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
303
|
+
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
304
|
+
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
305
|
+
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
306
|
+
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
307
|
+
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
308
|
+
enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
|
|
309
|
+
enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
|
|
310
|
+
enrichVar('DATA_STORE_MAP_SIZE_KB', config.dbMapSizeKb.toString());
|
|
311
|
+
enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
|
|
312
|
+
enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
|
|
313
|
+
enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
|
|
314
|
+
enrichVar('PUBLIC_DATA_TREE_MAP_SIZE_KB', config.publicDataTreeMapSizeKb.toString());
|
|
315
|
+
if (config.skipArchiverInitialSync !== undefined) {
|
|
316
|
+
enrichVar('SKIP_ARCHIVER_INITIAL_SYNC', config.skipArchiverInitialSync.toString());
|
|
317
|
+
}
|
|
318
|
+
if (config.blobAllowEmptySources !== undefined) {
|
|
319
|
+
enrichVar('BLOB_ALLOW_EMPTY_SOURCES', config.blobAllowEmptySources.toString());
|
|
320
|
+
}
|
|
321
|
+
if (config.autoUpdate) {
|
|
322
|
+
enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
|
|
323
|
+
}
|
|
324
|
+
if (config.autoUpdateUrl) {
|
|
325
|
+
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
326
|
+
}
|
|
327
|
+
if (config.publicIncludeMetrics) {
|
|
328
|
+
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
329
|
+
}
|
|
330
|
+
if (config.publicMetricsCollectorUrl) {
|
|
331
|
+
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
332
|
+
}
|
|
333
|
+
if (config.publicMetricsCollectFrom) {
|
|
334
|
+
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
335
|
+
}
|
|
336
|
+
// Deployment stuff
|
|
337
|
+
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
338
|
+
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
339
|
+
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
340
|
+
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
341
|
+
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
342
|
+
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
343
|
+
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
344
|
+
enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
|
|
345
|
+
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
346
|
+
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
347
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
|
348
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
|
|
349
|
+
enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
|
|
350
|
+
enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
|
|
351
|
+
enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
|
|
352
|
+
enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
|
|
353
|
+
enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
|
|
354
|
+
enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
|
|
355
|
+
enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
|
|
356
|
+
enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
|
|
357
|
+
enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
|
|
358
|
+
enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
|
|
359
|
+
enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
|
|
360
|
+
// Slashing
|
|
361
|
+
enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
|
|
362
|
+
enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
|
|
363
|
+
enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
|
|
364
|
+
enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
|
|
365
|
+
enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
|
|
366
|
+
enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
|
|
367
|
+
enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
|
|
368
|
+
enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
|
|
369
|
+
enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
|
|
370
|
+
enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
|
|
371
|
+
enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
|
|
372
|
+
enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
|
|
373
|
+
enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
|
|
374
|
+
enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
|
|
375
|
+
enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
|
|
376
|
+
}
|