@aztec/cli 0.0.1-commit.d3ec352c → 0.0.1-commit.fcb71a6
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.js +1 -1
- package/dest/cmds/infrastructure/sequencers.d.ts +1 -1
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +9 -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 +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/package.json +32 -29
- package/src/cmds/contracts/inspect_contract.ts +1 -1
- package/src/cmds/infrastructure/sequencers.ts +5 -3
- 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/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
|
@@ -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
|
}
|
package/src/utils/aztec.ts
CHANGED
|
@@ -6,23 +6,23 @@ import {
|
|
|
6
6
|
loadContractArtifact,
|
|
7
7
|
} from '@aztec/aztec.js/abi';
|
|
8
8
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type Operator,
|
|
13
|
-
RollupContract,
|
|
14
|
-
} from '@aztec/ethereum';
|
|
9
|
+
import type { L1ContractsConfig } from '@aztec/ethereum/config';
|
|
10
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
11
|
+
import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
15
12
|
import { SecretValue } from '@aztec/foundation/config';
|
|
16
|
-
import { Fr } from '@aztec/foundation/
|
|
17
|
-
import type
|
|
13
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
14
|
+
import { type LogFn, createLogger } from '@aztec/foundation/log';
|
|
18
15
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
19
16
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
20
17
|
|
|
21
18
|
import TOML from '@iarna/toml';
|
|
22
19
|
import { readFile } from 'fs/promises';
|
|
20
|
+
import type { HDAccount, Hex, PrivateKeyAccount } from 'viem';
|
|
23
21
|
|
|
24
22
|
import { encodeArgs } from './encoding.js';
|
|
25
23
|
|
|
24
|
+
const logger = createLogger('cli:utils:aztec');
|
|
25
|
+
|
|
26
26
|
/**
|
|
27
27
|
* Helper to get an ABI function or throw error if it doesn't exist.
|
|
28
28
|
* @param artifact - Contract's build artifact in JSON format.
|
|
@@ -37,89 +37,32 @@ export function getFunctionAbi(artifact: ContractArtifact, fnName: string): Func
|
|
|
37
37
|
return fn;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* Function to execute the 'deployRollupContracts' command.
|
|
42
|
-
* @param rpcUrls - The RPC URL of the ethereum node.
|
|
43
|
-
* @param chainId - The chain ID of the L1 host.
|
|
44
|
-
* @param privateKey - The private key to be used in contract deployment.
|
|
45
|
-
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
46
|
-
*/
|
|
47
|
-
export async function deployAztecContracts(
|
|
48
|
-
rpcUrls: string[],
|
|
49
|
-
chainId: number,
|
|
50
|
-
privateKey: string | undefined,
|
|
51
|
-
mnemonic: string,
|
|
52
|
-
mnemonicIndex: number,
|
|
53
|
-
salt: number | undefined,
|
|
54
|
-
initialValidators: Operator[],
|
|
55
|
-
genesisArchiveRoot: Fr,
|
|
56
|
-
feeJuicePortalInitialBalance: bigint,
|
|
57
|
-
acceleratedTestDeployments: boolean,
|
|
58
|
-
config: L1ContractsConfig,
|
|
59
|
-
existingToken: EthAddress | undefined,
|
|
60
|
-
realVerifier: boolean,
|
|
61
|
-
createVerificationJson: string | false,
|
|
62
|
-
debugLogger: Logger,
|
|
63
|
-
): Promise<DeployL1ContractsReturnType> {
|
|
64
|
-
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
65
|
-
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
66
|
-
|
|
67
|
-
const account = !privateKey
|
|
68
|
-
? mnemonicToAccount(mnemonic!, { addressIndex: mnemonicIndex })
|
|
69
|
-
: privateKeyToAccount(addLeadingHex(privateKey));
|
|
70
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
71
|
-
|
|
72
|
-
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
73
|
-
|
|
74
|
-
const result = await deployL1Contracts(
|
|
75
|
-
chain.rpcUrls,
|
|
76
|
-
account,
|
|
77
|
-
chain.chainInfo,
|
|
78
|
-
debugLogger,
|
|
79
|
-
{
|
|
80
|
-
vkTreeRoot: getVKTreeRoot(),
|
|
81
|
-
protocolContractsHash,
|
|
82
|
-
genesisArchiveRoot,
|
|
83
|
-
salt,
|
|
84
|
-
initialValidators,
|
|
85
|
-
acceleratedTestDeployments,
|
|
86
|
-
feeJuicePortalInitialBalance,
|
|
87
|
-
realVerifier,
|
|
88
|
-
existingTokenAddress: existingToken,
|
|
89
|
-
...config,
|
|
90
|
-
},
|
|
91
|
-
config,
|
|
92
|
-
createVerificationJson,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return result;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
40
|
export async function deployNewRollupContracts(
|
|
99
41
|
registryAddress: EthAddress,
|
|
100
42
|
rpcUrls: string[],
|
|
101
|
-
chainId: number,
|
|
102
43
|
privateKey: string | undefined,
|
|
44
|
+
chainId: number,
|
|
103
45
|
mnemonic: string,
|
|
104
46
|
mnemonicIndex: number,
|
|
105
|
-
salt: number | undefined,
|
|
106
47
|
initialValidators: Operator[],
|
|
107
48
|
genesisArchiveRoot: Fr,
|
|
108
49
|
feeJuicePortalInitialBalance: bigint,
|
|
109
50
|
config: L1ContractsConfig,
|
|
110
51
|
realVerifier: boolean,
|
|
111
|
-
createVerificationJson: string | false,
|
|
112
|
-
logger: Logger,
|
|
113
52
|
): Promise<{ rollup: RollupContract; slashFactoryAddress: EthAddress }> {
|
|
114
|
-
const {
|
|
53
|
+
const { deployRollupForUpgrade } = await import('@aztec/ethereum/deploy-aztec-l1-contracts');
|
|
115
54
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
116
55
|
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
117
56
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
57
|
+
let account: HDAccount | PrivateKeyAccount;
|
|
58
|
+
if (privateKey) {
|
|
59
|
+
account = privateKeyToAccount(addLeadingHex(privateKey));
|
|
60
|
+
} else {
|
|
61
|
+
account = mnemonicToAccount(mnemonic!, { addressIndex: mnemonicIndex });
|
|
62
|
+
const privateKeyBuf = account.getHdKey().privateKey;
|
|
63
|
+
const privateKeyHex = Buffer.from(privateKeyBuf!).toString('hex');
|
|
64
|
+
privateKey = `0x${privateKeyHex}`;
|
|
65
|
+
}
|
|
123
66
|
|
|
124
67
|
if (!initialValidators || initialValidators.length === 0) {
|
|
125
68
|
// initialize the new rollup with Amin's validator address.
|
|
@@ -138,9 +81,11 @@ export async function deployNewRollupContracts(
|
|
|
138
81
|
}
|
|
139
82
|
|
|
140
83
|
const { rollup, slashFactoryAddress } = await deployRollupForUpgrade(
|
|
141
|
-
|
|
84
|
+
privateKey as Hex,
|
|
85
|
+
rpcUrls[0],
|
|
86
|
+
chainId,
|
|
87
|
+
registryAddress,
|
|
142
88
|
{
|
|
143
|
-
salt,
|
|
144
89
|
vkTreeRoot: getVKTreeRoot(),
|
|
145
90
|
protocolContractsHash,
|
|
146
91
|
genesisArchiveRoot,
|
|
@@ -149,13 +94,9 @@ export async function deployNewRollupContracts(
|
|
|
149
94
|
realVerifier,
|
|
150
95
|
...config,
|
|
151
96
|
},
|
|
152
|
-
registryAddress,
|
|
153
|
-
logger,
|
|
154
|
-
config,
|
|
155
|
-
createVerificationJson,
|
|
156
97
|
);
|
|
157
98
|
|
|
158
|
-
return { rollup, slashFactoryAddress };
|
|
99
|
+
return { rollup, slashFactoryAddress: EthAddress.fromString(slashFactoryAddress!) };
|
|
159
100
|
}
|
|
160
101
|
|
|
161
102
|
/**
|
package/src/utils/commands.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { LogId } from '@aztec/aztec.js/log';
|
|
5
|
-
import { TxHash } from '@aztec/aztec.js/tx';
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
7
4
|
import type { PXE } from '@aztec/pxe/server';
|
|
5
|
+
import { FunctionSelector } from '@aztec/stdlib/abi/function-selector';
|
|
6
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
7
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
8
|
+
import { LogId } from '@aztec/stdlib/logs/log-id';
|
|
9
|
+
import { TxHash } from '@aztec/stdlib/tx/tx-hash';
|
|
9
10
|
|
|
10
11
|
import { type Command, CommanderError, InvalidArgumentError, Option } from 'commander';
|
|
11
12
|
import { lookup } from 'dns/promises';
|
package/src/utils/encoding.ts
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function deployL1Contracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, sponsoredFPC: boolean, acceleratedTestDeployments: boolean, json: boolean, createVerificationJson: string | false, initialValidators: EthAddress[], realVerifier: boolean, existingToken: EthAddress | undefined, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95X2wxX2NvbnRyYWN0cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvbDEvZGVwbG95X2wxX2NvbnRyYWN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUk1RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFNM0Qsd0JBQXNCLGlCQUFpQixDQUNyQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQ2pCLE9BQU8sRUFBRSxNQUFNLEVBQ2YsVUFBVSxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQzlCLFFBQVEsRUFBRSxNQUFNLEVBQ2hCLGFBQWEsRUFBRSxNQUFNLEVBQ3JCLElBQUksRUFBRSxNQUFNLEdBQUcsU0FBUyxFQUN4QixZQUFZLEVBQUUsT0FBTyxFQUNyQixZQUFZLEVBQUUsT0FBTyxFQUNyQiwwQkFBMEIsRUFBRSxPQUFPLEVBQ25DLElBQUksRUFBRSxPQUFPLEVBQ2Isc0JBQXNCLEVBQUUsTUFBTSxHQUFHLEtBQUssRUFDdEMsaUJBQWlCLEVBQUUsVUFBVSxFQUFFLEVBQy9CLFlBQVksRUFBRSxPQUFPLEVBQ3JCLGFBQWEsRUFBRSxVQUFVLEdBQUcsU0FBUyxFQUNyQyxHQUFHLEVBQUUsS0FBSyxFQUNWLFdBQVcsRUFBRSxNQUFNLGlCQThEcEIifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,iBAAiB,EAAE,UAAU,EAAE,EAC/B,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,UAAU,GAAG,SAAS,EACrC,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA8DpB"}
|