@aztec/cli 0.86.0 → 0.87.0
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.js +2 -2
- package/dest/cmds/infrastructure/index.js +1 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +11 -0
- 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 +19 -0
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +59 -54
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
- package/dest/cmds/misc/index.js +1 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +1 -1
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +4 -4
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +4 -4
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +3 -3
- package/package.json +25 -24
- package/src/cmds/devnet/bootstrap_network.ts +2 -2
- package/src/cmds/infrastructure/index.ts +1 -1
- package/src/cmds/l1/index.ts +24 -0
- package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
- package/src/cmds/l1/update_l1_validators.ts +52 -44
- package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
- package/src/cmds/misc/index.ts +1 -1
- package/src/cmds/misc/update.ts +0 -1
- package/src/utils/aztec.ts +3 -9
- package/src/utils/commands.ts +4 -4
- package/src/utils/encoding.ts +1 -1
- package/src/utils/inspect.ts +4 -5
|
@@ -162,7 +162,7 @@ async function deployFPC(wallet, tokenAddress, admin) {
|
|
|
162
162
|
async function deployCounter(wallet) {
|
|
163
163
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
164
164
|
// @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
|
|
165
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
165
|
+
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
166
166
|
const counter = await CounterContract.deploy(wallet, 1, wallet.getAddress()).send({
|
|
167
167
|
universalDeploy: true
|
|
168
168
|
}).deployed(waitOpts);
|
|
@@ -180,7 +180,7 @@ async function fundFPC(pxe, counterAddress, wallet, l1Client, fpcAddress, debugL
|
|
|
180
180
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
181
181
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
182
182
|
// @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
|
|
183
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
183
|
+
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
184
184
|
const { protocolContractAddresses: { feeJuice } } = await wallet.getPXEInfo();
|
|
185
185
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
186
186
|
const feeJuicePortal = await L1FeeJuicePortalManager.new(wallet, l1Client, debugLog);
|
|
@@ -13,7 +13,7 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
13
13
|
who,
|
|
14
14
|
mnemonic: options.mnemonic,
|
|
15
15
|
rpcUrl: options.rpcUrl,
|
|
16
|
-
l1RpcUrls: options.l1RpcUrls
|
|
16
|
+
l1RpcUrls: options.l1RpcUrls,
|
|
17
17
|
chainId: options.l1ChainId,
|
|
18
18
|
blockNumber: options.blockNumber,
|
|
19
19
|
log,
|
|
@@ -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;AAW3D,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;AAW3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WA4iB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -132,6 +132,17 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
132
132
|
debugLogger
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
|
+
program.command('trigger-seed-snapshot').description('Triggers a seed snapshot for the next epoch.').option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress).addOption(l1RpcUrlsOption).addOption(l1ChainIdOption).action(async (options)=>{
|
|
136
|
+
const { triggerSeedSnapshot } = await import('./trigger_seed_snapshot.js');
|
|
137
|
+
await triggerSeedSnapshot({
|
|
138
|
+
rollupAddress: options.rollup,
|
|
139
|
+
rpcUrls: options.l1RpcUrls,
|
|
140
|
+
chainId: options.l1ChainId,
|
|
141
|
+
privateKey: options.privateKey,
|
|
142
|
+
mnemonic: options.mnemonic,
|
|
143
|
+
log
|
|
144
|
+
});
|
|
145
|
+
});
|
|
135
146
|
program.command('debug-rollup').description('Debugs the rollup contract.').addOption(l1RpcUrlsOption).addOption(l1ChainIdOption).option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress).action(async (options)=>{
|
|
136
147
|
const { debugRollup } = await import('./update_l1_validators.js');
|
|
137
148
|
await debugRollup({
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
import type { RollupCommandArgs } from './update_l1_validators.js';
|
|
3
|
+
export declare function triggerSeedSnapshot({ rpcUrls, chainId, privateKey, mnemonic, rollupAddress, log, }: RollupCommandArgs & {
|
|
4
|
+
log: LogFn;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=trigger_seed_snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_seed_snapshot.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/trigger_seed_snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,wBAAsB,mBAAmB,CAAC,EACxC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,GAAG,GACJ,EAAE,iBAAiB,GAAG;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,iBAepC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
2
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
3
|
+
import { getContract } from 'viem';
|
|
4
|
+
export async function triggerSeedSnapshot({ rpcUrls, chainId, privateKey, mnemonic, rollupAddress, log }) {
|
|
5
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
6
|
+
const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
7
|
+
const rollup = getContract({
|
|
8
|
+
address: rollupAddress.toString(),
|
|
9
|
+
abi: RollupAbi,
|
|
10
|
+
client
|
|
11
|
+
});
|
|
12
|
+
log('Triggering seed snapshot for next epoch');
|
|
13
|
+
const txHash = await rollup.write.setupSeedSnapshotForNextEpoch();
|
|
14
|
+
log(`Sent! | Seed snapshot setup for next epoch | tx hash: ${txHash}`);
|
|
15
|
+
const receipt = await client.waitForTransactionReceipt({
|
|
16
|
+
hash: txHash
|
|
17
|
+
});
|
|
18
|
+
log(`Done! | Seed snapshot setup for next epoch | tx hash: ${txHash} | status: ${receipt.status}`);
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update_l1_validators.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/update_l1_validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update_l1_validators.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/update_l1_validators.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,UAAU,CAAC;IAC1B,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B,EAAE,UAAU,CAAC;CACxC;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB;;;EAQhC;AAED,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,GAAG,EACH,WAAW,GACZ,EAAE,8BAA8B,GAAG,UAAU,GAAG;IAAE,eAAe,EAAE,UAAU,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CAAE,iBAiD/G;AAED,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,GAAG;IAAE,gBAAgB,EAAE,UAAU,CAAA;CAAE,iBAiBnE;AAED,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,iBAgBhC;AAED,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,OAAO,EACP,aAAa,EACb,SAAS,EACT,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,iBAyBxD;AAED,wBAAsB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,iBAAiB,GAAG,UAAU,iBAwBzG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EthCheatCodes, RollupContract, createEthereumChain, getExpectedAddress, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum';
|
|
1
|
+
import { EthCheatCodes, L1TxUtils, RollupContract, createEthereumChain, createExtendedL1Client, getExpectedAddress, getL1ContractsConfigEnvVars, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
|
|
2
2
|
import { ForwarderAbi, ForwarderBytecode, RollupAbi, StakingAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
3
|
-
import {
|
|
3
|
+
import { encodeFunctionData, formatEther, getContract } from 'viem';
|
|
4
4
|
import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
5
5
|
export function generateL1Account() {
|
|
6
6
|
const privateKey = generatePrivateKey();
|
|
@@ -13,32 +13,42 @@ export function generateL1Account() {
|
|
|
13
13
|
}
|
|
14
14
|
export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, proposerEOAAddress, stakingAssetHandlerAddress, log, debugLogger }) {
|
|
15
15
|
const dualLog = makeDualLog(log, debugLogger);
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const account = getAccount(privateKey, mnemonic);
|
|
17
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
18
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
18
19
|
const stakingAssetHandler = getContract({
|
|
19
20
|
address: stakingAssetHandlerAddress.toString(),
|
|
20
21
|
abi: StakingAssetHandlerAbi,
|
|
21
|
-
client:
|
|
22
|
+
client: l1Client
|
|
22
23
|
});
|
|
23
24
|
const rollup = await stakingAssetHandler.read.getRollup();
|
|
24
25
|
const forwarderAddress = getExpectedAddress(ForwarderAbi, ForwarderBytecode, [
|
|
25
26
|
proposerEOAAddress.toString()
|
|
26
27
|
], proposerEOAAddress.toString()).address;
|
|
27
28
|
dualLog(`Adding validator (${attesterAddress}, ${proposerEOAAddress} [forwarder: ${forwarderAddress}]) to rollup ${rollup.toString()}`);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
30
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
31
|
+
to: stakingAssetHandlerAddress.toString(),
|
|
32
|
+
data: encodeFunctionData({
|
|
33
|
+
abi: StakingAssetHandlerAbi,
|
|
34
|
+
functionName: 'addValidator',
|
|
35
|
+
args: [
|
|
36
|
+
attesterAddress.toString(),
|
|
37
|
+
forwarderAddress
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
abi: StakingAssetHandlerAbi
|
|
41
|
+
});
|
|
42
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
43
|
+
await l1Client.waitForTransactionReceipt({
|
|
44
|
+
hash: receipt.transactionHash
|
|
35
45
|
});
|
|
36
46
|
if (isAnvilTestChain(chainId)) {
|
|
37
47
|
dualLog(`Funding validator on L1`);
|
|
38
48
|
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
39
49
|
await cheatCodes.setBalance(proposerEOAAddress, 10n ** 20n);
|
|
40
50
|
} else {
|
|
41
|
-
const balance = await
|
|
51
|
+
const balance = await l1Client.getBalance({
|
|
42
52
|
address: proposerEOAAddress.toString()
|
|
43
53
|
});
|
|
44
54
|
dualLog(`Proposer balance: ${formatEther(balance)} ETH`);
|
|
@@ -49,42 +59,46 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
|
|
|
49
59
|
}
|
|
50
60
|
export async function removeL1Validator({ rpcUrls, chainId, privateKey, mnemonic, validatorAddress, rollupAddress, log, debugLogger }) {
|
|
51
61
|
const dualLog = makeDualLog(log, debugLogger);
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
abi: RollupAbi,
|
|
57
|
-
client: walletClient
|
|
58
|
-
});
|
|
62
|
+
const account = getAccount(privateKey, mnemonic);
|
|
63
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
64
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
65
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
59
66
|
dualLog(`Removing validator ${validatorAddress.toString()} from rollup ${rollupAddress.toString()}`);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
68
|
+
to: rollupAddress.toString(),
|
|
69
|
+
data: encodeFunctionData({
|
|
70
|
+
abi: RollupAbi,
|
|
71
|
+
functionName: 'initiateWithdraw',
|
|
72
|
+
args: [
|
|
73
|
+
validatorAddress.toString(),
|
|
74
|
+
validatorAddress.toString()
|
|
75
|
+
]
|
|
76
|
+
})
|
|
67
77
|
});
|
|
78
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
68
79
|
}
|
|
69
80
|
export async function pruneRollup({ rpcUrls, chainId, privateKey, mnemonic, rollupAddress, log, debugLogger }) {
|
|
70
81
|
const dualLog = makeDualLog(log, debugLogger);
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
abi: RollupAbi,
|
|
76
|
-
client: walletClient
|
|
77
|
-
});
|
|
82
|
+
const account = getAccount(privateKey, mnemonic);
|
|
83
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
84
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
85
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
78
86
|
dualLog(`Trying prune`);
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
88
|
+
to: rollupAddress.toString(),
|
|
89
|
+
data: encodeFunctionData({
|
|
90
|
+
abi: RollupAbi,
|
|
91
|
+
functionName: 'prune'
|
|
92
|
+
})
|
|
83
93
|
});
|
|
94
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
84
95
|
}
|
|
85
96
|
export async function fastForwardEpochs({ rpcUrls, chainId, rollupAddress, numEpochs, log, debugLogger }) {
|
|
86
97
|
const dualLog = makeDualLog(log, debugLogger);
|
|
87
|
-
const publicClient = getPublicClient(
|
|
98
|
+
const publicClient = getPublicClient({
|
|
99
|
+
l1RpcUrls: rpcUrls,
|
|
100
|
+
l1ChainId: chainId
|
|
101
|
+
});
|
|
88
102
|
const rollup = getContract({
|
|
89
103
|
address: rollupAddress.toString(),
|
|
90
104
|
abi: RollupAbi,
|
|
@@ -111,7 +125,10 @@ export async function fastForwardEpochs({ rpcUrls, chainId, rollupAddress, numEp
|
|
|
111
125
|
}
|
|
112
126
|
export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }) {
|
|
113
127
|
const config = getL1ContractsConfigEnvVars();
|
|
114
|
-
const publicClient = getPublicClient(
|
|
128
|
+
const publicClient = getPublicClient({
|
|
129
|
+
l1RpcUrls: rpcUrls,
|
|
130
|
+
l1ChainId: chainId
|
|
131
|
+
});
|
|
115
132
|
const rollup = new RollupContract(publicClient, rollupAddress);
|
|
116
133
|
const pendingNum = await rollup.getBlockNumber();
|
|
117
134
|
log(`Pending block num: ${pendingNum}`);
|
|
@@ -139,22 +156,10 @@ function makeDualLog(log, debugLogger) {
|
|
|
139
156
|
debugLogger.info(msg);
|
|
140
157
|
};
|
|
141
158
|
}
|
|
142
|
-
function
|
|
143
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
144
|
-
return createPublicClient({
|
|
145
|
-
chain: chain.chainInfo,
|
|
146
|
-
transport: fallback(rpcUrls.map((url)=>http(url)))
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function getWalletClient(rpcUrls, chainId, privateKey, mnemonic) {
|
|
159
|
+
function getAccount(privateKey, mnemonic) {
|
|
150
160
|
if (!privateKey && !mnemonic) {
|
|
151
161
|
throw new Error('Either privateKey or mnemonic must be provided to create a wallet client');
|
|
152
162
|
}
|
|
153
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
154
163
|
const account = !privateKey ? mnemonicToAccount(mnemonic) : privateKeyToAccount(`${privateKey.startsWith('0x') ? '' : '0x'}${privateKey}`);
|
|
155
|
-
return
|
|
156
|
-
account,
|
|
157
|
-
chain: chain.chainInfo,
|
|
158
|
-
transport: fallback(rpcUrls.map((url)=>http(url)))
|
|
159
|
-
});
|
|
164
|
+
return account;
|
|
160
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_secret_and_hash.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_secret_and_hash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"generate_secret_and_hash.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_secret_and_hash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,KAAK,iBAUrD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computeSecretHash } from '@aztec/aztec.js';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
export function generateSecretAndHash(log) {
|
|
3
|
+
export async function generateSecretAndHash(log) {
|
|
4
4
|
const secret = Fr.random();
|
|
5
5
|
// We hash this the same way that aztec nr hash does.
|
|
6
|
-
const secretHash = computeSecretHash(secret);
|
|
6
|
+
const secretHash = await computeSecretHash(secret);
|
|
7
7
|
log(`
|
|
8
8
|
Secret: ${secret}
|
|
9
9
|
Secret hash: ${secretHash}
|
package/dest/cmds/misc/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export function injectCommands(program, log) {
|
|
|
33
33
|
});
|
|
34
34
|
program.command('generate-secret-and-hash').description('Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults)').action(async ()=>{
|
|
35
35
|
const { generateSecretAndHash } = await import('./generate_secret_and_hash.js');
|
|
36
|
-
generateSecretAndHash(log);
|
|
36
|
+
await generateSecretAndHash(log);
|
|
37
37
|
});
|
|
38
38
|
program.command('get-canonical-sponsored-fpc-address').description('Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI').action(async ()=>{
|
|
39
39
|
const { getCanonicalSponsoredFPCAddress } = await import('./get_canonical_sponsored_fpc_address.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAYnD,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
|
package/dest/cmds/misc/update.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { relative, resolve } from 'path';
|
|
2
2
|
import { parse } from 'semver';
|
|
3
3
|
import { updateAztecNr } from './update/noir.js';
|
|
4
4
|
import { getNewestVersion, updateAztecDeps, updateLockfile } from './update/npm.js';
|
|
@@ -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,
|
|
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,EAAE,KAAK,2BAA2B,EAAE,KAAK,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,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,UAAU,EAAE,EAC/B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,0BAA0B,EAAE,OAAO,EACnC,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC,CA4BtC;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,UAAU,EAAE,EAC/B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,mBAAmB,EAAE,UAAU,CAAA;CAAE,CAAC,CAkCtE;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,WAK1C,CAAC;AAEF;;;;GAIG;AACH,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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import { FunctionType, getAllFunctionAbis, loadContractArtifact } from '@aztec/aztec.js/abi';
|
|
3
|
-
import { RegistryContract, RollupContract } from '@aztec/ethereum';
|
|
4
3
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
5
4
|
import TOML from '@iarna/toml';
|
|
6
5
|
import { readFile } from 'fs/promises';
|
|
@@ -53,9 +52,10 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
53
52
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
54
53
|
const client = createExtendedL1Client(rpcUrls, account, chain.chainInfo, undefined, mnemonicIndex);
|
|
55
54
|
if (!initialValidators || initialValidators.length === 0) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
// initialize the new rollup with Amin's validator address.
|
|
56
|
+
initialValidators = [
|
|
57
|
+
EthAddress.fromString('0x3b218d0F26d15B36C715cB06c949210a0d630637')
|
|
58
|
+
];
|
|
59
59
|
logger.info('Initializing new rollup with old attesters', {
|
|
60
60
|
initialValidators
|
|
61
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/utils/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,OAAO,EAAwC,MAAM,EAAE,MAAM,WAAW,CAAC;AAIvF;;;GAGG;AACH,eAAO,MAAM,YAAY,uBAGI,CAAC;AAE9B,eAAO,MAAM,SAAS,QAAuB,CAAC;AAC9C,eAAO,MAAQ,cAAc,UAA+B,WAAW,sBAAE,QAAQ,sBAAE,OAAO,sBAAE,WAAW,oBAAgB,CAAC;AAExH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAG7D;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/utils/commands.ts"],"names":[],"mappings":"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"}
|
package/dest/utils/commands.js
CHANGED
|
@@ -221,7 +221,7 @@ export function parseBigint(bigint) {
|
|
|
221
221
|
}
|
|
222
222
|
try {
|
|
223
223
|
return PublicKeys.fromString(publicKey);
|
|
224
|
-
} catch
|
|
224
|
+
} catch {
|
|
225
225
|
throw new InvalidArgumentError(`Invalid public key: ${publicKey}`);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
@@ -233,7 +233,7 @@ export function parseBigint(bigint) {
|
|
|
233
233
|
*/ export function parsePartialAddress(address) {
|
|
234
234
|
try {
|
|
235
235
|
return Fr.fromHexString(address);
|
|
236
|
-
} catch
|
|
236
|
+
} catch {
|
|
237
237
|
throw new InvalidArgumentError(`Invalid partial address: ${address}`);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -245,7 +245,7 @@ export function parseBigint(bigint) {
|
|
|
245
245
|
*/ export function parseSecretKey(secretKey) {
|
|
246
246
|
try {
|
|
247
247
|
return Fr.fromHexString(secretKey);
|
|
248
|
-
} catch
|
|
248
|
+
} catch {
|
|
249
249
|
throw new InvalidArgumentError(`Invalid encryption secret key: ${secretKey}`);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -275,7 +275,7 @@ export function parseBigint(bigint) {
|
|
|
275
275
|
return new Fr(BigInt(field.replace(/n$/, '')));
|
|
276
276
|
}
|
|
277
277
|
return new Fr(BigInt(field));
|
|
278
|
-
} catch
|
|
278
|
+
} catch {
|
|
279
279
|
throw new InvalidArgumentError(`Invalid field: ${field}`);
|
|
280
280
|
}
|
|
281
281
|
}
|
package/dest/utils/encoding.js
CHANGED
|
@@ -29,7 +29,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
29
29
|
let res;
|
|
30
30
|
try {
|
|
31
31
|
res = BigInt(arg);
|
|
32
|
-
} catch
|
|
32
|
+
} catch {
|
|
33
33
|
throw new Error(`Invalid value passed for ${name}. Could not parse ${arg} as a${kind === 'integer' ? 'n' : ''} ${kind}.`);
|
|
34
34
|
}
|
|
35
35
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7G;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,iBAmGrE;
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7G;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,iBAmGrE;AAuCD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;AAC/D,KAAK,2BAA2B,GAAG,gBAAgB,GAAG;IAAE,OAAO,EAAE,EAAE,CAAA;CAAE,CAAC"}
|
package/dest/utils/inspect.js
CHANGED
|
@@ -141,11 +141,11 @@ async function getKnownNullifiers(pxe, artifactMap) {
|
|
|
141
141
|
const deployNullifiers = {};
|
|
142
142
|
const classNullifiers = {};
|
|
143
143
|
for (const contract of knownContracts){
|
|
144
|
-
initNullifiers[siloNullifier(contract, contract.toField()).toString()] = contract;
|
|
145
|
-
deployNullifiers[siloNullifier(deployerAddress, contract.toField()).toString()] = contract;
|
|
144
|
+
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
145
|
+
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
146
146
|
}
|
|
147
147
|
for (const artifact of Object.values(artifactMap)){
|
|
148
|
-
classNullifiers[siloNullifier(registererAddress, artifact.classId).toString()] = `${artifact.name}Class<${artifact.classId}>`;
|
|
148
|
+
classNullifiers[(await siloNullifier(registererAddress, artifact.classId)).toString()] = `${artifact.name}Class<${artifact.classId}>`;
|
|
149
149
|
}
|
|
150
150
|
return {
|
|
151
151
|
initNullifiers,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/archiver": "0.
|
|
69
|
-
"@aztec/aztec.js": "0.
|
|
70
|
-
"@aztec/constants": "0.
|
|
71
|
-
"@aztec/entrypoints": "0.
|
|
72
|
-
"@aztec/foundation": "0.
|
|
73
|
-
"@aztec/l1-artifacts": "0.
|
|
74
|
-
"@aztec/p2p": "0.
|
|
75
|
-
"@aztec/stdlib": "0.
|
|
76
|
-
"@aztec/world-state": "0.
|
|
68
|
+
"@aztec/archiver": "0.87.0",
|
|
69
|
+
"@aztec/aztec.js": "0.87.0",
|
|
70
|
+
"@aztec/constants": "0.87.0",
|
|
71
|
+
"@aztec/entrypoints": "0.87.0",
|
|
72
|
+
"@aztec/foundation": "0.87.0",
|
|
73
|
+
"@aztec/l1-artifacts": "0.87.0",
|
|
74
|
+
"@aztec/p2p": "0.87.0",
|
|
75
|
+
"@aztec/stdlib": "0.87.0",
|
|
76
|
+
"@aztec/world-state": "0.87.0",
|
|
77
77
|
"@iarna/toml": "^2.2.5",
|
|
78
78
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
79
79
|
"commander": "^12.1.0",
|
|
@@ -85,32 +85,33 @@
|
|
|
85
85
|
"viem": "2.23.7"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@aztec/accounts": "0.
|
|
89
|
-
"@aztec/ethereum": "0.
|
|
90
|
-
"@aztec/protocol-contracts": "0.
|
|
88
|
+
"@aztec/accounts": "0.87.0",
|
|
89
|
+
"@aztec/ethereum": "0.87.0",
|
|
90
|
+
"@aztec/protocol-contracts": "0.87.0",
|
|
91
91
|
"@jest/globals": "^29.5.0",
|
|
92
92
|
"@types/jest": "^29.5.0",
|
|
93
93
|
"@types/lodash.chunk": "^4.2.9",
|
|
94
94
|
"@types/lodash.groupby": "^4.6.9",
|
|
95
95
|
"@types/lodash.startcase": "^4.4.7",
|
|
96
|
-
"@types/node": "^
|
|
96
|
+
"@types/node": "^22.15.17",
|
|
97
97
|
"@types/semver": "^7.5.2",
|
|
98
98
|
"@types/source-map-support": "^0.5.10",
|
|
99
99
|
"jest": "^29.5.0",
|
|
100
100
|
"jest-mock-extended": "^3.0.5",
|
|
101
101
|
"ts-jest": "^29.1.0",
|
|
102
102
|
"ts-node": "^10.9.1",
|
|
103
|
-
"typescript": "^5.
|
|
103
|
+
"typescript": "^5.3.3"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@aztec/accounts": "0.
|
|
107
|
-
"@aztec/bb-prover": "0.
|
|
108
|
-
"@aztec/ethereum": "0.
|
|
109
|
-
"@aztec/l1-artifacts": "0.
|
|
110
|
-
"@aztec/noir-contracts.js": "0.
|
|
111
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
112
|
-
"@aztec/
|
|
113
|
-
"@aztec/
|
|
106
|
+
"@aztec/accounts": "0.87.0",
|
|
107
|
+
"@aztec/bb-prover": "0.87.0",
|
|
108
|
+
"@aztec/ethereum": "0.87.0",
|
|
109
|
+
"@aztec/l1-artifacts": "0.87.0",
|
|
110
|
+
"@aztec/noir-contracts.js": "0.87.0",
|
|
111
|
+
"@aztec/noir-protocol-circuits-types": "0.87.0",
|
|
112
|
+
"@aztec/noir-test-contracts.js": "0.87.0",
|
|
113
|
+
"@aztec/protocol-contracts": "0.87.0",
|
|
114
|
+
"@aztec/stdlib": "0.87.0"
|
|
114
115
|
},
|
|
115
116
|
"files": [
|
|
116
117
|
"dest",
|
|
@@ -119,6 +120,6 @@
|
|
|
119
120
|
],
|
|
120
121
|
"types": "./dest/index.d.ts",
|
|
121
122
|
"engines": {
|
|
122
|
-
"node": ">=
|
|
123
|
+
"node": ">=20.10"
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -248,7 +248,7 @@ async function deployFPC(
|
|
|
248
248
|
async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
|
|
249
249
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
250
250
|
// @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
|
|
251
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
251
|
+
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
252
252
|
const counter = await CounterContract.deploy(wallet, 1, wallet.getAddress())
|
|
253
253
|
.send({ universalDeploy: true })
|
|
254
254
|
.deployed(waitOpts);
|
|
@@ -274,7 +274,7 @@ async function fundFPC(
|
|
|
274
274
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
275
275
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
276
276
|
// @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
|
|
277
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
277
|
+
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
278
278
|
const {
|
|
279
279
|
protocolContractAddresses: { feeJuice },
|
|
280
280
|
} = await wallet.getPXEInfo();
|
|
@@ -51,7 +51,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
51
51
|
who,
|
|
52
52
|
mnemonic: options.mnemonic,
|
|
53
53
|
rpcUrl: options.rpcUrl,
|
|
54
|
-
l1RpcUrls: options.l1RpcUrls
|
|
54
|
+
l1RpcUrls: options.l1RpcUrls,
|
|
55
55
|
chainId: options.l1ChainId,
|
|
56
56
|
blockNumber: options.blockNumber,
|
|
57
57
|
log,
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -352,6 +352,30 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
352
352
|
});
|
|
353
353
|
});
|
|
354
354
|
|
|
355
|
+
program
|
|
356
|
+
.command('trigger-seed-snapshot')
|
|
357
|
+
.description('Triggers a seed snapshot for the next epoch.')
|
|
358
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
359
|
+
.option(
|
|
360
|
+
'-m, --mnemonic <string>',
|
|
361
|
+
'The mnemonic to use in deployment',
|
|
362
|
+
'test test test test test test test test test test test junk',
|
|
363
|
+
)
|
|
364
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
365
|
+
.addOption(l1RpcUrlsOption)
|
|
366
|
+
.addOption(l1ChainIdOption)
|
|
367
|
+
.action(async options => {
|
|
368
|
+
const { triggerSeedSnapshot } = await import('./trigger_seed_snapshot.js');
|
|
369
|
+
await triggerSeedSnapshot({
|
|
370
|
+
rollupAddress: options.rollup,
|
|
371
|
+
rpcUrls: options.l1RpcUrls,
|
|
372
|
+
chainId: options.l1ChainId,
|
|
373
|
+
privateKey: options.privateKey,
|
|
374
|
+
mnemonic: options.mnemonic,
|
|
375
|
+
log,
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
|
|
355
379
|
program
|
|
356
380
|
.command('debug-rollup')
|
|
357
381
|
.description('Debugs the rollup contract.')
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
2
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
4
|
+
|
|
5
|
+
import { getContract } from 'viem';
|
|
6
|
+
|
|
7
|
+
import type { RollupCommandArgs } from './update_l1_validators.js';
|
|
8
|
+
|
|
9
|
+
export async function triggerSeedSnapshot({
|
|
10
|
+
rpcUrls,
|
|
11
|
+
chainId,
|
|
12
|
+
privateKey,
|
|
13
|
+
mnemonic,
|
|
14
|
+
rollupAddress,
|
|
15
|
+
log,
|
|
16
|
+
}: RollupCommandArgs & { log: LogFn }) {
|
|
17
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
18
|
+
const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic!, chain.chainInfo);
|
|
19
|
+
|
|
20
|
+
const rollup = getContract({
|
|
21
|
+
address: rollupAddress.toString(),
|
|
22
|
+
abi: RollupAbi,
|
|
23
|
+
client,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
log('Triggering seed snapshot for next epoch');
|
|
27
|
+
const txHash = await rollup.write.setupSeedSnapshotForNextEpoch();
|
|
28
|
+
log(`Sent! | Seed snapshot setup for next epoch | tx hash: ${txHash}`);
|
|
29
|
+
const receipt = await client.waitForTransactionReceipt({ hash: txHash });
|
|
30
|
+
log(`Done! | Seed snapshot setup for next epoch | tx hash: ${txHash} | status: ${receipt.status}`);
|
|
31
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EthCheatCodes,
|
|
3
|
+
L1TxUtils,
|
|
3
4
|
RollupContract,
|
|
4
5
|
createEthereumChain,
|
|
6
|
+
createExtendedL1Client,
|
|
5
7
|
getExpectedAddress,
|
|
6
8
|
getL1ContractsConfigEnvVars,
|
|
9
|
+
getPublicClient,
|
|
7
10
|
isAnvilTestChain,
|
|
8
11
|
} from '@aztec/ethereum';
|
|
9
12
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
13
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
11
14
|
import { ForwarderAbi, ForwarderBytecode, RollupAbi, StakingAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
12
15
|
|
|
13
|
-
import {
|
|
16
|
+
import { encodeFunctionData, formatEther, getContract } from 'viem';
|
|
14
17
|
import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
15
18
|
|
|
16
19
|
export interface RollupCommandArgs {
|
|
@@ -57,13 +60,14 @@ export async function addL1Validator({
|
|
|
57
60
|
debugLogger,
|
|
58
61
|
}: StakingAssetHandlerCommandArgs & LoggerArgs & { attesterAddress: EthAddress; proposerEOAAddress: EthAddress }) {
|
|
59
62
|
const dualLog = makeDualLog(log, debugLogger);
|
|
60
|
-
const
|
|
61
|
-
const
|
|
63
|
+
const account = getAccount(privateKey, mnemonic);
|
|
64
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
65
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
62
66
|
|
|
63
67
|
const stakingAssetHandler = getContract({
|
|
64
68
|
address: stakingAssetHandlerAddress.toString(),
|
|
65
69
|
abi: StakingAssetHandlerAbi,
|
|
66
|
-
client:
|
|
70
|
+
client: l1Client,
|
|
67
71
|
});
|
|
68
72
|
|
|
69
73
|
const rollup = await stakingAssetHandler.read.getRollup();
|
|
@@ -78,15 +82,26 @@ export async function addL1Validator({
|
|
|
78
82
|
dualLog(
|
|
79
83
|
`Adding validator (${attesterAddress}, ${proposerEOAAddress} [forwarder: ${forwarderAddress}]) to rollup ${rollup.toString()}`,
|
|
80
84
|
);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
|
|
86
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
87
|
+
|
|
88
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
89
|
+
to: stakingAssetHandlerAddress.toString(),
|
|
90
|
+
data: encodeFunctionData({
|
|
91
|
+
abi: StakingAssetHandlerAbi,
|
|
92
|
+
functionName: 'addValidator',
|
|
93
|
+
args: [attesterAddress.toString(), forwarderAddress],
|
|
94
|
+
}),
|
|
95
|
+
abi: StakingAssetHandlerAbi,
|
|
96
|
+
});
|
|
97
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
98
|
+
await l1Client.waitForTransactionReceipt({ hash: receipt.transactionHash });
|
|
84
99
|
if (isAnvilTestChain(chainId)) {
|
|
85
100
|
dualLog(`Funding validator on L1`);
|
|
86
101
|
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
87
102
|
await cheatCodes.setBalance(proposerEOAAddress, 10n ** 20n);
|
|
88
103
|
} else {
|
|
89
|
-
const balance = await
|
|
104
|
+
const balance = await l1Client.getBalance({ address: proposerEOAAddress.toString() });
|
|
90
105
|
dualLog(`Proposer balance: ${formatEther(balance)} ETH`);
|
|
91
106
|
if (balance === 0n) {
|
|
92
107
|
dualLog(`WARNING: Proposer has no balance. Remember to fund it!`);
|
|
@@ -105,18 +120,21 @@ export async function removeL1Validator({
|
|
|
105
120
|
debugLogger,
|
|
106
121
|
}: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress }) {
|
|
107
122
|
const dualLog = makeDualLog(log, debugLogger);
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
abi: RollupAbi,
|
|
113
|
-
client: walletClient,
|
|
114
|
-
});
|
|
123
|
+
const account = getAccount(privateKey, mnemonic);
|
|
124
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
125
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
126
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
115
127
|
|
|
116
128
|
dualLog(`Removing validator ${validatorAddress.toString()} from rollup ${rollupAddress.toString()}`);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
130
|
+
to: rollupAddress.toString(),
|
|
131
|
+
data: encodeFunctionData({
|
|
132
|
+
abi: RollupAbi,
|
|
133
|
+
functionName: 'initiateWithdraw',
|
|
134
|
+
args: [validatorAddress.toString(), validatorAddress.toString()],
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
120
138
|
}
|
|
121
139
|
|
|
122
140
|
export async function pruneRollup({
|
|
@@ -129,18 +147,20 @@ export async function pruneRollup({
|
|
|
129
147
|
debugLogger,
|
|
130
148
|
}: RollupCommandArgs & LoggerArgs) {
|
|
131
149
|
const dualLog = makeDualLog(log, debugLogger);
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
abi: RollupAbi,
|
|
137
|
-
client: walletClient,
|
|
138
|
-
});
|
|
150
|
+
const account = getAccount(privateKey, mnemonic);
|
|
151
|
+
const chain = createEthereumChain(rpcUrls, chainId);
|
|
152
|
+
const l1Client = createExtendedL1Client(rpcUrls, account, chain.chainInfo);
|
|
153
|
+
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
139
154
|
|
|
140
155
|
dualLog(`Trying prune`);
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
157
|
+
to: rollupAddress.toString(),
|
|
158
|
+
data: encodeFunctionData({
|
|
159
|
+
abi: RollupAbi,
|
|
160
|
+
functionName: 'prune',
|
|
161
|
+
}),
|
|
162
|
+
});
|
|
163
|
+
dualLog(`Transaction hash: ${receipt.transactionHash}`);
|
|
144
164
|
}
|
|
145
165
|
|
|
146
166
|
export async function fastForwardEpochs({
|
|
@@ -152,7 +172,7 @@ export async function fastForwardEpochs({
|
|
|
152
172
|
debugLogger,
|
|
153
173
|
}: RollupCommandArgs & LoggerArgs & { numEpochs: bigint }) {
|
|
154
174
|
const dualLog = makeDualLog(log, debugLogger);
|
|
155
|
-
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
175
|
+
const publicClient = getPublicClient({ l1RpcUrls: rpcUrls, l1ChainId: chainId });
|
|
156
176
|
const rollup = getContract({
|
|
157
177
|
address: rollupAddress.toString(),
|
|
158
178
|
abi: RollupAbi,
|
|
@@ -179,7 +199,7 @@ export async function fastForwardEpochs({
|
|
|
179
199
|
|
|
180
200
|
export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }: RollupCommandArgs & LoggerArgs) {
|
|
181
201
|
const config = getL1ContractsConfigEnvVars();
|
|
182
|
-
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
202
|
+
const publicClient = getPublicClient({ l1RpcUrls: rpcUrls, l1ChainId: chainId });
|
|
183
203
|
const rollup = new RollupContract(publicClient, rollupAddress);
|
|
184
204
|
|
|
185
205
|
const pendingNum = await rollup.getBlockNumber();
|
|
@@ -210,24 +230,12 @@ function makeDualLog(log: LogFn, debugLogger: Logger) {
|
|
|
210
230
|
};
|
|
211
231
|
}
|
|
212
232
|
|
|
213
|
-
function
|
|
214
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
215
|
-
return createPublicClient({ chain: chain.chainInfo, transport: fallback(rpcUrls.map(url => http(url))) });
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function getWalletClient(
|
|
219
|
-
rpcUrls: string[],
|
|
220
|
-
chainId: number,
|
|
221
|
-
privateKey: string | undefined,
|
|
222
|
-
mnemonic: string | undefined,
|
|
223
|
-
) {
|
|
233
|
+
function getAccount(privateKey: string | undefined, mnemonic: string | undefined) {
|
|
224
234
|
if (!privateKey && !mnemonic) {
|
|
225
235
|
throw new Error('Either privateKey or mnemonic must be provided to create a wallet client');
|
|
226
236
|
}
|
|
227
|
-
|
|
228
|
-
const chain = createEthereumChain(rpcUrls, chainId);
|
|
229
237
|
const account = !privateKey
|
|
230
238
|
? mnemonicToAccount(mnemonic!)
|
|
231
239
|
: privateKeyToAccount(`${privateKey.startsWith('0x') ? '' : '0x'}${privateKey}` as `0x${string}`);
|
|
232
|
-
return
|
|
240
|
+
return account;
|
|
233
241
|
}
|
|
@@ -2,11 +2,11 @@ import { computeSecretHash } from '@aztec/aztec.js';
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
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}
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -74,7 +74,7 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
74
74
|
.description('Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults)')
|
|
75
75
|
.action(async () => {
|
|
76
76
|
const { generateSecretAndHash } = await import('./generate_secret_and_hash.js');
|
|
77
|
-
generateSecretAndHash(log);
|
|
77
|
+
await generateSecretAndHash(log);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
program
|
package/src/cmds/misc/update.ts
CHANGED
package/src/utils/aztec.ts
CHANGED
|
@@ -6,12 +6,7 @@ import {
|
|
|
6
6
|
getAllFunctionAbis,
|
|
7
7
|
loadContractArtifact,
|
|
8
8
|
} from '@aztec/aztec.js/abi';
|
|
9
|
-
import {
|
|
10
|
-
type DeployL1ContractsReturnType,
|
|
11
|
-
type L1ContractsConfig,
|
|
12
|
-
RegistryContract,
|
|
13
|
-
RollupContract,
|
|
14
|
-
} from '@aztec/ethereum';
|
|
9
|
+
import { type DeployL1ContractsReturnType, type L1ContractsConfig, RollupContract } from '@aztec/ethereum';
|
|
15
10
|
import type { Fr } from '@aztec/foundation/fields';
|
|
16
11
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
17
12
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
@@ -112,9 +107,8 @@ export async function deployNewRollupContracts(
|
|
|
112
107
|
const client = createExtendedL1Client(rpcUrls, account, chain.chainInfo, undefined, mnemonicIndex);
|
|
113
108
|
|
|
114
109
|
if (!initialValidators || initialValidators.length === 0) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
initialValidators = (await rollup.getAttesters()).map(str => EthAddress.fromString(str));
|
|
110
|
+
// initialize the new rollup with Amin's validator address.
|
|
111
|
+
initialValidators = [EthAddress.fromString('0x3b218d0F26d15B36C715cB06c949210a0d630637')];
|
|
118
112
|
logger.info('Initializing new rollup with old attesters', { initialValidators });
|
|
119
113
|
}
|
|
120
114
|
|
package/src/utils/commands.ts
CHANGED
|
@@ -287,7 +287,7 @@ export function parsePublicKey(publicKey: string): PublicKeys | undefined {
|
|
|
287
287
|
}
|
|
288
288
|
try {
|
|
289
289
|
return PublicKeys.fromString(publicKey);
|
|
290
|
-
} catch
|
|
290
|
+
} catch {
|
|
291
291
|
throw new InvalidArgumentError(`Invalid public key: ${publicKey}`);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
@@ -301,7 +301,7 @@ export function parsePublicKey(publicKey: string): PublicKeys | undefined {
|
|
|
301
301
|
export function parsePartialAddress(address: string): Fr {
|
|
302
302
|
try {
|
|
303
303
|
return Fr.fromHexString(address);
|
|
304
|
-
} catch
|
|
304
|
+
} catch {
|
|
305
305
|
throw new InvalidArgumentError(`Invalid partial address: ${address}`);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -315,7 +315,7 @@ export function parsePartialAddress(address: string): Fr {
|
|
|
315
315
|
export function parseSecretKey(secretKey: string): Fr {
|
|
316
316
|
try {
|
|
317
317
|
return Fr.fromHexString(secretKey);
|
|
318
|
-
} catch
|
|
318
|
+
} catch {
|
|
319
319
|
throw new InvalidArgumentError(`Invalid encryption secret key: ${secretKey}`);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
@@ -348,7 +348,7 @@ export function parseField(field: string): Fr {
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
return new Fr(BigInt(field));
|
|
351
|
-
} catch
|
|
351
|
+
} catch {
|
|
352
352
|
throw new InvalidArgumentError(`Invalid field: ${field}`);
|
|
353
353
|
}
|
|
354
354
|
}
|
package/src/utils/encoding.ts
CHANGED
|
@@ -35,7 +35,7 @@ function encodeArg(arg: string, abiType: AbiType, name: string): any {
|
|
|
35
35
|
let res: bigint;
|
|
36
36
|
try {
|
|
37
37
|
res = BigInt(arg);
|
|
38
|
-
} catch
|
|
38
|
+
} catch {
|
|
39
39
|
throw new Error(
|
|
40
40
|
`Invalid value passed for ${name}. Could not parse ${arg} as a${kind === 'integer' ? 'n' : ''} ${kind}.`,
|
|
41
41
|
);
|
package/src/utils/inspect.ts
CHANGED
|
@@ -166,13 +166,12 @@ async function getKnownNullifiers(pxe: PXE, artifactMap: ArtifactMap) {
|
|
|
166
166
|
const deployNullifiers: Record<string, AztecAddress> = {};
|
|
167
167
|
const classNullifiers: Record<string, string> = {};
|
|
168
168
|
for (const contract of knownContracts) {
|
|
169
|
-
initNullifiers[siloNullifier(contract, contract.toField()).toString()] = contract;
|
|
170
|
-
deployNullifiers[siloNullifier(deployerAddress, contract.toField()).toString()] = contract;
|
|
169
|
+
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
170
|
+
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
171
171
|
}
|
|
172
172
|
for (const artifact of Object.values(artifactMap)) {
|
|
173
|
-
classNullifiers[
|
|
174
|
-
|
|
175
|
-
] = `${artifact.name}Class<${artifact.classId}>`;
|
|
173
|
+
classNullifiers[(await siloNullifier(registererAddress, artifact.classId)).toString()] =
|
|
174
|
+
`${artifact.name}Class<${artifact.classId}>`;
|
|
176
175
|
}
|
|
177
176
|
return { initNullifiers, deployNullifiers, classNullifiers };
|
|
178
177
|
}
|