@aztec/cli 1.0.0-nightly.20250805 → 1.0.0-nightly.20250807
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/cmds/infrastructure/sequencers.d.ts +1 -0
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +10 -3
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +2 -1
- package/dest/cmds/l1/update_l1_validators.d.ts +2 -1
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +16 -5
- package/dest/utils/aztec.d.ts +1 -1
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +6 -2
- package/package.json +22 -22
- package/src/cmds/infrastructure/sequencers.ts +17 -4
- package/src/cmds/l1/index.ts +6 -0
- package/src/cmds/l1/update_l1_validators.ts +30 -4
- package/src/utils/aztec.ts +12 -3
|
@@ -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,GAAG,OAAO,CAAC;IAC1D,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,GAAG,OAAO,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,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,iBAoGA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
1
|
+
import { Fr, createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
+
import { GSEContract, 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';
|
|
6
6
|
export async function sequencers(opts) {
|
|
7
|
-
const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
|
|
7
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
|
|
8
8
|
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
9
9
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
10
10
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
@@ -45,6 +45,10 @@ export async function sequencers(opts) {
|
|
|
45
45
|
client: walletClient
|
|
46
46
|
});
|
|
47
47
|
const config = getL1ContractsConfigEnvVars();
|
|
48
|
+
const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
|
|
49
|
+
const gseAddress = await rollup.getGSE();
|
|
50
|
+
const gseContract = new GSEContract(publicClient, gseAddress);
|
|
51
|
+
const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
|
|
48
52
|
await Promise.all([
|
|
49
53
|
await stakingAsset.write.mint([
|
|
50
54
|
walletClient.account.address,
|
|
@@ -60,6 +64,9 @@ export async function sequencers(opts) {
|
|
|
60
64
|
const hash = await writeableRollup.write.deposit([
|
|
61
65
|
who,
|
|
62
66
|
who,
|
|
67
|
+
registrationTuple.publicKeyInG1,
|
|
68
|
+
registrationTuple.publicKeyInG2,
|
|
69
|
+
registrationTuple.proofOfPossession,
|
|
63
70
|
true
|
|
64
71
|
]);
|
|
65
72
|
await publicClient.waitForTransactionReceipt({
|
|
@@ -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;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAajD,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;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAajD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WA6iB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -95,7 +95,7 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
95
95
|
const account = generateL1Account();
|
|
96
96
|
log(JSON.stringify(account, null, 2));
|
|
97
97
|
});
|
|
98
|
-
program.command('add-l1-validator').description('Adds a validator to the L1 rollup contract.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use sending the transaction', 'test test test test test test test test test test test junk').addOption(l1ChainIdOption).option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress).option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress).option('--proof <buffer>', 'The proof to use for the attestation', (arg)=>Buffer.from(withoutHexPrefix(arg), 'hex')).option('--merkle-proof <string>', 'The merkle proof to use for the attestation (comma separated list of 32 byte buffers)', (arg)=>arg.split(',')).action(async (options)=>{
|
|
98
|
+
program.command('add-l1-validator').description('Adds a validator to the L1 rollup contract.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use sending the transaction', 'test test test test test test test test test test test junk').addOption(l1ChainIdOption).option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress).option('--bls-secret-key <string>', 'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.', parseBigint).option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress).option('--proof <buffer>', 'The proof to use for the attestation', (arg)=>Buffer.from(withoutHexPrefix(arg), 'hex')).option('--merkle-proof <string>', 'The merkle proof to use for the attestation (comma separated list of 32 byte buffers)', (arg)=>arg.split(',')).action(async (options)=>{
|
|
99
99
|
const { addL1Validator } = await import('./update_l1_validators.js');
|
|
100
100
|
await addL1Validator({
|
|
101
101
|
rpcUrls: options.l1RpcUrls,
|
|
@@ -106,6 +106,7 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
106
106
|
stakingAssetHandlerAddress: options.stakingAssetHandler,
|
|
107
107
|
merkleProof: options.merkleProof,
|
|
108
108
|
proofParams: options.proof,
|
|
109
|
+
blsSecretKey: options.blsSecretKey,
|
|
109
110
|
log,
|
|
110
111
|
debugLogger
|
|
111
112
|
});
|
|
@@ -23,7 +23,8 @@ export declare function generateL1Account(): {
|
|
|
23
23
|
privateKey: `0x${string}`;
|
|
24
24
|
address: `0x${string}`;
|
|
25
25
|
};
|
|
26
|
-
export declare function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, log, debugLogger, }: StakingAssetHandlerCommandArgs & LoggerArgs & {
|
|
26
|
+
export declare function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, blsSecretKey, log, debugLogger, }: StakingAssetHandlerCommandArgs & LoggerArgs & {
|
|
27
|
+
blsSecretKey: bigint;
|
|
27
28
|
attesterAddress: EthAddress;
|
|
28
29
|
proofParams: Buffer;
|
|
29
30
|
merkleProof: string[];
|
|
@@ -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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AAiB,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,4 +1,4 @@
|
|
|
1
|
-
import { L1TxUtils, RollupContract, createEthereumChain, createExtendedL1Client, getL1ContractsConfigEnvVars, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
|
|
1
|
+
import { GSEContract, L1TxUtils, RollupContract, createEthereumChain, createExtendedL1Client, getL1ContractsConfigEnvVars, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
|
|
2
2
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
import { RollupAbi, StakingAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
4
4
|
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
@@ -14,7 +14,7 @@ export function generateL1Account() {
|
|
|
14
14
|
address: account.address
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, log, debugLogger }) {
|
|
17
|
+
export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, blsSecretKey, log, debugLogger }) {
|
|
18
18
|
const dualLog = makeDualLog(log, debugLogger);
|
|
19
19
|
const account = getAccount(privateKey, mnemonic);
|
|
20
20
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
@@ -24,8 +24,16 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
|
|
|
24
24
|
abi: StakingAssetHandlerAbi,
|
|
25
25
|
client: l1Client
|
|
26
26
|
});
|
|
27
|
-
const
|
|
28
|
-
dualLog(`Adding validator ${attesterAddress} to rollup ${
|
|
27
|
+
const rollupAddress = await stakingAssetHandler.read.getRollup();
|
|
28
|
+
dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()}`);
|
|
29
|
+
const rollup = getContract({
|
|
30
|
+
address: rollupAddress,
|
|
31
|
+
abi: RollupAbi,
|
|
32
|
+
client: l1Client
|
|
33
|
+
});
|
|
34
|
+
const gseAddress = await rollup.read.getGSE();
|
|
35
|
+
const gse = new GSEContract(l1Client, gseAddress);
|
|
36
|
+
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
29
37
|
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
30
38
|
const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
|
|
31
39
|
const merkleProofArray = merkleProof.map((proof)=>addLeadingHex(proof));
|
|
@@ -37,7 +45,10 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
|
|
|
37
45
|
args: [
|
|
38
46
|
attesterAddress.toString(),
|
|
39
47
|
merkleProofArray,
|
|
40
|
-
proofParamsObj.toViem()
|
|
48
|
+
proofParamsObj.toViem(),
|
|
49
|
+
registrationTuple.publicKeyInG1,
|
|
50
|
+
registrationTuple.publicKeyInG2,
|
|
51
|
+
registrationTuple.proofOfPossession
|
|
41
52
|
]
|
|
42
53
|
}),
|
|
43
54
|
abi: StakingAssetHandlerAbi
|
package/dest/utils/aztec.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EthAddress, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type L1ContractsConfig, type Operator, RollupContract } from '@aztec/ethereum';
|
|
4
|
-
import
|
|
4
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
6
6
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,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,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9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,GAAI,KAAK,MAAM,KAAG,KAAK,MAAM,EAKtD,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE;AAKD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,iBAyB9E"}
|
package/dest/utils/aztec.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import { FunctionType, getAllFunctionAbis, loadContractArtifact } from '@aztec/aztec.js/abi';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
4
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
4
5
|
import TOML from '@iarna/toml';
|
|
5
6
|
import { readFile } from 'fs/promises';
|
|
@@ -54,11 +55,14 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
54
55
|
const client = createExtendedL1Client(rpcUrls, account, chain.chainInfo, undefined, mnemonicIndex);
|
|
55
56
|
if (!initialValidators || initialValidators.length === 0) {
|
|
56
57
|
// initialize the new rollup with Amin's validator address.
|
|
57
|
-
const
|
|
58
|
+
const aminAddressString = '0x3b218d0F26d15B36C715cB06c949210a0d630637';
|
|
59
|
+
const amin = EthAddress.fromString(aminAddressString);
|
|
58
60
|
initialValidators = [
|
|
59
61
|
{
|
|
60
62
|
attester: amin,
|
|
61
|
-
withdrawer: amin
|
|
63
|
+
withdrawer: amin,
|
|
64
|
+
// No secrets here. The actual keys are not currently used.
|
|
65
|
+
bn254SecretKey: Fr.fromHexString(aminAddressString).toBigInt()
|
|
62
66
|
}
|
|
63
67
|
];
|
|
64
68
|
logger.info('Initializing new rollup with old attesters', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250807",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
73
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
75
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
76
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
77
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
78
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
79
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
81
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
72
|
+
"@aztec/archiver": "1.0.0-nightly.20250807",
|
|
73
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250807",
|
|
74
|
+
"@aztec/constants": "1.0.0-nightly.20250807",
|
|
75
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250807",
|
|
76
|
+
"@aztec/ethereum": "1.0.0-nightly.20250807",
|
|
77
|
+
"@aztec/foundation": "1.0.0-nightly.20250807",
|
|
78
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250807",
|
|
79
|
+
"@aztec/p2p": "1.0.0-nightly.20250807",
|
|
80
|
+
"@aztec/stdlib": "1.0.0-nightly.20250807",
|
|
81
|
+
"@aztec/world-state": "1.0.0-nightly.20250807",
|
|
82
82
|
"@iarna/toml": "^2.2.5",
|
|
83
83
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
84
84
|
"commander": "^12.1.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"viem": "2.23.7"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
94
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
93
|
+
"@aztec/accounts": "1.0.0-nightly.20250807",
|
|
94
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250807",
|
|
95
95
|
"@jest/globals": "^30.0.0",
|
|
96
96
|
"@types/jest": "^30.0.0",
|
|
97
97
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -107,15 +107,15 @@
|
|
|
107
107
|
"typescript": "^5.3.3"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
111
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
112
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
113
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
114
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
115
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
116
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
117
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
118
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
110
|
+
"@aztec/accounts": "1.0.0-nightly.20250807",
|
|
111
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250807",
|
|
112
|
+
"@aztec/ethereum": "1.0.0-nightly.20250807",
|
|
113
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250807",
|
|
114
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250807",
|
|
115
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250807",
|
|
116
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250807",
|
|
117
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250807",
|
|
118
|
+
"@aztec/stdlib": "1.0.0-nightly.20250807"
|
|
119
119
|
},
|
|
120
120
|
"files": [
|
|
121
121
|
"dest",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
1
|
+
import { Fr, createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
+
import { GSEContract, 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
|
|
|
@@ -10,6 +10,7 @@ export async function sequencers(opts: {
|
|
|
10
10
|
command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
|
|
11
11
|
who?: string;
|
|
12
12
|
mnemonic?: string;
|
|
13
|
+
bn254SecretKey?: bigint;
|
|
13
14
|
rpcUrl: string;
|
|
14
15
|
l1RpcUrls: string[];
|
|
15
16
|
chainId: number;
|
|
@@ -17,7 +18,7 @@ export async function sequencers(opts: {
|
|
|
17
18
|
log: LogFn;
|
|
18
19
|
debugLogger: Logger;
|
|
19
20
|
}) {
|
|
20
|
-
const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
|
|
21
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
|
|
21
22
|
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
22
23
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
23
24
|
|
|
@@ -72,6 +73,11 @@ export async function sequencers(opts: {
|
|
|
72
73
|
|
|
73
74
|
const config = getL1ContractsConfigEnvVars();
|
|
74
75
|
|
|
76
|
+
const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
|
|
77
|
+
const gseAddress = await rollup.getGSE();
|
|
78
|
+
const gseContract = new GSEContract(publicClient, gseAddress);
|
|
79
|
+
const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
|
|
80
|
+
|
|
75
81
|
await Promise.all(
|
|
76
82
|
[
|
|
77
83
|
await stakingAsset.write.mint([walletClient.account.address, config.activationThreshold], {} as any),
|
|
@@ -79,7 +85,14 @@ export async function sequencers(opts: {
|
|
|
79
85
|
].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
|
|
80
86
|
);
|
|
81
87
|
|
|
82
|
-
const hash = await writeableRollup.write.deposit([
|
|
88
|
+
const hash = await writeableRollup.write.deposit([
|
|
89
|
+
who,
|
|
90
|
+
who,
|
|
91
|
+
registrationTuple.publicKeyInG1,
|
|
92
|
+
registrationTuple.publicKeyInG2,
|
|
93
|
+
registrationTuple.proofOfPossession,
|
|
94
|
+
true,
|
|
95
|
+
]);
|
|
83
96
|
await publicClient.waitForTransactionReceipt({ hash });
|
|
84
97
|
log(`Added in tx ${hash}`);
|
|
85
98
|
} else if (command === 'flush') {
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -293,6 +293,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
293
293
|
)
|
|
294
294
|
.addOption(l1ChainIdOption)
|
|
295
295
|
.option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress)
|
|
296
|
+
.option(
|
|
297
|
+
'--bls-secret-key <string>',
|
|
298
|
+
'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.',
|
|
299
|
+
parseBigint,
|
|
300
|
+
)
|
|
296
301
|
.option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress)
|
|
297
302
|
.option('--proof <buffer>', 'The proof to use for the attestation', arg =>
|
|
298
303
|
Buffer.from(withoutHexPrefix(arg), 'hex'),
|
|
@@ -313,6 +318,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
313
318
|
stakingAssetHandlerAddress: options.stakingAssetHandler,
|
|
314
319
|
merkleProof: options.merkleProof,
|
|
315
320
|
proofParams: options.proof,
|
|
321
|
+
blsSecretKey: options.blsSecretKey,
|
|
316
322
|
log,
|
|
317
323
|
debugLogger,
|
|
318
324
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
GSEContract,
|
|
2
3
|
L1TxUtils,
|
|
3
4
|
RollupContract,
|
|
4
5
|
createEthereumChain,
|
|
@@ -59,10 +60,16 @@ export async function addL1Validator({
|
|
|
59
60
|
stakingAssetHandlerAddress,
|
|
60
61
|
merkleProof,
|
|
61
62
|
proofParams,
|
|
63
|
+
blsSecretKey,
|
|
62
64
|
log,
|
|
63
65
|
debugLogger,
|
|
64
66
|
}: StakingAssetHandlerCommandArgs &
|
|
65
|
-
LoggerArgs & {
|
|
67
|
+
LoggerArgs & {
|
|
68
|
+
blsSecretKey: bigint; // scalar field element of BN254
|
|
69
|
+
attesterAddress: EthAddress;
|
|
70
|
+
proofParams: Buffer;
|
|
71
|
+
merkleProof: string[];
|
|
72
|
+
}) {
|
|
66
73
|
const dualLog = makeDualLog(log, debugLogger);
|
|
67
74
|
const account = getAccount(privateKey, mnemonic);
|
|
68
75
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
@@ -74,8 +81,20 @@ export async function addL1Validator({
|
|
|
74
81
|
client: l1Client,
|
|
75
82
|
});
|
|
76
83
|
|
|
77
|
-
const
|
|
78
|
-
dualLog(`Adding validator ${attesterAddress} to rollup ${
|
|
84
|
+
const rollupAddress = await stakingAssetHandler.read.getRollup();
|
|
85
|
+
dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()}`);
|
|
86
|
+
|
|
87
|
+
const rollup = getContract({
|
|
88
|
+
address: rollupAddress,
|
|
89
|
+
abi: RollupAbi,
|
|
90
|
+
client: l1Client,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const gseAddress = await rollup.read.getGSE();
|
|
94
|
+
|
|
95
|
+
const gse = new GSEContract(l1Client, gseAddress);
|
|
96
|
+
|
|
97
|
+
const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
|
|
79
98
|
|
|
80
99
|
const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
|
|
81
100
|
const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
|
|
@@ -86,7 +105,14 @@ export async function addL1Validator({
|
|
|
86
105
|
data: encodeFunctionData({
|
|
87
106
|
abi: StakingAssetHandlerAbi,
|
|
88
107
|
functionName: 'addValidator',
|
|
89
|
-
args: [
|
|
108
|
+
args: [
|
|
109
|
+
attesterAddress.toString(),
|
|
110
|
+
merkleProofArray,
|
|
111
|
+
proofParamsObj.toViem(),
|
|
112
|
+
registrationTuple.publicKeyInG1,
|
|
113
|
+
registrationTuple.publicKeyInG2,
|
|
114
|
+
registrationTuple.proofOfPossession,
|
|
115
|
+
],
|
|
90
116
|
}),
|
|
91
117
|
abi: StakingAssetHandlerAbi,
|
|
92
118
|
});
|
package/src/utils/aztec.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type Operator,
|
|
13
13
|
RollupContract,
|
|
14
14
|
} from '@aztec/ethereum';
|
|
15
|
-
import
|
|
15
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
16
16
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
17
17
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
18
18
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
@@ -116,8 +116,17 @@ export async function deployNewRollupContracts(
|
|
|
116
116
|
|
|
117
117
|
if (!initialValidators || initialValidators.length === 0) {
|
|
118
118
|
// initialize the new rollup with Amin's validator address.
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const aminAddressString = '0x3b218d0F26d15B36C715cB06c949210a0d630637';
|
|
120
|
+
const amin = EthAddress.fromString(aminAddressString);
|
|
121
|
+
|
|
122
|
+
initialValidators = [
|
|
123
|
+
{
|
|
124
|
+
attester: amin,
|
|
125
|
+
withdrawer: amin,
|
|
126
|
+
// No secrets here. The actual keys are not currently used.
|
|
127
|
+
bn254SecretKey: Fr.fromHexString(aminAddressString).toBigInt(),
|
|
128
|
+
},
|
|
129
|
+
];
|
|
121
130
|
logger.info('Initializing new rollup with old attesters', { initialValidators });
|
|
122
131
|
}
|
|
123
132
|
|