@aztec/cli 3.0.0-nightly.20250910 → 3.0.0-nightly.20250912
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/devnet/bootstrap_network.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +11 -10
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +2 -2
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -14
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +4 -4
- package/dest/cmds/l1/deploy_new_rollup.js +2 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +2 -2
- package/dest/cmds/l1/update_l1_validators.js +1 -1
- package/dest/config/chain_l2_config.d.ts.map +1 -1
- package/dest/config/chain_l2_config.js +35 -68
- package/dest/utils/aztec.d.ts +1 -1
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +2 -2
- package/dest/utils/setup_contracts.d.ts +3 -3
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +9 -19
- package/package.json +24 -23
- package/src/cmds/devnet/bootstrap_network.ts +15 -10
- package/src/cmds/infrastructure/index.ts +1 -9
- package/src/cmds/infrastructure/setup_l2_contract.ts +10 -17
- package/src/cmds/l1/deploy_l1_contracts.ts +4 -2
- package/src/cmds/l1/deploy_new_rollup.ts +2 -2
- package/src/cmds/l1/index.ts +2 -0
- package/src/cmds/l1/update_l1_validators.ts +1 -1
- package/src/config/chain_l2_config.ts +46 -80
- package/src/utils/aztec.ts +2 -0
- package/src/utils/setup_contracts.ts +6 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAsFjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { BatchCall, Fr, L1FeeJuicePortalManager, createCompatibleClient, retryUntil, waitForProven } from '@aztec/aztec.js';
|
|
3
3
|
import { createEthereumChain, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
4
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
4
5
|
import { getContract } from 'viem';
|
|
5
6
|
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
6
7
|
const waitOpts = {
|
|
@@ -13,12 +14,12 @@ const provenWaitOpts = {
|
|
|
13
14
|
};
|
|
14
15
|
export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey, l1Mnemonic, addressIndex, json, log, debugLog) {
|
|
15
16
|
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
17
|
+
const wallet = new TestWallet(pxe);
|
|
16
18
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
17
19
|
// so all we need to do is register them to our pxe.
|
|
18
|
-
const [
|
|
19
|
-
await
|
|
20
|
-
const
|
|
21
|
-
const defaultAccountAddress = wallet.getAddress();
|
|
20
|
+
const [accountData] = await getInitialTestAccountsData();
|
|
21
|
+
const accountManager = await wallet.createSchnorrAccount(accountData.secret, accountData.salt, accountData.signingKey);
|
|
22
|
+
const defaultAccountAddress = accountManager.getAddress();
|
|
22
23
|
const l1Client = createExtendedL1Client(l1Urls, l1PrivateKey ? privateKeyToAccount(l1PrivateKey) : // Note that this account needs to be funded on L1 !
|
|
23
24
|
mnemonicToAccount(l1Mnemonic, {
|
|
24
25
|
addressIndex
|
|
@@ -26,7 +27,7 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
26
27
|
const { erc20Address, portalAddress } = await deployERC20(l1Client);
|
|
27
28
|
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
28
29
|
await initPortal(pxe, l1Client, erc20Address, portalAddress, bridge.address);
|
|
29
|
-
const fpcAdmin =
|
|
30
|
+
const fpcAdmin = defaultAccountAddress;
|
|
30
31
|
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
31
32
|
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
32
33
|
await fundFPC(pxe, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
@@ -190,19 +191,19 @@ async function fundFPC(pxe, counterAddress, wallet, defaultAccountAddress, l1Cli
|
|
|
190
191
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
191
192
|
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
192
193
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
193
|
-
const { protocolContractAddresses: { feeJuice } } = await
|
|
194
|
+
const { protocolContractAddresses: { feeJuice } } = await pxe.getNodeInfo();
|
|
194
195
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
195
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
196
|
+
const feeJuicePortal = await L1FeeJuicePortalManager.new(pxe, l1Client, debugLog);
|
|
196
197
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, undefined, true);
|
|
197
198
|
await retryUntil(async ()=>await pxe.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
|
|
198
199
|
const counter = await CounterContract.at(counterAddress, wallet);
|
|
199
200
|
debugLog.info('Incrementing Counter');
|
|
200
201
|
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
201
202
|
// advance the chain
|
|
202
|
-
await counter.methods.increment(
|
|
203
|
+
await counter.methods.increment(defaultAccountAddress).send({
|
|
203
204
|
from: defaultAccountAddress
|
|
204
205
|
}).wait(waitOpts);
|
|
205
|
-
await counter.methods.increment(
|
|
206
|
+
await counter.methods.increment(defaultAccountAddress).send({
|
|
206
207
|
from: defaultAccountAddress
|
|
207
208
|
}).wait(waitOpts);
|
|
208
209
|
debugLog.info('Claiming FPC');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAgD/E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
2
2
|
export function injectCommands(program, log, debugLogger) {
|
|
3
|
-
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--sponsoredFPC', 'Deploy a sponsored FPC.').option('--json', 'Output the contract addresses in JSON format').
|
|
3
|
+
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--sponsoredFPC', 'Deploy a sponsored FPC.').option('--json', 'Output the contract addresses in JSON format').action(async (options)=>{
|
|
4
4
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
5
|
-
await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json,
|
|
5
|
+
await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json, log);
|
|
6
6
|
});
|
|
7
7
|
program.command('sequencers').argument('<command>', 'Command to run: list, add, remove, who-next').argument('[who]', 'Who to add/remove').description('Manages or queries registered sequencers on the L1 rollup contract.').requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
|
|
8
8
|
ETHEREUM_HOSTS
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function setupL2Contracts(rpcUrl: string, testAccounts: boolean, sponsoredFPC: boolean, json: boolean,
|
|
2
|
+
export declare function setupL2Contracts(rpcUrl: string, testAccounts: boolean, sponsoredFPC: boolean, json: boolean, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=setup_l2_contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,iBA8BX"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
5
6
|
import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
|
|
6
|
-
export async function setupL2Contracts(rpcUrl, testAccounts, sponsoredFPC, json,
|
|
7
|
+
export async function setupL2Contracts(rpcUrl, testAccounts, sponsoredFPC, json, log) {
|
|
7
8
|
const waitOpts = {
|
|
8
9
|
timeout: 180,
|
|
9
10
|
interval: 1
|
|
10
11
|
};
|
|
11
|
-
const waitForProvenOptions = !skipProofWait ? {
|
|
12
|
-
provenTimeout: 600
|
|
13
|
-
} : undefined;
|
|
14
12
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
15
|
-
if (waitForProvenOptions) {
|
|
16
|
-
log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
|
|
17
|
-
}
|
|
18
13
|
log('setupL2Contracts: Creating PXE client...');
|
|
19
14
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([
|
|
20
15
|
1,
|
|
@@ -23,22 +18,23 @@ export async function setupL2Contracts(rpcUrl, testAccounts, sponsoredFPC, json,
|
|
|
23
18
|
1,
|
|
24
19
|
1
|
|
25
20
|
], false));
|
|
26
|
-
|
|
21
|
+
const wallet = new TestWallet(pxe);
|
|
22
|
+
let deployedAccountManagers = [];
|
|
27
23
|
if (testAccounts) {
|
|
28
24
|
log('setupL2Contracts: Deploying test accounts...');
|
|
29
|
-
|
|
30
|
-
await deployFundedSchnorrAccounts(
|
|
25
|
+
const initialAccountsData = await getInitialTestAccountsData();
|
|
26
|
+
deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
|
|
31
27
|
}
|
|
32
28
|
if (sponsoredFPC) {
|
|
33
29
|
log('setupL2Contracts: Setting up sponsored FPC...');
|
|
34
|
-
await setupSponsoredFPC(pxe, log
|
|
30
|
+
await setupSponsoredFPC(pxe, log);
|
|
35
31
|
}
|
|
36
32
|
if (json) {
|
|
37
33
|
const toPrint = {
|
|
38
34
|
...ProtocolContractAddress
|
|
39
35
|
};
|
|
40
|
-
|
|
41
|
-
toPrint[`testAccount${i}`] = a.
|
|
36
|
+
deployedAccountManagers.forEach((a, i)=>{
|
|
37
|
+
toPrint[`testAccount${i}`] = a.getAddress();
|
|
42
38
|
});
|
|
43
39
|
log(JSON.stringify(toPrint, null, 2));
|
|
44
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type EthAddress } from '@aztec/aztec.js';
|
|
2
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, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
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, flushEntryQueue: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=deploy_l1_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAM,MAAM,iBAAiB,CAAC;AAGtD,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,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAM,MAAM,iBAAiB,CAAC;AAGtD,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,eAAe,EAAE,OAAO,EACxB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA8DpB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { Fr } from '@aztec/aztec.js';
|
|
3
3
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
4
|
import { SecretValue } from '@aztec/foundation/config';
|
|
5
5
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
6
6
|
import { deployAztecContracts } from '../../utils/aztec.js';
|
|
7
7
|
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
8
|
-
export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, acceleratedTestDeployments, json, createVerificationJson, initialValidators, realVerifier, log, debugLogger) {
|
|
8
|
+
export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, acceleratedTestDeployments, json, createVerificationJson, initialValidators, realVerifier, flushEntryQueue, log, debugLogger) {
|
|
9
9
|
const config = getL1ContractsConfigEnvVars();
|
|
10
|
-
const initialAccounts = testAccounts ? await
|
|
10
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
11
11
|
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
12
12
|
const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddress);
|
|
13
13
|
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
@@ -16,7 +16,7 @@ export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic,
|
|
|
16
16
|
withdrawer: a,
|
|
17
17
|
bn254SecretKey: new SecretValue(Fr.random().toBigInt())
|
|
18
18
|
}));
|
|
19
|
-
const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidatorOperators, genesisArchiveRoot, fundingNeeded, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger);
|
|
19
|
+
const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidatorOperators, genesisArchiveRoot, fundingNeeded, acceleratedTestDeployments, config, realVerifier, createVerificationJson, flushEntryQueue, debugLogger);
|
|
20
20
|
if (json) {
|
|
21
21
|
log(JSON.stringify(Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v])=>[
|
|
22
22
|
k,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
4
4
|
import { deployNewRollupContracts } from '../../utils/aztec.js';
|
|
5
5
|
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
6
6
|
export async function deployNewRollup(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, json, initialValidators, realVerifier, log, debugLogger) {
|
|
7
7
|
const config = getL1ContractsConfigEnvVars();
|
|
8
|
-
const initialAccounts = testAccounts ? await
|
|
8
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
9
9
|
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
10
10
|
const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddress);
|
|
11
11
|
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAkhB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -8,10 +8,10 @@ const l1RpcUrlsOption = new Option('--l1-rpc-urls <string>', 'List of Ethereum h
|
|
|
8
8
|
]).makeOptionMandatory(true).argParser((arg)=>arg.split(',').map((url)=>url.trim()));
|
|
9
9
|
const networkOption = new Option('--network <string>', 'Network to execute against').env('NETWORK');
|
|
10
10
|
export function injectCommands(program, log, debugLogger) {
|
|
11
|
-
program.command('deploy-l1-contracts').description('Deploys all necessary Ethereum contracts for Aztec.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false).option('--real-verifier', 'Deploy the real verifier', false).option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false).action(async (options)=>{
|
|
11
|
+
program.command('deploy-l1-contracts').description('Deploys all necessary Ethereum contracts for Aztec.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false).option('--real-verifier', 'Deploy the real verifier', false).option('--flush-entry-queue', 'Whether to flush the entry queue after adding initial validators', false).option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false).action(async (options)=>{
|
|
12
12
|
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
13
13
|
const initialValidators = options.validators?.split(',').map((validator)=>EthAddress.fromString(validator)) || [];
|
|
14
|
-
await deployL1Contracts(options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.salt, options.testAccounts, options.sponsoredFpc, options.acceleratedTestDeployments, options.json, options.createVerificationJson, initialValidators, options.realVerifier, log, debugLogger);
|
|
14
|
+
await deployL1Contracts(options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.salt, options.testAccounts, options.sponsoredFpc, options.acceleratedTestDeployments, options.json, options.createVerificationJson, initialValidators, options.realVerifier, options.flushEntryQueue, log, debugLogger);
|
|
15
15
|
});
|
|
16
16
|
program.command('deploy-new-rollup').description('Deploys a new rollup contract and adds it to the registry (if you are the owner).').requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress).addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', MNEMONIC ?? 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--real-verifier', 'Deploy the real verifier', false).action(async (options)=>{
|
|
17
17
|
const { deployNewRollup } = await import('./deploy_new_rollup.js');
|
|
@@ -208,7 +208,7 @@ export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }) {
|
|
|
208
208
|
log(`Committee: ${committee?.map((v)=>v.toString()).join(', ')}`);
|
|
209
209
|
const archive = await rollup.archive();
|
|
210
210
|
log(`Archive: ${archive}`);
|
|
211
|
-
const epochNum = await rollup.
|
|
211
|
+
const epochNum = await rollup.getCurrentEpochNumber();
|
|
212
212
|
log(`Current epoch: ${epochNum}`);
|
|
213
213
|
const slot = await rollup.getSlotNumber();
|
|
214
214
|
log(`Current slot: ${slot}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/config/chain_l2_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOrE,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,aAAa,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/config/chain_l2_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOrE,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,aAAa,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAoCJ,eAAO,MAAM,4BAA4B,EAAE,aAqC1C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAmDxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAmDlC,CAAC;AAIF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,gBAgC9E;AAED,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAkBpC;AAuBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBA0F/E"}
|
|
@@ -5,6 +5,32 @@ import path, { dirname, join } from 'path';
|
|
|
5
5
|
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
|
|
6
6
|
type: 'json'
|
|
7
7
|
};
|
|
8
|
+
const DefaultSlashConfig = {
|
|
9
|
+
/** Tally-style slashing */ slasherFlavor: 'tally',
|
|
10
|
+
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
11
|
+
/** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
|
|
12
|
+
/** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
|
|
13
|
+
/** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
|
|
14
|
+
/** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
15
|
+
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
16
|
+
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
17
|
+
// Slashing stuff
|
|
18
|
+
slashMinPenaltyPercentage: 0.5,
|
|
19
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
20
|
+
slashInactivityTargetPercentage: 0.7,
|
|
21
|
+
slashInactivityConsecutiveEpochThreshold: 1,
|
|
22
|
+
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
23
|
+
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
24
|
+
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
25
|
+
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
26
|
+
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
27
|
+
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
28
|
+
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
29
|
+
slashMaxPayloadSize: 50,
|
|
30
|
+
slashGracePeriodL2Slots: 32 * 2,
|
|
31
|
+
slashOffenseExpirationRounds: 8,
|
|
32
|
+
sentinelEnabled: true
|
|
33
|
+
};
|
|
8
34
|
export const stagingIgnitionL2ChainConfig = {
|
|
9
35
|
l1ChainId: 11155111,
|
|
10
36
|
testAccounts: true,
|
|
@@ -27,32 +53,14 @@ export const stagingIgnitionL2ChainConfig = {
|
|
|
27
53
|
'sequencer'
|
|
28
54
|
],
|
|
29
55
|
...DefaultL1ContractsConfig,
|
|
56
|
+
...DefaultSlashConfig,
|
|
30
57
|
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
31
58
|
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
32
59
|
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
33
60
|
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
34
61
|
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
35
62
|
/** The mana target for the rollup */ manaTarget: 0n,
|
|
36
|
-
/** The proving cost per mana */ provingCostPerMana: 0n
|
|
37
|
-
slasherFlavor: 'none',
|
|
38
|
-
slashAmountSmall: 0n,
|
|
39
|
-
slashAmountMedium: 0n,
|
|
40
|
-
slashAmountLarge: 0n,
|
|
41
|
-
slashMinPenaltyPercentage: 0.5,
|
|
42
|
-
slashMaxPenaltyPercentage: 200,
|
|
43
|
-
slashInactivityTargetPercentage: 0,
|
|
44
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
45
|
-
slashInactivityPenalty: 0n,
|
|
46
|
-
slashPrunePenalty: 0n,
|
|
47
|
-
slashDataWithholdingPenalty: 0n,
|
|
48
|
-
slashProposeInvalidAttestationsPenalty: 0n,
|
|
49
|
-
slashAttestDescendantOfInvalidPenalty: 0n,
|
|
50
|
-
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
51
|
-
slashMaxPayloadSize: 50,
|
|
52
|
-
slashGracePeriodL2Slots: 0,
|
|
53
|
-
slashUnknownPenalty: 0n,
|
|
54
|
-
slashOffenseExpirationRounds: 10,
|
|
55
|
-
sentinelEnabled: false
|
|
63
|
+
/** The proving cost per mana */ provingCostPerMana: 0n
|
|
56
64
|
};
|
|
57
65
|
export const stagingPublicL2ChainConfig = {
|
|
58
66
|
l1ChainId: 11155111,
|
|
@@ -80,6 +88,8 @@ export const stagingPublicL2ChainConfig = {
|
|
|
80
88
|
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
81
89
|
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
82
90
|
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
91
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
92
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
83
93
|
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
84
94
|
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
85
95
|
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
@@ -88,30 +98,7 @@ export const stagingPublicL2ChainConfig = {
|
|
|
88
98
|
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
89
99
|
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
90
100
|
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
91
|
-
|
|
92
|
-
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
93
|
-
/** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
|
|
94
|
-
/** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
|
|
95
|
-
/** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
|
|
96
|
-
/** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
97
|
-
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
98
|
-
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
99
|
-
// Slashing stuff
|
|
100
|
-
slashMinPenaltyPercentage: 0.5,
|
|
101
|
-
slashMaxPenaltyPercentage: 2.0,
|
|
102
|
-
slashInactivityTargetPercentage: 0.7,
|
|
103
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
104
|
-
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
105
|
-
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
106
|
-
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
107
|
-
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
108
|
-
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
109
|
-
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
110
|
-
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
111
|
-
slashMaxPayloadSize: 50,
|
|
112
|
-
slashGracePeriodL2Slots: 32 * 2,
|
|
113
|
-
slashOffenseExpirationRounds: 8,
|
|
114
|
-
sentinelEnabled: true
|
|
101
|
+
...DefaultSlashConfig
|
|
115
102
|
};
|
|
116
103
|
export const testnetL2ChainConfig = {
|
|
117
104
|
l1ChainId: 11155111,
|
|
@@ -139,38 +126,17 @@ export const testnetL2ChainConfig = {
|
|
|
139
126
|
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
140
127
|
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
141
128
|
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
129
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochs: 2,
|
|
142
130
|
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
143
131
|
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
144
132
|
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
133
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
145
134
|
/** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
146
135
|
/** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
|
|
147
136
|
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
148
137
|
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
149
138
|
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
150
|
-
|
|
151
|
-
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
152
|
-
/** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
|
|
153
|
-
/** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
|
|
154
|
-
/** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
|
|
155
|
-
/** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
156
|
-
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
157
|
-
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
158
|
-
// Slashing stuff
|
|
159
|
-
slashMinPenaltyPercentage: 0.5,
|
|
160
|
-
slashMaxPenaltyPercentage: 2.0,
|
|
161
|
-
slashInactivityTargetPercentage: 0.7,
|
|
162
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
163
|
-
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
164
|
-
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
165
|
-
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
166
|
-
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
167
|
-
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
168
|
-
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
169
|
-
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
170
|
-
slashMaxPayloadSize: 50,
|
|
171
|
-
slashGracePeriodL2Slots: 32 * 2,
|
|
172
|
-
slashOffenseExpirationRounds: 8,
|
|
173
|
-
sentinelEnabled: true
|
|
139
|
+
...DefaultSlashConfig
|
|
174
140
|
};
|
|
175
141
|
const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
|
|
176
142
|
export async function getBootnodes(networkName, cacheDir) {
|
|
@@ -293,6 +259,7 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
|
293
259
|
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
294
260
|
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
295
261
|
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
262
|
+
enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
|
|
296
263
|
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
297
264
|
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
298
265
|
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
package/dest/utils/aztec.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function getFunctionAbi(artifact: ContractArtifact, fnName: strin
|
|
|
18
18
|
* @param privateKey - The private key to be used in contract deployment.
|
|
19
19
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
20
20
|
*/
|
|
21
|
-
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
|
|
21
|
+
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, flushEntryQueue: boolean, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
|
|
22
22
|
export declare function deployNewRollupContracts(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, config: L1ContractsConfig, realVerifier: boolean, logger: Logger): Promise<{
|
|
23
23
|
rollup: RollupContract;
|
|
24
24
|
slashFactoryAddress: EthAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,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,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,0BAA0B,EAAE,OAAO,EACnC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC,
|
|
1
|
+
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,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,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,0BAA0B,EAAE,OAAO,EACnC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,eAAe,EAAE,OAAO,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC,CAiCtC;AAED,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,UAAU,EAC3B,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,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,mBAAmB,EAAE,UAAU,CAAA;CAAE,CAAC,CA6CtE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAKjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,6BA4BpE;AAED;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK;;;;GAO3G;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,KAAK,MAAM,EAKtD,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE;AAKD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,iBAyB9E"}
|
package/dest/utils/aztec.js
CHANGED
|
@@ -25,7 +25,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
25
25
|
* @param chainId - The chain ID of the L1 host.
|
|
26
26
|
* @param privateKey - The private key to be used in contract deployment.
|
|
27
27
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
28
|
-
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger) {
|
|
28
|
+
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson, flushEntryQueue, debugLogger) {
|
|
29
29
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
30
30
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
31
31
|
const account = !privateKey ? mnemonicToAccount(mnemonic, {
|
|
@@ -43,7 +43,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
43
43
|
feeJuicePortalInitialBalance,
|
|
44
44
|
realVerifier,
|
|
45
45
|
...config
|
|
46
|
-
}, config, createVerificationJson);
|
|
46
|
+
}, config, createVerificationJson, flushEntryQueue);
|
|
47
47
|
return result;
|
|
48
48
|
}
|
|
49
49
|
export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, config, realVerifier, logger) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
4
|
-
export declare function setupSponsoredFPC(pxe: PXE, log: LogFn
|
|
3
|
+
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
4
|
+
export declare function setupSponsoredFPC(pxe: PXE, log: LogFn): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,GAAG,EAA8C,MAAM,iBAAiB,CAAC;AAE3F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,wBAAsB,sBAAsB,oDAM3C;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,iBAQ3D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fr, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
|
|
2
2
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
4
3
|
async function getSponsoredFPCContract() {
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
5
|
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
@@ -14,23 +13,14 @@ export async function getSponsoredFPCAddress() {
|
|
|
14
13
|
});
|
|
15
14
|
return sponsoredFPCInstance.address;
|
|
16
15
|
}
|
|
17
|
-
export async function setupSponsoredFPC(pxe, log
|
|
16
|
+
export async function setupSponsoredFPC(pxe, log) {
|
|
18
17
|
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
26
|
-
universalDeploy: true,
|
|
27
|
-
fee: {
|
|
28
|
-
paymentMethod
|
|
29
|
-
}
|
|
18
|
+
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
19
|
+
salt: new Fr(SPONSORED_FPC_SALT)
|
|
20
|
+
});
|
|
21
|
+
await pxe.registerContract({
|
|
22
|
+
instance: sponsoredFPCInstance,
|
|
23
|
+
artifact: SponsoredFPCContract.artifact
|
|
30
24
|
});
|
|
31
|
-
|
|
32
|
-
if (waitForProvenOptions !== undefined) {
|
|
33
|
-
await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
|
|
34
|
-
}
|
|
35
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
25
|
+
log(`SponsoredFPC: ${sponsoredFPCInstance.address}`);
|
|
36
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250912",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -70,17 +70,20 @@
|
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/
|
|
80
|
-
"@aztec/
|
|
81
|
-
"@aztec/
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/
|
|
73
|
+
"@aztec/accounts": "3.0.0-nightly.20250912",
|
|
74
|
+
"@aztec/archiver": "3.0.0-nightly.20250912",
|
|
75
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250912",
|
|
76
|
+
"@aztec/constants": "3.0.0-nightly.20250912",
|
|
77
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250912",
|
|
78
|
+
"@aztec/ethereum": "3.0.0-nightly.20250912",
|
|
79
|
+
"@aztec/foundation": "3.0.0-nightly.20250912",
|
|
80
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250912",
|
|
81
|
+
"@aztec/node-lib": "3.0.0-nightly.20250912",
|
|
82
|
+
"@aztec/p2p": "3.0.0-nightly.20250912",
|
|
83
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250912",
|
|
84
|
+
"@aztec/stdlib": "3.0.0-nightly.20250912",
|
|
85
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250912",
|
|
86
|
+
"@aztec/world-state": "3.0.0-nightly.20250912",
|
|
84
87
|
"@iarna/toml": "^2.2.5",
|
|
85
88
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
86
89
|
"commander": "^12.1.0",
|
|
@@ -92,8 +95,6 @@
|
|
|
92
95
|
"viem": "2.23.7"
|
|
93
96
|
},
|
|
94
97
|
"devDependencies": {
|
|
95
|
-
"@aztec/accounts": "3.0.0-nightly.20250910",
|
|
96
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.20250910",
|
|
97
98
|
"@jest/globals": "^30.0.0",
|
|
98
99
|
"@types/jest": "^30.0.0",
|
|
99
100
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -109,15 +110,15 @@
|
|
|
109
110
|
"typescript": "^5.3.3"
|
|
110
111
|
},
|
|
111
112
|
"peerDependencies": {
|
|
112
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
113
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
114
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
115
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
116
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
117
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
118
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
119
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
120
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
113
|
+
"@aztec/accounts": "3.0.0-nightly.20250912",
|
|
114
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250912",
|
|
115
|
+
"@aztec/ethereum": "3.0.0-nightly.20250912",
|
|
116
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250912",
|
|
117
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250912",
|
|
118
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250912",
|
|
119
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250912",
|
|
120
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250912",
|
|
121
|
+
"@aztec/stdlib": "3.0.0-nightly.20250912"
|
|
121
122
|
},
|
|
122
123
|
"files": [
|
|
123
124
|
"dest",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import {
|
|
3
3
|
AztecAddress,
|
|
4
4
|
BatchCall,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
deployL1Contract,
|
|
22
22
|
} from '@aztec/ethereum';
|
|
23
23
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
24
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
24
25
|
|
|
25
26
|
import { getContract } from 'viem';
|
|
26
27
|
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
@@ -53,14 +54,18 @@ export async function bootstrapNetwork(
|
|
|
53
54
|
debugLog: Logger,
|
|
54
55
|
) {
|
|
55
56
|
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
57
|
+
const wallet = new TestWallet(pxe);
|
|
56
58
|
|
|
57
59
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
58
60
|
// so all we need to do is register them to our pxe.
|
|
59
|
-
const [
|
|
60
|
-
await
|
|
61
|
+
const [accountData] = await getInitialTestAccountsData();
|
|
62
|
+
const accountManager = await wallet.createSchnorrAccount(
|
|
63
|
+
accountData.secret,
|
|
64
|
+
accountData.salt,
|
|
65
|
+
accountData.signingKey,
|
|
66
|
+
);
|
|
61
67
|
|
|
62
|
-
const
|
|
63
|
-
const defaultAccountAddress = wallet.getAddress();
|
|
68
|
+
const defaultAccountAddress = accountManager.getAddress();
|
|
64
69
|
|
|
65
70
|
const l1Client = createExtendedL1Client(
|
|
66
71
|
l1Urls,
|
|
@@ -78,7 +83,7 @@ export async function bootstrapNetwork(
|
|
|
78
83
|
|
|
79
84
|
await initPortal(pxe, l1Client, erc20Address, portalAddress, bridge.address);
|
|
80
85
|
|
|
81
|
-
const fpcAdmin =
|
|
86
|
+
const fpcAdmin = defaultAccountAddress;
|
|
82
87
|
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
83
88
|
|
|
84
89
|
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
@@ -285,11 +290,11 @@ async function fundFPC(
|
|
|
285
290
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
286
291
|
const {
|
|
287
292
|
protocolContractAddresses: { feeJuice },
|
|
288
|
-
} = await
|
|
293
|
+
} = await pxe.getNodeInfo();
|
|
289
294
|
|
|
290
295
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
291
296
|
|
|
292
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
297
|
+
const feeJuicePortal = await L1FeeJuicePortalManager.new(pxe, l1Client, debugLog);
|
|
293
298
|
|
|
294
299
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
|
|
295
300
|
fpcAddress,
|
|
@@ -305,8 +310,8 @@ async function fundFPC(
|
|
|
305
310
|
|
|
306
311
|
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
307
312
|
// advance the chain
|
|
308
|
-
await counter.methods.increment(
|
|
309
|
-
await counter.methods.increment(
|
|
313
|
+
await counter.methods.increment(defaultAccountAddress).send({ from: defaultAccountAddress }).wait(waitOpts);
|
|
314
|
+
await counter.methods.increment(defaultAccountAddress).send({ from: defaultAccountAddress }).wait(waitOpts);
|
|
310
315
|
|
|
311
316
|
debugLog.info('Claiming FPC');
|
|
312
317
|
|
|
@@ -12,17 +12,9 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
12
12
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
13
13
|
.option('--sponsoredFPC', 'Deploy a sponsored FPC.')
|
|
14
14
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
15
|
-
.option('--skipProofWait', "Don't wait for proofs to land.")
|
|
16
15
|
.action(async options => {
|
|
17
16
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
18
|
-
await setupL2Contracts(
|
|
19
|
-
options.rpcUrl,
|
|
20
|
-
options.testAccounts,
|
|
21
|
-
options.sponsoredFPC,
|
|
22
|
-
options.json,
|
|
23
|
-
options.skipProofWait,
|
|
24
|
-
log,
|
|
25
|
-
);
|
|
17
|
+
await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json, log);
|
|
26
18
|
});
|
|
27
19
|
|
|
28
20
|
program
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { AccountManager, type AztecAddress, type WaitOpts, createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
5
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
6
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
6
7
|
|
|
7
8
|
import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
|
|
8
9
|
|
|
@@ -11,41 +12,33 @@ export async function setupL2Contracts(
|
|
|
11
12
|
testAccounts: boolean,
|
|
12
13
|
sponsoredFPC: boolean,
|
|
13
14
|
json: boolean,
|
|
14
|
-
skipProofWait: boolean,
|
|
15
15
|
log: LogFn,
|
|
16
16
|
) {
|
|
17
17
|
const waitOpts: WaitOpts = {
|
|
18
18
|
timeout: 180,
|
|
19
19
|
interval: 1,
|
|
20
20
|
};
|
|
21
|
-
const waitForProvenOptions: WaitForProvenOpts | undefined = !skipProofWait
|
|
22
|
-
? {
|
|
23
|
-
provenTimeout: 600,
|
|
24
|
-
}
|
|
25
|
-
: undefined;
|
|
26
21
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
27
|
-
if (waitForProvenOptions) {
|
|
28
|
-
log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
|
|
29
|
-
}
|
|
30
22
|
log('setupL2Contracts: Creating PXE client...');
|
|
31
23
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
|
|
24
|
+
const wallet = new TestWallet(pxe);
|
|
32
25
|
|
|
33
|
-
let
|
|
26
|
+
let deployedAccountManagers: AccountManager[] = [];
|
|
34
27
|
if (testAccounts) {
|
|
35
28
|
log('setupL2Contracts: Deploying test accounts...');
|
|
36
|
-
|
|
37
|
-
await deployFundedSchnorrAccounts(
|
|
29
|
+
const initialAccountsData = await getInitialTestAccountsData();
|
|
30
|
+
deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
|
|
38
31
|
}
|
|
39
32
|
|
|
40
33
|
if (sponsoredFPC) {
|
|
41
34
|
log('setupL2Contracts: Setting up sponsored FPC...');
|
|
42
|
-
await setupSponsoredFPC(pxe, log
|
|
35
|
+
await setupSponsoredFPC(pxe, log);
|
|
43
36
|
}
|
|
44
37
|
|
|
45
38
|
if (json) {
|
|
46
39
|
const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
|
|
47
|
-
|
|
48
|
-
toPrint[`testAccount${i}`] = a.
|
|
40
|
+
deployedAccountManagers.forEach((a, i) => {
|
|
41
|
+
toPrint[`testAccount${i}`] = a.getAddress();
|
|
49
42
|
});
|
|
50
43
|
log(JSON.stringify(toPrint, null, 2));
|
|
51
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type EthAddress, Fr } from '@aztec/aztec.js';
|
|
3
3
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
4
|
import { SecretValue } from '@aztec/foundation/config';
|
|
@@ -22,12 +22,13 @@ export async function deployL1Contracts(
|
|
|
22
22
|
createVerificationJson: string | false,
|
|
23
23
|
initialValidators: EthAddress[],
|
|
24
24
|
realVerifier: boolean,
|
|
25
|
+
flushEntryQueue: boolean,
|
|
25
26
|
log: LogFn,
|
|
26
27
|
debugLogger: Logger,
|
|
27
28
|
) {
|
|
28
29
|
const config = getL1ContractsConfigEnvVars();
|
|
29
30
|
|
|
30
|
-
const initialAccounts = testAccounts ? await
|
|
31
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
31
32
|
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
32
33
|
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
|
|
33
34
|
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
@@ -52,6 +53,7 @@ export async function deployL1Contracts(
|
|
|
52
53
|
config,
|
|
53
54
|
realVerifier,
|
|
54
55
|
createVerificationJson,
|
|
56
|
+
flushEntryQueue,
|
|
55
57
|
debugLogger,
|
|
56
58
|
);
|
|
57
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type Operator, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
@@ -25,7 +25,7 @@ export async function deployNewRollup(
|
|
|
25
25
|
) {
|
|
26
26
|
const config = getL1ContractsConfigEnvVars();
|
|
27
27
|
|
|
28
|
-
const initialAccounts = testAccounts ? await
|
|
28
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
29
29
|
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
30
30
|
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
|
|
31
31
|
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
48
48
|
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
49
49
|
.option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
|
|
50
50
|
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
51
|
+
.option('--flush-entry-queue', 'Whether to flush the entry queue after adding initial validators', false)
|
|
51
52
|
.option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
|
|
52
53
|
.action(async options => {
|
|
53
54
|
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
@@ -68,6 +69,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
68
69
|
options.createVerificationJson,
|
|
69
70
|
initialValidators,
|
|
70
71
|
options.realVerifier,
|
|
72
|
+
options.flushEntryQueue,
|
|
71
73
|
log,
|
|
72
74
|
debugLogger,
|
|
73
75
|
);
|
|
@@ -308,7 +308,7 @@ export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }: Roll
|
|
|
308
308
|
log(`Committee: ${committee?.map(v => v.toString()).join(', ')}`);
|
|
309
309
|
const archive = await rollup.archive();
|
|
310
310
|
log(`Archive: ${archive}`);
|
|
311
|
-
const epochNum = await rollup.
|
|
311
|
+
const epochNum = await rollup.getCurrentEpochNumber();
|
|
312
312
|
log(`Current epoch: ${epochNum}`);
|
|
313
313
|
const slot = await rollup.getSlotNumber();
|
|
314
314
|
log(`Current slot: ${slot}`);
|
|
@@ -34,6 +34,40 @@ export type L2ChainConfig = L1ContractsConfig &
|
|
|
34
34
|
sentinelEnabled: boolean;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
const DefaultSlashConfig = {
|
|
38
|
+
/** Tally-style slashing */
|
|
39
|
+
slasherFlavor: 'tally',
|
|
40
|
+
/** Allow one round for vetoing */
|
|
41
|
+
slashingExecutionDelayInRounds: 1,
|
|
42
|
+
/** How long for a slash payload to be executed */
|
|
43
|
+
slashingLifetimeInRounds: 5,
|
|
44
|
+
/** Allow 2 rounds to discover faults */
|
|
45
|
+
slashingOffsetInRounds: 2,
|
|
46
|
+
/** No slash vetoer */
|
|
47
|
+
slashingVetoer: EthAddress.ZERO,
|
|
48
|
+
/** Use default slash amounts */
|
|
49
|
+
slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
50
|
+
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
51
|
+
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
52
|
+
|
|
53
|
+
// Slashing stuff
|
|
54
|
+
slashMinPenaltyPercentage: 0.5,
|
|
55
|
+
slashMaxPenaltyPercentage: 2.0,
|
|
56
|
+
slashInactivityTargetPercentage: 0.7,
|
|
57
|
+
slashInactivityConsecutiveEpochThreshold: 1,
|
|
58
|
+
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
59
|
+
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
60
|
+
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
61
|
+
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
62
|
+
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
63
|
+
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
64
|
+
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
65
|
+
slashMaxPayloadSize: 50,
|
|
66
|
+
slashGracePeriodL2Slots: 32 * 2, // Two epochs from genesis
|
|
67
|
+
slashOffenseExpirationRounds: 8,
|
|
68
|
+
sentinelEnabled: true,
|
|
69
|
+
} satisfies Partial<L2ChainConfig>;
|
|
70
|
+
|
|
37
71
|
export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
38
72
|
l1ChainId: 11155111,
|
|
39
73
|
testAccounts: true,
|
|
@@ -55,6 +89,7 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
55
89
|
publicMetricsCollectFrom: ['sequencer'],
|
|
56
90
|
|
|
57
91
|
...DefaultL1ContractsConfig,
|
|
92
|
+
...DefaultSlashConfig,
|
|
58
93
|
|
|
59
94
|
/** How many seconds an L1 slot lasts. */
|
|
60
95
|
ethereumSlotDuration: 12,
|
|
@@ -70,26 +105,6 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
70
105
|
manaTarget: 0n,
|
|
71
106
|
/** The proving cost per mana */
|
|
72
107
|
provingCostPerMana: 0n,
|
|
73
|
-
|
|
74
|
-
slasherFlavor: 'none',
|
|
75
|
-
slashAmountSmall: 0n,
|
|
76
|
-
slashAmountMedium: 0n,
|
|
77
|
-
slashAmountLarge: 0n,
|
|
78
|
-
slashMinPenaltyPercentage: 0.5,
|
|
79
|
-
slashMaxPenaltyPercentage: 200,
|
|
80
|
-
slashInactivityTargetPercentage: 0,
|
|
81
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
82
|
-
slashInactivityPenalty: 0n,
|
|
83
|
-
slashPrunePenalty: 0n,
|
|
84
|
-
slashDataWithholdingPenalty: 0n,
|
|
85
|
-
slashProposeInvalidAttestationsPenalty: 0n,
|
|
86
|
-
slashAttestDescendantOfInvalidPenalty: 0n,
|
|
87
|
-
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
88
|
-
slashMaxPayloadSize: 50,
|
|
89
|
-
slashGracePeriodL2Slots: 0,
|
|
90
|
-
slashUnknownPenalty: 0n,
|
|
91
|
-
slashOffenseExpirationRounds: 10,
|
|
92
|
-
sentinelEnabled: false,
|
|
93
108
|
};
|
|
94
109
|
|
|
95
110
|
export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
@@ -121,6 +136,10 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
121
136
|
aztecEpochDuration: 32,
|
|
122
137
|
/** The target validator committee size. */
|
|
123
138
|
aztecTargetCommitteeSize: 48,
|
|
139
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */
|
|
140
|
+
lagInEpochs: DefaultL1ContractsConfig.lagInEpochs,
|
|
141
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
|
|
142
|
+
localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
124
143
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
125
144
|
aztecProofSubmissionEpochs: 1,
|
|
126
145
|
/** The deposit amount for a validator */
|
|
@@ -137,37 +156,8 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
|
|
|
137
156
|
provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
138
157
|
/** Exit delay for stakers */
|
|
139
158
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
140
|
-
/** Tally-style slashing */
|
|
141
|
-
slasherFlavor: 'tally',
|
|
142
|
-
/** Allow one round for vetoing */
|
|
143
|
-
slashingExecutionDelayInRounds: 1,
|
|
144
|
-
/** How long for a slash payload to be executed */
|
|
145
|
-
slashingLifetimeInRounds: 5,
|
|
146
|
-
/** Allow 2 rounds to discover faults */
|
|
147
|
-
slashingOffsetInRounds: 2,
|
|
148
|
-
/** No slash vetoer */
|
|
149
|
-
slashingVetoer: EthAddress.ZERO,
|
|
150
|
-
/** Use default slash amounts */
|
|
151
|
-
slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
152
|
-
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
153
|
-
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
154
159
|
|
|
155
|
-
|
|
156
|
-
slashMinPenaltyPercentage: 0.5,
|
|
157
|
-
slashMaxPenaltyPercentage: 2.0,
|
|
158
|
-
slashInactivityTargetPercentage: 0.7,
|
|
159
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
160
|
-
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
161
|
-
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
162
|
-
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
163
|
-
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
164
|
-
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
165
|
-
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
166
|
-
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
167
|
-
slashMaxPayloadSize: 50,
|
|
168
|
-
slashGracePeriodL2Slots: 32 * 2, // Two epochs from genesis
|
|
169
|
-
slashOffenseExpirationRounds: 8,
|
|
170
|
-
sentinelEnabled: true,
|
|
160
|
+
...DefaultSlashConfig,
|
|
171
161
|
};
|
|
172
162
|
|
|
173
163
|
export const testnetL2ChainConfig: L2ChainConfig = {
|
|
@@ -199,12 +189,16 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
199
189
|
aztecEpochDuration: 32,
|
|
200
190
|
/** The target validator committee size. */
|
|
201
191
|
aztecTargetCommitteeSize: 48,
|
|
192
|
+
/** The number of epochs to lag behind the current epoch for validator selection. */
|
|
193
|
+
lagInEpochs: 2,
|
|
202
194
|
/** The number of epochs after an epoch ends that proofs are still accepted. */
|
|
203
195
|
aztecProofSubmissionEpochs: 1,
|
|
204
196
|
/** The deposit amount for a validator */
|
|
205
197
|
activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
206
198
|
/** The minimum stake for a validator. */
|
|
207
199
|
ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
200
|
+
/** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
|
|
201
|
+
localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
|
|
208
202
|
/** The slashing round size */
|
|
209
203
|
slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
|
|
210
204
|
/** Governance proposing round size */
|
|
@@ -215,37 +209,8 @@ export const testnetL2ChainConfig: L2ChainConfig = {
|
|
|
215
209
|
provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
216
210
|
/** Exit delay for stakers */
|
|
217
211
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
218
|
-
/** Tally-style slashing */
|
|
219
|
-
slasherFlavor: 'tally',
|
|
220
|
-
/** Allow one round for vetoing */
|
|
221
|
-
slashingExecutionDelayInRounds: 1,
|
|
222
|
-
/** How long for a slash payload to be executed */
|
|
223
|
-
slashingLifetimeInRounds: 5,
|
|
224
|
-
/** Allow 2 rounds to discover faults */
|
|
225
|
-
slashingOffsetInRounds: 2,
|
|
226
|
-
/** No slash vetoer */
|
|
227
|
-
slashingVetoer: EthAddress.ZERO,
|
|
228
|
-
/** Use default slash amounts */
|
|
229
|
-
slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
230
|
-
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
231
|
-
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
232
212
|
|
|
233
|
-
|
|
234
|
-
slashMinPenaltyPercentage: 0.5,
|
|
235
|
-
slashMaxPenaltyPercentage: 2.0,
|
|
236
|
-
slashInactivityTargetPercentage: 0.7,
|
|
237
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
238
|
-
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
239
|
-
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
240
|
-
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
241
|
-
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
242
|
-
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
243
|
-
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
244
|
-
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
245
|
-
slashMaxPayloadSize: 50,
|
|
246
|
-
slashGracePeriodL2Slots: 32 * 2, // Two epochs from genesis
|
|
247
|
-
slashOffenseExpirationRounds: 8,
|
|
248
|
-
sentinelEnabled: true,
|
|
213
|
+
...DefaultSlashConfig,
|
|
249
214
|
};
|
|
250
215
|
|
|
251
216
|
const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
|
|
@@ -385,6 +350,7 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
|
|
|
385
350
|
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
386
351
|
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
387
352
|
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
353
|
+
enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
|
|
388
354
|
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
389
355
|
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
390
356
|
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
package/src/utils/aztec.ts
CHANGED
|
@@ -59,6 +59,7 @@ export async function deployAztecContracts(
|
|
|
59
59
|
config: L1ContractsConfig,
|
|
60
60
|
realVerifier: boolean,
|
|
61
61
|
createVerificationJson: string | false,
|
|
62
|
+
flushEntryQueue: boolean,
|
|
62
63
|
debugLogger: Logger,
|
|
63
64
|
): Promise<DeployL1ContractsReturnType> {
|
|
64
65
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
@@ -89,6 +90,7 @@ export async function deployAztecContracts(
|
|
|
89
90
|
},
|
|
90
91
|
config,
|
|
91
92
|
createVerificationJson,
|
|
93
|
+
flushEntryQueue,
|
|
92
94
|
);
|
|
93
95
|
|
|
94
96
|
return result;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AztecAddress,
|
|
3
|
-
DefaultWaitOpts,
|
|
4
|
-
Fr,
|
|
5
|
-
type PXE,
|
|
6
|
-
SignerlessWallet,
|
|
7
|
-
SponsoredFeePaymentMethod,
|
|
8
|
-
type WaitForProvenOpts,
|
|
9
|
-
getContractInstanceFromInstantiationParams,
|
|
10
|
-
waitForProven,
|
|
11
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import { Fr, type PXE, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
|
|
12
2
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
13
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
14
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
15
4
|
|
|
16
5
|
async function getSponsoredFPCContract() {
|
|
@@ -28,31 +17,12 @@ export async function getSponsoredFPCAddress() {
|
|
|
28
17
|
return sponsoredFPCInstance.address;
|
|
29
18
|
}
|
|
30
19
|
|
|
31
|
-
export async function setupSponsoredFPC(
|
|
32
|
-
pxe: PXE,
|
|
33
|
-
log: LogFn,
|
|
34
|
-
waitOpts = DefaultWaitOpts,
|
|
35
|
-
waitForProvenOptions?: WaitForProvenOpts,
|
|
36
|
-
) {
|
|
20
|
+
export async function setupSponsoredFPC(pxe: PXE, log: LogFn) {
|
|
37
21
|
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
|
|
41
|
-
|
|
42
|
-
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
|
|
43
|
-
|
|
44
|
-
const deployTx = SponsoredFPCContract.deploy(deployer).send({
|
|
45
|
-
from: AztecAddress.ZERO,
|
|
46
|
-
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
47
|
-
universalDeploy: true,
|
|
48
|
-
fee: { paymentMethod },
|
|
22
|
+
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
23
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
49
24
|
});
|
|
25
|
+
await pxe.registerContract({ instance: sponsoredFPCInstance, artifact: SponsoredFPCContract.artifact });
|
|
50
26
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (waitForProvenOptions !== undefined) {
|
|
54
|
-
await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
27
|
+
log(`SponsoredFPC: ${sponsoredFPCInstance.address}`);
|
|
58
28
|
}
|