@aztec/cli 3.0.0-nightly.20251111 → 3.0.0-nightly.20251113
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 -1
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +3 -9
- package/dest/cmds/misc/update/npm.js +1 -1
- package/dest/cmds/validator_keys/add.d.ts.map +1 -1
- package/dest/cmds/validator_keys/add.js +1 -2
- package/dest/cmds/validator_keys/index.d.ts.map +1 -1
- package/dest/cmds/validator_keys/index.js +10 -3
- package/dest/cmds/validator_keys/new.d.ts +4 -1
- package/dest/cmds/validator_keys/new.d.ts.map +1 -1
- package/dest/cmds/validator_keys/new.js +82 -8
- package/dest/cmds/validator_keys/shared.d.ts +0 -1
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
- package/dest/cmds/validator_keys/shared.js +2 -14
- package/dest/cmds/validator_keys/staker.d.ts +38 -0
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/staker.js +206 -0
- package/dest/config/chain_l2_config.d.ts +9 -9
- package/dest/config/chain_l2_config.d.ts.map +1 -1
- package/dest/config/chain_l2_config.js +40 -25
- package/package.json +28 -25
- package/src/cmds/contracts/inspect_contract.ts +3 -10
- package/src/cmds/misc/update/npm.ts +1 -1
- package/src/cmds/validator_keys/add.ts +0 -2
- package/src/cmds/validator_keys/index.ts +31 -3
- package/src/cmds/validator_keys/new.ts +97 -9
- package/src/cmds/validator_keys/shared.ts +1 -9
- package/src/cmds/validator_keys/staker.ts +298 -0
- package/src/config/chain_l2_config.ts +53 -35
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { prettyPrintJSON } from '@aztec/cli/utils';
|
|
2
|
+
import { GSEContract, createEthereumChain } from '@aztec/ethereum';
|
|
3
|
+
import { computeBn254G1PublicKey, computeBn254G2PublicKey } from '@aztec/foundation/crypto';
|
|
4
|
+
import { decryptBn254Keystore } from '@aztec/foundation/crypto/bls/bn254_keystore';
|
|
5
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
7
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
8
|
+
import { loadKeystoreFile } from '@aztec/node-keystore/loader';
|
|
9
|
+
import type {
|
|
10
|
+
AttesterAccount,
|
|
11
|
+
AttesterAccounts,
|
|
12
|
+
BLSAccount,
|
|
13
|
+
EncryptedKeyFileConfig,
|
|
14
|
+
EthAccount,
|
|
15
|
+
MnemonicConfig,
|
|
16
|
+
} from '@aztec/node-keystore/types';
|
|
17
|
+
|
|
18
|
+
import { Wallet } from '@ethersproject/wallet';
|
|
19
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
20
|
+
import { createPublicClient, fallback, http } from 'viem';
|
|
21
|
+
import { privateKeyToAddress } from 'viem/accounts';
|
|
22
|
+
|
|
23
|
+
export type StakerOptions = {
|
|
24
|
+
from: string;
|
|
25
|
+
password?: string;
|
|
26
|
+
output?: string;
|
|
27
|
+
gseAddress: EthAddress;
|
|
28
|
+
l1RpcUrls: string[];
|
|
29
|
+
l1ChainId: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type StakerOutput = {
|
|
33
|
+
attester: string;
|
|
34
|
+
publicKeyG1: {
|
|
35
|
+
x: string;
|
|
36
|
+
y: string;
|
|
37
|
+
};
|
|
38
|
+
publicKeyG2: {
|
|
39
|
+
x0: string;
|
|
40
|
+
x1: string;
|
|
41
|
+
y0: string;
|
|
42
|
+
y1: string;
|
|
43
|
+
};
|
|
44
|
+
proofOfPossession: {
|
|
45
|
+
x: string;
|
|
46
|
+
y: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Check if an object is a MnemonicConfig
|
|
52
|
+
*/
|
|
53
|
+
function isMnemonicConfig(obj: unknown): obj is MnemonicConfig {
|
|
54
|
+
return typeof obj === 'object' && obj !== null && 'mnemonic' in obj;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if a value is an encrypted keystore file config
|
|
59
|
+
*/
|
|
60
|
+
function isEncryptedKeyFileConfig(value: unknown): value is EncryptedKeyFileConfig {
|
|
61
|
+
return typeof value === 'object' && value !== null && 'path' in value;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if a BLSAccount is a private key string (not an encrypted keystore file)
|
|
66
|
+
*/
|
|
67
|
+
function isBlsPrivateKey(bls: unknown): bls is string {
|
|
68
|
+
return typeof bls === 'string' && bls.startsWith('0x');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if an EthAccount is a private key string (66 chars: 0x + 64 hex)
|
|
73
|
+
*/
|
|
74
|
+
function isEthPrivateKey(eth: unknown): eth is string {
|
|
75
|
+
return typeof eth === 'string' && eth.startsWith('0x') && eth.length === 66;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if a string is an Ethereum address (42 chars: 0x + 40 hex)
|
|
80
|
+
*/
|
|
81
|
+
function isEthAddress(value: unknown): value is string {
|
|
82
|
+
return typeof value === 'string' && /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Decrypt a BLS private key from an encrypted keystore file
|
|
87
|
+
*/
|
|
88
|
+
function decryptBlsKey(bls: BLSAccount, password?: string): string | undefined {
|
|
89
|
+
if (isBlsPrivateKey(bls)) {
|
|
90
|
+
return bls;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (isEncryptedKeyFileConfig(bls)) {
|
|
94
|
+
if (!password && !bls.password) {
|
|
95
|
+
return undefined; // Can't decrypt without password
|
|
96
|
+
}
|
|
97
|
+
const pwd = password ?? bls.password!;
|
|
98
|
+
return decryptBn254Keystore(bls.path, pwd);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Decrypt an Ethereum private key from an encrypted keystore file
|
|
106
|
+
*/
|
|
107
|
+
async function decryptEthKey(eth: EthAccount, password?: string): Promise<string | undefined> {
|
|
108
|
+
if (isEthPrivateKey(eth)) {
|
|
109
|
+
return eth;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (isEncryptedKeyFileConfig(eth)) {
|
|
113
|
+
if (!password && !eth.password) {
|
|
114
|
+
return undefined; // Can't decrypt without password
|
|
115
|
+
}
|
|
116
|
+
const pwd = password ?? eth.password!;
|
|
117
|
+
const json = readFileSync(eth.path, 'utf-8');
|
|
118
|
+
const wallet = await Wallet.fromEncryptedJson(json, pwd);
|
|
119
|
+
return wallet.privateKey as string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Extract Ethereum address from an EthAccount (or private key)
|
|
127
|
+
*/
|
|
128
|
+
async function getEthAddress(eth: EthAccount | string, password?: string): Promise<EthAddress | undefined> {
|
|
129
|
+
// Case 1: It's a private key string - derive the address
|
|
130
|
+
if (isEthPrivateKey(eth)) {
|
|
131
|
+
return privateKeyToAddress(eth as `0x${string}`) as unknown as EthAddress;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Case 2: It's just an address string directly (EthRemoteSignerAccount can be just EthAddress)
|
|
135
|
+
if (isEthAddress(eth)) {
|
|
136
|
+
return eth as unknown as EthAddress;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Case 3: It's an object with an address property (remote signer config)
|
|
140
|
+
if (typeof eth === 'object' && eth !== null && 'address' in eth) {
|
|
141
|
+
return (eth as any).address as EthAddress;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Case 4: It's an encrypted keystore file - decrypt and derive address
|
|
145
|
+
if (isEncryptedKeyFileConfig(eth)) {
|
|
146
|
+
const privateKey = await decryptEthKey(eth, password);
|
|
147
|
+
if (privateKey) {
|
|
148
|
+
return privateKeyToAddress(privateKey as `0x${string}`) as unknown as EthAddress;
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Extract BLS private key and Ethereum address from an AttesterAccount
|
|
158
|
+
*/
|
|
159
|
+
async function extractAttesterInfo(
|
|
160
|
+
attester: AttesterAccount,
|
|
161
|
+
password?: string,
|
|
162
|
+
): Promise<{ blsPrivateKey?: string; ethAddress?: EthAddress }> {
|
|
163
|
+
// Case 1: attester is { eth: EthAccount, bls?: BLSAccount }
|
|
164
|
+
if (typeof attester === 'object' && attester !== null && 'eth' in attester) {
|
|
165
|
+
const ethAddress = await getEthAddress(attester.eth, password);
|
|
166
|
+
const blsPrivateKey = attester.bls ? decryptBlsKey(attester.bls, password) : undefined;
|
|
167
|
+
return { blsPrivateKey, ethAddress };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Case 2: attester is just an EthAccount directly (no BLS key)
|
|
171
|
+
return {
|
|
172
|
+
blsPrivateKey: undefined,
|
|
173
|
+
ethAddress: await getEthAddress(attester as EthAccount, password),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Process a single attester entry and output staking JSON
|
|
179
|
+
*/
|
|
180
|
+
async function processAttester(
|
|
181
|
+
attester: AttesterAccount,
|
|
182
|
+
gse: GSEContract,
|
|
183
|
+
password?: string,
|
|
184
|
+
): Promise<StakerOutput | undefined> {
|
|
185
|
+
const { blsPrivateKey, ethAddress } = await extractAttesterInfo(attester, password);
|
|
186
|
+
|
|
187
|
+
// Skip if no BLS private key or no Ethereum address
|
|
188
|
+
if (!blsPrivateKey || !ethAddress) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Derive G1 and G2 public keys
|
|
193
|
+
const g1PublicKey = await computeBn254G1PublicKey(blsPrivateKey);
|
|
194
|
+
const g2PublicKey = await computeBn254G2PublicKey(blsPrivateKey);
|
|
195
|
+
|
|
196
|
+
// Generate proof of possession
|
|
197
|
+
const bn254SecretKeyFieldElement = Fr.fromString(blsPrivateKey);
|
|
198
|
+
const registrationTuple = await gse.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
|
|
199
|
+
|
|
200
|
+
return {
|
|
201
|
+
attester: String(ethAddress),
|
|
202
|
+
publicKeyG1: {
|
|
203
|
+
x: '0x' + g1PublicKey.x.toString(16).padStart(64, '0'),
|
|
204
|
+
y: '0x' + g1PublicKey.y.toString(16).padStart(64, '0'),
|
|
205
|
+
},
|
|
206
|
+
publicKeyG2: {
|
|
207
|
+
x0: '0x' + g2PublicKey.x.c0.toString(16).padStart(64, '0'),
|
|
208
|
+
x1: '0x' + g2PublicKey.x.c1.toString(16).padStart(64, '0'),
|
|
209
|
+
y0: '0x' + g2PublicKey.y.c0.toString(16).padStart(64, '0'),
|
|
210
|
+
y1: '0x' + g2PublicKey.y.c1.toString(16).padStart(64, '0'),
|
|
211
|
+
},
|
|
212
|
+
proofOfPossession: {
|
|
213
|
+
x: '0x' + registrationTuple.proofOfPossession.x.toString(16),
|
|
214
|
+
y: '0x' + registrationTuple.proofOfPossession.y.toString(16),
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Process AttesterAccounts (which can be a single attester, array, or mnemonic)
|
|
221
|
+
*/
|
|
222
|
+
export async function processAttesterAccounts(
|
|
223
|
+
attesterAccounts: AttesterAccounts,
|
|
224
|
+
gse: GSEContract,
|
|
225
|
+
password?: string,
|
|
226
|
+
): Promise<StakerOutput[]> {
|
|
227
|
+
// Skip mnemonic configs
|
|
228
|
+
if (isMnemonicConfig(attesterAccounts)) {
|
|
229
|
+
return [];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Handle array of attesters
|
|
233
|
+
if (Array.isArray(attesterAccounts)) {
|
|
234
|
+
const results: StakerOutput[] = [];
|
|
235
|
+
for (const attester of attesterAccounts) {
|
|
236
|
+
const result = await processAttester(attester, gse, password);
|
|
237
|
+
if (result) {
|
|
238
|
+
results.push(result);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return results;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Handle single attester
|
|
245
|
+
const result = await processAttester(attesterAccounts, gse, password);
|
|
246
|
+
return result ? [result] : [];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Main staker command function
|
|
251
|
+
*/
|
|
252
|
+
export async function generateStakerJson(options: StakerOptions, log: LogFn): Promise<void> {
|
|
253
|
+
const { from, password, gseAddress, l1RpcUrls, l1ChainId, output } = options;
|
|
254
|
+
|
|
255
|
+
// Load the keystore file
|
|
256
|
+
const keystore = loadKeystoreFile(from);
|
|
257
|
+
|
|
258
|
+
if (!gseAddress) {
|
|
259
|
+
throw new Error('GSE contract address is required');
|
|
260
|
+
}
|
|
261
|
+
log(`Calling GSE contract ${gseAddress} on chain ${l1ChainId}, using ${l1RpcUrls.join(', ')} to get staker outputs`);
|
|
262
|
+
|
|
263
|
+
if (!keystore.validators || keystore.validators.length === 0) {
|
|
264
|
+
log('No validators found in keystore');
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const allOutputs: StakerOutput[] = [];
|
|
269
|
+
|
|
270
|
+
// L1 client for proof of possession
|
|
271
|
+
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
272
|
+
const publicClient = createPublicClient({
|
|
273
|
+
chain: chain.chainInfo,
|
|
274
|
+
transport: fallback(l1RpcUrls.map(url => http(url))),
|
|
275
|
+
});
|
|
276
|
+
const gse = new GSEContract(publicClient, gseAddress);
|
|
277
|
+
|
|
278
|
+
// Process each validator
|
|
279
|
+
for (const validator of keystore.validators) {
|
|
280
|
+
const outputs = await processAttesterAccounts(validator.attester, gse, password);
|
|
281
|
+
allOutputs.push(...outputs);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (allOutputs.length === 0) {
|
|
285
|
+
log('No attesters with BLS keys found (skipping mnemonics and encrypted keystores without password)');
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const jsonOutput = prettyPrintJSON(allOutputs);
|
|
290
|
+
|
|
291
|
+
// Write to file if output is specified, otherwise log to stdout
|
|
292
|
+
if (output) {
|
|
293
|
+
writeFileSync(output, jsonOutput, 'utf-8');
|
|
294
|
+
log(`Wrote staking data to ${output}`);
|
|
295
|
+
} else {
|
|
296
|
+
log(jsonOutput);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DefaultL1ContractsConfig, type L1ContractsConfig } from '@aztec/ethereum';
|
|
1
|
+
import { DefaultL1ContractsConfig, type L1ContractsConfig, type L1TxUtilsConfig } from '@aztec/ethereum';
|
|
2
2
|
import type { NetworkNames } from '@aztec/foundation/config';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
5
|
-
import type {
|
|
5
|
+
import type { P2PConfig } from '@aztec/p2p';
|
|
6
|
+
import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
7
|
|
|
7
8
|
import path from 'path';
|
|
8
9
|
|
|
@@ -14,15 +15,15 @@ const SNAPSHOTS_URL = 'https://aztec-labs-snapshots.com';
|
|
|
14
15
|
const defaultDBMapSizeKb = 128 * 1_024 * 1_024; // 128 GB
|
|
15
16
|
const tbMapSizeKb = 1_024 * 1_024 * 1_024; // 1 TB
|
|
16
17
|
|
|
17
|
-
export type L2ChainConfig = L1ContractsConfig &
|
|
18
|
-
Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways'> &
|
|
18
|
+
export type L2ChainConfig = Omit<L1ContractsConfig, keyof L1TxUtilsConfig> &
|
|
19
|
+
Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways' | 'slashOverridePayload' | 'slashSelfAllowed'> &
|
|
20
|
+
Pick<P2PConfig, 'bootstrapNodes' | 'p2pEnabled' | 'txPoolDeleteTxsAfterReorg'> &
|
|
21
|
+
Pick<SequencerConfig, 'minTxsPerBlock' | 'maxTxsPerBlock'> & {
|
|
19
22
|
l1ChainId: number;
|
|
20
23
|
testAccounts: boolean;
|
|
21
24
|
sponsoredFPC: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
seqMinTxsPerBlock: number;
|
|
25
|
-
seqMaxTxsPerBlock: number;
|
|
25
|
+
minTxsPerBlock: number;
|
|
26
|
+
maxTxsPerBlock: number;
|
|
26
27
|
realProofs: boolean;
|
|
27
28
|
snapshotsUrls: string[];
|
|
28
29
|
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
@@ -35,9 +36,9 @@ export type L2ChainConfig = L1ContractsConfig &
|
|
|
35
36
|
skipArchiverInitialSync?: boolean;
|
|
36
37
|
blobAllowEmptySources?: boolean;
|
|
37
38
|
|
|
38
|
-
// Setting the
|
|
39
|
+
// Setting the dataStoreMapSize provides the default for every DB in the node.
|
|
39
40
|
// Then we explicitly override the sizes for the archiver and the larger trees.
|
|
40
|
-
|
|
41
|
+
dataStoreMapSizeKb: number;
|
|
41
42
|
archiverStoreMapSizeKb: number;
|
|
42
43
|
noteHashTreeMapSizeKb: number;
|
|
43
44
|
nullifierTreeMapSizeKb: number;
|
|
@@ -86,7 +87,7 @@ const DefaultSlashConfig = {
|
|
|
86
87
|
} satisfies Partial<L2ChainConfig>;
|
|
87
88
|
|
|
88
89
|
const DefaultNetworkDBMapSizeConfig = {
|
|
89
|
-
|
|
90
|
+
dataStoreMapSizeKb: defaultDBMapSizeKb,
|
|
90
91
|
archiverStoreMapSizeKb: tbMapSizeKb,
|
|
91
92
|
noteHashTreeMapSizeKb: tbMapSizeKb,
|
|
92
93
|
nullifierTreeMapSizeKb: tbMapSizeKb,
|
|
@@ -99,9 +100,9 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
99
100
|
sponsoredFPC: false,
|
|
100
101
|
disableTransactions: true,
|
|
101
102
|
p2pEnabled: true,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
bootstrapNodes: [],
|
|
104
|
+
minTxsPerBlock: 0,
|
|
105
|
+
maxTxsPerBlock: 0,
|
|
105
106
|
realProofs: true,
|
|
106
107
|
snapshotsUrls: [`${SNAPSHOTS_URL}/staging-ignition/`],
|
|
107
108
|
autoUpdate: 'config-and-version',
|
|
@@ -111,6 +112,8 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
111
112
|
publicIncludeMetrics,
|
|
112
113
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
113
114
|
publicMetricsCollectFrom: ['sequencer'],
|
|
115
|
+
txPoolDeleteTxsAfterReorg: false,
|
|
116
|
+
blobAllowEmptySources: true,
|
|
114
117
|
|
|
115
118
|
/** How many seconds an L1 slot lasts. */
|
|
116
119
|
ethereumSlotDuration: 12,
|
|
@@ -180,9 +183,9 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
180
183
|
sponsoredFPC: true,
|
|
181
184
|
disableTransactions: false,
|
|
182
185
|
p2pEnabled: true,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
bootstrapNodes: [],
|
|
187
|
+
minTxsPerBlock: 0,
|
|
188
|
+
maxTxsPerBlock: 20,
|
|
186
189
|
realProofs: true,
|
|
187
190
|
snapshotsUrls: [`${SNAPSHOTS_URL}/staging-public/`],
|
|
188
191
|
autoUpdate: 'config-and-version',
|
|
@@ -192,6 +195,7 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
192
195
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
193
196
|
publicMetricsCollectFrom: ['sequencer'],
|
|
194
197
|
maxTxPoolSize: 100_000_000, // 100MB
|
|
198
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
195
199
|
|
|
196
200
|
// Deployment stuff
|
|
197
201
|
/** How many seconds an L1 slot lasts. */
|
|
@@ -234,9 +238,9 @@ export const nextNetL2ChainConfig: L2ChainConfig = {
|
|
|
234
238
|
sponsoredFPC: true,
|
|
235
239
|
p2pEnabled: true,
|
|
236
240
|
disableTransactions: false,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
241
|
+
bootstrapNodes: [],
|
|
242
|
+
minTxsPerBlock: 0,
|
|
243
|
+
maxTxsPerBlock: 8,
|
|
240
244
|
realProofs: true,
|
|
241
245
|
snapshotsUrls: [],
|
|
242
246
|
autoUpdate: 'config-and-version',
|
|
@@ -246,6 +250,7 @@ export const nextNetL2ChainConfig: L2ChainConfig = {
|
|
|
246
250
|
publicMetricsCollectorUrl: '',
|
|
247
251
|
publicMetricsCollectFrom: [''],
|
|
248
252
|
maxTxPoolSize: 100_000_000, // 100MB
|
|
253
|
+
txPoolDeleteTxsAfterReorg: false,
|
|
249
254
|
|
|
250
255
|
// Deployment stuff
|
|
251
256
|
/** How many seconds an L1 slot lasts. */
|
|
@@ -288,9 +293,9 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
288
293
|
sponsoredFPC: true,
|
|
289
294
|
p2pEnabled: true,
|
|
290
295
|
disableTransactions: true,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
296
|
+
bootstrapNodes: [],
|
|
297
|
+
minTxsPerBlock: 0,
|
|
298
|
+
maxTxsPerBlock: 0,
|
|
294
299
|
realProofs: true,
|
|
295
300
|
snapshotsUrls: [`${SNAPSHOTS_URL}/testnet/`],
|
|
296
301
|
autoUpdate: 'config-and-version',
|
|
@@ -300,6 +305,7 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
300
305
|
publicIncludeMetrics,
|
|
301
306
|
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
302
307
|
publicMetricsCollectFrom: ['sequencer'],
|
|
308
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
303
309
|
skipArchiverInitialSync: true,
|
|
304
310
|
blobAllowEmptySources: true,
|
|
305
311
|
|
|
@@ -371,14 +377,16 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
371
377
|
};
|
|
372
378
|
|
|
373
379
|
export const mainnetL2ChainConfig: L2ChainConfig = {
|
|
380
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
381
|
+
disableTransactions: true,
|
|
382
|
+
|
|
374
383
|
l1ChainId: 1,
|
|
375
384
|
testAccounts: false,
|
|
376
385
|
sponsoredFPC: false,
|
|
377
386
|
p2pEnabled: true,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
seqMaxTxsPerBlock: 0,
|
|
387
|
+
bootstrapNodes: [],
|
|
388
|
+
minTxsPerBlock: 0,
|
|
389
|
+
maxTxsPerBlock: 0,
|
|
382
390
|
realProofs: true,
|
|
383
391
|
snapshotsUrls: [`${SNAPSHOTS_URL}/mainnet/`],
|
|
384
392
|
autoUpdate: 'notify',
|
|
@@ -462,9 +470,9 @@ export const devnetL2ChainConfig: L2ChainConfig = {
|
|
|
462
470
|
sponsoredFPC: true,
|
|
463
471
|
p2pEnabled: true,
|
|
464
472
|
disableTransactions: false,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
473
|
+
bootstrapNodes: [],
|
|
474
|
+
minTxsPerBlock: 0,
|
|
475
|
+
maxTxsPerBlock: 8,
|
|
468
476
|
realProofs: false,
|
|
469
477
|
snapshotsUrls: [],
|
|
470
478
|
autoUpdate: 'config-and-version',
|
|
@@ -474,6 +482,7 @@ export const devnetL2ChainConfig: L2ChainConfig = {
|
|
|
474
482
|
publicMetricsCollectorUrl: '',
|
|
475
483
|
publicMetricsCollectFrom: [''],
|
|
476
484
|
maxTxPoolSize: 100_000_000, // 100MB
|
|
485
|
+
txPoolDeleteTxsAfterReorg: true,
|
|
477
486
|
|
|
478
487
|
// Deployment stuff
|
|
479
488
|
/** How many seconds an L1 slot lasts. */
|
|
@@ -532,7 +541,7 @@ function getDefaultDataDir(networkName: NetworkNames): string {
|
|
|
532
541
|
return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
|
|
533
542
|
}
|
|
534
543
|
|
|
535
|
-
export function
|
|
544
|
+
export function enrichEnvironmentWithChainName(networkName: NetworkNames) {
|
|
536
545
|
if (networkName === 'local') {
|
|
537
546
|
return;
|
|
538
547
|
}
|
|
@@ -544,19 +553,24 @@ export function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
|
544
553
|
throw new Error(`Unknown network name: ${networkName}`);
|
|
545
554
|
}
|
|
546
555
|
|
|
547
|
-
|
|
556
|
+
enrichEnvironmentWithChainConfig(config);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export function enrichEnvironmentWithChainConfig(config: L2ChainConfig) {
|
|
560
|
+
enrichVar('BOOTSTRAP_NODES', config.bootstrapNodes.join(','));
|
|
548
561
|
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
549
562
|
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
550
563
|
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
551
564
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
552
|
-
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.
|
|
553
|
-
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.
|
|
565
|
+
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.minTxsPerBlock.toString());
|
|
566
|
+
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.maxTxsPerBlock.toString());
|
|
554
567
|
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
555
568
|
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
556
569
|
enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
|
|
557
570
|
enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
|
|
571
|
+
enrichVar('P2P_TX_POOL_DELETE_TXS_AFTER_REORG', config.txPoolDeleteTxsAfterReorg.toString());
|
|
558
572
|
|
|
559
|
-
enrichVar('DATA_STORE_MAP_SIZE_KB', config.
|
|
573
|
+
enrichVar('DATA_STORE_MAP_SIZE_KB', config.dataStoreMapSizeKb.toString());
|
|
560
574
|
enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
|
|
561
575
|
enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
|
|
562
576
|
enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
|
|
@@ -597,6 +611,7 @@ export function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
|
597
611
|
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
598
612
|
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
599
613
|
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
614
|
+
enrichVar('AZTEC_LAG_IN_EPOCHS', config.lagInEpochs.toString());
|
|
600
615
|
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
601
616
|
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
602
617
|
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
@@ -614,6 +629,7 @@ export function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
|
614
629
|
enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
|
|
615
630
|
enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
|
|
616
631
|
enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
|
|
632
|
+
enrichVar('AZTEC_SLASHING_DISABLE_DURATION', config.slashingDisableDuration.toString());
|
|
617
633
|
enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
|
|
618
634
|
enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
|
|
619
635
|
|
|
@@ -631,6 +647,8 @@ export function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
|
631
647
|
enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
|
|
632
648
|
enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
|
|
633
649
|
enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
|
|
650
|
+
enrichVar('SLASH_GRACE_PERIOD_L2_SLOTS', config.slashGracePeriodL2Slots.toString());
|
|
651
|
+
enrichVar('SLASH_EXECUTE_ROUNDS_LOOK_BACK', config.slashExecuteRoundsLookBack.toString());
|
|
634
652
|
|
|
635
653
|
enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
|
|
636
654
|
enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
|