@aztec/cli 0.0.0-test.0 → 0.0.1-commit.023c3e5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -428
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +10 -0
- package/dest/cmds/aztec_node/get_current_min_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_min_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/aztec_node/get_logs.d.ts +7 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +14 -15
- package/dest/cmds/aztec_node/index.d.ts +4 -0
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/contracts/index.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +13 -15
- package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
- package/dest/cmds/infrastructure/index.d.ts +3 -3
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +8 -10
- package/dest/cmds/infrastructure/sequencers.d.ts +5 -6
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +38 -18
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +2 -2
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +11 -24
- package/dest/cmds/l1/advance_epoch.d.ts +2 -2
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +8 -6
- package/dest/cmds/l1/assume_proven_through.d.ts +3 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +10 -10
- package/dest/cmds/l1/bridge_erc20.d.ts +3 -3
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +6 -5
- package/dest/cmds/l1/create_l1_account.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.js +81 -0
- package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -3
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +18 -9
- package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/get_l1_addresses.js +5 -2
- package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
- package/dest/cmds/l1/get_l1_balance.js +4 -2
- package/dest/cmds/l1/governance_utils.d.ts +5 -5
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +19 -17
- 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 +37 -44
- package/dest/cmds/l1/prover_stats.d.ts +1 -1
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
- package/dest/cmds/l1/prover_stats.js +32 -30
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
- package/dest/cmds/l1/trigger_seed_snapshot.js +20 -0
- package/dest/cmds/l1/update_l1_validators.d.ts +21 -6
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +198 -103
- package/dest/cmds/misc/compute_selector.d.ts +1 -1
- package/dest/cmds/misc/example_contracts.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +2 -2
- package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
- package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +4 -4
- package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +8 -4
- package/dest/cmds/misc/update/common.d.ts +1 -1
- package/dest/cmds/misc/update/github.d.ts +1 -2
- package/dest/cmds/misc/update/github.d.ts.map +1 -1
- package/dest/cmds/misc/update/github.js +0 -1
- package/dest/cmds/misc/update/noir.d.ts +1 -1
- package/dest/cmds/misc/update/npm.d.ts +1 -1
- package/dest/cmds/misc/update/npm.js +1 -1
- package/dest/cmds/misc/update/utils.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +2 -3
- package/dest/cmds/validator_keys/add.d.ts +5 -0
- package/dest/cmds/validator_keys/add.d.ts.map +1 -0
- package/dest/cmds/validator_keys/add.js +83 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
- package/dest/cmds/validator_keys/index.d.ts +4 -0
- package/dest/cmds/validator_keys/index.d.ts.map +1 -0
- package/dest/cmds/validator_keys/index.js +32 -0
- package/dest/cmds/validator_keys/new.d.ts +29 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +134 -0
- package/dest/cmds/validator_keys/shared.d.ts +68 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +274 -0
- package/dest/cmds/validator_keys/staker.d.ts +38 -0
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/staker.js +210 -0
- package/dest/cmds/validator_keys/utils.d.ts +25 -0
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
- package/dest/cmds/validator_keys/utils.js +52 -0
- package/dest/config/cached_fetch.d.ts +18 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +54 -0
- package/dest/config/chain_l2_config.d.ts +14 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +45 -0
- package/dest/config/enrich_env.d.ts +4 -0
- package/dest/config/enrich_env.d.ts.map +1 -0
- package/dest/config/enrich_env.js +12 -0
- package/dest/config/generated/networks.d.ts +205 -0
- package/dest/config/generated/networks.d.ts.map +1 -0
- package/dest/config/generated/networks.js +206 -0
- package/dest/config/get_l1_config.d.ts +9 -0
- package/dest/config/get_l1_config.d.ts.map +1 -0
- package/dest/config/get_l1_config.js +24 -0
- package/dest/config/index.d.ts +5 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +4 -0
- package/dest/config/network_config.d.ts +22 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +115 -0
- package/dest/utils/aztec.d.ts +15 -26
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +56 -72
- package/dest/utils/commands.d.ts +22 -13
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +43 -16
- package/dest/utils/encoding.d.ts +1 -1
- package/dest/utils/encoding.js +2 -2
- package/dest/utils/github.d.ts +1 -2
- package/dest/utils/github.d.ts.map +1 -1
- package/dest/utils/github.js +0 -1
- package/dest/utils/index.d.ts +2 -1
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -0
- package/dest/utils/inspect.d.ts +5 -11
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +23 -110
- package/dest/utils/setup_contracts.d.ts +3 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +16 -0
- package/package.json +61 -37
- package/public_include_metric_prefixes.json +1 -0
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +11 -0
- package/src/cmds/aztec_node/get_current_min_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +11 -9
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +15 -23
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/contracts/inspect_contract.ts +20 -17
- package/src/cmds/infrastructure/index.ts +8 -11
- package/src/cmds/infrastructure/sequencers.ts +41 -22
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -25
- package/src/cmds/l1/advance_epoch.ts +7 -5
- package/src/cmds/l1/assume_proven_through.ts +11 -10
- package/src/cmds/l1/bridge_erc20.ts +8 -4
- package/src/cmds/l1/deploy_l1_contracts_cmd.ts +107 -0
- package/src/cmds/l1/deploy_new_rollup.ts +24 -15
- package/src/cmds/l1/get_l1_addresses.ts +5 -3
- package/src/cmds/l1/get_l1_balance.ts +2 -2
- package/src/cmds/l1/governance_utils.ts +20 -24
- package/src/cmds/l1/index.ts +77 -113
- package/src/cmds/l1/prover_stats.ts +42 -31
- package/src/cmds/l1/trigger_seed_snapshot.ts +32 -0
- package/src/cmds/l1/update_l1_validators.ts +218 -97
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/generate_secret_and_hash.ts +4 -4
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
- package/src/cmds/misc/index.ts +14 -5
- package/src/cmds/misc/update/github.ts +0 -1
- package/src/cmds/misc/update/npm.ts +1 -1
- package/src/cmds/misc/update.ts +1 -7
- package/src/cmds/validator_keys/add.ts +123 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
- package/src/cmds/validator_keys/index.ts +142 -0
- package/src/cmds/validator_keys/new.ts +207 -0
- package/src/cmds/validator_keys/shared.ts +326 -0
- package/src/cmds/validator_keys/staker.ts +301 -0
- package/src/cmds/validator_keys/utils.ts +81 -0
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +57 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/generated/networks.ts +210 -0
- package/src/config/get_l1_config.ts +31 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +147 -0
- package/src/utils/aztec.ts +74 -120
- package/src/utils/commands.ts +57 -20
- package/src/utils/encoding.ts +2 -2
- package/src/utils/github.ts +0 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/inspect.ts +28 -124
- package/src/utils/setup_contracts.ts +19 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
- package/dest/cmds/devnet/bootstrap_network.js +0 -196
- package/dest/cmds/devnet/faucet.d.ts +0 -4
- package/dest/cmds/devnet/faucet.d.ts.map +0 -1
- package/dest/cmds/devnet/faucet.js +0 -26
- package/dest/cmds/devnet/index.d.ts +0 -4
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +0 -29
- package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
- package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
- package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
- package/dest/cmds/misc/setup_contracts.d.ts +0 -7
- package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
- package/dest/cmds/misc/setup_contracts.js +0 -27
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts +0 -4
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/devnet/bootstrap_network.ts +0 -318
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/l1/deploy_l1_contracts.ts +0 -65
- package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
- package/src/cmds/misc/setup_contracts.ts +0 -40
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '@aztec/ethereum';
|
|
1
|
+
import { createEthereumChain, isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
2
|
+
import { createExtendedL1Client, getPublicClient } from '@aztec/ethereum/client';
|
|
3
|
+
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
4
|
+
import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
|
+
import { createL1TxUtilsFromViemWallet } from '@aztec/ethereum/l1-tx-utils';
|
|
6
|
+
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
8
7
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
8
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
10
|
-
import {
|
|
9
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
10
|
+
import { RollupAbi, StakingAssetHandlerAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
11
|
+
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { encodeFunctionData, formatEther, getContract, maxUint256 } from 'viem';
|
|
13
14
|
import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
14
15
|
|
|
15
16
|
export interface RollupCommandArgs {
|
|
@@ -21,6 +22,14 @@ export interface RollupCommandArgs {
|
|
|
21
22
|
withdrawerAddress?: EthAddress;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
export interface StakingAssetHandlerCommandArgs {
|
|
26
|
+
rpcUrls: string[];
|
|
27
|
+
chainId: number;
|
|
28
|
+
privateKey?: string;
|
|
29
|
+
mnemonic?: string;
|
|
30
|
+
stakingAssetHandlerAddress: EthAddress;
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
export interface LoggerArgs {
|
|
25
34
|
log: LogFn;
|
|
26
35
|
debugLogger: Logger;
|
|
@@ -41,83 +50,209 @@ export async function addL1Validator({
|
|
|
41
50
|
chainId,
|
|
42
51
|
privateKey,
|
|
43
52
|
mnemonic,
|
|
44
|
-
|
|
45
|
-
rollupAddress,
|
|
53
|
+
attesterAddress,
|
|
46
54
|
withdrawerAddress,
|
|
55
|
+
stakingAssetHandlerAddress,
|
|
56
|
+
proofParams,
|
|
57
|
+
blsSecretKey,
|
|
47
58
|
log,
|
|
48
59
|
debugLogger,
|
|
49
|
-
}:
|
|
50
|
-
|
|
60
|
+
}: StakingAssetHandlerCommandArgs &
|
|
61
|
+
LoggerArgs & {
|
|
62
|
+
blsSecretKey: bigint; // scalar field element of BN254
|
|
63
|
+
attesterAddress: EthAddress;
|
|
64
|
+
withdrawerAddress: EthAddress;
|
|
65
|
+
proofParams: Buffer;
|
|
66
|
+
}) {
|
|
51
67
|
const dualLog = makeDualLog(log, debugLogger);
|
|
52
|
-
const
|
|
53
|
-
const
|
|
68
|
+
const account = getAccount(privateKey, mnemonic);
|
|
69
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
70
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
71
|
+
|
|
72
|
+
const stakingAssetHandler = getContract({
|
|
73
|
+
address: stakingAssetHandlerAddress.toString(),
|
|
74
|
+
abi: StakingAssetHandlerAbi,
|
|
75
|
+
client: l1Client,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const rollupAddress = await stakingAssetHandler.read.getRollup();
|
|
79
|
+
dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()}`);
|
|
80
|
+
|
|
54
81
|
const rollup = getContract({
|
|
55
|
-
address: rollupAddress
|
|
82
|
+
address: rollupAddress,
|
|
56
83
|
abi: RollupAbi,
|
|
57
|
-
client:
|
|
84
|
+
client: l1Client,
|
|
58
85
|
});
|
|
59
86
|
|
|
60
|
-
const
|
|
61
|
-
|
|
87
|
+
const gseAddress = await rollup.read.getGSE();
|
|
88
|
+
const gse = new GSEContract(l1Client, gseAddress);
|
|
89
|
+
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
90
|
+
|
|
91
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client, { logger: debugLogger });
|
|
92
|
+
const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
|
|
93
|
+
|
|
94
|
+
// Step 1: Claim STK tokens from the faucet
|
|
95
|
+
dualLog(`Claiming STK tokens from faucet`);
|
|
96
|
+
const { receipt: claimReceipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
97
|
+
to: stakingAssetHandlerAddress.toString(),
|
|
98
|
+
data: encodeFunctionData({
|
|
99
|
+
abi: StakingAssetHandlerAbi,
|
|
100
|
+
functionName: 'claim',
|
|
101
|
+
args: [proofParamsObj.toViem()],
|
|
102
|
+
}),
|
|
103
|
+
abi: StakingAssetHandlerAbi,
|
|
104
|
+
});
|
|
105
|
+
dualLog(`Claim transaction hash: ${claimReceipt.transactionHash}`);
|
|
106
|
+
await l1Client.waitForTransactionReceipt({ hash: claimReceipt.transactionHash });
|
|
107
|
+
|
|
108
|
+
// Step 2: Approve the rollup to spend STK tokens
|
|
109
|
+
const stakingAssetAddress = await stakingAssetHandler.read.STAKING_ASSET();
|
|
110
|
+
dualLog(`Approving rollup to spend STK tokens`);
|
|
111
|
+
const { receipt: approveReceipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
112
|
+
to: stakingAssetAddress,
|
|
113
|
+
data: encodeFunctionData({
|
|
114
|
+
abi: TestERC20Abi,
|
|
115
|
+
functionName: 'approve',
|
|
116
|
+
args: [rollupAddress, maxUint256],
|
|
117
|
+
}),
|
|
62
118
|
abi: TestERC20Abi,
|
|
63
|
-
client: walletClient,
|
|
64
119
|
});
|
|
120
|
+
await l1Client.waitForTransactionReceipt({ hash: approveReceipt.transactionHash });
|
|
121
|
+
|
|
122
|
+
// Step 3: Deposit into the rollup to register as a validator
|
|
123
|
+
dualLog(`Depositing into rollup to register validator`);
|
|
124
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
125
|
+
to: rollupAddress,
|
|
126
|
+
data: encodeFunctionData({
|
|
127
|
+
abi: RollupAbi,
|
|
128
|
+
functionName: 'deposit',
|
|
129
|
+
args: [
|
|
130
|
+
attesterAddress.toString(),
|
|
131
|
+
withdrawerAddress.toString(),
|
|
132
|
+
registrationTuple.publicKeyInG1,
|
|
133
|
+
registrationTuple.publicKeyInG2,
|
|
134
|
+
registrationTuple.proofOfPossession,
|
|
135
|
+
false, // moveWithLatestRollup
|
|
136
|
+
],
|
|
137
|
+
}),
|
|
138
|
+
abi: RollupAbi,
|
|
139
|
+
});
|
|
140
|
+
dualLog(`Deposit transaction hash: ${receipt.transactionHash}`);
|
|
141
|
+
await l1Client.waitForTransactionReceipt({ hash: receipt.transactionHash });
|
|
65
142
|
|
|
66
|
-
await Promise.all(
|
|
67
|
-
[
|
|
68
|
-
await stakingAsset.write.mint([walletClient.account.address, config.minimumStake], {} as any),
|
|
69
|
-
await stakingAsset.write.approve([rollupAddress.toString(), config.minimumStake], {} as any),
|
|
70
|
-
].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
dualLog(`Adding validator ${validatorAddress.toString()} to rollup ${rollupAddress.toString()}`);
|
|
74
|
-
const txHash = await rollup.write.deposit([
|
|
75
|
-
validatorAddress.toString(),
|
|
76
|
-
// TODO(#11451): custom forwarders
|
|
77
|
-
getExpectedAddress(ForwarderAbi, ForwarderBytecode, [validatorAddress.toString()], validatorAddress.toString())
|
|
78
|
-
.address,
|
|
79
|
-
withdrawerAddress?.toString() ?? validatorAddress.toString(),
|
|
80
|
-
config.minimumStake,
|
|
81
|
-
]);
|
|
82
|
-
dualLog(`Transaction hash: ${txHash}`);
|
|
83
|
-
await publicClient.waitForTransactionReceipt({ hash: txHash });
|
|
84
143
|
if (isAnvilTestChain(chainId)) {
|
|
85
144
|
dualLog(`Funding validator on L1`);
|
|
86
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
87
|
-
await cheatCodes.setBalance(
|
|
145
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
146
|
+
await cheatCodes.setBalance(attesterAddress, 10n ** 20n);
|
|
88
147
|
} else {
|
|
89
|
-
const balance = await
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
dualLog(`WARNING: Validator has no balance. Remember to fund it!`);
|
|
148
|
+
const balance = await l1Client.getBalance({ address: attesterAddress.toString() });
|
|
149
|
+
dualLog(`Validator balance: ${formatEther(balance)} ETH`);
|
|
150
|
+
if (balance === 0n) {
|
|
151
|
+
dualLog(`WARNING: Proposer has no balance. Remember to fund it!`);
|
|
94
152
|
}
|
|
95
153
|
}
|
|
96
154
|
}
|
|
97
155
|
|
|
98
|
-
export async function
|
|
156
|
+
export async function addL1ValidatorViaRollup({
|
|
99
157
|
rpcUrls,
|
|
100
158
|
chainId,
|
|
101
159
|
privateKey,
|
|
102
160
|
mnemonic,
|
|
103
|
-
|
|
161
|
+
attesterAddress,
|
|
162
|
+
withdrawerAddress,
|
|
163
|
+
blsSecretKey,
|
|
164
|
+
moveWithLatestRollup,
|
|
104
165
|
rollupAddress,
|
|
105
166
|
log,
|
|
106
167
|
debugLogger,
|
|
107
|
-
}: RollupCommandArgs &
|
|
168
|
+
}: RollupCommandArgs &
|
|
169
|
+
LoggerArgs & {
|
|
170
|
+
blsSecretKey: bigint; // scalar field element of BN254
|
|
171
|
+
attesterAddress: EthAddress;
|
|
172
|
+
moveWithLatestRollup: boolean;
|
|
173
|
+
}) {
|
|
108
174
|
const dualLog = makeDualLog(log, debugLogger);
|
|
109
|
-
const
|
|
110
|
-
const
|
|
175
|
+
const account = getAccount(privateKey, mnemonic);
|
|
176
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
177
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
178
|
+
|
|
179
|
+
dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()} via direct deposit`);
|
|
180
|
+
|
|
181
|
+
if (!withdrawerAddress) {
|
|
182
|
+
throw new Error(`Withdrawer address required`);
|
|
183
|
+
}
|
|
184
|
+
|
|
111
185
|
const rollup = getContract({
|
|
112
186
|
address: rollupAddress.toString(),
|
|
113
187
|
abi: RollupAbi,
|
|
114
|
-
client:
|
|
188
|
+
client: l1Client,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const gseAddress = await rollup.read.getGSE();
|
|
192
|
+
|
|
193
|
+
const gse = new GSEContract(l1Client, gseAddress);
|
|
194
|
+
|
|
195
|
+
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
196
|
+
|
|
197
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client, { logger: debugLogger });
|
|
198
|
+
|
|
199
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
200
|
+
to: rollupAddress.toString(),
|
|
201
|
+
data: encodeFunctionData({
|
|
202
|
+
abi: RollupAbi,
|
|
203
|
+
functionName: 'deposit',
|
|
204
|
+
args: [
|
|
205
|
+
attesterAddress.toString(),
|
|
206
|
+
withdrawerAddress.toString(),
|
|
207
|
+
registrationTuple.publicKeyInG1,
|
|
208
|
+
registrationTuple.publicKeyInG2,
|
|
209
|
+
registrationTuple.proofOfPossession,
|
|
210
|
+
moveWithLatestRollup,
|
|
211
|
+
],
|
|
212
|
+
}),
|
|
213
|
+
abi: StakingAssetHandlerAbi,
|
|
115
214
|
});
|
|
215
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
216
|
+
await l1Client.waitForTransactionReceipt({ hash: receipt.transactionHash });
|
|
217
|
+
if (isAnvilTestChain(chainId)) {
|
|
218
|
+
dualLog(`Funding validator on L1`);
|
|
219
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
220
|
+
await cheatCodes.setBalance(attesterAddress, 10n ** 20n);
|
|
221
|
+
} else {
|
|
222
|
+
const balance = await l1Client.getBalance({ address: attesterAddress.toString() });
|
|
223
|
+
dualLog(`Validator balance: ${formatEther(balance)} ETH`);
|
|
224
|
+
if (balance === 0n) {
|
|
225
|
+
dualLog(`WARNING: Proposer has no balance. Remember to fund it!`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export async function removeL1Validator({
|
|
231
|
+
rpcUrls,
|
|
232
|
+
chainId,
|
|
233
|
+
privateKey,
|
|
234
|
+
mnemonic,
|
|
235
|
+
validatorAddress,
|
|
236
|
+
rollupAddress,
|
|
237
|
+
log,
|
|
238
|
+
debugLogger,
|
|
239
|
+
}: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress }) {
|
|
240
|
+
const dualLog = makeDualLog(log, debugLogger);
|
|
241
|
+
const account = getAccount(privateKey, mnemonic);
|
|
242
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
243
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
244
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client, { logger: debugLogger });
|
|
116
245
|
|
|
117
246
|
dualLog(`Removing validator ${validatorAddress.toString()} from rollup ${rollupAddress.toString()}`);
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
247
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
248
|
+
to: rollupAddress.toString(),
|
|
249
|
+
data: encodeFunctionData({
|
|
250
|
+
abi: RollupAbi,
|
|
251
|
+
functionName: 'initiateWithdraw',
|
|
252
|
+
args: [validatorAddress.toString(), validatorAddress.toString()],
|
|
253
|
+
}),
|
|
254
|
+
});
|
|
255
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
121
256
|
}
|
|
122
257
|
|
|
123
258
|
export async function pruneRollup({
|
|
@@ -130,18 +265,20 @@ export async function pruneRollup({
|
|
|
130
265
|
debugLogger,
|
|
131
266
|
}: RollupCommandArgs & LoggerArgs) {
|
|
132
267
|
const dualLog = makeDualLog(log, debugLogger);
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
abi: RollupAbi,
|
|
138
|
-
client: walletClient,
|
|
139
|
-
});
|
|
268
|
+
const account = getAccount(privateKey, mnemonic);
|
|
269
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
270
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
271
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client, { logger: debugLogger });
|
|
140
272
|
|
|
141
273
|
dualLog(`Trying prune`);
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
274
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
275
|
+
to: rollupAddress.toString(),
|
|
276
|
+
data: encodeFunctionData({
|
|
277
|
+
abi: RollupAbi,
|
|
278
|
+
functionName: 'prune',
|
|
279
|
+
}),
|
|
280
|
+
});
|
|
281
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
145
282
|
}
|
|
146
283
|
|
|
147
284
|
export async function fastForwardEpochs({
|
|
@@ -153,20 +290,20 @@ export async function fastForwardEpochs({
|
|
|
153
290
|
debugLogger,
|
|
154
291
|
}: RollupCommandArgs & LoggerArgs & { numEpochs: bigint }) {
|
|
155
292
|
const dualLog = makeDualLog(log, debugLogger);
|
|
156
|
-
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
293
|
+
const publicClient = getPublicClient({ l1RpcUrls: rpcUrls, l1ChainId: chainId });
|
|
157
294
|
const rollup = getContract({
|
|
158
295
|
address: rollupAddress.toString(),
|
|
159
296
|
abi: RollupAbi,
|
|
160
297
|
client: publicClient,
|
|
161
298
|
});
|
|
162
299
|
|
|
163
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
300
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
164
301
|
const currentSlot = await rollup.read.getCurrentSlot();
|
|
165
302
|
const l2SlotsInEpoch = await rollup.read.getEpochDuration();
|
|
166
303
|
const timestamp = await rollup.read.getTimestampForSlot([currentSlot + l2SlotsInEpoch * numEpochs]);
|
|
167
304
|
dualLog(`Fast forwarding ${numEpochs} epochs to ${timestamp}`);
|
|
168
305
|
try {
|
|
169
|
-
await cheatCodes.warp(Number(timestamp));
|
|
306
|
+
await cheatCodes.warp(Number(timestamp), { resetBlockInterval: true });
|
|
170
307
|
dualLog(`Fast forwarded ${numEpochs} epochs to ${timestamp}`);
|
|
171
308
|
} catch (error) {
|
|
172
309
|
if (error instanceof Error && error.message.includes("is lower than or equal to previous block's timestamp")) {
|
|
@@ -180,31 +317,27 @@ export async function fastForwardEpochs({
|
|
|
180
317
|
|
|
181
318
|
export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }: RollupCommandArgs & LoggerArgs) {
|
|
182
319
|
const config = getL1ContractsConfigEnvVars();
|
|
183
|
-
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
184
|
-
const rollup =
|
|
185
|
-
address: rollupAddress.toString(),
|
|
186
|
-
abi: RollupAbi,
|
|
187
|
-
client: publicClient,
|
|
188
|
-
});
|
|
320
|
+
const publicClient = getPublicClient({ l1RpcUrls: rpcUrls, l1ChainId: chainId });
|
|
321
|
+
const rollup = new RollupContract(publicClient, rollupAddress);
|
|
189
322
|
|
|
190
|
-
const pendingNum = await rollup.
|
|
323
|
+
const pendingNum = await rollup.getCheckpointNumber();
|
|
191
324
|
log(`Pending block num: ${pendingNum}`);
|
|
192
|
-
const provenNum = await rollup.
|
|
325
|
+
const provenNum = await rollup.getProvenCheckpointNumber();
|
|
193
326
|
log(`Proven block num: ${provenNum}`);
|
|
194
|
-
const validators = await rollup.
|
|
327
|
+
const validators = await rollup.getAttesters();
|
|
195
328
|
log(`Validators: ${validators.map(v => v.toString()).join(', ')}`);
|
|
196
|
-
const committee = await rollup.
|
|
197
|
-
log(`Committee: ${committee
|
|
198
|
-
const archive = await rollup.
|
|
329
|
+
const committee = await rollup.getCurrentEpochCommittee();
|
|
330
|
+
log(`Committee: ${committee?.map(v => v.toString()).join(', ')}`);
|
|
331
|
+
const archive = await rollup.archive();
|
|
199
332
|
log(`Archive: ${archive}`);
|
|
200
|
-
const epochNum = await rollup.
|
|
333
|
+
const epochNum = await rollup.getCurrentEpochNumber();
|
|
201
334
|
log(`Current epoch: ${epochNum}`);
|
|
202
|
-
const slot = await rollup.
|
|
335
|
+
const slot = await rollup.getSlotNumber();
|
|
203
336
|
log(`Current slot: ${slot}`);
|
|
204
|
-
const proposerDuringPrevL1Block = await rollup.
|
|
337
|
+
const proposerDuringPrevL1Block = await rollup.getCurrentProposer();
|
|
205
338
|
log(`Proposer during previous L1 block: ${proposerDuringPrevL1Block}`);
|
|
206
339
|
const nextBlockTS = BigInt((await publicClient.getBlock()).timestamp + BigInt(config.ethereumSlotDuration));
|
|
207
|
-
const proposer = await rollup.
|
|
340
|
+
const proposer = await rollup.getProposerAt(nextBlockTS);
|
|
208
341
|
log(`Proposer NOW: ${proposer.toString()}`);
|
|
209
342
|
}
|
|
210
343
|
|
|
@@ -215,24 +348,12 @@ function makeDualLog(log: LogFn, debugLogger: Logger) {
|
|
|
215
348
|
};
|
|
216
349
|
}
|
|
217
350
|
|
|
218
|
-
function
|
|
219
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
220
|
-
return createPublicClient({ chain: chain.chainInfo, transport: fallback(rpcUrls.map(url => http(url))) });
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function getWalletClient(
|
|
224
|
-
rpcUrls: string[],
|
|
225
|
-
chainId: number,
|
|
226
|
-
privateKey: string | undefined,
|
|
227
|
-
mnemonic: string | undefined,
|
|
228
|
-
) {
|
|
351
|
+
function getAccount(privateKey: string | undefined, mnemonic: string | undefined) {
|
|
229
352
|
if (!privateKey && !mnemonic) {
|
|
230
353
|
throw new Error('Either privateKey or mnemonic must be provided to create a wallet client');
|
|
231
354
|
}
|
|
232
|
-
|
|
233
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
234
355
|
const account = !privateKey
|
|
235
356
|
? mnemonicToAccount(mnemonic!)
|
|
236
357
|
: privateKeyToAccount(`${privateKey.startsWith('0x') ? '' : '0x'}${privateKey}` as `0x${string}`);
|
|
237
|
-
return
|
|
358
|
+
return account;
|
|
238
359
|
}
|
|
@@ -3,10 +3,11 @@ import { createBootnodeENRandPeerId } from '@aztec/p2p/enr';
|
|
|
3
3
|
|
|
4
4
|
export async function generateEncodedBootnodeENR(
|
|
5
5
|
privateKey: string,
|
|
6
|
-
|
|
6
|
+
p2pIp: string,
|
|
7
|
+
p2pPort: number,
|
|
7
8
|
l1ChainId: number,
|
|
8
9
|
log: LogFn,
|
|
9
10
|
) {
|
|
10
|
-
const { enr } = await createBootnodeENRandPeerId(privateKey,
|
|
11
|
+
const { enr } = await createBootnodeENRandPeerId(privateKey, p2pIp, p2pPort, l1ChainId);
|
|
11
12
|
log(`ENR: ${enr.encodeTxt()}`);
|
|
12
13
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { computeSecretHash } from '@aztec/aztec.js';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { computeSecretHash } from '@aztec/aztec.js/crypto';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
|
-
export function generateSecretAndHash(log: LogFn) {
|
|
5
|
+
export async function generateSecretAndHash(log: LogFn) {
|
|
6
6
|
const secret = Fr.random();
|
|
7
7
|
|
|
8
8
|
// We hash this the same way that aztec nr hash does.
|
|
9
|
-
const secretHash = computeSecretHash(secret);
|
|
9
|
+
const secretHash = await computeSecretHash(secret);
|
|
10
10
|
|
|
11
11
|
log(`
|
|
12
12
|
Secret: ${secret}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
|
|
3
|
+
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
4
|
+
|
|
5
|
+
export async function getCanonicalSponsoredFPCAddress(log: LogFn) {
|
|
6
|
+
log(`Canonical SponsoredFPC Address: ${(await getSponsoredFPCAddress()).toString()}`);
|
|
7
|
+
}
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
import { printENR } from '@aztec/p2p/enr';
|
|
3
2
|
|
|
4
3
|
import type { Command } from 'commander';
|
|
5
4
|
|
|
@@ -35,11 +34,12 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
35
34
|
.summary('Generates the encoded ENR record for a bootnode.')
|
|
36
35
|
.description('Generates the encoded ENR record for a bootnode.')
|
|
37
36
|
.argument('<privateKey>', 'The peer id private key of the bootnode')
|
|
38
|
-
.argument('<
|
|
37
|
+
.argument('<p2pIp>', 'The bootnode P2P IP address')
|
|
38
|
+
.argument('<p2pPort>', 'The bootnode P2P port')
|
|
39
39
|
.addOption(l1ChainIdOption)
|
|
40
|
-
.action(async (privateKey: string,
|
|
40
|
+
.action(async (privateKey: string, p2pIp: string, p2pPort: number, options) => {
|
|
41
41
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
42
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
42
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
program
|
|
@@ -48,6 +48,7 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
48
48
|
.description('Decodes and ENR record')
|
|
49
49
|
.argument('<enr>', 'The encoded ENR string')
|
|
50
50
|
.action(async (enr: string) => {
|
|
51
|
+
const { printENR } = await import('@aztec/p2p/enr');
|
|
51
52
|
await printENR(enr, log);
|
|
52
53
|
});
|
|
53
54
|
|
|
@@ -73,7 +74,15 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
73
74
|
.description('Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults)')
|
|
74
75
|
.action(async () => {
|
|
75
76
|
const { generateSecretAndHash } = await import('./generate_secret_and_hash.js');
|
|
76
|
-
generateSecretAndHash(log);
|
|
77
|
+
await generateSecretAndHash(log);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
program
|
|
81
|
+
.command('get-canonical-sponsored-fpc-address')
|
|
82
|
+
.description('Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI')
|
|
83
|
+
.action(async () => {
|
|
84
|
+
const { getCanonicalSponsoredFPCAddress } = await import('./get_canonical_sponsored_fpc_address.js');
|
|
85
|
+
await getCanonicalSponsoredFPCAddress(log);
|
|
77
86
|
});
|
|
78
87
|
|
|
79
88
|
program
|
|
@@ -9,7 +9,7 @@ import { type SemVer, parse } from 'semver';
|
|
|
9
9
|
import type { DependencyChanges } from './common.js';
|
|
10
10
|
import { atomicUpdateFile } from './utils.js';
|
|
11
11
|
|
|
12
|
-
const deprecatedNpmPackages = new Set<string>(['@aztec/cli', '@aztec/aztec-
|
|
12
|
+
const deprecatedNpmPackages = new Set<string>(['@aztec/cli', '@aztec/aztec-local-network']);
|
|
13
13
|
const npmDeprecationMessage = `
|
|
14
14
|
The following packages have been deprecated and will no longer be updated on the npm registry:
|
|
15
15
|
${Array.from(deprecatedNpmPackages)
|
package/src/cmds/misc/update.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/* eslint-disable jsdoc/require-jsdoc */
|
|
2
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
2
|
|
|
4
3
|
import { relative, resolve } from 'path';
|
|
5
4
|
import { parse } from 'semver';
|
|
6
5
|
|
|
7
6
|
import type { DependencyChanges } from './update/common.js';
|
|
8
|
-
import { GITHUB_TAG_PREFIX } from './update/github.js';
|
|
9
7
|
import { updateAztecNr } from './update/noir.js';
|
|
10
8
|
import { getNewestVersion, updateAztecDeps, updateLockfile } from './update/npm.js';
|
|
11
9
|
|
|
@@ -44,11 +42,7 @@ export async function updateProject(
|
|
|
44
42
|
for (const contract of contracts) {
|
|
45
43
|
try {
|
|
46
44
|
projectDependencyChanges.push(
|
|
47
|
-
await updateAztecNr(
|
|
48
|
-
resolve(process.cwd(), projectPath, contract),
|
|
49
|
-
`${GITHUB_TAG_PREFIX}-v${targetAztecVersion.version}`,
|
|
50
|
-
log,
|
|
51
|
-
),
|
|
45
|
+
await updateAztecNr(resolve(process.cwd(), projectPath, contract), `v${targetAztecVersion.version}`, log),
|
|
52
46
|
);
|
|
53
47
|
} catch (err) {
|
|
54
48
|
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {
|