@aztec/cli 0.0.0-test.1 → 0.0.1-commit.b655e406
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 +14 -15
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- 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 +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +8 -9
- package/dest/cmds/infrastructure/sequencers.d.ts +4 -4
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +29 -16
- 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 +11 -24
- 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 +8 -6
- 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 +9 -8
- package/dest/cmds/l1/bridge_erc20.d.ts +2 -2
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +5 -5
- 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 +23 -6
- 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 +17 -8
- 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/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 +33 -43
- 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 +159 -103
- 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 +3 -3
- 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/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/validator_keys/add.d.ts +5 -0
- package/dest/cmds/validator_keys/add.d.ts.map +1 -0
- package/dest/cmds/validator_keys/add.js +70 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.js +26 -0
- package/dest/cmds/validator_keys/index.d.ts +4 -0
- package/dest/cmds/validator_keys/index.d.ts.map +1 -0
- package/dest/cmds/validator_keys/index.js +20 -0
- package/dest/cmds/validator_keys/new.d.ts +26 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +60 -0
- package/dest/cmds/validator_keys/shared.d.ts +68 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +271 -0
- 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 +475 -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 -17
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +54 -49
- package/dest/utils/commands.d.ts +17 -9
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +40 -14
- 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 +3 -10
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +19 -109
- package/dest/utils/setup_contracts.d.ts +3 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +16 -0
- package/package.json +44 -33
- 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 +15 -23
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/contracts/inspect_contract.ts +16 -6
- package/src/cmds/infrastructure/index.ts +8 -10
- package/src/cmds/infrastructure/sequencers.ts +36 -19
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -25
- package/src/cmds/l1/advance_epoch.ts +7 -5
- package/src/cmds/l1/assume_proven_through.ts +8 -7
- package/src/cmds/l1/bridge_erc20.ts +7 -4
- package/src/cmds/l1/deploy_l1_contracts.ts +32 -7
- package/src/cmds/l1/deploy_new_rollup.ts +23 -9
- package/src/cmds/l1/get_l1_addresses.ts +1 -1
- package/src/cmds/l1/governance_utils.ts +18 -17
- package/src/cmds/l1/index.ts +74 -101
- package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
- package/src/cmds/l1/update_l1_validators.ts +194 -94
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/generate_secret_and_hash.ts +3 -3
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- 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/validator_keys/add.ts +113 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +33 -0
- package/src/cmds/validator_keys/index.ts +96 -0
- package/src/cmds/validator_keys/new.ts +120 -0
- package/src/cmds/validator_keys/shared.ts +321 -0
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +627 -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 +78 -65
- package/src/utils/commands.ts +54 -18
- 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 +23 -123
- package/src/utils/setup_contracts.ts +19 -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.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/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 -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/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,475 @@
|
|
|
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
|
+
slashMinPenaltyPercentage: 0.5,
|
|
93
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
94
|
+
slashInactivityTargetPercentage: 0.7,
|
|
95
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
96
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
97
|
+
slashPrunePenalty: 0n,
|
|
98
|
+
slashDataWithholdingPenalty: 0n,
|
|
99
|
+
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
100
|
+
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
101
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
102
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
103
|
+
slashMaxPayloadSize: 50,
|
|
104
|
+
slashGracePeriodL2Slots: 32 * 4,
|
|
105
|
+
slashOffenseExpirationRounds: 8,
|
|
106
|
+
sentinelEnabled: true,
|
|
107
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
108
|
+
slashExecuteRoundsLookBack: 4,
|
|
109
|
+
...DefaultNetworkDBMapSizeConfig
|
|
110
|
+
};
|
|
111
|
+
export const stagingPublicL2ChainConfig = {
|
|
112
|
+
l1ChainId: 11155111,
|
|
113
|
+
testAccounts: false,
|
|
114
|
+
sponsoredFPC: true,
|
|
115
|
+
disableTransactions: false,
|
|
116
|
+
p2pEnabled: true,
|
|
117
|
+
p2pBootstrapNodes: [],
|
|
118
|
+
seqMinTxsPerBlock: 0,
|
|
119
|
+
seqMaxTxsPerBlock: 20,
|
|
120
|
+
realProofs: true,
|
|
121
|
+
snapshotsUrls: [
|
|
122
|
+
`${SNAPSHOTS_URL}/staging-public/`
|
|
123
|
+
],
|
|
124
|
+
autoUpdate: 'config-and-version',
|
|
125
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
|
|
126
|
+
publicIncludeMetrics,
|
|
127
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
128
|
+
publicMetricsCollectFrom: [
|
|
129
|
+
'sequencer'
|
|
130
|
+
],
|
|
131
|
+
maxTxPoolSize: 100_000_000,
|
|
132
|
+
// Deployment stuff
|
|
133
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
134
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
135
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
136
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
137
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
138
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
139
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
140
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
141
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
142
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
143
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
144
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
145
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
146
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
147
|
+
...DefaultSlashConfig,
|
|
148
|
+
...DefaultNetworkDBMapSizeConfig
|
|
149
|
+
};
|
|
150
|
+
export const nextNetL2ChainConfig = {
|
|
151
|
+
l1ChainId: 11155111,
|
|
152
|
+
testAccounts: true,
|
|
153
|
+
sponsoredFPC: true,
|
|
154
|
+
p2pEnabled: true,
|
|
155
|
+
disableTransactions: false,
|
|
156
|
+
p2pBootstrapNodes: [],
|
|
157
|
+
seqMinTxsPerBlock: 0,
|
|
158
|
+
seqMaxTxsPerBlock: 8,
|
|
159
|
+
realProofs: true,
|
|
160
|
+
snapshotsUrls: [],
|
|
161
|
+
autoUpdate: 'config-and-version',
|
|
162
|
+
autoUpdateUrl: '',
|
|
163
|
+
publicIncludeMetrics,
|
|
164
|
+
publicMetricsCollectorUrl: '',
|
|
165
|
+
publicMetricsCollectFrom: [
|
|
166
|
+
''
|
|
167
|
+
],
|
|
168
|
+
maxTxPoolSize: 100_000_000,
|
|
169
|
+
// Deployment stuff
|
|
170
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
171
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
172
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
173
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
174
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
175
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
176
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
177
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
178
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
179
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
180
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
181
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
182
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
183
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
184
|
+
...DefaultSlashConfig,
|
|
185
|
+
...DefaultNetworkDBMapSizeConfig
|
|
186
|
+
};
|
|
187
|
+
export const testnetL2ChainConfig = {
|
|
188
|
+
l1ChainId: 11155111,
|
|
189
|
+
testAccounts: false,
|
|
190
|
+
sponsoredFPC: true,
|
|
191
|
+
p2pEnabled: true,
|
|
192
|
+
disableTransactions: true,
|
|
193
|
+
p2pBootstrapNodes: [],
|
|
194
|
+
seqMinTxsPerBlock: 0,
|
|
195
|
+
seqMaxTxsPerBlock: 0,
|
|
196
|
+
realProofs: true,
|
|
197
|
+
snapshotsUrls: [
|
|
198
|
+
`${SNAPSHOTS_URL}/testnet/`
|
|
199
|
+
],
|
|
200
|
+
autoUpdate: 'config-and-version',
|
|
201
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
|
|
202
|
+
maxTxPoolSize: 100_000_000,
|
|
203
|
+
publicIncludeMetrics,
|
|
204
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
205
|
+
publicMetricsCollectFrom: [
|
|
206
|
+
'sequencer'
|
|
207
|
+
],
|
|
208
|
+
skipArchiverInitialSync: true,
|
|
209
|
+
blobAllowEmptySources: true,
|
|
210
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
211
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
212
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
213
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
214
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
215
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
216
|
+
// This is a diff from mainnet: we have 2-strikes you're out, rather than 3 on mainnet.
|
|
217
|
+
localEjectionThreshold: 198_000n * 10n ** 18n,
|
|
218
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
219
|
+
slashingRoundSizeInEpochs: 4,
|
|
220
|
+
slashingExecutionDelayInRounds: 28,
|
|
221
|
+
slashingLifetimeInRounds: 34,
|
|
222
|
+
slashingVetoer: EthAddress.fromString('0xBbB4aF368d02827945748b28CD4b2D42e4A37480'),
|
|
223
|
+
slashingOffsetInRounds: 2,
|
|
224
|
+
slashingDisableDuration: 259_200,
|
|
225
|
+
slasherFlavor: 'tally',
|
|
226
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
227
|
+
slashAmountMedium: 2_000n * 10n ** 18n,
|
|
228
|
+
slashAmountLarge: 2_000n * 10n ** 18n,
|
|
229
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
230
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
231
|
+
exitDelaySeconds: 4 * 24 * 60 * 60,
|
|
232
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
233
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
234
|
+
governanceProposerRoundSize: 300,
|
|
235
|
+
governanceProposerQuorum: 151,
|
|
236
|
+
// Node slashing config
|
|
237
|
+
slashInactivityTargetPercentage: 0.8,
|
|
238
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
239
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
240
|
+
slashPrunePenalty: 0n,
|
|
241
|
+
slashDataWithholdingPenalty: 0n,
|
|
242
|
+
slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
|
|
243
|
+
slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
|
|
244
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
245
|
+
slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n,
|
|
246
|
+
slashGracePeriodL2Slots: 1_200,
|
|
247
|
+
slashOffenseExpirationRounds: 8,
|
|
248
|
+
slashMinPenaltyPercentage: 0.5,
|
|
249
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
250
|
+
slashMaxPayloadSize: 50,
|
|
251
|
+
slashExecuteRoundsLookBack: 4,
|
|
252
|
+
sentinelEnabled: true,
|
|
253
|
+
...DefaultNetworkDBMapSizeConfig
|
|
254
|
+
};
|
|
255
|
+
export const mainnetL2ChainConfig = {
|
|
256
|
+
l1ChainId: 1,
|
|
257
|
+
testAccounts: false,
|
|
258
|
+
sponsoredFPC: false,
|
|
259
|
+
p2pEnabled: true,
|
|
260
|
+
disableTransactions: true,
|
|
261
|
+
p2pBootstrapNodes: [],
|
|
262
|
+
seqMinTxsPerBlock: 0,
|
|
263
|
+
seqMaxTxsPerBlock: 0,
|
|
264
|
+
realProofs: true,
|
|
265
|
+
snapshotsUrls: [
|
|
266
|
+
`${SNAPSHOTS_URL}/mainnet/`
|
|
267
|
+
],
|
|
268
|
+
autoUpdate: 'notify',
|
|
269
|
+
autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
|
|
270
|
+
maxTxPoolSize: 100_000_000,
|
|
271
|
+
publicIncludeMetrics,
|
|
272
|
+
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
273
|
+
publicMetricsCollectFrom: [
|
|
274
|
+
'sequencer'
|
|
275
|
+
],
|
|
276
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
277
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
|
|
278
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
279
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 24,
|
|
280
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
281
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
282
|
+
localEjectionThreshold: 196_000n * 10n ** 18n,
|
|
283
|
+
/** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
|
|
284
|
+
slashingRoundSizeInEpochs: 4,
|
|
285
|
+
slashingExecutionDelayInRounds: 28,
|
|
286
|
+
slashingLifetimeInRounds: 34,
|
|
287
|
+
slashingVetoer: EthAddress.ZERO,
|
|
288
|
+
slashingOffsetInRounds: 2,
|
|
289
|
+
slashingDisableDuration: 259_200,
|
|
290
|
+
slasherFlavor: 'tally',
|
|
291
|
+
slashAmountSmall: 2_000n * 10n ** 18n,
|
|
292
|
+
slashAmountMedium: 2_000n * 10n ** 18n,
|
|
293
|
+
slashAmountLarge: 2_000n * 10n ** 18n,
|
|
294
|
+
/** The mana target for the rollup */ manaTarget: 0n,
|
|
295
|
+
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
296
|
+
exitDelaySeconds: 4 * 24 * 60 * 60,
|
|
297
|
+
activationThreshold: 200_000n * 10n ** 18n,
|
|
298
|
+
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
299
|
+
governanceProposerRoundSize: 1000,
|
|
300
|
+
governanceProposerQuorum: 600,
|
|
301
|
+
// Node slashing config
|
|
302
|
+
slashInactivityTargetPercentage: 0.8,
|
|
303
|
+
slashInactivityConsecutiveEpochThreshold: 2,
|
|
304
|
+
slashInactivityPenalty: 2_000n * 10n ** 18n,
|
|
305
|
+
slashPrunePenalty: 0n,
|
|
306
|
+
slashDataWithholdingPenalty: 0n,
|
|
307
|
+
slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
|
|
308
|
+
slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
|
|
309
|
+
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
310
|
+
slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n,
|
|
311
|
+
slashGracePeriodL2Slots: 1_200,
|
|
312
|
+
slashOffenseExpirationRounds: 8,
|
|
313
|
+
slashMinPenaltyPercentage: 0.5,
|
|
314
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
315
|
+
slashMaxPayloadSize: 50,
|
|
316
|
+
slashExecuteRoundsLookBack: 4,
|
|
317
|
+
sentinelEnabled: true,
|
|
318
|
+
...DefaultNetworkDBMapSizeConfig
|
|
319
|
+
};
|
|
320
|
+
export const devnetL2ChainConfig = {
|
|
321
|
+
l1ChainId: 11155111,
|
|
322
|
+
testAccounts: true,
|
|
323
|
+
sponsoredFPC: true,
|
|
324
|
+
p2pEnabled: true,
|
|
325
|
+
disableTransactions: false,
|
|
326
|
+
p2pBootstrapNodes: [],
|
|
327
|
+
seqMinTxsPerBlock: 0,
|
|
328
|
+
seqMaxTxsPerBlock: 8,
|
|
329
|
+
realProofs: false,
|
|
330
|
+
snapshotsUrls: [],
|
|
331
|
+
autoUpdate: 'config-and-version',
|
|
332
|
+
autoUpdateUrl: '',
|
|
333
|
+
publicIncludeMetrics,
|
|
334
|
+
publicMetricsCollectorUrl: '',
|
|
335
|
+
publicMetricsCollectFrom: [
|
|
336
|
+
''
|
|
337
|
+
],
|
|
338
|
+
maxTxPoolSize: 100_000_000,
|
|
339
|
+
// Deployment stuff
|
|
340
|
+
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
341
|
+
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
342
|
+
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 8,
|
|
343
|
+
/** The target validator committee size. */ aztecTargetCommitteeSize: 1,
|
|
344
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 1,
|
|
345
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
346
|
+
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
347
|
+
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
348
|
+
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
349
|
+
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
350
|
+
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
351
|
+
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
352
|
+
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
353
|
+
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
354
|
+
...DefaultSlashConfig,
|
|
355
|
+
...DefaultNetworkDBMapSizeConfig
|
|
356
|
+
};
|
|
357
|
+
export function getL2ChainConfig(networkName) {
|
|
358
|
+
let config;
|
|
359
|
+
if (networkName === 'staging-public') {
|
|
360
|
+
config = {
|
|
361
|
+
...stagingPublicL2ChainConfig
|
|
362
|
+
};
|
|
363
|
+
} else if (networkName === 'testnet') {
|
|
364
|
+
config = {
|
|
365
|
+
...testnetL2ChainConfig
|
|
366
|
+
};
|
|
367
|
+
} else if (networkName === 'staging-ignition') {
|
|
368
|
+
config = {
|
|
369
|
+
...stagingIgnitionL2ChainConfig
|
|
370
|
+
};
|
|
371
|
+
} else if (networkName === 'mainnet') {
|
|
372
|
+
config = {
|
|
373
|
+
...mainnetL2ChainConfig
|
|
374
|
+
};
|
|
375
|
+
} else if (networkName === 'next-net') {
|
|
376
|
+
config = {
|
|
377
|
+
...nextNetL2ChainConfig
|
|
378
|
+
};
|
|
379
|
+
} else if (networkName === 'devnet') {
|
|
380
|
+
config = {
|
|
381
|
+
...devnetL2ChainConfig
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
return config;
|
|
385
|
+
}
|
|
386
|
+
function getDefaultDataDir(networkName) {
|
|
387
|
+
return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
|
|
388
|
+
}
|
|
389
|
+
export function enrichEnvironmentWithChainConfig(networkName) {
|
|
390
|
+
if (networkName === 'local') {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
|
|
394
|
+
const config = getL2ChainConfig(networkName);
|
|
395
|
+
if (!config) {
|
|
396
|
+
throw new Error(`Unknown network name: ${networkName}`);
|
|
397
|
+
}
|
|
398
|
+
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
399
|
+
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
400
|
+
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
401
|
+
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
402
|
+
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
403
|
+
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
404
|
+
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
405
|
+
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
406
|
+
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
407
|
+
enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
|
|
408
|
+
enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
|
|
409
|
+
enrichVar('DATA_STORE_MAP_SIZE_KB', config.dbMapSizeKb.toString());
|
|
410
|
+
enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
|
|
411
|
+
enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
|
|
412
|
+
enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
|
|
413
|
+
enrichVar('PUBLIC_DATA_TREE_MAP_SIZE_KB', config.publicDataTreeMapSizeKb.toString());
|
|
414
|
+
if (config.skipArchiverInitialSync !== undefined) {
|
|
415
|
+
enrichVar('SKIP_ARCHIVER_INITIAL_SYNC', config.skipArchiverInitialSync.toString());
|
|
416
|
+
}
|
|
417
|
+
if (config.blobAllowEmptySources !== undefined) {
|
|
418
|
+
enrichVar('BLOB_ALLOW_EMPTY_SOURCES', config.blobAllowEmptySources.toString());
|
|
419
|
+
}
|
|
420
|
+
if (config.autoUpdate) {
|
|
421
|
+
enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
|
|
422
|
+
}
|
|
423
|
+
if (config.autoUpdateUrl) {
|
|
424
|
+
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
425
|
+
}
|
|
426
|
+
if (config.publicIncludeMetrics) {
|
|
427
|
+
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
428
|
+
}
|
|
429
|
+
if (config.publicMetricsCollectorUrl) {
|
|
430
|
+
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
431
|
+
}
|
|
432
|
+
if (config.publicMetricsCollectFrom) {
|
|
433
|
+
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
434
|
+
}
|
|
435
|
+
// Deployment stuff
|
|
436
|
+
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
437
|
+
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
438
|
+
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
439
|
+
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
440
|
+
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
441
|
+
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
442
|
+
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
443
|
+
enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
|
|
444
|
+
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
445
|
+
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
446
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
|
447
|
+
enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
|
|
448
|
+
enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
|
|
449
|
+
enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
|
|
450
|
+
enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
|
|
451
|
+
enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
|
|
452
|
+
enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
|
|
453
|
+
enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
|
|
454
|
+
enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
|
|
455
|
+
enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
|
|
456
|
+
enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
|
|
457
|
+
enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
|
|
458
|
+
enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
|
|
459
|
+
// Slashing
|
|
460
|
+
enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
|
|
461
|
+
enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
|
|
462
|
+
enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
|
|
463
|
+
enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
|
|
464
|
+
enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
|
|
465
|
+
enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
|
|
466
|
+
enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
|
|
467
|
+
enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
|
|
468
|
+
enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
|
|
469
|
+
enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
|
|
470
|
+
enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
|
|
471
|
+
enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
|
|
472
|
+
enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
|
|
473
|
+
enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
|
|
474
|
+
enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
|
|
475
|
+
}
|
|
@@ -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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NetworkConfigMapSchema } from '@aztec/foundation/config';
|
|
2
|
+
import { readFile } from 'fs/promises';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { cachedFetch } from './cached_fetch.js';
|
|
5
|
+
import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
|
|
6
|
+
const DEFAULT_CONFIG_URL = 'https://raw.githubusercontent.com/AztecProtocol/networks/refs/heads/main/network_config.json';
|
|
7
|
+
const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
|
|
8
|
+
/**
|
|
9
|
+
* Fetches remote network configuration from GitHub with caching support.
|
|
10
|
+
* Uses the reusable cachedFetch utility.
|
|
11
|
+
*
|
|
12
|
+
* @param networkName - The network name to fetch config for
|
|
13
|
+
* @param cacheDir - Optional cache directory for storing fetched config
|
|
14
|
+
* @returns Remote configuration for the specified network, or undefined if not found/error
|
|
15
|
+
*/ export async function getNetworkConfig(networkName, cacheDir) {
|
|
16
|
+
let url;
|
|
17
|
+
const configLocation = process.env.NETWORK_CONFIG_LOCATION || DEFAULT_CONFIG_URL;
|
|
18
|
+
if (!configLocation) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
if (configLocation.includes('://')) {
|
|
23
|
+
url = new URL(configLocation);
|
|
24
|
+
} else {
|
|
25
|
+
url = new URL(`file://${configLocation}`);
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
/* no-op */ }
|
|
29
|
+
if (!url) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
let rawConfig;
|
|
34
|
+
if (url.protocol === 'http:' || url.protocol === 'https:') {
|
|
35
|
+
rawConfig = await cachedFetch(url.href, {
|
|
36
|
+
cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
|
|
37
|
+
cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined
|
|
38
|
+
});
|
|
39
|
+
} else if (url.protocol === 'file:') {
|
|
40
|
+
rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
|
|
41
|
+
} else {
|
|
42
|
+
throw new Error('Unsupported Aztec network config protocol: ' + url.href);
|
|
43
|
+
}
|
|
44
|
+
if (!rawConfig) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
|
|
48
|
+
if (networkName in networkConfigMap) {
|
|
49
|
+
return networkConfigMap[networkName];
|
|
50
|
+
} else {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Enriches environment variables with remote network configuration.
|
|
59
|
+
* This function is called before node config initialization to set env vars
|
|
60
|
+
* from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
|
|
61
|
+
*
|
|
62
|
+
* @param networkName - The network name to fetch remote config for
|
|
63
|
+
*/ export async function enrichEnvironmentWithNetworkConfig(networkName) {
|
|
64
|
+
if (networkName === 'local') {
|
|
65
|
+
return; // No remote config for local development
|
|
66
|
+
}
|
|
67
|
+
const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
|
|
68
|
+
const networkConfig = await getNetworkConfig(networkName, cacheDir);
|
|
69
|
+
if (!networkConfig) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
enrichVar('BOOTSTRAP_NODES', networkConfig.bootnodes.join(','));
|
|
73
|
+
enrichVar('L1_CHAIN_ID', String(networkConfig.l1ChainId));
|
|
74
|
+
enrichVar('SYNC_SNAPSHOTS_URLS', networkConfig.snapshots.join(','));
|
|
75
|
+
enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', networkConfig.registryAddress.toString());
|
|
76
|
+
if (networkConfig.feeAssetHandlerAddress) {
|
|
77
|
+
enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', networkConfig.feeAssetHandlerAddress.toString());
|
|
78
|
+
}
|
|
79
|
+
}
|