@aztec/cli 0.0.1-commit.5daedc8 → 0.0.1-commit.6230efd
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/aztec_node/get_block.d.ts +1 -1
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -1
- package/dest/cmds/aztec_node/get_block.js +2 -1
- package/dest/cmds/aztec_node/get_logs.d.ts +3 -2
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +1 -1
- package/dest/cmds/infrastructure/index.d.ts +1 -1
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +0 -1
- package/dest/cmds/infrastructure/sequencers.d.ts +1 -2
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +9 -3
- 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 +2 -1
- 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 +2 -1
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
- package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +39 -4
- package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +3 -3
- 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/get_l1_addresses.js +5 -2
- package/dest/cmds/l1/get_l1_balance.js +4 -2
- package/dest/cmds/l1/governance_utils.d.ts +1 -1
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +3 -1
- package/dest/cmds/l1/index.d.ts +1 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +10 -8
- package/dest/cmds/l1/prover_stats.d.ts +1 -1
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
- package/dest/cmds/l1/prover_stats.js +4 -2
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +1 -1
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
- package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
- package/dest/cmds/l1/update_l1_validators.d.ts +1 -1
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +5 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +1 -1
- package/dest/cmds/validator_keys/generate_bls_keypair.js +1 -1
- package/dest/cmds/validator_keys/new.d.ts +1 -1
- package/dest/cmds/validator_keys/new.d.ts.map +1 -1
- package/dest/cmds/validator_keys/new.js +5 -2
- package/dest/cmds/validator_keys/shared.d.ts +1 -1
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
- package/dest/cmds/validator_keys/shared.js +2 -1
- package/dest/cmds/validator_keys/staker.d.ts +2 -2
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -1
- package/dest/cmds/validator_keys/staker.js +7 -4
- package/dest/cmds/validator_keys/utils.d.ts +1 -1
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -1
- package/dest/cmds/validator_keys/utils.js +1 -1
- package/dest/config/chain_l2_config.d.ts +6 -5
- package/dest/config/chain_l2_config.d.ts.map +1 -1
- package/dest/config/chain_l2_config.js +49 -30
- package/dest/config/get_l1_config.d.ts +3 -2
- package/dest/config/get_l1_config.d.ts.map +1 -1
- package/dest/config/get_l1_config.js +3 -1
- package/dest/config/network_config.d.ts +1 -1
- package/dest/config/network_config.d.ts.map +1 -1
- package/dest/config/network_config.js +6 -0
- package/dest/utils/aztec.d.ts +7 -13
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +19 -40
- package/dest/utils/commands.d.ts +7 -6
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +6 -5
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/inspect.d.ts +3 -2
- package/dest/utils/inspect.d.ts.map +1 -1
- package/package.json +34 -31
- package/src/cmds/aztec_node/get_block.ts +2 -1
- package/src/cmds/aztec_node/get_logs.ts +3 -2
- package/src/cmds/contracts/inspect_contract.ts +1 -1
- package/src/cmds/infrastructure/index.ts +0 -1
- package/src/cmds/infrastructure/sequencers.ts +5 -4
- package/src/cmds/l1/assume_proven_through.ts +4 -1
- package/src/cmds/l1/bridge_erc20.ts +2 -1
- package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +39 -22
- package/src/cmds/l1/deploy_new_rollup.ts +4 -9
- package/src/cmds/l1/get_l1_addresses.ts +4 -2
- package/src/cmds/l1/get_l1_balance.ts +2 -2
- package/src/cmds/l1/governance_utils.ts +3 -8
- package/src/cmds/l1/index.ts +7 -17
- package/src/cmds/l1/prover_stats.ts +6 -2
- package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
- package/src/cmds/l1/update_l1_validators.ts +5 -10
- package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
- package/src/cmds/misc/index.ts +1 -1
- package/src/cmds/validator_keys/generate_bls_keypair.ts +1 -1
- package/src/cmds/validator_keys/new.ts +3 -2
- package/src/cmds/validator_keys/shared.ts +2 -1
- package/src/cmds/validator_keys/staker.ts +5 -4
- package/src/cmds/validator_keys/utils.ts +2 -1
- package/src/config/chain_l2_config.ts +59 -33
- package/src/config/get_l1_config.ts +4 -1
- package/src/config/network_config.ts +7 -0
- package/src/utils/aztec.ts +24 -83
- package/src/utils/commands.ts +6 -5
- package/src/utils/encoding.ts +1 -1
- package/src/utils/inspect.ts +2 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
package/src/cmds/l1/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
3
3
|
|
|
4
4
|
import { type Command, Option } from 'commander';
|
|
5
5
|
|
|
6
|
-
import { getL1RollupAddressFromEnv } from '../../config/get_l1_config.js';
|
|
7
6
|
import {
|
|
8
7
|
ETHEREUM_HOSTS,
|
|
9
8
|
MNEMONIC,
|
|
@@ -15,8 +14,6 @@ import {
|
|
|
15
14
|
parseEthereumAddress,
|
|
16
15
|
} from '../../utils/commands.js';
|
|
17
16
|
|
|
18
|
-
export { addL1Validator } from './update_l1_validators.js';
|
|
19
|
-
|
|
20
17
|
const l1RpcUrlsOption = new Option(
|
|
21
18
|
'--l1-rpc-urls <string>',
|
|
22
19
|
'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
|
|
@@ -42,31 +39,25 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
42
39
|
)
|
|
43
40
|
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
44
41
|
.addOption(l1ChainIdOption)
|
|
45
|
-
.option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
|
|
46
42
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
47
43
|
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
48
44
|
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
49
|
-
.option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
|
|
50
45
|
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
51
46
|
.option('--existing-token <address>', 'Use an existing ERC20 for both fee and staking', parseEthereumAddress)
|
|
52
|
-
.option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
|
|
53
47
|
.action(async options => {
|
|
54
|
-
const {
|
|
48
|
+
const { deployL1ContractsCmd } = await import('./deploy_l1_contracts_cmd.js');
|
|
55
49
|
|
|
56
50
|
const initialValidators =
|
|
57
51
|
options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
|
|
58
|
-
await
|
|
52
|
+
await deployL1ContractsCmd(
|
|
59
53
|
options.l1RpcUrls,
|
|
60
54
|
options.l1ChainId,
|
|
61
55
|
options.privateKey,
|
|
62
56
|
options.mnemonic,
|
|
63
57
|
options.mnemonicIndex,
|
|
64
|
-
options.salt,
|
|
65
58
|
options.testAccounts,
|
|
66
59
|
options.sponsoredFpc,
|
|
67
|
-
options.acceleratedTestDeployments,
|
|
68
60
|
options.json,
|
|
69
|
-
options.createVerificationJson,
|
|
70
61
|
initialValidators,
|
|
71
62
|
options.realVerifier,
|
|
72
63
|
options.existingToken,
|
|
@@ -89,12 +80,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
89
80
|
)
|
|
90
81
|
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
91
82
|
.addOption(l1ChainIdOption)
|
|
92
|
-
.option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
|
|
93
83
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
94
84
|
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
95
85
|
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
96
86
|
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
97
|
-
.option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
|
|
98
87
|
.action(async options => {
|
|
99
88
|
const { deployNewRollup } = await import('./deploy_new_rollup.js');
|
|
100
89
|
|
|
@@ -107,15 +96,12 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
107
96
|
options.privateKey,
|
|
108
97
|
options.mnemonic,
|
|
109
98
|
options.mnemonicIndex,
|
|
110
|
-
options.salt,
|
|
111
99
|
options.testAccounts,
|
|
112
100
|
options.sponsoredFpc,
|
|
113
101
|
options.json,
|
|
114
102
|
initialValidators,
|
|
115
103
|
options.realVerifier,
|
|
116
|
-
options.createVerificationJson,
|
|
117
104
|
log,
|
|
118
|
-
debugLogger,
|
|
119
105
|
);
|
|
120
106
|
});
|
|
121
107
|
|
|
@@ -313,7 +299,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
313
299
|
.action(async options => {
|
|
314
300
|
const { addL1ValidatorViaRollup } = await import('./update_l1_validators.js');
|
|
315
301
|
|
|
316
|
-
|
|
302
|
+
let rollupAddress = options.rollup;
|
|
303
|
+
if (!rollupAddress) {
|
|
304
|
+
const { getL1RollupAddressFromEnv } = await import('../../config/get_l1_config.js');
|
|
305
|
+
rollupAddress = await getL1RollupAddressFromEnv(options.l1RpcUrls, options.l1ChainId);
|
|
306
|
+
}
|
|
317
307
|
|
|
318
308
|
await addL1ValidatorViaRollup({
|
|
319
309
|
rpcUrls: options.l1RpcUrls,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { retrieveL2ProofVerifiedEvents } from '@aztec/archiver';
|
|
2
|
-
import {
|
|
2
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
3
|
+
import type { ViemPublicClient } from '@aztec/ethereum/types';
|
|
3
4
|
import { compactArray, mapValues, unique } from '@aztec/foundation/collection';
|
|
4
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
6
|
import { type LogFn, type Logger, createLogger } from '@aztec/foundation/log';
|
|
@@ -46,7 +47,10 @@ export async function proverStats(opts: {
|
|
|
46
47
|
.then(a => a.rollupAddress);
|
|
47
48
|
|
|
48
49
|
const chain = createEthereumChain(l1RpcUrls, chainId).chainInfo;
|
|
49
|
-
const publicClient = createPublicClient({
|
|
50
|
+
const publicClient = createPublicClient({
|
|
51
|
+
chain,
|
|
52
|
+
transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
|
|
53
|
+
});
|
|
50
54
|
const lastBlockNum = endBlock ?? (await publicClient.getBlockNumber());
|
|
51
55
|
debugLog.verbose(`Querying events on rollup at ${rollup.toString()} from ${startBlock} up to ${lastBlockNum}`);
|
|
52
56
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createEthereumChain
|
|
1
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
2
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
4
|
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
4
5
|
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
createL1TxUtilsFromViemWallet,
|
|
7
|
-
getL1ContractsConfigEnvVars,
|
|
8
|
-
getPublicClient,
|
|
9
|
-
isAnvilTestChain,
|
|
10
|
-
} from '@aztec/ethereum';
|
|
1
|
+
import { createEthereumChain, isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
2
|
+
import { createExtendedL1Client, getPublicClient } from '@aztec/ethereum/client';
|
|
3
|
+
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
4
|
+
import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
|
+
import { createL1TxUtilsFromViemWallet } from '@aztec/ethereum/l1-tx-utils';
|
|
11
6
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
12
7
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
13
8
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computeSecretHash } from '@aztec/aztec.js/crypto';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
5
|
export async function generateSecretAndHash(log: LogFn) {
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
import { printENR } from '@aztec/p2p/enr';
|
|
3
2
|
|
|
4
3
|
import type { Command } from 'commander';
|
|
5
4
|
|
|
@@ -49,6 +48,7 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
49
48
|
.description('Decodes and ENR record')
|
|
50
49
|
.argument('<enr>', 'The encoded ENR string')
|
|
51
50
|
.action(async (enr: string) => {
|
|
51
|
+
const { printENR } = await import('@aztec/p2p/enr');
|
|
52
52
|
await printENR(enr, log);
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { prettyPrintJSON } from '@aztec/cli/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
3
|
+
import { GSEContract } from '@aztec/ethereum/contracts';
|
|
3
4
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
5
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -134,7 +135,7 @@ export async function newValidatorKeystore(options: NewValidatorKeystoreOptions,
|
|
|
134
135
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
135
136
|
const publicClient = createPublicClient({
|
|
136
137
|
chain: chain.chainInfo,
|
|
137
|
-
transport: fallback(l1RpcUrls.map(url => http(url))),
|
|
138
|
+
transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
|
|
138
139
|
});
|
|
139
140
|
const gse = new GSEContract(publicClient, gseAddress);
|
|
140
141
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { prettyPrintJSON } from '@aztec/cli/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { deriveBlsPrivateKey } from '@aztec/foundation/crypto/bls';
|
|
3
3
|
import { createBn254Keystore } from '@aztec/foundation/crypto/bls/bn254_keystore';
|
|
4
|
+
import { computeBn254G1PublicKeyCompressed } from '@aztec/foundation/crypto/bn254';
|
|
4
5
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
6
7
|
import type { EthAccount, EthPrivateKey, ValidatorKeyStore } from '@aztec/node-keystore/types';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { prettyPrintJSON } from '@aztec/cli/utils';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
3
|
+
import { GSEContract } from '@aztec/ethereum/contracts';
|
|
4
4
|
import { decryptBn254Keystore } from '@aztec/foundation/crypto/bls/bn254_keystore';
|
|
5
|
+
import { computeBn254G1PublicKey, computeBn254G2PublicKey } from '@aztec/foundation/crypto/bn254';
|
|
6
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
7
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
7
8
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
9
|
import { loadKeystoreFile } from '@aztec/node-keystore/loader';
|
|
9
10
|
import type {
|
|
@@ -272,7 +273,7 @@ export async function generateStakerJson(options: StakerOptions, log: LogFn): Pr
|
|
|
272
273
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
273
274
|
const publicClient = createPublicClient({
|
|
274
275
|
chain: chain.chainInfo,
|
|
275
|
-
transport: fallback(l1RpcUrls.map(url => http(url))),
|
|
276
|
+
transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
|
|
276
277
|
});
|
|
277
278
|
const gse = new GSEContract(publicClient, gseAddress);
|
|
278
279
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import {
|
|
2
|
+
import { ethPrivateKeySchema } from '@aztec/node-keystore/schemas';
|
|
3
|
+
import type { EthPrivateKey } from '@aztec/node-keystore/types';
|
|
3
4
|
|
|
4
5
|
export const defaultBlsPath = 'm/12381/3600/0/0/0';
|
|
5
6
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DefaultL1ContractsConfig, type L1ContractsConfig
|
|
1
|
+
import { DefaultL1ContractsConfig, type L1ContractsConfig } from '@aztec/ethereum/config';
|
|
2
|
+
import type { L1TxUtilsConfig } from '@aztec/ethereum/l1-tx-utils/config';
|
|
2
3
|
import type { NetworkNames } from '@aztec/foundation/config';
|
|
3
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
5
|
import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
5
|
-
import type { P2PConfig } from '@aztec/p2p';
|
|
6
|
+
import type { P2PConfig } from '@aztec/p2p/config';
|
|
6
7
|
import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
7
8
|
|
|
8
9
|
import path from 'path';
|
|
@@ -18,7 +19,7 @@ const tbMapSizeKb = 1_024 * 1_024 * 1_024; // 1 TB
|
|
|
18
19
|
export type L2ChainConfig = Omit<L1ContractsConfig, keyof L1TxUtilsConfig> &
|
|
19
20
|
Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways' | 'slashOverridePayload' | 'slashSelfAllowed'> &
|
|
20
21
|
Pick<P2PConfig, 'bootstrapNodes' | 'p2pEnabled' | 'txPoolDeleteTxsAfterReorg'> &
|
|
21
|
-
Pick<SequencerConfig, 'minTxsPerBlock' | 'maxTxsPerBlock'> & {
|
|
22
|
+
Pick<SequencerConfig, 'buildCheckpointIfEmpty' | 'minTxsPerBlock' | 'maxTxsPerBlock' | 'blockDurationMs'> & {
|
|
22
23
|
l1ChainId: number;
|
|
23
24
|
testAccounts: boolean;
|
|
24
25
|
sponsoredFPC: boolean;
|
|
@@ -28,7 +29,7 @@ export type L2ChainConfig = Omit<L1ContractsConfig, keyof L1TxUtilsConfig> &
|
|
|
28
29
|
snapshotsUrls: string[];
|
|
29
30
|
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
30
31
|
autoUpdateUrl?: string;
|
|
31
|
-
|
|
32
|
+
maxPendingTxCount: number;
|
|
32
33
|
publicMetricsOptOut: boolean;
|
|
33
34
|
publicIncludeMetrics?: string[];
|
|
34
35
|
publicMetricsCollectorUrl?: string;
|
|
@@ -103,11 +104,12 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
103
104
|
bootstrapNodes: [],
|
|
104
105
|
minTxsPerBlock: 0,
|
|
105
106
|
maxTxsPerBlock: 0,
|
|
107
|
+
buildCheckpointIfEmpty: true,
|
|
106
108
|
realProofs: true,
|
|
107
109
|
snapshotsUrls: [`${SNAPSHOTS_URL}/staging-ignition/`],
|
|
108
110
|
autoUpdate: 'config-and-version',
|
|
109
111
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
|
|
110
|
-
|
|
112
|
+
maxPendingTxCount: 0,
|
|
111
113
|
publicMetricsOptOut: false,
|
|
112
114
|
publicIncludeMetrics,
|
|
113
115
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
@@ -127,6 +129,8 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
127
129
|
lagInEpochsForValidatorSet: 2,
|
|
128
130
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
129
131
|
lagInEpochsForRandao: 2,
|
|
132
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
133
|
+
inboxLag: 1,
|
|
130
134
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
131
135
|
aztecProofSubmissionEpochs: 1,
|
|
132
136
|
/** How many sequencers must agree with a slash for it to be executed. */
|
|
@@ -188,6 +192,7 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
188
192
|
bootstrapNodes: [],
|
|
189
193
|
minTxsPerBlock: 0,
|
|
190
194
|
maxTxsPerBlock: 20,
|
|
195
|
+
buildCheckpointIfEmpty: true,
|
|
191
196
|
realProofs: true,
|
|
192
197
|
snapshotsUrls: [`${SNAPSHOTS_URL}/staging-public/`],
|
|
193
198
|
autoUpdate: 'config-and-version',
|
|
@@ -196,7 +201,7 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
196
201
|
publicIncludeMetrics,
|
|
197
202
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
198
203
|
publicMetricsCollectFrom: ['sequencer'],
|
|
199
|
-
|
|
204
|
+
maxPendingTxCount: 1_000, // ~156MB
|
|
200
205
|
txPoolDeleteTxsAfterReorg: true,
|
|
201
206
|
|
|
202
207
|
// Deployment stuff
|
|
@@ -212,6 +217,8 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
212
217
|
lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
|
|
213
218
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
214
219
|
lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
|
|
220
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
221
|
+
inboxLag: DefaultL1ContractsConfig.inboxLag,
|
|
215
222
|
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
|
|
216
223
|
localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
217
224
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
@@ -245,6 +252,7 @@ export const nextNetL2ChainConfig: L2ChainConfig = {
|
|
|
245
252
|
bootstrapNodes: [],
|
|
246
253
|
minTxsPerBlock: 0,
|
|
247
254
|
maxTxsPerBlock: 8,
|
|
255
|
+
buildCheckpointIfEmpty: true,
|
|
248
256
|
realProofs: true,
|
|
249
257
|
snapshotsUrls: [],
|
|
250
258
|
autoUpdate: 'config-and-version',
|
|
@@ -253,7 +261,7 @@ export const nextNetL2ChainConfig: L2ChainConfig = {
|
|
|
253
261
|
publicIncludeMetrics,
|
|
254
262
|
publicMetricsCollectorUrl: '',
|
|
255
263
|
publicMetricsCollectFrom: [''],
|
|
256
|
-
|
|
264
|
+
maxPendingTxCount: 1_000, // ~156MB
|
|
257
265
|
txPoolDeleteTxsAfterReorg: false,
|
|
258
266
|
|
|
259
267
|
// Deployment stuff
|
|
@@ -269,6 +277,8 @@ export const nextNetL2ChainConfig: L2ChainConfig = {
|
|
|
269
277
|
lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
|
|
270
278
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
271
279
|
lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
|
|
280
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
281
|
+
inboxLag: DefaultL1ContractsConfig.inboxLag,
|
|
272
282
|
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
|
|
273
283
|
localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
274
284
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
@@ -301,12 +311,13 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
301
311
|
disableTransactions: true,
|
|
302
312
|
bootstrapNodes: [],
|
|
303
313
|
minTxsPerBlock: 0,
|
|
304
|
-
maxTxsPerBlock:
|
|
314
|
+
maxTxsPerBlock: 20,
|
|
315
|
+
buildCheckpointIfEmpty: true,
|
|
305
316
|
realProofs: true,
|
|
306
317
|
snapshotsUrls: [`${SNAPSHOTS_URL}/testnet/`],
|
|
307
318
|
autoUpdate: 'config-and-version',
|
|
308
319
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
|
|
309
|
-
|
|
320
|
+
maxPendingTxCount: 5_000, // ~760MB
|
|
310
321
|
publicMetricsOptOut: false,
|
|
311
322
|
publicIncludeMetrics,
|
|
312
323
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
@@ -322,55 +333,57 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
322
333
|
/** How many L2 slots an epoch lasts. */
|
|
323
334
|
aztecEpochDuration: 32,
|
|
324
335
|
/** The target validator committee size. */
|
|
325
|
-
aztecTargetCommitteeSize:
|
|
336
|
+
aztecTargetCommitteeSize: 48,
|
|
326
337
|
/** The number of epochs to lag behind the current epoch for validator selection. */
|
|
327
338
|
lagInEpochsForValidatorSet: 2,
|
|
328
339
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
329
340
|
lagInEpochsForRandao: 2,
|
|
341
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
342
|
+
inboxLag: 1,
|
|
330
343
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
331
344
|
aztecProofSubmissionEpochs: 1,
|
|
332
345
|
|
|
333
|
-
// This is a diff from mainnet: we have
|
|
334
|
-
localEjectionThreshold:
|
|
346
|
+
// This is a diff from mainnet: we have 1-strike you're out, rather than 3 on mainnet.
|
|
347
|
+
localEjectionThreshold: 199_000n * 10n ** 18n,
|
|
335
348
|
/** How many sequencers must agree with a slash for it to be executed. */
|
|
336
|
-
slashingQuorum:
|
|
337
|
-
slashingRoundSizeInEpochs:
|
|
338
|
-
slashingExecutionDelayInRounds:
|
|
339
|
-
slashingLifetimeInRounds:
|
|
340
|
-
slashingVetoer: EthAddress.fromString('
|
|
349
|
+
slashingQuorum: 33,
|
|
350
|
+
slashingRoundSizeInEpochs: 2,
|
|
351
|
+
slashingExecutionDelayInRounds: 2,
|
|
352
|
+
slashingLifetimeInRounds: 5,
|
|
353
|
+
slashingVetoer: EthAddress.fromString('0xdfe19Da6a717b7088621d8bBB66be59F2d78e924'),
|
|
341
354
|
slashingOffsetInRounds: 2,
|
|
342
355
|
|
|
343
|
-
slashingDisableDuration:
|
|
356
|
+
slashingDisableDuration: 5 * 24 * 60 * 60, // 5 days
|
|
344
357
|
slasherFlavor: 'tally',
|
|
345
358
|
|
|
346
|
-
slashAmountSmall:
|
|
347
|
-
slashAmountMedium:
|
|
348
|
-
slashAmountLarge:
|
|
359
|
+
slashAmountSmall: 10_000n * 10n ** 18n,
|
|
360
|
+
slashAmountMedium: 50_000n * 10n ** 18n,
|
|
361
|
+
slashAmountLarge: 200_000n * 10n ** 18n,
|
|
349
362
|
|
|
350
363
|
/** The mana target for the rollup */
|
|
351
|
-
manaTarget:
|
|
364
|
+
manaTarget: 150_000_000n,
|
|
352
365
|
|
|
353
366
|
/** The proving cost per mana */
|
|
354
|
-
provingCostPerMana:
|
|
367
|
+
provingCostPerMana: 100n,
|
|
355
368
|
|
|
356
369
|
exitDelaySeconds: 4 * 24 * 60 * 60, // 4 days
|
|
357
370
|
|
|
358
371
|
activationThreshold: 200_000n * 10n ** 18n,
|
|
359
372
|
ejectionThreshold: 100_000n * 10n ** 18n,
|
|
360
373
|
|
|
361
|
-
governanceProposerRoundSize:
|
|
362
|
-
governanceProposerQuorum:
|
|
374
|
+
governanceProposerRoundSize: 100,
|
|
375
|
+
governanceProposerQuorum: 60,
|
|
363
376
|
|
|
364
377
|
// Node slashing config
|
|
365
378
|
slashInactivityTargetPercentage: 0.8,
|
|
366
379
|
slashInactivityConsecutiveEpochThreshold: 2,
|
|
367
|
-
slashInactivityPenalty:
|
|
380
|
+
slashInactivityPenalty: 10_000n * 10n ** 18n,
|
|
368
381
|
slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
|
|
369
382
|
slashDataWithholdingPenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for data withholding offenses right now
|
|
370
|
-
slashProposeInvalidAttestationsPenalty:
|
|
371
|
-
slashAttestDescendantOfInvalidPenalty:
|
|
372
|
-
slashUnknownPenalty:
|
|
373
|
-
slashBroadcastedInvalidBlockPenalty:
|
|
383
|
+
slashProposeInvalidAttestationsPenalty: 10_000n * 10n ** 18n,
|
|
384
|
+
slashAttestDescendantOfInvalidPenalty: 10_000n * 10n ** 18n,
|
|
385
|
+
slashUnknownPenalty: 10_000n * 10n ** 18n,
|
|
386
|
+
slashBroadcastedInvalidBlockPenalty: 10_000n * 10n ** 18n, // 10_000n * 10n ** 18n, Disabled for now until further testing
|
|
374
387
|
slashGracePeriodL2Slots: 1_200, // One day from deployment
|
|
375
388
|
slashOffenseExpirationRounds: 8,
|
|
376
389
|
|
|
@@ -395,11 +408,12 @@ export const mainnetL2ChainConfig: L2ChainConfig = {
|
|
|
395
408
|
bootstrapNodes: [],
|
|
396
409
|
minTxsPerBlock: 0,
|
|
397
410
|
maxTxsPerBlock: 0,
|
|
411
|
+
buildCheckpointIfEmpty: true,
|
|
398
412
|
realProofs: true,
|
|
399
413
|
snapshotsUrls: [`${SNAPSHOTS_URL}/mainnet/`],
|
|
400
414
|
autoUpdate: 'notify',
|
|
401
415
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
|
|
402
|
-
|
|
416
|
+
maxPendingTxCount: 0,
|
|
403
417
|
publicMetricsOptOut: true,
|
|
404
418
|
publicIncludeMetrics,
|
|
405
419
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
@@ -418,6 +432,8 @@ export const mainnetL2ChainConfig: L2ChainConfig = {
|
|
|
418
432
|
lagInEpochsForValidatorSet: 2,
|
|
419
433
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
420
434
|
lagInEpochsForRandao: 2,
|
|
435
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
436
|
+
inboxLag: 1,
|
|
421
437
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
422
438
|
aztecProofSubmissionEpochs: 1,
|
|
423
439
|
|
|
@@ -483,6 +499,7 @@ export const devnetL2ChainConfig: L2ChainConfig = {
|
|
|
483
499
|
bootstrapNodes: [],
|
|
484
500
|
minTxsPerBlock: 0,
|
|
485
501
|
maxTxsPerBlock: 8,
|
|
502
|
+
buildCheckpointIfEmpty: true,
|
|
486
503
|
realProofs: false,
|
|
487
504
|
snapshotsUrls: [],
|
|
488
505
|
autoUpdate: 'config-and-version',
|
|
@@ -491,7 +508,7 @@ export const devnetL2ChainConfig: L2ChainConfig = {
|
|
|
491
508
|
publicIncludeMetrics,
|
|
492
509
|
publicMetricsCollectorUrl: '',
|
|
493
510
|
publicMetricsCollectFrom: [''],
|
|
494
|
-
|
|
511
|
+
maxPendingTxCount: 1_000, // ~156MB
|
|
495
512
|
txPoolDeleteTxsAfterReorg: true,
|
|
496
513
|
|
|
497
514
|
// Deployment stuff
|
|
@@ -507,6 +524,8 @@ export const devnetL2ChainConfig: L2ChainConfig = {
|
|
|
507
524
|
lagInEpochsForValidatorSet: 1,
|
|
508
525
|
/** The number of epochs to lag behind the current epoch for randao selection. */
|
|
509
526
|
lagInEpochsForRandao: 1,
|
|
527
|
+
/** The number of checkpoints to lag in the inbox (prevents sequencer DOS attacks). */
|
|
528
|
+
inboxLag: DefaultL1ContractsConfig.inboxLag,
|
|
510
529
|
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
|
|
511
530
|
localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
512
531
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
@@ -576,10 +595,16 @@ export function enrichEnvironmentWithChainConfig(config: L2ChainConfig) {
|
|
|
576
595
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
577
596
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.minTxsPerBlock.toString());
|
|
578
597
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.maxTxsPerBlock.toString());
|
|
598
|
+
if (config.blockDurationMs !== undefined) {
|
|
599
|
+
enrichVar('SEQ_BLOCK_DURATION_MS', config.blockDurationMs.toString());
|
|
600
|
+
}
|
|
601
|
+
if (config.buildCheckpointIfEmpty !== undefined) {
|
|
602
|
+
enrichVar('SEQ_BUILD_CHECKPOINT_IF_EMPTY', config.buildCheckpointIfEmpty.toString());
|
|
603
|
+
}
|
|
579
604
|
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
580
605
|
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
581
606
|
enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
|
|
582
|
-
enrichVar('
|
|
607
|
+
enrichVar('P2P_MAX_PENDING_TX_COUNT', config.maxPendingTxCount.toString());
|
|
583
608
|
enrichVar('P2P_TX_POOL_DELETE_TXS_AFTER_REORG', config.txPoolDeleteTxsAfterReorg.toString());
|
|
584
609
|
|
|
585
610
|
enrichVar('DATA_STORE_MAP_SIZE_KB', config.dataStoreMapSizeKb.toString());
|
|
@@ -625,6 +650,7 @@ export function enrichEnvironmentWithChainConfig(config: L2ChainConfig) {
|
|
|
625
650
|
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
626
651
|
enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET', config.lagInEpochsForValidatorSet.toString());
|
|
627
652
|
enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_RANDAO', config.lagInEpochsForRandao.toString());
|
|
653
|
+
enrichVar('AZTEC_INBOX_LAG', config.inboxLag.toString());
|
|
628
654
|
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
629
655
|
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
630
656
|
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
2
|
+
import { RegistryContract } from '@aztec/ethereum/contracts';
|
|
3
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
|
+
import { getL1ContractsConfig } from '@aztec/ethereum/queries';
|
|
2
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
6
|
|
|
4
7
|
export async function getL1Config(
|
|
@@ -137,4 +137,11 @@ export async function enrichEnvironmentWithNetworkConfig(networkName: NetworkNam
|
|
|
137
137
|
if (networkConfig.feeAssetHandlerAddress) {
|
|
138
138
|
enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', networkConfig.feeAssetHandlerAddress.toString());
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
if (networkConfig.blobFileStoreUrls?.length) {
|
|
142
|
+
enrichVar('BLOB_FILE_STORE_URLS', networkConfig.blobFileStoreUrls.join(','));
|
|
143
|
+
}
|
|
144
|
+
if (networkConfig.blockDurationMs !== undefined) {
|
|
145
|
+
enrichVar('SEQ_BLOCK_DURATION_MS', String(networkConfig.blockDurationMs));
|
|
146
|
+
}
|
|
140
147
|
}
|