@aztec/cli 0.0.1-commit.c80b6263 → 0.0.1-commit.cf93bcc56
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/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 +3 -2
- package/dest/cmds/l1/compute_genesis_values.d.ts +4 -0
- package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
- package/dest/cmds/l1/compute_genesis_values.js +17 -0
- package/dest/cmds/l1/index.d.ts +1 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +4 -0
- package/dest/cmds/l1/update_l1_validators.js +5 -5
- package/dest/config/generated/networks.d.ts +7 -1
- package/dest/config/generated/networks.d.ts.map +1 -1
- package/dest/config/generated/networks.js +6 -0
- package/package.json +30 -30
- package/src/cmds/infrastructure/setup_l2_contract.ts +4 -3
- package/src/cmds/l1/compute_genesis_values.ts +29 -0
- package/src/cmds/l1/index.ts +18 -0
- package/src/cmds/l1/update_l1_validators.ts +5 -5
- package/src/config/generated/networks.ts +6 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
export declare function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dXBfbDJfY29udHJhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2luZnJhc3RydWN0dXJlL3NldHVwX2wyX2NvbnRyYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBS25ELHdCQUFzQixnQkFBZ0IsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxPQUFPLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxpQkF3QnZHIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAMA,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":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,iBAwBvG"}
|
|
@@ -2,7 +2,8 @@ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
|
2
2
|
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
|
-
import {
|
|
5
|
+
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
6
|
+
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
6
7
|
export async function setupL2Contracts(nodeUrl, testAccounts, json, log) {
|
|
7
8
|
const waitOpts = {
|
|
8
9
|
timeout: 180,
|
|
@@ -11,7 +12,7 @@ export async function setupL2Contracts(nodeUrl, testAccounts, json, log) {
|
|
|
11
12
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
12
13
|
log('setupL2Contracts: Creating PXE client...');
|
|
13
14
|
const node = createAztecNodeClient(nodeUrl);
|
|
14
|
-
const wallet = await
|
|
15
|
+
const wallet = await EmbeddedWallet.create(node);
|
|
15
16
|
let deployedAccountManagers = [];
|
|
16
17
|
if (testAccounts) {
|
|
17
18
|
log('setupL2Contracts: Deploying test accounts...');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
/** Computes and prints genesis values needed for L1 contract deployment. */
|
|
3
|
+
export declare function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV9nZW5lc2lzX3ZhbHVlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvbDEvY29tcHV0ZV9nZW5lc2lzX3ZhbHVlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQU1uRCw0RUFBNEU7QUFDNUUsd0JBQXNCLHVCQUF1QixDQUFDLFlBQVksRUFBRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxpQkFvQnJHIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute_genesis_values.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/compute_genesis_values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,4EAA4E;AAC5E,wBAAsB,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,iBAoBrG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
3
|
+
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
4
|
+
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
5
|
+
/** Computes and prints genesis values needed for L1 contract deployment. */ export async function computeGenesisValuesCmd(testAccounts, sponsoredFPC, log) {
|
|
6
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
7
|
+
const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
8
|
+
const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddresses);
|
|
9
|
+
const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
|
|
10
|
+
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
11
|
+
const vkTreeRoot = getVKTreeRoot();
|
|
12
|
+
log(JSON.stringify({
|
|
13
|
+
vkTreeRoot: vkTreeRoot.toString(),
|
|
14
|
+
protocolContractsHash: protocolContractsHash.toString(),
|
|
15
|
+
genesisArchiveRoot: genesisArchiveRoot.toString()
|
|
16
|
+
}, null, 2));
|
|
17
|
+
}
|
package/dest/cmds/l1/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { type Command } from 'commander';
|
|
3
3
|
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2wxL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUzRCxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQVUsTUFBTSxXQUFXLENBQUM7QUF3QmpELHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLFdBK2YvRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAwBjD,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":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAwBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WA+f/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -17,6 +17,10 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
17
17
|
const initialValidators = options.validators?.split(',').map((validator)=>EthAddress.fromString(validator)) || [];
|
|
18
18
|
await deployNewRollup(options.registryAddress, options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.testAccounts, options.sponsoredFpc, options.json, initialValidators, options.realVerifier, log);
|
|
19
19
|
});
|
|
20
|
+
program.command('compute-genesis-values').description('Computes genesis values (VK tree root, protocol contracts hash, genesis archive root).').addOption(new Option('--test-accounts <boolean>', 'Include initial test accounts in genesis state').env('TEST_ACCOUNTS').argParser((arg)=>arg === 'true')).addOption(new Option('--sponsored-fpc <boolean>', 'Include sponsored FPC contract in genesis state').env('SPONSORED_FPC').argParser((arg)=>arg === 'true')).action(async (options)=>{
|
|
21
|
+
const { computeGenesisValuesCmd } = await import('./compute_genesis_values.js');
|
|
22
|
+
await computeGenesisValuesCmd(options.testAccounts, options.sponsoredFpc, log);
|
|
23
|
+
});
|
|
20
24
|
program.command('deposit-governance-tokens').description('Deposits governance tokens to the governance contract.').requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress).requiredOption('--recipient <string>', 'The recipient of the tokens', parseEthereumAddress).requiredOption('-a, --amount <string>', 'The amount of tokens to deposit', parseBigint).option('--mint', 'Mint the tokens on L1', false).addOption(l1RpcUrlsOption).addOption(l1ChainIdOption).option('-p, --private-key <string>', 'The private key to use to deposit', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use to deposit', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to deposit', (arg)=>parseInt(arg), 0).action(async (options)=>{
|
|
21
25
|
const { depositGovernanceTokens } = await import('./governance_utils.js');
|
|
22
26
|
await depositGovernanceTokens({
|
|
@@ -2,7 +2,7 @@ import { createEthereumChain, isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
|
2
2
|
import { createExtendedL1Client, getPublicClient } from '@aztec/ethereum/client';
|
|
3
3
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
4
4
|
import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
|
-
import {
|
|
5
|
+
import { createL1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
6
6
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
7
7
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
8
8
|
import { RollupAbi, StakingAssetHandlerAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
@@ -38,7 +38,7 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
|
|
|
38
38
|
const gseAddress = await rollup.read.getGSE();
|
|
39
39
|
const gse = new GSEContract(l1Client, gseAddress);
|
|
40
40
|
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
41
|
-
const l1TxUtils =
|
|
41
|
+
const l1TxUtils = createL1TxUtils(l1Client, {
|
|
42
42
|
logger: debugLogger
|
|
43
43
|
});
|
|
44
44
|
const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
|
|
@@ -130,7 +130,7 @@ export async function addL1ValidatorViaRollup({ rpcUrls, chainId, privateKey, mn
|
|
|
130
130
|
const gseAddress = await rollup.read.getGSE();
|
|
131
131
|
const gse = new GSEContract(l1Client, gseAddress);
|
|
132
132
|
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
133
|
-
const l1TxUtils =
|
|
133
|
+
const l1TxUtils = createL1TxUtils(l1Client, {
|
|
134
134
|
logger: debugLogger
|
|
135
135
|
});
|
|
136
136
|
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
@@ -172,7 +172,7 @@ export async function removeL1Validator({ rpcUrls, chainId, privateKey, mnemonic
|
|
|
172
172
|
const account = getAccount(privateKey, mnemonic);
|
|
173
173
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
174
174
|
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
175
|
-
const l1TxUtils =
|
|
175
|
+
const l1TxUtils = createL1TxUtils(l1Client, {
|
|
176
176
|
logger: debugLogger
|
|
177
177
|
});
|
|
178
178
|
dualLog(`Removing validator ${validatorAddress.toString()} from rollup ${rollupAddress.toString()}`);
|
|
@@ -194,7 +194,7 @@ export async function pruneRollup({ rpcUrls, chainId, privateKey, mnemonic, roll
|
|
|
194
194
|
const account = getAccount(privateKey, mnemonic);
|
|
195
195
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
196
196
|
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
197
|
-
const l1TxUtils =
|
|
197
|
+
const l1TxUtils = createL1TxUtils(l1Client, {
|
|
198
198
|
logger: debugLogger
|
|
199
199
|
});
|
|
200
200
|
dualLog(`Trying prune`);
|
|
@@ -64,6 +64,8 @@ export declare const devnetConfig: {
|
|
|
64
64
|
readonly SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1;
|
|
65
65
|
readonly SLASH_INACTIVITY_PENALTY: 10000000000000000000;
|
|
66
66
|
readonly SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000;
|
|
67
|
+
readonly SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000;
|
|
68
|
+
readonly SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000;
|
|
67
69
|
readonly SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000;
|
|
68
70
|
readonly SLASH_UNKNOWN_PENALTY: 10000000000000000000;
|
|
69
71
|
readonly SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000;
|
|
@@ -127,6 +129,8 @@ export declare const testnetConfig: {
|
|
|
127
129
|
readonly SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1;
|
|
128
130
|
readonly SLASH_INACTIVITY_PENALTY: 10000000000000000000;
|
|
129
131
|
readonly SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000;
|
|
132
|
+
readonly SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000;
|
|
133
|
+
readonly SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000;
|
|
130
134
|
readonly SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000;
|
|
131
135
|
readonly SLASH_UNKNOWN_PENALTY: 10000000000000000000;
|
|
132
136
|
readonly SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000;
|
|
@@ -197,9 +201,11 @@ export declare const mainnetConfig: {
|
|
|
197
201
|
readonly SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2;
|
|
198
202
|
readonly SLASH_INACTIVITY_PENALTY: 2e+21;
|
|
199
203
|
readonly SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2e+21;
|
|
204
|
+
readonly SLASH_DUPLICATE_PROPOSAL_PENALTY: 2e+21;
|
|
205
|
+
readonly SLASH_DUPLICATE_ATTESTATION_PENALTY: 2e+21;
|
|
200
206
|
readonly SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2e+21;
|
|
201
207
|
readonly SLASH_UNKNOWN_PENALTY: 2e+21;
|
|
202
208
|
readonly SLASH_INVALID_BLOCK_PENALTY: 2e+21;
|
|
203
209
|
readonly SLASH_GRACE_PERIOD_L2_SLOTS: 1200;
|
|
204
210
|
};
|
|
205
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
211
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV0d29ya3MuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb25maWcvZ2VuZXJhdGVkL25ldHdvcmtzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLGVBQU8sTUFBTSxZQUFZOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0F3RWYsQ0FBQztBQUVYLGVBQU8sTUFBTSxhQUFhOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBZ0VoQixDQUFDO0FBRVgsZUFBTyxNQUFNLGFBQWE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBdUVoQixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../../src/config/generated/networks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../../src/config/generated/networks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEf,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEhB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEhB,CAAC"}
|
|
@@ -66,6 +66,8 @@ export const devnetConfig = {
|
|
|
66
66
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
|
|
67
67
|
SLASH_INACTIVITY_PENALTY: 10000000000000000000,
|
|
68
68
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
|
|
69
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
|
|
70
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
|
|
69
71
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
|
|
70
72
|
SLASH_UNKNOWN_PENALTY: 10000000000000000000,
|
|
71
73
|
SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
|
|
@@ -129,6 +131,8 @@ export const testnetConfig = {
|
|
|
129
131
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
|
|
130
132
|
SLASH_INACTIVITY_PENALTY: 10000000000000000000,
|
|
131
133
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
|
|
134
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
|
|
135
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
|
|
132
136
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
|
|
133
137
|
SLASH_UNKNOWN_PENALTY: 10000000000000000000,
|
|
134
138
|
SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
|
|
@@ -199,6 +203,8 @@ export const mainnetConfig = {
|
|
|
199
203
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2,
|
|
200
204
|
SLASH_INACTIVITY_PENALTY: 2E+21,
|
|
201
205
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2E+21,
|
|
206
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 2E+21,
|
|
207
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 2E+21,
|
|
202
208
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2E+21,
|
|
203
209
|
SLASH_UNKNOWN_PENALTY: 2E+21,
|
|
204
210
|
SLASH_INVALID_BLOCK_PENALTY: 2E+21,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.cf93bcc56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -77,23 +77,23 @@
|
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
81
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
82
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
83
|
-
"@aztec/constants": "0.0.1-commit.
|
|
84
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
85
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
86
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
87
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
88
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
89
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
90
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
91
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
92
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
93
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
94
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
95
|
-
"@aztec/
|
|
96
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
80
|
+
"@aztec/accounts": "0.0.1-commit.cf93bcc56",
|
|
81
|
+
"@aztec/archiver": "0.0.1-commit.cf93bcc56",
|
|
82
|
+
"@aztec/aztec.js": "0.0.1-commit.cf93bcc56",
|
|
83
|
+
"@aztec/constants": "0.0.1-commit.cf93bcc56",
|
|
84
|
+
"@aztec/entrypoints": "0.0.1-commit.cf93bcc56",
|
|
85
|
+
"@aztec/ethereum": "0.0.1-commit.cf93bcc56",
|
|
86
|
+
"@aztec/foundation": "0.0.1-commit.cf93bcc56",
|
|
87
|
+
"@aztec/l1-artifacts": "0.0.1-commit.cf93bcc56",
|
|
88
|
+
"@aztec/node-keystore": "0.0.1-commit.cf93bcc56",
|
|
89
|
+
"@aztec/node-lib": "0.0.1-commit.cf93bcc56",
|
|
90
|
+
"@aztec/p2p": "0.0.1-commit.cf93bcc56",
|
|
91
|
+
"@aztec/protocol-contracts": "0.0.1-commit.cf93bcc56",
|
|
92
|
+
"@aztec/sequencer-client": "0.0.1-commit.cf93bcc56",
|
|
93
|
+
"@aztec/slasher": "0.0.1-commit.cf93bcc56",
|
|
94
|
+
"@aztec/stdlib": "0.0.1-commit.cf93bcc56",
|
|
95
|
+
"@aztec/wallets": "0.0.1-commit.cf93bcc56",
|
|
96
|
+
"@aztec/world-state": "0.0.1-commit.cf93bcc56",
|
|
97
97
|
"@ethersproject/wallet": "^5.8.0",
|
|
98
98
|
"@iarna/toml": "^2.2.5",
|
|
99
99
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
@@ -107,9 +107,9 @@
|
|
|
107
107
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
111
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
112
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
110
|
+
"@aztec/aztec-node": "0.0.1-commit.cf93bcc56",
|
|
111
|
+
"@aztec/kv-store": "0.0.1-commit.cf93bcc56",
|
|
112
|
+
"@aztec/telemetry-client": "0.0.1-commit.cf93bcc56",
|
|
113
113
|
"@jest/globals": "^30.0.0",
|
|
114
114
|
"@types/jest": "^30.0.0",
|
|
115
115
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -126,15 +126,15 @@
|
|
|
126
126
|
"typescript": "^5.3.3"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
130
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
131
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
132
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
133
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
134
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
135
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
136
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
137
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
129
|
+
"@aztec/accounts": "0.0.1-commit.cf93bcc56",
|
|
130
|
+
"@aztec/bb-prover": "0.0.1-commit.cf93bcc56",
|
|
131
|
+
"@aztec/ethereum": "0.0.1-commit.cf93bcc56",
|
|
132
|
+
"@aztec/l1-artifacts": "0.0.1-commit.cf93bcc56",
|
|
133
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.cf93bcc56",
|
|
134
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.cf93bcc56",
|
|
135
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.cf93bcc56",
|
|
136
|
+
"@aztec/protocol-contracts": "0.0.1-commit.cf93bcc56",
|
|
137
|
+
"@aztec/stdlib": "0.0.1-commit.cf93bcc56"
|
|
138
138
|
},
|
|
139
139
|
"files": [
|
|
140
140
|
"dest",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import
|
|
2
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import type { WaitOpts } from '@aztec/aztec.js/contracts';
|
|
4
4
|
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
5
5
|
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
6
6
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
7
7
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
8
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
9
|
-
import {
|
|
9
|
+
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
10
|
+
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
10
11
|
|
|
11
12
|
export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn) {
|
|
12
13
|
const waitOpts: WaitOpts = {
|
|
@@ -16,7 +17,7 @@ export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, j
|
|
|
16
17
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
17
18
|
log('setupL2Contracts: Creating PXE client...');
|
|
18
19
|
const node = createAztecNodeClient(nodeUrl);
|
|
19
|
-
const wallet = await
|
|
20
|
+
const wallet = await EmbeddedWallet.create(node);
|
|
20
21
|
|
|
21
22
|
let deployedAccountManagers: AccountManager[] = [];
|
|
22
23
|
if (testAccounts) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
4
|
+
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
5
|
+
|
|
6
|
+
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
7
|
+
|
|
8
|
+
/** Computes and prints genesis values needed for L1 contract deployment. */
|
|
9
|
+
export async function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn) {
|
|
10
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
11
|
+
const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
12
|
+
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddresses);
|
|
13
|
+
const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
|
|
14
|
+
|
|
15
|
+
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
16
|
+
const vkTreeRoot = getVKTreeRoot();
|
|
17
|
+
|
|
18
|
+
log(
|
|
19
|
+
JSON.stringify(
|
|
20
|
+
{
|
|
21
|
+
vkTreeRoot: vkTreeRoot.toString(),
|
|
22
|
+
protocolContractsHash: protocolContractsHash.toString(),
|
|
23
|
+
genesisArchiveRoot: genesisArchiveRoot.toString(),
|
|
24
|
+
},
|
|
25
|
+
null,
|
|
26
|
+
2,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
}
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -106,6 +106,24 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
106
106
|
);
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
+
program
|
|
110
|
+
.command('compute-genesis-values')
|
|
111
|
+
.description('Computes genesis values (VK tree root, protocol contracts hash, genesis archive root).')
|
|
112
|
+
.addOption(
|
|
113
|
+
new Option('--test-accounts <boolean>', 'Include initial test accounts in genesis state')
|
|
114
|
+
.env('TEST_ACCOUNTS')
|
|
115
|
+
.argParser(arg => arg === 'true'),
|
|
116
|
+
)
|
|
117
|
+
.addOption(
|
|
118
|
+
new Option('--sponsored-fpc <boolean>', 'Include sponsored FPC contract in genesis state')
|
|
119
|
+
.env('SPONSORED_FPC')
|
|
120
|
+
.argParser(arg => arg === 'true'),
|
|
121
|
+
)
|
|
122
|
+
.action(async options => {
|
|
123
|
+
const { computeGenesisValuesCmd } = await import('./compute_genesis_values.js');
|
|
124
|
+
await computeGenesisValuesCmd(options.testAccounts, options.sponsoredFpc, log);
|
|
125
|
+
});
|
|
126
|
+
|
|
109
127
|
program
|
|
110
128
|
.command('deposit-governance-tokens')
|
|
111
129
|
.description('Deposits governance tokens to the governance contract.')
|
|
@@ -2,7 +2,7 @@ import { createEthereumChain, isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
|
2
2
|
import { createExtendedL1Client, getPublicClient } from '@aztec/ethereum/client';
|
|
3
3
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
4
4
|
import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
|
-
import {
|
|
5
|
+
import { createL1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
6
6
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
7
7
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
8
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
@@ -88,7 +88,7 @@ export async function addL1Validator({
|
|
|
88
88
|
const gse = new GSEContract(l1Client, gseAddress);
|
|
89
89
|
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
90
90
|
|
|
91
|
-
const l1TxUtils =
|
|
91
|
+
const l1TxUtils = createL1TxUtils(l1Client, { logger: debugLogger });
|
|
92
92
|
const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
|
|
93
93
|
|
|
94
94
|
// Step 1: Claim STK tokens from the faucet
|
|
@@ -194,7 +194,7 @@ export async function addL1ValidatorViaRollup({
|
|
|
194
194
|
|
|
195
195
|
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
196
196
|
|
|
197
|
-
const l1TxUtils =
|
|
197
|
+
const l1TxUtils = createL1TxUtils(l1Client, { logger: debugLogger });
|
|
198
198
|
|
|
199
199
|
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
200
200
|
to: rollupAddress.toString(),
|
|
@@ -241,7 +241,7 @@ export async function removeL1Validator({
|
|
|
241
241
|
const account = getAccount(privateKey, mnemonic);
|
|
242
242
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
243
243
|
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
244
|
-
const l1TxUtils =
|
|
244
|
+
const l1TxUtils = createL1TxUtils(l1Client, { logger: debugLogger });
|
|
245
245
|
|
|
246
246
|
dualLog(`Removing validator ${validatorAddress.toString()} from rollup ${rollupAddress.toString()}`);
|
|
247
247
|
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
@@ -268,7 +268,7 @@ export async function pruneRollup({
|
|
|
268
268
|
const account = getAccount(privateKey, mnemonic);
|
|
269
269
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
270
270
|
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
271
|
-
const l1TxUtils =
|
|
271
|
+
const l1TxUtils = createL1TxUtils(l1Client, { logger: debugLogger });
|
|
272
272
|
|
|
273
273
|
dualLog(`Trying prune`);
|
|
274
274
|
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
@@ -67,6 +67,8 @@ export const devnetConfig = {
|
|
|
67
67
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
|
|
68
68
|
SLASH_INACTIVITY_PENALTY: 10000000000000000000,
|
|
69
69
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
|
|
70
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
|
|
71
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
|
|
70
72
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
|
|
71
73
|
SLASH_UNKNOWN_PENALTY: 10000000000000000000,
|
|
72
74
|
SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
|
|
@@ -131,6 +133,8 @@ export const testnetConfig = {
|
|
|
131
133
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
|
|
132
134
|
SLASH_INACTIVITY_PENALTY: 10000000000000000000,
|
|
133
135
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
|
|
136
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
|
|
137
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
|
|
134
138
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
|
|
135
139
|
SLASH_UNKNOWN_PENALTY: 10000000000000000000,
|
|
136
140
|
SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
|
|
@@ -202,6 +206,8 @@ export const mainnetConfig = {
|
|
|
202
206
|
SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2,
|
|
203
207
|
SLASH_INACTIVITY_PENALTY: 2E+21,
|
|
204
208
|
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2E+21,
|
|
209
|
+
SLASH_DUPLICATE_PROPOSAL_PENALTY: 2E+21,
|
|
210
|
+
SLASH_DUPLICATE_ATTESTATION_PENALTY: 2E+21,
|
|
205
211
|
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2E+21,
|
|
206
212
|
SLASH_UNKNOWN_PENALTY: 2E+21,
|
|
207
213
|
SLASH_INVALID_BLOCK_PENALTY: 2E+21,
|