@aztec/cli 0.80.0 → 0.82.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.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +11 -10
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +5 -9
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -7
- package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +2 -2
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +1 -0
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +2 -2
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +11 -17
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- 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/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +2 -2
- package/dest/cmds/misc/setup_contracts.d.ts +2 -2
- package/dest/cmds/misc/setup_contracts.d.ts.map +1 -1
- package/dest/cmds/misc/setup_contracts.js +8 -4
- package/dest/cmds/pxe/get_node_info.d.ts.map +1 -1
- package/dest/cmds/pxe/get_node_info.js +3 -1
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +2 -3
- package/package.json +20 -20
- package/src/cmds/devnet/bootstrap_network.ts +14 -12
- package/src/cmds/infrastructure/sequencers.ts +5 -9
- package/src/cmds/infrastructure/setup_l2_contract.ts +11 -6
- package/src/cmds/l1/bridge_erc20.ts +9 -1
- package/src/cmds/l1/deploy_l1_contracts.ts +1 -0
- package/src/cmds/l1/index.ts +2 -0
- package/src/cmds/l1/update_l1_validators.ts +11 -14
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/index.ts +4 -3
- package/src/cmds/misc/setup_contracts.ts +19 -5
- package/src/cmds/pxe/get_node_info.ts +2 -1
- package/src/utils/inspect.ts +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAqB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBA4EjB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
|
|
2
|
-
import { BatchCall, Fr, L1FeeJuicePortalManager, createCompatibleClient, retryUntil } from '@aztec/aztec.js';
|
|
3
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
2
|
+
import { BatchCall, Fr, L1FeeJuicePortalManager, createCompatibleClient, retryUntil, waitForProven } from '@aztec/aztec.js';
|
|
4
3
|
import { createEthereumChain, createL1Clients, deployL1Contract } from '@aztec/ethereum';
|
|
5
4
|
import { getContract } from 'viem';
|
|
6
5
|
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
7
6
|
const waitOpts = {
|
|
8
7
|
timeout: 120,
|
|
8
|
+
interval: 1
|
|
9
|
+
};
|
|
10
|
+
const provenWaitOpts = {
|
|
9
11
|
provenTimeout: 4800,
|
|
10
12
|
interval: 1
|
|
11
13
|
};
|
|
@@ -22,7 +24,7 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
22
24
|
const fpcAdmin = wallet.getAddress();
|
|
23
25
|
const fpc = await deployFPC(wallet, token.address, fpcAdmin);
|
|
24
26
|
const counter = await deployCounter(wallet);
|
|
25
|
-
await fundFPC(counter.address, wallet, l1Clients, fpc.address, debugLog);
|
|
27
|
+
await fundFPC(pxe, counter.address, wallet, l1Clients, fpc.address, debugLog);
|
|
26
28
|
if (json) {
|
|
27
29
|
log(JSON.stringify({
|
|
28
30
|
devCoinL1: erc20Address.toString(),
|
|
@@ -168,7 +170,7 @@ async function deployCounter(wallet) {
|
|
|
168
170
|
return info;
|
|
169
171
|
}
|
|
170
172
|
// NOTE: Disabling for now in order to get devnet running
|
|
171
|
-
async function fundFPC(counterAddress, wallet, l1Clients, fpcAddress, debugLog) {
|
|
173
|
+
async function fundFPC(pxe, counterAddress, wallet, l1Clients, fpcAddress, debugLog) {
|
|
172
174
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
173
175
|
// @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
|
|
174
176
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
@@ -178,9 +180,8 @@ async function fundFPC(counterAddress, wallet, l1Clients, fpcAddress, debugLog)
|
|
|
178
180
|
const { protocolContractAddresses: { feeJuice } } = await wallet.getPXEInfo();
|
|
179
181
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
180
182
|
const feeJuicePortal = await L1FeeJuicePortalManager.new(wallet, l1Clients.publicClient, l1Clients.walletClient, debugLog);
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
await retryUntil(async ()=>await wallet.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
|
|
183
|
+
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, undefined, true);
|
|
184
|
+
await retryUntil(async ()=>await pxe.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
|
|
184
185
|
const counter = await CounterContract.at(counterAddress, wallet);
|
|
185
186
|
debugLog.info('Incrementing Counter');
|
|
186
187
|
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
@@ -188,9 +189,9 @@ async function fundFPC(counterAddress, wallet, l1Clients, fpcAddress, debugLog)
|
|
|
188
189
|
await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts);
|
|
189
190
|
await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts);
|
|
190
191
|
debugLog.info('Claiming FPC');
|
|
191
|
-
await feeJuiceContract.methods.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex).send().wait({
|
|
192
|
-
...waitOpts
|
|
193
|
-
proven: true
|
|
192
|
+
const receipt = await feeJuiceContract.methods.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex).send().wait({
|
|
193
|
+
...waitOpts
|
|
194
194
|
});
|
|
195
|
+
await waitForProven(pxe, receipt, provenWaitOpts);
|
|
195
196
|
debugLog.info('Finished claiming FPC');
|
|
196
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,
|
|
1
|
+
{"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,iBAgFA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
2
|
+
import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
4
4
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
5
5
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
@@ -17,11 +17,7 @@ export async function sequencers(opts) {
|
|
|
17
17
|
chain: chain.chainInfo,
|
|
18
18
|
transport: fallback(l1RpcUrls.map((url)=>http(url)))
|
|
19
19
|
}) : undefined;
|
|
20
|
-
const rollup =
|
|
21
|
-
address: l1ContractAddresses.rollupAddress.toString(),
|
|
22
|
-
abi: RollupAbi,
|
|
23
|
-
client: publicClient
|
|
24
|
-
});
|
|
20
|
+
const rollup = new RollupContract(publicClient, l1ContractAddresses.rollupAddress);
|
|
25
21
|
const writeableRollup = walletClient ? getContract({
|
|
26
22
|
address: l1ContractAddresses.rollupAddress.toString(),
|
|
27
23
|
abi: RollupAbi,
|
|
@@ -29,7 +25,7 @@ export async function sequencers(opts) {
|
|
|
29
25
|
}) : undefined;
|
|
30
26
|
const who = maybeWho ?? walletClient?.account.address.toString();
|
|
31
27
|
if (command === 'list') {
|
|
32
|
-
const sequencers = await rollup.
|
|
28
|
+
const sequencers = await rollup.getAttesters();
|
|
33
29
|
if (sequencers.length === 0) {
|
|
34
30
|
log(`No sequencers registered on rollup`);
|
|
35
31
|
} else {
|
|
@@ -44,7 +40,7 @@ export async function sequencers(opts) {
|
|
|
44
40
|
}
|
|
45
41
|
log(`Adding ${who} as sequencer`);
|
|
46
42
|
const stakingAsset = getContract({
|
|
47
|
-
address: await rollup.
|
|
43
|
+
address: await rollup.getStakingAsset(),
|
|
48
44
|
abi: TestERC20Abi,
|
|
49
45
|
client: walletClient
|
|
50
46
|
});
|
|
@@ -85,7 +81,7 @@ export async function sequencers(opts) {
|
|
|
85
81
|
});
|
|
86
82
|
log(`Removed in tx ${hash}`);
|
|
87
83
|
} else if (command === 'who-next') {
|
|
88
|
-
const next = await rollup.
|
|
84
|
+
const next = await rollup.getCurrentProposer();
|
|
89
85
|
log(`Sequencer expected to build is ${next}`);
|
|
90
86
|
} else {
|
|
91
87
|
throw new Error(`Unknown command ${command}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,GAAG,EAAE,KAAK,iBAsCX"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
5
|
import { setupCanonicalL2FeeJuice } from '../misc/setup_contracts.js';
|
|
6
6
|
export async function setupL2Contracts(rpcUrl, testAccounts, json, skipProofWait, log) {
|
|
7
7
|
const waitOpts = {
|
|
8
8
|
timeout: 180,
|
|
9
|
-
interval: 1
|
|
10
|
-
proven: !skipProofWait,
|
|
11
|
-
provenTimeout: 600
|
|
9
|
+
interval: 1
|
|
12
10
|
};
|
|
11
|
+
const waitForProvenOptions = !skipProofWait ? {
|
|
12
|
+
provenTimeout: 600
|
|
13
|
+
} : undefined;
|
|
13
14
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
15
|
+
if (waitForProvenOptions) {
|
|
16
|
+
log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
|
|
17
|
+
}
|
|
14
18
|
log('setupL2Contracts: Creating PXE client...');
|
|
15
19
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([
|
|
16
20
|
1,
|
|
@@ -19,12 +23,11 @@ export async function setupL2Contracts(rpcUrl, testAccounts, json, skipProofWait
|
|
|
19
23
|
1,
|
|
20
24
|
1
|
|
21
25
|
], false));
|
|
22
|
-
const wallet = new SignerlessWallet(pxe);
|
|
23
26
|
log('setupL2Contracts: Getting fee juice portal address...');
|
|
24
27
|
// Deploy Fee Juice
|
|
25
|
-
const feeJuicePortalAddress = (await
|
|
28
|
+
const feeJuicePortalAddress = (await pxe.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
|
|
26
29
|
log('setupL2Contracts: Setting up fee juice portal...');
|
|
27
|
-
await setupCanonicalL2FeeJuice(
|
|
30
|
+
await setupCanonicalL2FeeJuice(pxe, feeJuicePortalAddress, log, waitOpts, waitForProvenOptions);
|
|
28
31
|
let deployedAccounts = [];
|
|
29
32
|
if (testAccounts) {
|
|
30
33
|
log('setupL2Contracts: Deploying test accounts...');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type AztecAddress, type EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function bridgeERC20(amount: bigint, recipient: AztecAddress, l1RpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, tokenAddress: EthAddress, portalAddress: EthAddress, privateTransfer: boolean, mint: boolean, json: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
3
|
+
export declare function bridgeERC20(amount: bigint, recipient: AztecAddress, l1RpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, tokenAddress: EthAddress, handlerAddress: EthAddress | undefined, portalAddress: EthAddress, privateTransfer: boolean, mint: boolean, json: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=bridge_erc20.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge_erc20.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/bridge_erc20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAExG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EACxB,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bridge_erc20.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/bridge_erc20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAExG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EACxB,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAuCpB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { L1ToL2TokenPortalManager } from '@aztec/aztec.js';
|
|
2
2
|
import { createEthereumChain, createL1Clients } from '@aztec/ethereum';
|
|
3
3
|
import { prettyPrintJSON } from '../../utils/commands.js';
|
|
4
|
-
export async function bridgeERC20(amount, recipient, l1RpcUrls, chainId, privateKey, mnemonic, tokenAddress, portalAddress, privateTransfer, mint, json, log, debugLogger) {
|
|
4
|
+
export async function bridgeERC20(amount, recipient, l1RpcUrls, chainId, privateKey, mnemonic, tokenAddress, handlerAddress, portalAddress, privateTransfer, mint, json, log, debugLogger) {
|
|
5
5
|
// Prepare L1 client
|
|
6
6
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
7
7
|
const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
8
8
|
// Setup portal manager
|
|
9
|
-
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, publicClient, walletClient, debugLogger);
|
|
9
|
+
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, publicClient, walletClient, debugLogger);
|
|
10
10
|
let claimSecret;
|
|
11
11
|
let messageHash;
|
|
12
12
|
if (privateTransfer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAK3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAK3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA6CpB"}
|
|
@@ -25,5 +25,6 @@ export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic,
|
|
|
25
25
|
log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
26
26
|
log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`);
|
|
27
27
|
log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
28
|
+
log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -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;AAsBjD,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;AAsBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAshB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -164,9 +164,9 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
164
164
|
await deployUltraHonkVerifier(options.rollupAddress?.toString(), options.l1RpcUrls, options.l1ChainId, options.l1PrivateKey, options.mnemonic, options.rpcUrl, options.bb, options.bbWorkingDir, log, debugLogger);
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
|
-
program.command('bridge-erc20').description('Bridges ERC20 tokens to L2.').argument('<amount>', 'The amount of Fee Juice to mint and bridge.', parseBigint).argument('<recipient>', 'Aztec address of the recipient.', parseAztecAddress).addOption(l1RpcUrlsOption).option('-m, --mnemonic <string>', 'The mnemonic to use for deriving the Ethereum address that will mint and bridge', 'test test test test test test test test test test test junk').option('--mint', 'Mint the tokens on L1', false).option('--private', 'If the bridge should use the private flow', false).addOption(l1ChainIdOption).requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress).requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress).option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--json', 'Output the claim in JSON format').action(async (amount, recipient, options)=>{
|
|
167
|
+
program.command('bridge-erc20').description('Bridges ERC20 tokens to L2.').argument('<amount>', 'The amount of Fee Juice to mint and bridge.', parseBigint).argument('<recipient>', 'Aztec address of the recipient.', parseAztecAddress).addOption(l1RpcUrlsOption).option('-m, --mnemonic <string>', 'The mnemonic to use for deriving the Ethereum address that will mint and bridge', 'test test test test test test test test test test test junk').option('--mint', 'Mint the tokens on L1', false).option('--private', 'If the bridge should use the private flow', false).addOption(l1ChainIdOption).requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress).requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress).option('-f, --faucet <string>', 'The address of the faucet contract (only used if minting)', parseEthereumAddress).option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--json', 'Output the claim in JSON format').action(async (amount, recipient, options)=>{
|
|
168
168
|
const { bridgeERC20 } = await import('./bridge_erc20.js');
|
|
169
|
-
await bridgeERC20(amount, recipient, options.l1RpcUrls, options.l1ChainId, options.l1PrivateKey, options.mnemonic, options.token, options.portal, options.private, options.mint, options.json, log, debugLogger);
|
|
169
|
+
await bridgeERC20(amount, recipient, options.l1RpcUrls, options.l1ChainId, options.l1PrivateKey, options.mnemonic, options.token, options.faucet, options.portal, options.private, options.mint, options.json, log, debugLogger);
|
|
170
170
|
});
|
|
171
171
|
program.command('create-l1-account').option('--json', 'Output the account in JSON format').action(async (options)=>{
|
|
172
172
|
const { createL1Account } = await import('./create_l1_account.js');
|
|
@@ -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":"AAQA,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,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,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,GAAG;IAAE,gBAAgB,EAAE,UAAU,CAAA;CAAE,iBA+CnE;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,iBAcnE;AAED,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,iBAchC;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,4 +1,4 @@
|
|
|
1
|
-
import { EthCheatCodes, createEthereumChain, getExpectedAddress, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum';
|
|
1
|
+
import { EthCheatCodes, RollupContract, createEthereumChain, getExpectedAddress, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum';
|
|
2
2
|
import { ForwarderAbi, ForwarderBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
3
3
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
4
4
|
import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
@@ -132,31 +132,25 @@ export async function fastForwardEpochs({ rpcUrls, chainId, rollupAddress, numEp
|
|
|
132
132
|
export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }) {
|
|
133
133
|
const config = getL1ContractsConfigEnvVars();
|
|
134
134
|
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
135
|
-
const rollup =
|
|
136
|
-
|
|
137
|
-
abi: RollupAbi,
|
|
138
|
-
client: publicClient
|
|
139
|
-
});
|
|
140
|
-
const pendingNum = await rollup.read.getPendingBlockNumber();
|
|
135
|
+
const rollup = new RollupContract(publicClient, rollupAddress);
|
|
136
|
+
const pendingNum = await rollup.getBlockNumber();
|
|
141
137
|
log(`Pending block num: ${pendingNum}`);
|
|
142
|
-
const provenNum = await rollup.
|
|
138
|
+
const provenNum = await rollup.getProvenBlockNumber();
|
|
143
139
|
log(`Proven block num: ${provenNum}`);
|
|
144
|
-
const validators = await rollup.
|
|
140
|
+
const validators = await rollup.getAttesters();
|
|
145
141
|
log(`Validators: ${validators.map((v)=>v.toString()).join(', ')}`);
|
|
146
|
-
const committee = await rollup.
|
|
142
|
+
const committee = await rollup.getCurrentEpochCommittee();
|
|
147
143
|
log(`Committee: ${committee.map((v)=>v.toString()).join(', ')}`);
|
|
148
|
-
const archive = await rollup.
|
|
144
|
+
const archive = await rollup.archive();
|
|
149
145
|
log(`Archive: ${archive}`);
|
|
150
|
-
const epochNum = await rollup.
|
|
146
|
+
const epochNum = await rollup.getEpochNumber();
|
|
151
147
|
log(`Current epoch: ${epochNum}`);
|
|
152
|
-
const slot = await rollup.
|
|
148
|
+
const slot = await rollup.getSlotNumber();
|
|
153
149
|
log(`Current slot: ${slot}`);
|
|
154
|
-
const proposerDuringPrevL1Block = await rollup.
|
|
150
|
+
const proposerDuringPrevL1Block = await rollup.getCurrentProposer();
|
|
155
151
|
log(`Proposer during previous L1 block: ${proposerDuringPrevL1Block}`);
|
|
156
152
|
const nextBlockTS = BigInt((await publicClient.getBlock()).timestamp + BigInt(config.ethereumSlotDuration));
|
|
157
|
-
const proposer = await rollup.
|
|
158
|
-
nextBlockTS
|
|
159
|
-
]);
|
|
153
|
+
const proposer = await rollup.getProposerAt(nextBlockTS);
|
|
160
154
|
log(`Proposer NOW: ${proposer.toString()}`);
|
|
161
155
|
}
|
|
162
156
|
function makeDualLog(log, debugLogger) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function generateEncodedBootnodeENR(privateKey: string,
|
|
2
|
+
export declare function generateEncodedBootnodeENR(privateKey: string, p2pIp: string, p2pPort: number, l1ChainId: number, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=generate_bootnode_enr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_bootnode_enr.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_bootnode_enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,
|
|
1
|
+
{"version":3,"file":"generate_bootnode_enr.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_bootnode_enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,KAAK,iBAIX"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBootnodeENRandPeerId } from '@aztec/p2p/enr';
|
|
2
|
-
export async function generateEncodedBootnodeENR(privateKey,
|
|
3
|
-
const { enr } = await createBootnodeENRandPeerId(privateKey,
|
|
2
|
+
export async function generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, l1ChainId, log) {
|
|
3
|
+
const { enr } = await createBootnodeENRandPeerId(privateKey, p2pIp, p2pPort, l1ChainId);
|
|
4
4
|
log(`ENR: ${enr.encodeTxt()}`);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,WAqF1D"}
|
package/dest/cmds/misc/index.js
CHANGED
|
@@ -16,9 +16,9 @@ export function injectCommands(program, log) {
|
|
|
16
16
|
const { generateP2PPrivateKey } = await import('./generate_p2p_private_key.js');
|
|
17
17
|
await generateP2PPrivateKey(log);
|
|
18
18
|
});
|
|
19
|
-
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<
|
|
19
|
+
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<p2pIp>', 'The bootnode P2P IP address').argument('<p2pPort>', 'The bootnode P2P port').addOption(l1ChainIdOption).action(async (privateKey, p2pIp, p2pPort, options)=>{
|
|
20
20
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
21
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
21
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
22
22
|
});
|
|
23
23
|
program.command('decode-enr').summary('Decodes an ENR record').description('Decodes and ENR record').argument('<enr>', 'The encoded ENR string').action(async (enr)=>{
|
|
24
24
|
await printENR(enr, log);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type EthAddress, type
|
|
1
|
+
import { type EthAddress, type PXE, type WaitForProvenOpts } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
3
|
/**
|
|
4
4
|
* Deploys the contract to pay for gas on L2.
|
|
5
5
|
*/
|
|
6
|
-
export declare function setupCanonicalL2FeeJuice(
|
|
6
|
+
export declare function setupCanonicalL2FeeJuice(pxe: PXE, feeJuicePortalAddress: EthAddress, log: LogFn, waitOpts?: import("@aztec/aztec.js").WaitOpts, waitForProvenOptions?: WaitForProvenOpts): Promise<void>;
|
|
7
7
|
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,GAAG,EAER,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,GAAG,EACR,qBAAqB,EAAE,UAAU,EACjC,GAAG,EAAE,KAAK,EACV,QAAQ,qCAAkB,EAC1B,oBAAoB,CAAC,EAAE,iBAAiB,iBA+BzC"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { DefaultWaitOpts, FeeJuicePaymentMethod } from '@aztec/aztec.js';
|
|
1
|
+
import { DefaultWaitOpts, FeeJuicePaymentMethod, SignerlessWallet, waitForProven } from '@aztec/aztec.js';
|
|
2
2
|
import { FEE_JUICE_INITIAL_MINT } from '@aztec/constants';
|
|
3
3
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
4
|
import { Gas } from '@aztec/stdlib/gas';
|
|
5
5
|
/**
|
|
6
6
|
* Deploys the contract to pay for gas on L2.
|
|
7
|
-
*/ export async function setupCanonicalL2FeeJuice(
|
|
7
|
+
*/ export async function setupCanonicalL2FeeJuice(pxe, feeJuicePortalAddress, log, waitOpts = DefaultWaitOpts, waitForProvenOptions) {
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
9
|
// @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
|
|
10
10
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
11
|
+
const deployer = new SignerlessWallet(pxe);
|
|
11
12
|
const feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, deployer);
|
|
12
|
-
const portalAddress = await
|
|
13
|
+
const portalAddress = await pxe.getPublicStorageAt(feeJuiceContract.address, feeJuiceContract.artifact.storageLayout.portal_address.slot);
|
|
13
14
|
if (portalAddress.isZero()) {
|
|
14
15
|
log('setupCanonicalL2FeeJuice: Calling initialize on fee juice contract...');
|
|
15
16
|
const paymentMethod = new FeeJuicePaymentMethod(ProtocolContractAddress.FeeJuice);
|
|
16
|
-
await feeJuiceContract.methods.initialize(feeJuicePortalAddress, FEE_JUICE_INITIAL_MINT).send({
|
|
17
|
+
const receipt = await feeJuiceContract.methods.initialize(feeJuicePortalAddress, FEE_JUICE_INITIAL_MINT).send({
|
|
17
18
|
fee: {
|
|
18
19
|
paymentMethod,
|
|
19
20
|
gasSettings: {
|
|
@@ -21,6 +22,9 @@ import { Gas } from '@aztec/stdlib/gas';
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
}).wait(waitOpts);
|
|
25
|
+
if (waitForProvenOptions !== undefined) {
|
|
26
|
+
await waitForProven(pxe, receipt, waitForProvenOptions);
|
|
27
|
+
}
|
|
24
28
|
} else {
|
|
25
29
|
log('setupCanonicalL2FeeJuice: Fee juice contract already initialized. Fee Juice Portal address: ' + portalAddress.toString());
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBA8D/B"}
|
|
@@ -25,7 +25,8 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
25
25
|
rewardDistributor: info.l1ContractAddresses.rewardDistributorAddress.toString(),
|
|
26
26
|
governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(),
|
|
27
27
|
governance: info.l1ContractAddresses.governanceAddress.toString(),
|
|
28
|
-
slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString()
|
|
28
|
+
slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString(),
|
|
29
|
+
feeAssetHandler: info.l1ContractAddresses.feeAssetHandlerAddress?.toString()
|
|
29
30
|
},
|
|
30
31
|
protocolContractAddresses: {
|
|
31
32
|
classRegisterer: info.protocolContractAddresses.classRegisterer.toString(),
|
|
@@ -52,6 +53,7 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
52
53
|
log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
53
54
|
log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`);
|
|
54
55
|
log(` SlashFactory Address: ${info.l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
56
|
+
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
55
57
|
log(`L2 Contract Addresses:`);
|
|
56
58
|
log(` Class Registerer: ${info.protocolContractAddresses.classRegisterer.toString()}`);
|
|
57
59
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
@@ -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;AAwCD,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
|
@@ -120,9 +120,8 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
120
120
|
function inspectNote(note, artifactMap, log, text = 'Note') {
|
|
121
121
|
const artifact = artifactMap[note.contractAddress.toString()];
|
|
122
122
|
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
123
|
-
|
|
124
|
-
log(`
|
|
125
|
-
log(` Owner: ${toFriendlyAddress(note.owner, artifactMap)}`);
|
|
123
|
+
log(` ${text} at ${contract}`);
|
|
124
|
+
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
126
125
|
for (const field of note.note.items){
|
|
127
126
|
log(` ${field.toString()}`);
|
|
128
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/archiver": "0.
|
|
71
|
-
"@aztec/aztec.js": "0.
|
|
72
|
-
"@aztec/constants": "0.
|
|
73
|
-
"@aztec/foundation": "0.
|
|
74
|
-
"@aztec/l1-artifacts": "0.
|
|
75
|
-
"@aztec/p2p": "0.
|
|
76
|
-
"@aztec/stdlib": "0.
|
|
77
|
-
"@aztec/world-state": "0.
|
|
70
|
+
"@aztec/archiver": "0.82.0",
|
|
71
|
+
"@aztec/aztec.js": "0.82.0",
|
|
72
|
+
"@aztec/constants": "0.82.0",
|
|
73
|
+
"@aztec/foundation": "0.82.0",
|
|
74
|
+
"@aztec/l1-artifacts": "0.82.0",
|
|
75
|
+
"@aztec/p2p": "0.82.0",
|
|
76
|
+
"@aztec/stdlib": "0.82.0",
|
|
77
|
+
"@aztec/world-state": "0.82.0",
|
|
78
78
|
"@iarna/toml": "^2.2.5",
|
|
79
79
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
80
80
|
"commander": "^12.1.0",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"viem": "2.23.7"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@aztec/accounts": "0.
|
|
90
|
-
"@aztec/ethereum": "0.
|
|
91
|
-
"@aztec/protocol-contracts": "0.
|
|
89
|
+
"@aztec/accounts": "0.82.0",
|
|
90
|
+
"@aztec/ethereum": "0.82.0",
|
|
91
|
+
"@aztec/protocol-contracts": "0.82.0",
|
|
92
92
|
"@jest/globals": "^29.5.0",
|
|
93
93
|
"@types/jest": "^29.5.0",
|
|
94
94
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
"typescript": "^5.0.4"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@aztec/accounts": "0.
|
|
108
|
-
"@aztec/bb-prover": "0.
|
|
109
|
-
"@aztec/ethereum": "0.
|
|
110
|
-
"@aztec/l1-artifacts": "0.
|
|
111
|
-
"@aztec/noir-contracts.js": "0.
|
|
112
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
113
|
-
"@aztec/protocol-contracts": "0.
|
|
114
|
-
"@aztec/stdlib": "0.
|
|
107
|
+
"@aztec/accounts": "0.82.0",
|
|
108
|
+
"@aztec/bb-prover": "0.82.0",
|
|
109
|
+
"@aztec/ethereum": "0.82.0",
|
|
110
|
+
"@aztec/l1-artifacts": "0.82.0",
|
|
111
|
+
"@aztec/noir-contracts.js": "0.82.0",
|
|
112
|
+
"@aztec/noir-protocol-circuits-types": "0.82.0",
|
|
113
|
+
"@aztec/protocol-contracts": "0.82.0",
|
|
114
|
+
"@aztec/stdlib": "0.82.0"
|
|
115
115
|
},
|
|
116
116
|
"files": [
|
|
117
117
|
"dest",
|
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
Fr,
|
|
7
7
|
L1FeeJuicePortalManager,
|
|
8
8
|
type PXE,
|
|
9
|
+
type WaitForProvenOpts,
|
|
9
10
|
type WaitOpts,
|
|
10
11
|
type Wallet,
|
|
11
12
|
createCompatibleClient,
|
|
12
13
|
retryUntil,
|
|
14
|
+
waitForProven,
|
|
13
15
|
} from '@aztec/aztec.js';
|
|
14
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
15
16
|
import {
|
|
16
17
|
type ContractArtifacts,
|
|
17
18
|
type L1Clients,
|
|
@@ -32,6 +33,10 @@ type ContractDeploymentInfo = {
|
|
|
32
33
|
|
|
33
34
|
const waitOpts: WaitOpts = {
|
|
34
35
|
timeout: 120,
|
|
36
|
+
interval: 1,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const provenWaitOpts: WaitForProvenOpts = {
|
|
35
40
|
provenTimeout: 4800,
|
|
36
41
|
interval: 1,
|
|
37
42
|
};
|
|
@@ -72,7 +77,7 @@ export async function bootstrapNetwork(
|
|
|
72
77
|
|
|
73
78
|
const counter = await deployCounter(wallet);
|
|
74
79
|
|
|
75
|
-
await fundFPC(counter.address, wallet, l1Clients, fpc.address, debugLog);
|
|
80
|
+
await fundFPC(pxe, counter.address, wallet, l1Clients, fpc.address, debugLog);
|
|
76
81
|
|
|
77
82
|
if (json) {
|
|
78
83
|
log(
|
|
@@ -259,6 +264,7 @@ async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
|
|
|
259
264
|
|
|
260
265
|
// NOTE: Disabling for now in order to get devnet running
|
|
261
266
|
async function fundFPC(
|
|
267
|
+
pxe: PXE,
|
|
262
268
|
counterAddress: AztecAddress,
|
|
263
269
|
wallet: Wallet,
|
|
264
270
|
l1Clients: L1Clients,
|
|
@@ -284,19 +290,13 @@ async function fundFPC(
|
|
|
284
290
|
debugLog,
|
|
285
291
|
);
|
|
286
292
|
|
|
287
|
-
const amount = FEE_FUNDING_FOR_TESTER_ACCOUNT;
|
|
288
293
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
|
|
289
294
|
fpcAddress,
|
|
290
|
-
|
|
295
|
+
undefined,
|
|
291
296
|
true,
|
|
292
297
|
);
|
|
293
298
|
|
|
294
|
-
await retryUntil(
|
|
295
|
-
async () => await wallet.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)),
|
|
296
|
-
'message sync',
|
|
297
|
-
600,
|
|
298
|
-
1,
|
|
299
|
-
);
|
|
299
|
+
await retryUntil(async () => await pxe.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
|
|
300
300
|
|
|
301
301
|
const counter = await CounterContract.at(counterAddress, wallet);
|
|
302
302
|
|
|
@@ -309,10 +309,12 @@ async function fundFPC(
|
|
|
309
309
|
|
|
310
310
|
debugLog.info('Claiming FPC');
|
|
311
311
|
|
|
312
|
-
await feeJuiceContract.methods
|
|
312
|
+
const receipt = await feeJuiceContract.methods
|
|
313
313
|
.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex)
|
|
314
314
|
.send()
|
|
315
|
-
.wait({ ...waitOpts
|
|
315
|
+
.wait({ ...waitOpts });
|
|
316
|
+
|
|
317
|
+
await waitForProven(pxe, receipt, provenWaitOpts);
|
|
316
318
|
|
|
317
319
|
debugLog.info('Finished claiming FPC');
|
|
318
320
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
2
|
+
import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
4
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
5
5
|
|
|
@@ -35,11 +35,7 @@ export async function sequencers(opts: {
|
|
|
35
35
|
})
|
|
36
36
|
: undefined;
|
|
37
37
|
|
|
38
|
-
const rollup =
|
|
39
|
-
address: l1ContractAddresses.rollupAddress.toString(),
|
|
40
|
-
abi: RollupAbi,
|
|
41
|
-
client: publicClient,
|
|
42
|
-
});
|
|
38
|
+
const rollup = new RollupContract(publicClient, l1ContractAddresses.rollupAddress);
|
|
43
39
|
|
|
44
40
|
const writeableRollup = walletClient
|
|
45
41
|
? getContract({
|
|
@@ -52,7 +48,7 @@ export async function sequencers(opts: {
|
|
|
52
48
|
const who = (maybeWho as `0x{string}`) ?? walletClient?.account.address.toString();
|
|
53
49
|
|
|
54
50
|
if (command === 'list') {
|
|
55
|
-
const sequencers = await rollup.
|
|
51
|
+
const sequencers = await rollup.getAttesters();
|
|
56
52
|
if (sequencers.length === 0) {
|
|
57
53
|
log(`No sequencers registered on rollup`);
|
|
58
54
|
} else {
|
|
@@ -69,7 +65,7 @@ export async function sequencers(opts: {
|
|
|
69
65
|
log(`Adding ${who} as sequencer`);
|
|
70
66
|
|
|
71
67
|
const stakingAsset = getContract({
|
|
72
|
-
address: await rollup.
|
|
68
|
+
address: await rollup.getStakingAsset(),
|
|
73
69
|
abi: TestERC20Abi,
|
|
74
70
|
client: walletClient,
|
|
75
71
|
});
|
|
@@ -95,7 +91,7 @@ export async function sequencers(opts: {
|
|
|
95
91
|
await publicClient.waitForTransactionReceipt({ hash });
|
|
96
92
|
log(`Removed in tx ${hash}`);
|
|
97
93
|
} else if (command === 'who-next') {
|
|
98
|
-
const next = await rollup.
|
|
94
|
+
const next = await rollup.getCurrentProposer();
|
|
99
95
|
log(`Sequencer expected to build is ${next}`);
|
|
100
96
|
} else {
|
|
101
97
|
throw new Error(`Unknown command ${command}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InitialAccountData, deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
-
import { type AztecAddress,
|
|
2
|
+
import { type AztecAddress, type WaitForProvenOpts, type WaitOpts, createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
5
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -16,19 +16,24 @@ export async function setupL2Contracts(
|
|
|
16
16
|
const waitOpts: WaitOpts = {
|
|
17
17
|
timeout: 180,
|
|
18
18
|
interval: 1,
|
|
19
|
-
proven: !skipProofWait,
|
|
20
|
-
provenTimeout: 600,
|
|
21
19
|
};
|
|
20
|
+
const waitForProvenOptions: WaitForProvenOpts | undefined = !skipProofWait
|
|
21
|
+
? {
|
|
22
|
+
provenTimeout: 600,
|
|
23
|
+
}
|
|
24
|
+
: undefined;
|
|
22
25
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
26
|
+
if (waitForProvenOptions) {
|
|
27
|
+
log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
|
|
28
|
+
}
|
|
23
29
|
log('setupL2Contracts: Creating PXE client...');
|
|
24
30
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
|
|
25
|
-
const wallet = new SignerlessWallet(pxe);
|
|
26
31
|
|
|
27
32
|
log('setupL2Contracts: Getting fee juice portal address...');
|
|
28
33
|
// Deploy Fee Juice
|
|
29
|
-
const feeJuicePortalAddress = (await
|
|
34
|
+
const feeJuicePortalAddress = (await pxe.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
|
|
30
35
|
log('setupL2Contracts: Setting up fee juice portal...');
|
|
31
|
-
await setupCanonicalL2FeeJuice(
|
|
36
|
+
await setupCanonicalL2FeeJuice(pxe, feeJuicePortalAddress, log, waitOpts, waitForProvenOptions);
|
|
32
37
|
|
|
33
38
|
let deployedAccounts: InitialAccountData[] = [];
|
|
34
39
|
if (testAccounts) {
|
|
@@ -12,6 +12,7 @@ export async function bridgeERC20(
|
|
|
12
12
|
privateKey: string | undefined,
|
|
13
13
|
mnemonic: string,
|
|
14
14
|
tokenAddress: EthAddress,
|
|
15
|
+
handlerAddress: EthAddress | undefined,
|
|
15
16
|
portalAddress: EthAddress,
|
|
16
17
|
privateTransfer: boolean,
|
|
17
18
|
mint: boolean,
|
|
@@ -24,7 +25,14 @@ export async function bridgeERC20(
|
|
|
24
25
|
const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
25
26
|
|
|
26
27
|
// Setup portal manager
|
|
27
|
-
const manager = new L1ToL2TokenPortalManager(
|
|
28
|
+
const manager = new L1ToL2TokenPortalManager(
|
|
29
|
+
portalAddress,
|
|
30
|
+
tokenAddress,
|
|
31
|
+
handlerAddress,
|
|
32
|
+
publicClient,
|
|
33
|
+
walletClient,
|
|
34
|
+
debugLogger,
|
|
35
|
+
);
|
|
28
36
|
let claimSecret: Fr;
|
|
29
37
|
let messageHash: `0x${string}`;
|
|
30
38
|
if (privateTransfer) {
|
|
@@ -61,5 +61,6 @@ export async function deployL1Contracts(
|
|
|
61
61
|
log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
62
62
|
log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`);
|
|
63
63
|
log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
64
|
+
log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
64
65
|
}
|
|
65
66
|
}
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -457,6 +457,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
457
457
|
.addOption(l1ChainIdOption)
|
|
458
458
|
.requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress)
|
|
459
459
|
.requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress)
|
|
460
|
+
.option('-f, --faucet <string>', 'The address of the faucet contract (only used if minting)', parseEthereumAddress)
|
|
460
461
|
.option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
461
462
|
.option('--json', 'Output the claim in JSON format')
|
|
462
463
|
.action(async (amount, recipient, options) => {
|
|
@@ -469,6 +470,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
469
470
|
options.l1PrivateKey,
|
|
470
471
|
options.mnemonic,
|
|
471
472
|
options.token,
|
|
473
|
+
options.faucet,
|
|
472
474
|
options.portal,
|
|
473
475
|
options.private,
|
|
474
476
|
options.mint,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EthCheatCodes,
|
|
3
|
+
RollupContract,
|
|
3
4
|
createEthereumChain,
|
|
4
5
|
getExpectedAddress,
|
|
5
6
|
getL1ContractsConfigEnvVars,
|
|
@@ -181,30 +182,26 @@ export async function fastForwardEpochs({
|
|
|
181
182
|
export async function debugRollup({ rpcUrls, chainId, rollupAddress, log }: RollupCommandArgs & LoggerArgs) {
|
|
182
183
|
const config = getL1ContractsConfigEnvVars();
|
|
183
184
|
const publicClient = getPublicClient(rpcUrls, chainId);
|
|
184
|
-
const rollup =
|
|
185
|
-
address: rollupAddress.toString(),
|
|
186
|
-
abi: RollupAbi,
|
|
187
|
-
client: publicClient,
|
|
188
|
-
});
|
|
185
|
+
const rollup = new RollupContract(publicClient, rollupAddress);
|
|
189
186
|
|
|
190
|
-
const pendingNum = await rollup.
|
|
187
|
+
const pendingNum = await rollup.getBlockNumber();
|
|
191
188
|
log(`Pending block num: ${pendingNum}`);
|
|
192
|
-
const provenNum = await rollup.
|
|
189
|
+
const provenNum = await rollup.getProvenBlockNumber();
|
|
193
190
|
log(`Proven block num: ${provenNum}`);
|
|
194
|
-
const validators = await rollup.
|
|
191
|
+
const validators = await rollup.getAttesters();
|
|
195
192
|
log(`Validators: ${validators.map(v => v.toString()).join(', ')}`);
|
|
196
|
-
const committee = await rollup.
|
|
193
|
+
const committee = await rollup.getCurrentEpochCommittee();
|
|
197
194
|
log(`Committee: ${committee.map(v => v.toString()).join(', ')}`);
|
|
198
|
-
const archive = await rollup.
|
|
195
|
+
const archive = await rollup.archive();
|
|
199
196
|
log(`Archive: ${archive}`);
|
|
200
|
-
const epochNum = await rollup.
|
|
197
|
+
const epochNum = await rollup.getEpochNumber();
|
|
201
198
|
log(`Current epoch: ${epochNum}`);
|
|
202
|
-
const slot = await rollup.
|
|
199
|
+
const slot = await rollup.getSlotNumber();
|
|
203
200
|
log(`Current slot: ${slot}`);
|
|
204
|
-
const proposerDuringPrevL1Block = await rollup.
|
|
201
|
+
const proposerDuringPrevL1Block = await rollup.getCurrentProposer();
|
|
205
202
|
log(`Proposer during previous L1 block: ${proposerDuringPrevL1Block}`);
|
|
206
203
|
const nextBlockTS = BigInt((await publicClient.getBlock()).timestamp + BigInt(config.ethereumSlotDuration));
|
|
207
|
-
const proposer = await rollup.
|
|
204
|
+
const proposer = await rollup.getProposerAt(nextBlockTS);
|
|
208
205
|
log(`Proposer NOW: ${proposer.toString()}`);
|
|
209
206
|
}
|
|
210
207
|
|
|
@@ -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
|
}
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -35,11 +35,12 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
35
35
|
.summary('Generates the encoded ENR record for a bootnode.')
|
|
36
36
|
.description('Generates the encoded ENR record for a bootnode.')
|
|
37
37
|
.argument('<privateKey>', 'The peer id private key of the bootnode')
|
|
38
|
-
.argument('<
|
|
38
|
+
.argument('<p2pIp>', 'The bootnode P2P IP address')
|
|
39
|
+
.argument('<p2pPort>', 'The bootnode P2P port')
|
|
39
40
|
.addOption(l1ChainIdOption)
|
|
40
|
-
.action(async (privateKey: string,
|
|
41
|
+
.action(async (privateKey: string, p2pIp: string, p2pPort: number, options) => {
|
|
41
42
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
42
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
43
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
program
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DefaultWaitOpts,
|
|
3
|
+
type EthAddress,
|
|
4
|
+
FeeJuicePaymentMethod,
|
|
5
|
+
type PXE,
|
|
6
|
+
SignerlessWallet,
|
|
7
|
+
type WaitForProvenOpts,
|
|
8
|
+
waitForProven,
|
|
9
|
+
} from '@aztec/aztec.js';
|
|
2
10
|
import { FEE_JUICE_INITIAL_MINT } from '@aztec/constants';
|
|
3
11
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
12
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -8,18 +16,21 @@ import { Gas } from '@aztec/stdlib/gas';
|
|
|
8
16
|
* Deploys the contract to pay for gas on L2.
|
|
9
17
|
*/
|
|
10
18
|
export async function setupCanonicalL2FeeJuice(
|
|
11
|
-
|
|
19
|
+
pxe: PXE,
|
|
12
20
|
feeJuicePortalAddress: EthAddress,
|
|
13
|
-
waitOpts = DefaultWaitOpts,
|
|
14
21
|
log: LogFn,
|
|
22
|
+
waitOpts = DefaultWaitOpts,
|
|
23
|
+
waitForProvenOptions?: WaitForProvenOpts,
|
|
15
24
|
) {
|
|
16
25
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
26
|
// @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
|
|
18
27
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
19
28
|
|
|
29
|
+
const deployer = new SignerlessWallet(pxe);
|
|
30
|
+
|
|
20
31
|
const feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, deployer);
|
|
21
32
|
|
|
22
|
-
const portalAddress = await
|
|
33
|
+
const portalAddress = await pxe.getPublicStorageAt(
|
|
23
34
|
feeJuiceContract.address,
|
|
24
35
|
feeJuiceContract.artifact.storageLayout.portal_address.slot,
|
|
25
36
|
);
|
|
@@ -27,10 +38,13 @@ export async function setupCanonicalL2FeeJuice(
|
|
|
27
38
|
if (portalAddress.isZero()) {
|
|
28
39
|
log('setupCanonicalL2FeeJuice: Calling initialize on fee juice contract...');
|
|
29
40
|
const paymentMethod = new FeeJuicePaymentMethod(ProtocolContractAddress.FeeJuice);
|
|
30
|
-
await feeJuiceContract.methods
|
|
41
|
+
const receipt = await feeJuiceContract.methods
|
|
31
42
|
.initialize(feeJuicePortalAddress, FEE_JUICE_INITIAL_MINT)
|
|
32
43
|
.send({ fee: { paymentMethod, gasSettings: { teardownGasLimits: Gas.empty() } } })
|
|
33
44
|
.wait(waitOpts);
|
|
45
|
+
if (waitForProvenOptions !== undefined) {
|
|
46
|
+
await waitForProven(pxe, receipt, waitForProvenOptions);
|
|
47
|
+
}
|
|
34
48
|
} else {
|
|
35
49
|
log(
|
|
36
50
|
'setupCanonicalL2FeeJuice: Fee juice contract already initialized. Fee Juice Portal address: ' +
|
|
@@ -35,6 +35,7 @@ export async function getNodeInfo(
|
|
|
35
35
|
governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(),
|
|
36
36
|
governance: info.l1ContractAddresses.governanceAddress.toString(),
|
|
37
37
|
slashFactory: info.l1ContractAddresses.slashFactoryAddress?.toString(),
|
|
38
|
+
feeAssetHandler: info.l1ContractAddresses.feeAssetHandlerAddress?.toString(),
|
|
38
39
|
},
|
|
39
40
|
protocolContractAddresses: {
|
|
40
41
|
classRegisterer: info.protocolContractAddresses.classRegisterer.toString(),
|
|
@@ -61,7 +62,7 @@ export async function getNodeInfo(
|
|
|
61
62
|
log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
62
63
|
log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`);
|
|
63
64
|
log(` SlashFactory Address: ${info.l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
64
|
-
|
|
65
|
+
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
65
66
|
log(`L2 Contract Addresses:`);
|
|
66
67
|
log(` Class Registerer: ${info.protocolContractAddresses.classRegisterer.toString()}`);
|
|
67
68
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
package/src/utils/inspect.ts
CHANGED
|
@@ -142,9 +142,8 @@ export async function inspectTx(
|
|
|
142
142
|
function inspectNote(note: ExtendedNote, artifactMap: ArtifactMap, log: LogFn, text = 'Note') {
|
|
143
143
|
const artifact = artifactMap[note.contractAddress.toString()];
|
|
144
144
|
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
145
|
-
|
|
146
|
-
log(`
|
|
147
|
-
log(` Owner: ${toFriendlyAddress(note.owner, artifactMap)}`);
|
|
145
|
+
log(` ${text} at ${contract}`);
|
|
146
|
+
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
148
147
|
for (const field of note.note.items) {
|
|
149
148
|
log(` ${field.toString()}`);
|
|
150
149
|
}
|