@aztec/ethereum 3.0.0-nightly.20250923 → 3.0.0-nightly.20250925
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/config.js +3 -3
- package/dest/deploy_l1_contracts.d.ts +5 -1
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +42 -32
- package/dest/test/eth_cheat_codes.d.ts +10 -3
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +9 -3
- package/dest/test/rollup_cheat_codes.d.ts +3 -8
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +3 -4
- package/dest/test/upgrade_utils.d.ts.map +1 -1
- package/dest/test/upgrade_utils.js +2 -1
- package/package.json +5 -5
- package/src/config.ts +3 -3
- package/src/deploy_l1_contracts.ts +89 -46
- package/src/test/eth_cheat_codes.ts +11 -5
- package/src/test/rollup_cheat_codes.ts +8 -12
- package/src/test/upgrade_utils.ts +2 -1
package/dest/config.js
CHANGED
|
@@ -146,11 +146,11 @@ const TestnetEntryQueueConfig = {
|
|
|
146
146
|
maxQueueFlushSize: 32n
|
|
147
147
|
};
|
|
148
148
|
const StagingIgnitionEntryQueueConfig = {
|
|
149
|
-
bootstrapValidatorSetSize:
|
|
150
|
-
bootstrapFlushSize:
|
|
149
|
+
bootstrapValidatorSetSize: 24n,
|
|
150
|
+
bootstrapFlushSize: 24n,
|
|
151
151
|
normalFlushSizeMin: 1n,
|
|
152
152
|
normalFlushSizeQuotient: 2048n,
|
|
153
|
-
maxQueueFlushSize:
|
|
153
|
+
maxQueueFlushSize: 24n
|
|
154
154
|
};
|
|
155
155
|
export const getEntryQueueConfig = (networkName)=>{
|
|
156
156
|
switch(networkName){
|
|
@@ -173,7 +173,10 @@ export declare class L1Deployer {
|
|
|
173
173
|
constructor(client: ExtendedViemWalletClient, maybeSalt: number | undefined, dateProvider?: DateProvider, acceleratedTestDeployments?: boolean, logger?: Logger, txUtilsConfig?: L1TxUtilsConfig | undefined, createVerificationJson?: boolean);
|
|
174
174
|
deploy<const TAbi extends Abi>(params: ContractArtifacts<TAbi>, args?: ContractConstructorArgs<TAbi>, opts?: {
|
|
175
175
|
gasLimit?: bigint;
|
|
176
|
-
}): Promise<
|
|
176
|
+
}): Promise<{
|
|
177
|
+
address: EthAddress;
|
|
178
|
+
existed: boolean;
|
|
179
|
+
}>;
|
|
177
180
|
waitForDeployments(): Promise<void>;
|
|
178
181
|
sendTransaction(tx: L1TxRequest, options?: L1GasConfig): Promise<{
|
|
179
182
|
txHash: Hex;
|
|
@@ -202,6 +205,7 @@ export declare function deployL1Contract(extendedClient: ExtendedViemWalletClien
|
|
|
202
205
|
address: EthAddress;
|
|
203
206
|
txHash: Hex | undefined;
|
|
204
207
|
deployedLibraries?: VerificationLibraryEntry[];
|
|
208
|
+
existed: boolean;
|
|
205
209
|
}>;
|
|
206
210
|
export declare function getExpectedAddress(abi: Narrow<Abi | readonly unknown[]>, bytecode: Hex, args: readonly unknown[], salt: Hex): {
|
|
207
211
|
address: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../src/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAwB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EACL,KAAK,KAAK,EACV,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,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AGlE;AAGD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,wBAAwB,EACxC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,SAAS,OAAO,EAAE,CAAC,EACrC,QAAQ,EAAE,GAAG,EACb,IAAI,GAAE,SAAS,OAAO,EAAO,EAC7B,IAAI,GAAE;IACJ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACjC,GACL,OAAO,CAAC;IACT,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,GAAG,GAAG,SAAS,CAAC;IACxB,iBAAiB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC/C,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAkJD;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,SAAS,OAAO,EAAE,CAAC,EACrC,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,IAAI,EAAE,GAAG;;;;EAeV"}
|
|
@@ -25,31 +25,31 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
25
25
|
const networkName = getActiveNetworkName();
|
|
26
26
|
logger.info(`Deploying shared contracts for network configuration: ${networkName}`);
|
|
27
27
|
const txHashes = [];
|
|
28
|
-
const feeAssetAddress = await deployer.deploy(FeeAssetArtifact, [
|
|
28
|
+
const { address: feeAssetAddress } = await deployer.deploy(FeeAssetArtifact, [
|
|
29
29
|
'FeeJuice',
|
|
30
30
|
'FEE',
|
|
31
31
|
l1Client.account.address
|
|
32
32
|
]);
|
|
33
33
|
logger.verbose(`Deployed Fee Asset at ${feeAssetAddress}`);
|
|
34
|
-
const stakingAssetAddress = await deployer.deploy(StakingAssetArtifact, [
|
|
34
|
+
const { address: stakingAssetAddress } = await deployer.deploy(StakingAssetArtifact, [
|
|
35
35
|
'Staking',
|
|
36
36
|
'STK',
|
|
37
37
|
l1Client.account.address
|
|
38
38
|
]);
|
|
39
39
|
logger.verbose(`Deployed Staking Asset at ${stakingAssetAddress}`);
|
|
40
|
-
const gseAddress = await deployer.deploy(GSEArtifact, [
|
|
40
|
+
const gseAddress = (await deployer.deploy(GSEArtifact, [
|
|
41
41
|
l1Client.account.address,
|
|
42
42
|
stakingAssetAddress.toString(),
|
|
43
43
|
args.activationThreshold,
|
|
44
44
|
args.ejectionThreshold
|
|
45
|
-
]);
|
|
45
|
+
])).address;
|
|
46
46
|
logger.verbose(`Deployed GSE at ${gseAddress}`);
|
|
47
|
-
const registryAddress = await deployer.deploy(RegistryArtifact, [
|
|
47
|
+
const { address: registryAddress } = await deployer.deploy(RegistryArtifact, [
|
|
48
48
|
l1Client.account.address,
|
|
49
49
|
feeAssetAddress.toString()
|
|
50
50
|
]);
|
|
51
51
|
logger.verbose(`Deployed Registry at ${registryAddress}`);
|
|
52
|
-
const governanceProposerAddress = await deployer.deploy(GovernanceProposerArtifact, [
|
|
52
|
+
const { address: governanceProposerAddress } = await deployer.deploy(GovernanceProposerArtifact, [
|
|
53
53
|
registryAddress.toString(),
|
|
54
54
|
gseAddress.toString(),
|
|
55
55
|
BigInt(args.governanceProposerQuorum ?? args.governanceProposerRoundSize / 2 + 1),
|
|
@@ -58,7 +58,7 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
58
58
|
logger.verbose(`Deployed GovernanceProposer at ${governanceProposerAddress}`);
|
|
59
59
|
// @note @LHerskind the assets are expected to be the same at some point, but for better
|
|
60
60
|
// configurability they are different for now.
|
|
61
|
-
const governanceAddress = await deployer.deploy(GovernanceArtifact, [
|
|
61
|
+
const { address: governanceAddress } = await deployer.deploy(GovernanceArtifact, [
|
|
62
62
|
stakingAssetAddress.toString(),
|
|
63
63
|
governanceProposerAddress.toString(),
|
|
64
64
|
gseAddress.toString(),
|
|
@@ -98,11 +98,11 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
98
98
|
logger.verbose(`Set governance on GSE in ${txHash}`);
|
|
99
99
|
txHashes.push(txHash);
|
|
100
100
|
}
|
|
101
|
-
const coinIssuerAddress = await deployer.deploy(CoinIssuerArtifact, [
|
|
101
|
+
const coinIssuerAddress = (await deployer.deploy(CoinIssuerArtifact, [
|
|
102
102
|
feeAssetAddress.toString(),
|
|
103
103
|
25_000_000_000n * 10n ** 18n / (60n * 60n * 24n * 365n),
|
|
104
104
|
l1Client.account.address
|
|
105
|
-
]);
|
|
105
|
+
])).address;
|
|
106
106
|
logger.verbose(`Deployed CoinIssuer at ${coinIssuerAddress}`);
|
|
107
107
|
logger.verbose(`Waiting for deployments to complete`);
|
|
108
108
|
await deployer.waitForDeployments();
|
|
@@ -112,11 +112,11 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
112
112
|
let zkPassportVerifierAddress = undefined;
|
|
113
113
|
// Only if not on mainnet will we deploy the handlers
|
|
114
114
|
if (l1Client.chain.id !== 1) {
|
|
115
|
-
/* -------------------------------------------------------------------------- */ /* CHEAT CODES START HERE */ /* -------------------------------------------------------------------------- */ feeAssetHandlerAddress = await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
115
|
+
/* -------------------------------------------------------------------------- */ /* CHEAT CODES START HERE */ /* -------------------------------------------------------------------------- */ feeAssetHandlerAddress = (await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
116
116
|
l1Client.account.address,
|
|
117
117
|
feeAssetAddress.toString(),
|
|
118
118
|
BigInt(1000n * 10n ** 18n)
|
|
119
|
-
]);
|
|
119
|
+
])).address;
|
|
120
120
|
logger.verbose(`Deployed FeeAssetHandler at ${feeAssetHandlerAddress}`);
|
|
121
121
|
// Only if we are "fresh" will we be adding as a minter, otherwise above will simply get same address
|
|
122
122
|
if (needToSetGovernance) {
|
|
@@ -162,9 +162,9 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
162
162
|
skipBindCheck: args.zkPassportArgs?.mockZkPassportVerifier ?? false,
|
|
163
163
|
skipMerkleCheck: true
|
|
164
164
|
};
|
|
165
|
-
stakingAssetHandlerAddress = await deployer.deploy(StakingAssetHandlerArtifact, [
|
|
165
|
+
stakingAssetHandlerAddress = (await deployer.deploy(StakingAssetHandlerArtifact, [
|
|
166
166
|
stakingAssetHandlerDeployArgs
|
|
167
|
-
]);
|
|
167
|
+
])).address;
|
|
168
168
|
logger.verbose(`Deployed StakingAssetHandler at ${stakingAssetHandlerAddress}`);
|
|
169
169
|
const { txHash: stakingMinterTxHash } = await deployer.sendTransaction({
|
|
170
170
|
to: stakingAssetAddress.toString(),
|
|
@@ -218,7 +218,7 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
218
218
|
};
|
|
219
219
|
const getZkPassportVerifierAddress = async (deployer, args)=>{
|
|
220
220
|
if (args.zkPassportArgs?.mockZkPassportVerifier) {
|
|
221
|
-
return await deployer.deploy(mockVerifiers.mockZkPassportVerifier);
|
|
221
|
+
return (await deployer.deploy(mockVerifiers.mockZkPassportVerifier)).address;
|
|
222
222
|
}
|
|
223
223
|
return ZK_PASSPORT_VERIFIER_ADDRESS;
|
|
224
224
|
};
|
|
@@ -252,17 +252,17 @@ const getZkPassportVerifierAddress = async (deployer, args)=>{
|
|
|
252
252
|
};
|
|
253
253
|
};
|
|
254
254
|
export const deploySlashFactory = async (deployer, rollupAddress, logger)=>{
|
|
255
|
-
const slashFactoryAddress = await deployer.deploy(SlashFactoryArtifact, [
|
|
255
|
+
const slashFactoryAddress = (await deployer.deploy(SlashFactoryArtifact, [
|
|
256
256
|
rollupAddress
|
|
257
|
-
]);
|
|
257
|
+
])).address;
|
|
258
258
|
logger.verbose(`Deployed SlashFactory at ${slashFactoryAddress}`);
|
|
259
259
|
return slashFactoryAddress;
|
|
260
260
|
};
|
|
261
261
|
export const deployUpgradePayload = async (deployer, addresses)=>{
|
|
262
|
-
const payloadAddress = await deployer.deploy(RegisterNewRollupVersionPayloadArtifact, [
|
|
262
|
+
const payloadAddress = (await deployer.deploy(RegisterNewRollupVersionPayloadArtifact, [
|
|
263
263
|
addresses.registryAddress.toString(),
|
|
264
264
|
addresses.rollupAddress.toString()
|
|
265
|
-
]);
|
|
265
|
+
])).address;
|
|
266
266
|
return payloadAddress;
|
|
267
267
|
};
|
|
268
268
|
function slasherFlavorToSolidityEnum(flavor) {
|
|
@@ -291,10 +291,10 @@ function slasherFlavorToSolidityEnum(flavor) {
|
|
|
291
291
|
const txHashes = [];
|
|
292
292
|
let epochProofVerifier = EthAddress.ZERO;
|
|
293
293
|
if (args.realVerifier) {
|
|
294
|
-
epochProofVerifier = await deployer.deploy(l1ArtifactsVerifiers.honkVerifier);
|
|
294
|
+
epochProofVerifier = (await deployer.deploy(l1ArtifactsVerifiers.honkVerifier)).address;
|
|
295
295
|
logger.verbose(`Rollup will use the real verifier at ${epochProofVerifier}`);
|
|
296
296
|
} else {
|
|
297
|
-
epochProofVerifier = await deployer.deploy(mockVerifiers.mockVerifier);
|
|
297
|
+
epochProofVerifier = (await deployer.deploy(mockVerifiers.mockVerifier)).address;
|
|
298
298
|
logger.verbose(`Rollup will use the mock verifier at ${epochProofVerifier}`);
|
|
299
299
|
}
|
|
300
300
|
const rewardConfig = {
|
|
@@ -350,10 +350,10 @@ function slasherFlavorToSolidityEnum(flavor) {
|
|
|
350
350
|
genesisStateArgs,
|
|
351
351
|
rollupConfigArgs
|
|
352
352
|
];
|
|
353
|
-
const rollupAddress = await deployer.deploy(RollupArtifact, rollupArgs, {
|
|
353
|
+
const { address: rollupAddress, existed: rollupExisted } = await deployer.deploy(RollupArtifact, rollupArgs, {
|
|
354
354
|
gasLimit: 15_000_000n
|
|
355
355
|
});
|
|
356
|
-
logger.verbose(`Deployed Rollup at ${rollupAddress}`, rollupConfigArgs);
|
|
356
|
+
logger.verbose(`Deployed Rollup at ${rollupAddress}, already existed: ${rollupExisted}`, rollupConfigArgs);
|
|
357
357
|
const rollupContract = new RollupContract(extendedClient, rollupAddress);
|
|
358
358
|
await deployer.waitForDeployments();
|
|
359
359
|
logger.verbose(`All core contracts have been deployed`);
|
|
@@ -374,9 +374,9 @@ function slasherFlavorToSolidityEnum(flavor) {
|
|
|
374
374
|
logger.verbose(`Funding fee juice portal with ${args.feeJuicePortalInitialBalance} fee juice in ${mintTxHash} (accelerated test deployments)`);
|
|
375
375
|
txHashes.push(mintTxHash);
|
|
376
376
|
}
|
|
377
|
-
const slashFactoryAddress = await deployer.deploy(SlashFactoryArtifact, [
|
|
377
|
+
const slashFactoryAddress = (await deployer.deploy(SlashFactoryArtifact, [
|
|
378
378
|
rollupAddress.toString()
|
|
379
|
-
]);
|
|
379
|
+
])).address;
|
|
380
380
|
logger.verbose(`Deployed SlashFactory at ${slashFactoryAddress}`);
|
|
381
381
|
// We need to call a function on the registry to set the various contract addresses.
|
|
382
382
|
const registryContract = getContract({
|
|
@@ -440,7 +440,11 @@ function slasherFlavorToSolidityEnum(flavor) {
|
|
|
440
440
|
} else {
|
|
441
441
|
logger.verbose(`Not the owner of the gse, skipping rollup addition`);
|
|
442
442
|
}
|
|
443
|
-
|
|
443
|
+
const activeAttestorCount = await rollupContract.getActiveAttesterCount();
|
|
444
|
+
const queuedAttestorCount = await rollupContract.getEntryQueueLength();
|
|
445
|
+
logger.info(`Rollup has ${activeAttestorCount} active attestors and ${queuedAttestorCount} queued attestors`);
|
|
446
|
+
const shouldAddValidators = activeAttestorCount === 0n && queuedAttestorCount === 0n;
|
|
447
|
+
if (args.initialValidators && shouldAddValidators && await gseContract.read.isRollupRegistered([
|
|
444
448
|
rollupContract.address
|
|
445
449
|
])) {
|
|
446
450
|
await addMultipleValidators(extendedClient, deployer, addresses.gseAddress.toString(), rollupAddress.toString(), addresses.stakingAssetAddress.toString(), args.initialValidators, args.acceleratedTestDeployments, logger);
|
|
@@ -606,10 +610,10 @@ export const handoverToGovernance = async (extendedClient, deployer, registryAdd
|
|
|
606
610
|
return;
|
|
607
611
|
}
|
|
608
612
|
const gseContract = new GSEContract(extendedClient, gseAddress);
|
|
609
|
-
const multiAdder = await deployer.deploy(MultiAdderArtifact, [
|
|
613
|
+
const multiAdder = (await deployer.deploy(MultiAdderArtifact, [
|
|
610
614
|
rollupAddress,
|
|
611
615
|
deployer.client.account.address
|
|
612
|
-
]);
|
|
616
|
+
])).address;
|
|
613
617
|
const makeValidatorTuples = async (validator)=>{
|
|
614
618
|
const registrationTuple = await gseContract.makeRegistrationTuple(validator.bn254SecretKey.getValue());
|
|
615
619
|
return {
|
|
@@ -701,11 +705,11 @@ export const handoverToGovernance = async (extendedClient, deployer, registryAdd
|
|
|
701
705
|
* @param logger - The logger.
|
|
702
706
|
*/ // eslint-disable-next-line camelcase
|
|
703
707
|
export const cheat_initializeFeeAssetHandler = async (extendedClient, deployer, feeAssetAddress, logger)=>{
|
|
704
|
-
const feeAssetHandlerAddress = await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
708
|
+
const feeAssetHandlerAddress = (await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
705
709
|
extendedClient.account.address,
|
|
706
710
|
feeAssetAddress.toString(),
|
|
707
711
|
BigInt(1e18)
|
|
708
|
-
]);
|
|
712
|
+
])).address;
|
|
709
713
|
logger.verbose(`Deployed FeeAssetHandler at ${feeAssetHandlerAddress}`);
|
|
710
714
|
const { txHash } = await deployer.sendTransaction({
|
|
711
715
|
to: feeAssetAddress.toString(),
|
|
@@ -1037,7 +1041,7 @@ export class L1Deployer {
|
|
|
1037
1041
|
args
|
|
1038
1042
|
});
|
|
1039
1043
|
try {
|
|
1040
|
-
const { txHash, address, deployedLibraries } = await deployL1Contract(this.client, params.contractAbi, params.contractBytecode, args ?? [], {
|
|
1044
|
+
const { txHash, address, deployedLibraries, existed } = await deployL1Contract(this.client, params.contractAbi, params.contractBytecode, args ?? [], {
|
|
1041
1045
|
salt: this.salt,
|
|
1042
1046
|
libraries: params.libraries,
|
|
1043
1047
|
logger: this.logger,
|
|
@@ -1068,7 +1072,10 @@ export class L1Deployer {
|
|
|
1068
1072
|
libraries: deployedLibraries ?? []
|
|
1069
1073
|
});
|
|
1070
1074
|
}
|
|
1071
|
-
return
|
|
1075
|
+
return {
|
|
1076
|
+
address,
|
|
1077
|
+
existed
|
|
1078
|
+
};
|
|
1072
1079
|
} catch (error) {
|
|
1073
1080
|
throw new Error(`Failed to deploy ${params.name}`, {
|
|
1074
1081
|
cause: formatViemError(error)
|
|
@@ -1194,6 +1201,7 @@ export class L1Deployer {
|
|
|
1194
1201
|
logger?.verbose(`Skipping waiting for linked libraries to be deployed ${acceleratedTestDeployments ? '(accelerated test deployments)' : ''}`);
|
|
1195
1202
|
}
|
|
1196
1203
|
}
|
|
1204
|
+
let existed = false;
|
|
1197
1205
|
if (saltFromOpts) {
|
|
1198
1206
|
logger?.info(`Deploying contract with salt ${saltFromOpts}`);
|
|
1199
1207
|
const { address, paddedSalt: salt, calldata } = getExpectedAddress(abi, bytecode, args, saltFromOpts);
|
|
@@ -1236,6 +1244,7 @@ export class L1Deployer {
|
|
|
1236
1244
|
logger?.verbose(`Deployed contract with salt ${salt} to address ${resultingAddress} in tx ${txHash}.`);
|
|
1237
1245
|
} else {
|
|
1238
1246
|
logger?.verbose(`Skipping existing deployment of contract with salt ${salt} to address ${resultingAddress}`);
|
|
1247
|
+
existed = true;
|
|
1239
1248
|
}
|
|
1240
1249
|
} else {
|
|
1241
1250
|
const deployData = encodeDeployData({
|
|
@@ -1256,7 +1265,8 @@ export class L1Deployer {
|
|
|
1256
1265
|
return {
|
|
1257
1266
|
address: EthAddress.fromString(resultingAddress),
|
|
1258
1267
|
txHash,
|
|
1259
|
-
deployedLibraries
|
|
1268
|
+
deployedLibraries,
|
|
1269
|
+
existed
|
|
1260
1270
|
};
|
|
1261
1271
|
}
|
|
1262
1272
|
export function getExpectedAddress(abi, bytecode, args, salt) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
2
|
+
import type { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
3
3
|
import { type Hex } from 'viem';
|
|
4
4
|
import type { ViemPublicClient } from '../types.js';
|
|
5
5
|
/**
|
|
@@ -10,6 +10,10 @@ export declare class EthCheatCodes {
|
|
|
10
10
|
* The RPC URL to use for interacting with the chain
|
|
11
11
|
*/
|
|
12
12
|
rpcUrls: string[];
|
|
13
|
+
/**
|
|
14
|
+
* The date provider to use for time operations
|
|
15
|
+
*/
|
|
16
|
+
dateProvider: DateProvider | TestDateProvider;
|
|
13
17
|
/**
|
|
14
18
|
* The logger to use for the eth cheatcodes
|
|
15
19
|
*/
|
|
@@ -20,6 +24,10 @@ export declare class EthCheatCodes {
|
|
|
20
24
|
* The RPC URL to use for interacting with the chain
|
|
21
25
|
*/
|
|
22
26
|
rpcUrls: string[],
|
|
27
|
+
/**
|
|
28
|
+
* The date provider to use for time operations
|
|
29
|
+
*/
|
|
30
|
+
dateProvider: DateProvider | TestDateProvider,
|
|
23
31
|
/**
|
|
24
32
|
* The logger to use for the eth cheatcodes
|
|
25
33
|
*/
|
|
@@ -104,13 +112,12 @@ export declare class EthCheatCodes {
|
|
|
104
112
|
/**
|
|
105
113
|
* Set the next block timestamp and mines the block.
|
|
106
114
|
* Optionally resets interval mining so the next block is mined in `blockInterval` seconds from now.
|
|
107
|
-
*
|
|
115
|
+
* Always updates the injected date provider to follow L1 time.
|
|
108
116
|
* @param timestamp - The timestamp to set the next block to
|
|
109
117
|
*/
|
|
110
118
|
warp(timestamp: number | bigint, opts?: {
|
|
111
119
|
silent?: boolean;
|
|
112
120
|
resetBlockInterval?: boolean;
|
|
113
|
-
updateDateProvider?: TestDateProvider;
|
|
114
121
|
}): Promise<void>;
|
|
115
122
|
/**
|
|
116
123
|
* Load the value at a storage slot of a contract address on eth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/eth_cheat_codes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"eth_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/eth_cheat_codes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,KAAK,GAAG,EAAsC,MAAM,MAAM,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,qBAAa,aAAa;IAGtB;;OAEG;IACI,OAAO,EAAE,MAAM,EAAE;IACxB;;OAEG;IACI,YAAY,EAAE,YAAY,GAAG,gBAAgB;IACpD;;OAEG;IACI,MAAM;IAbf,SAAgB,YAAY,EAAE,gBAAgB,CAAC;;IAE7C;;OAEG;IACI,OAAO,EAAE,MAAM,EAAE;IACxB;;OAEG;IACI,YAAY,EAAE,YAAY,GAAG,gBAAgB;IACpD;;OAEG;IACI,MAAM,yCAAuC;IAOhD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE;IAS3C;;;OAGG;IACU,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAU7C;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAK3C;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAKvC;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzC;;;OAGG;IACU,IAAI,CAA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AAE,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,GAAG,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,EAAE,EAAO,GAClH,OAAO,CAAC,IAAI,CAAC;IAaT,gBAAgB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAIrC,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAgCtE"}
|
|
@@ -7,14 +7,18 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
7
7
|
* A class that provides utility functions for interacting with ethereum (L1).
|
|
8
8
|
*/ export class EthCheatCodes {
|
|
9
9
|
rpcUrls;
|
|
10
|
+
dateProvider;
|
|
10
11
|
logger;
|
|
11
12
|
publicClient;
|
|
12
13
|
constructor(/**
|
|
13
14
|
* The RPC URL to use for interacting with the chain
|
|
14
15
|
*/ rpcUrls, /**
|
|
16
|
+
* The date provider to use for time operations
|
|
17
|
+
*/ dateProvider, /**
|
|
15
18
|
* The logger to use for the eth cheatcodes
|
|
16
19
|
*/ logger = createLogger('ethereum:cheat_codes')){
|
|
17
20
|
this.rpcUrls = rpcUrls;
|
|
21
|
+
this.dateProvider = dateProvider;
|
|
18
22
|
this.logger = logger;
|
|
19
23
|
this.publicClient = createPublicClient({
|
|
20
24
|
transport: fallback(this.rpcUrls.map((url)=>http(url)))
|
|
@@ -206,7 +210,7 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
206
210
|
/**
|
|
207
211
|
* Set the next block timestamp and mines the block.
|
|
208
212
|
* Optionally resets interval mining so the next block is mined in `blockInterval` seconds from now.
|
|
209
|
-
*
|
|
213
|
+
* Always updates the injected date provider to follow L1 time.
|
|
210
214
|
* @param timestamp - The timestamp to set the next block to
|
|
211
215
|
*/ async warp(timestamp, opts = {}) {
|
|
212
216
|
let blockInterval = null;
|
|
@@ -226,8 +230,10 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
226
230
|
]);
|
|
227
231
|
// And mine a block so the timestamp goes into effect now
|
|
228
232
|
await this.doMine();
|
|
229
|
-
// Update the date provider
|
|
230
|
-
|
|
233
|
+
// Update the injected date provider so it follows L1 time
|
|
234
|
+
if ('setTime' in this.dateProvider) {
|
|
235
|
+
this.dateProvider.setTime(Number(timestamp) * 1000);
|
|
236
|
+
}
|
|
231
237
|
} catch (err) {
|
|
232
238
|
throw new Error(`Error warping: ${err}`);
|
|
233
239
|
} finally{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ViemPublicClient } from '@aztec/ethereum';
|
|
2
2
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
4
4
|
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
5
5
|
import { type GetContractReturnType, type Hex } from 'viem';
|
|
6
6
|
import { EthCheatCodes } from './eth_cheat_codes.js';
|
|
@@ -11,7 +11,7 @@ export declare class RollupCheatCodes {
|
|
|
11
11
|
private rollup;
|
|
12
12
|
private logger;
|
|
13
13
|
constructor(ethCheatCodes: EthCheatCodes, addresses: Pick<L1ContractAddresses, 'rollupAddress'>);
|
|
14
|
-
static create(rpcUrls: string[], addresses: Pick<L1ContractAddresses, 'rollupAddress'
|
|
14
|
+
static create(rpcUrls: string[], addresses: Pick<L1ContractAddresses, 'rollupAddress'>, dateProvider: DateProvider): RollupCheatCodes;
|
|
15
15
|
/** Returns the current slot */
|
|
16
16
|
getSlot(): Promise<bigint>;
|
|
17
17
|
/** Returns the current epoch */
|
|
@@ -39,16 +39,11 @@ export declare class RollupCheatCodes {
|
|
|
39
39
|
* @param opts - Options
|
|
40
40
|
*/
|
|
41
41
|
advanceToEpoch(epoch: bigint | number, opts?: {
|
|
42
|
-
/** Optional test date provider to update with the epoch timestamp */
|
|
43
|
-
updateDateProvider?: TestDateProvider;
|
|
44
42
|
/** Offset in seconds */
|
|
45
43
|
offset?: number;
|
|
46
44
|
}): Promise<bigint>;
|
|
47
45
|
/** Warps time in L1 until the next epoch */
|
|
48
|
-
advanceToNextEpoch(
|
|
49
|
-
/** Optional test date provider to update with the epoch timestamp */
|
|
50
|
-
updateDateProvider?: TestDateProvider;
|
|
51
|
-
}): Promise<void>;
|
|
46
|
+
advanceToNextEpoch(): Promise<void>;
|
|
52
47
|
/** Warps time in L1 until the beginning of the next slot. */
|
|
53
48
|
advanceToNextSlot(): Promise<bigint[]>;
|
|
54
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/rollup_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAGjF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"rollup_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/rollup_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAGjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,GAAG,EAMT,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,8CAA8C;AAC9C,qBAAa,gBAAgB;IAOzB,OAAO,CAAC,aAAa;IANvB,OA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E,gBAAgB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;IAQ1G;;OAEG;IACU,UAAU;IASvB,4CAA4C;IAC/B,oBAAoB;IAQjC;;;OAGG;IACU,sBAAsB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;IAMtE;;;OAGG;IACU,qBAAqB,CAAC,QAAQ,EAAE,MAAM;CAWpD"}
|
|
@@ -23,8 +23,8 @@ import { EthCheatCodes } from './eth_cheat_codes.js';
|
|
|
23
23
|
client: this.client
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
static create(rpcUrls, addresses) {
|
|
27
|
-
const ethCheatCodes = new EthCheatCodes(rpcUrls);
|
|
26
|
+
static create(rpcUrls, addresses, dateProvider) {
|
|
27
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrls, dateProvider);
|
|
28
28
|
return new RollupCheatCodes(ethCheatCodes, addresses);
|
|
29
29
|
}
|
|
30
30
|
/** Returns the current slot */ async getSlot() {
|
|
@@ -99,14 +99,13 @@ import { EthCheatCodes } from './eth_cheat_codes.js';
|
|
|
99
99
|
}
|
|
100
100
|
return timestamp;
|
|
101
101
|
}
|
|
102
|
-
/** Warps time in L1 until the next epoch */ async advanceToNextEpoch(
|
|
102
|
+
/** Warps time in L1 until the next epoch */ async advanceToNextEpoch() {
|
|
103
103
|
const slot = await this.getSlot();
|
|
104
104
|
const { epochDuration, slotDuration } = await this.getConfig();
|
|
105
105
|
const slotsUntilNextEpoch = epochDuration - slot % epochDuration + 1n;
|
|
106
106
|
const timeToNextEpoch = slotsUntilNextEpoch * slotDuration;
|
|
107
107
|
const l1Timestamp = BigInt((await this.client.getBlock()).timestamp);
|
|
108
108
|
await this.ethCheatCodes.warp(Number(l1Timestamp + timeToNextEpoch), {
|
|
109
|
-
...opts,
|
|
110
109
|
silent: true,
|
|
111
110
|
resetBlockInterval: true
|
|
112
111
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade_utils.d.ts","sourceRoot":"","sources":["../../src/test/upgrade_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade_utils.d.ts","sourceRoot":"","sources":["../../src/test/upgrade_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAe,MAAM,MAAM,CAAC;AAGvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG9E,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,qBAAqB,CAAC,OAAO,aAAa,EAAE,gBAAgB,CAAC,EACzE,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,MAAM,iBAmCf;AAED,wBAAsB,wBAAwB,CAC5C,cAAc,EAAE,KAAK,MAAM,EAAE,EAC7B,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EAAE,gBAAgB,EAC9B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IACT,UAAU,EAAE,qBAAqB,CAAC,OAAO,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAyCD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
1
2
|
import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi';
|
|
2
3
|
import { TestERC20Abi as StakingAssetAbi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
3
4
|
import { getContract } from 'viem';
|
|
@@ -15,7 +16,7 @@ export async function executeGovernanceProposal(proposalId, governance, voteAmou
|
|
|
15
16
|
value: 1n
|
|
16
17
|
});
|
|
17
18
|
};
|
|
18
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, logger);
|
|
19
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), logger);
|
|
19
20
|
const timeToActive = proposal.creation + proposal.config.votingDelay;
|
|
20
21
|
logger.info(`Warping to ${timeToActive + 1n}`);
|
|
21
22
|
await cheatCodes.warp(Number(timeToActive + 1n));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/ethereum",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250925",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"../package.common.json"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
36
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
37
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250925",
|
|
35
|
+
"@aztec/constants": "3.0.0-nightly.20250925",
|
|
36
|
+
"@aztec/foundation": "3.0.0-nightly.20250925",
|
|
37
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250925",
|
|
38
38
|
"@viem/anvil": "^0.0.10",
|
|
39
39
|
"dotenv": "^16.0.3",
|
|
40
40
|
"lodash.chunk": "^4.2.0",
|
package/src/config.ts
CHANGED
|
@@ -232,11 +232,11 @@ const TestnetEntryQueueConfig = {
|
|
|
232
232
|
};
|
|
233
233
|
|
|
234
234
|
const StagingIgnitionEntryQueueConfig = {
|
|
235
|
-
bootstrapValidatorSetSize:
|
|
236
|
-
bootstrapFlushSize:
|
|
235
|
+
bootstrapValidatorSetSize: 24n,
|
|
236
|
+
bootstrapFlushSize: 24n,
|
|
237
237
|
normalFlushSizeMin: 1n,
|
|
238
238
|
normalFlushSizeQuotient: 2048n,
|
|
239
|
-
maxQueueFlushSize:
|
|
239
|
+
maxQueueFlushSize: 24n,
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
export const getEntryQueueConfig = (networkName: NetworkNames) => {
|
|
@@ -6,7 +6,7 @@ import type { Fr } from '@aztec/foundation/fields';
|
|
|
6
6
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
7
7
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
8
8
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
|
-
import
|
|
9
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
10
10
|
|
|
11
11
|
import type { Abi, Narrow } from 'abitype';
|
|
12
12
|
import { mkdir, writeFile } from 'fs/promises';
|
|
@@ -187,27 +187,37 @@ export const deploySharedContracts = async (
|
|
|
187
187
|
|
|
188
188
|
const txHashes: Hex[] = [];
|
|
189
189
|
|
|
190
|
-
const feeAssetAddress = await deployer.deploy(FeeAssetArtifact, [
|
|
190
|
+
const { address: feeAssetAddress } = await deployer.deploy(FeeAssetArtifact, [
|
|
191
|
+
'FeeJuice',
|
|
192
|
+
'FEE',
|
|
193
|
+
l1Client.account.address,
|
|
194
|
+
]);
|
|
191
195
|
logger.verbose(`Deployed Fee Asset at ${feeAssetAddress}`);
|
|
192
196
|
|
|
193
|
-
const stakingAssetAddress = await deployer.deploy(StakingAssetArtifact, [
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const gseAddress = await deployer.deploy(GSEArtifact, [
|
|
197
|
+
const { address: stakingAssetAddress } = await deployer.deploy(StakingAssetArtifact, [
|
|
198
|
+
'Staking',
|
|
199
|
+
'STK',
|
|
197
200
|
l1Client.account.address,
|
|
198
|
-
stakingAssetAddress.toString(),
|
|
199
|
-
args.activationThreshold,
|
|
200
|
-
args.ejectionThreshold,
|
|
201
201
|
]);
|
|
202
|
+
logger.verbose(`Deployed Staking Asset at ${stakingAssetAddress}`);
|
|
203
|
+
|
|
204
|
+
const gseAddress = (
|
|
205
|
+
await deployer.deploy(GSEArtifact, [
|
|
206
|
+
l1Client.account.address,
|
|
207
|
+
stakingAssetAddress.toString(),
|
|
208
|
+
args.activationThreshold,
|
|
209
|
+
args.ejectionThreshold,
|
|
210
|
+
])
|
|
211
|
+
).address;
|
|
202
212
|
logger.verbose(`Deployed GSE at ${gseAddress}`);
|
|
203
213
|
|
|
204
|
-
const registryAddress = await deployer.deploy(RegistryArtifact, [
|
|
214
|
+
const { address: registryAddress } = await deployer.deploy(RegistryArtifact, [
|
|
205
215
|
l1Client.account.address,
|
|
206
216
|
feeAssetAddress.toString(),
|
|
207
217
|
]);
|
|
208
218
|
logger.verbose(`Deployed Registry at ${registryAddress}`);
|
|
209
219
|
|
|
210
|
-
const governanceProposerAddress = await deployer.deploy(GovernanceProposerArtifact, [
|
|
220
|
+
const { address: governanceProposerAddress } = await deployer.deploy(GovernanceProposerArtifact, [
|
|
211
221
|
registryAddress.toString(),
|
|
212
222
|
gseAddress.toString(),
|
|
213
223
|
BigInt(args.governanceProposerQuorum ?? args.governanceProposerRoundSize / 2 + 1),
|
|
@@ -217,7 +227,7 @@ export const deploySharedContracts = async (
|
|
|
217
227
|
|
|
218
228
|
// @note @LHerskind the assets are expected to be the same at some point, but for better
|
|
219
229
|
// configurability they are different for now.
|
|
220
|
-
const governanceAddress = await deployer.deploy(GovernanceArtifact, [
|
|
230
|
+
const { address: governanceAddress } = await deployer.deploy(GovernanceArtifact, [
|
|
221
231
|
stakingAssetAddress.toString(),
|
|
222
232
|
governanceProposerAddress.toString(),
|
|
223
233
|
gseAddress.toString(),
|
|
@@ -259,11 +269,13 @@ export const deploySharedContracts = async (
|
|
|
259
269
|
txHashes.push(txHash);
|
|
260
270
|
}
|
|
261
271
|
|
|
262
|
-
const coinIssuerAddress =
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
272
|
+
const coinIssuerAddress = (
|
|
273
|
+
await deployer.deploy(CoinIssuerArtifact, [
|
|
274
|
+
feeAssetAddress.toString(),
|
|
275
|
+
(25_000_000_000n * 10n ** 18n) / (60n * 60n * 24n * 365n),
|
|
276
|
+
l1Client.account.address,
|
|
277
|
+
])
|
|
278
|
+
).address;
|
|
267
279
|
logger.verbose(`Deployed CoinIssuer at ${coinIssuerAddress}`);
|
|
268
280
|
|
|
269
281
|
logger.verbose(`Waiting for deployments to complete`);
|
|
@@ -281,11 +293,13 @@ export const deploySharedContracts = async (
|
|
|
281
293
|
/* CHEAT CODES START HERE */
|
|
282
294
|
/* -------------------------------------------------------------------------- */
|
|
283
295
|
|
|
284
|
-
feeAssetHandlerAddress =
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
296
|
+
feeAssetHandlerAddress = (
|
|
297
|
+
await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
298
|
+
l1Client.account.address,
|
|
299
|
+
feeAssetAddress.toString(),
|
|
300
|
+
BigInt(1000n * 10n ** 18n),
|
|
301
|
+
])
|
|
302
|
+
).address;
|
|
289
303
|
logger.verbose(`Deployed FeeAssetHandler at ${feeAssetHandlerAddress}`);
|
|
290
304
|
|
|
291
305
|
// Only if we are "fresh" will we be adding as a minter, otherwise above will simply get same address
|
|
@@ -328,7 +342,8 @@ export const deploySharedContracts = async (
|
|
|
328
342
|
skipMerkleCheck: true, // skip merkle check - needed for testing without generating proofs
|
|
329
343
|
} as const;
|
|
330
344
|
|
|
331
|
-
stakingAssetHandlerAddress = await deployer.deploy(StakingAssetHandlerArtifact, [stakingAssetHandlerDeployArgs])
|
|
345
|
+
stakingAssetHandlerAddress = (await deployer.deploy(StakingAssetHandlerArtifact, [stakingAssetHandlerDeployArgs]))
|
|
346
|
+
.address;
|
|
332
347
|
logger.verbose(`Deployed StakingAssetHandler at ${stakingAssetHandlerAddress}`);
|
|
333
348
|
|
|
334
349
|
const { txHash: stakingMinterTxHash } = await deployer.sendTransaction({
|
|
@@ -399,7 +414,7 @@ export const deploySharedContracts = async (
|
|
|
399
414
|
|
|
400
415
|
const getZkPassportVerifierAddress = async (deployer: L1Deployer, args: DeployL1ContractsArgs): Promise<EthAddress> => {
|
|
401
416
|
if (args.zkPassportArgs?.mockZkPassportVerifier) {
|
|
402
|
-
return await deployer.deploy(mockVerifiers.mockZkPassportVerifier);
|
|
417
|
+
return (await deployer.deploy(mockVerifiers.mockZkPassportVerifier)).address;
|
|
403
418
|
}
|
|
404
419
|
return ZK_PASSPORT_VERIFIER_ADDRESS;
|
|
405
420
|
};
|
|
@@ -452,7 +467,7 @@ export const deployRollupForUpgrade = async (
|
|
|
452
467
|
};
|
|
453
468
|
|
|
454
469
|
export const deploySlashFactory = async (deployer: L1Deployer, rollupAddress: Hex, logger: Logger) => {
|
|
455
|
-
const slashFactoryAddress = await deployer.deploy(SlashFactoryArtifact, [rollupAddress]);
|
|
470
|
+
const slashFactoryAddress = (await deployer.deploy(SlashFactoryArtifact, [rollupAddress])).address;
|
|
456
471
|
logger.verbose(`Deployed SlashFactory at ${slashFactoryAddress}`);
|
|
457
472
|
return slashFactoryAddress;
|
|
458
473
|
};
|
|
@@ -461,10 +476,12 @@ export const deployUpgradePayload = async (
|
|
|
461
476
|
deployer: L1Deployer,
|
|
462
477
|
addresses: Pick<L1ContractAddresses, 'registryAddress' | 'rollupAddress'>,
|
|
463
478
|
) => {
|
|
464
|
-
const payloadAddress =
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
479
|
+
const payloadAddress = (
|
|
480
|
+
await deployer.deploy(RegisterNewRollupVersionPayloadArtifact, [
|
|
481
|
+
addresses.registryAddress.toString(),
|
|
482
|
+
addresses.rollupAddress.toString(),
|
|
483
|
+
])
|
|
484
|
+
).address;
|
|
468
485
|
|
|
469
486
|
return payloadAddress;
|
|
470
487
|
};
|
|
@@ -517,10 +534,10 @@ export const deployRollup = async (
|
|
|
517
534
|
let epochProofVerifier = EthAddress.ZERO;
|
|
518
535
|
|
|
519
536
|
if (args.realVerifier) {
|
|
520
|
-
epochProofVerifier = await deployer.deploy(l1ArtifactsVerifiers.honkVerifier);
|
|
537
|
+
epochProofVerifier = (await deployer.deploy(l1ArtifactsVerifiers.honkVerifier)).address;
|
|
521
538
|
logger.verbose(`Rollup will use the real verifier at ${epochProofVerifier}`);
|
|
522
539
|
} else {
|
|
523
|
-
epochProofVerifier = await deployer.deploy(mockVerifiers.mockVerifier);
|
|
540
|
+
epochProofVerifier = (await deployer.deploy(mockVerifiers.mockVerifier)).address;
|
|
524
541
|
logger.verbose(`Rollup will use the mock verifier at ${epochProofVerifier}`);
|
|
525
542
|
}
|
|
526
543
|
|
|
@@ -582,8 +599,10 @@ export const deployRollup = async (
|
|
|
582
599
|
rollupConfigArgs,
|
|
583
600
|
] as const;
|
|
584
601
|
|
|
585
|
-
const rollupAddress = await deployer.deploy(RollupArtifact, rollupArgs, {
|
|
586
|
-
|
|
602
|
+
const { address: rollupAddress, existed: rollupExisted } = await deployer.deploy(RollupArtifact, rollupArgs, {
|
|
603
|
+
gasLimit: 15_000_000n,
|
|
604
|
+
});
|
|
605
|
+
logger.verbose(`Deployed Rollup at ${rollupAddress}, already existed: ${rollupExisted}`, rollupConfigArgs);
|
|
587
606
|
|
|
588
607
|
const rollupContract = new RollupContract(extendedClient, rollupAddress);
|
|
589
608
|
|
|
@@ -608,7 +627,7 @@ export const deployRollup = async (
|
|
|
608
627
|
txHashes.push(mintTxHash);
|
|
609
628
|
}
|
|
610
629
|
|
|
611
|
-
const slashFactoryAddress = await deployer.deploy(SlashFactoryArtifact, [rollupAddress.toString()]);
|
|
630
|
+
const slashFactoryAddress = (await deployer.deploy(SlashFactoryArtifact, [rollupAddress.toString()])).address;
|
|
612
631
|
logger.verbose(`Deployed SlashFactory at ${slashFactoryAddress}`);
|
|
613
632
|
|
|
614
633
|
// We need to call a function on the registry to set the various contract addresses.
|
|
@@ -670,7 +689,17 @@ export const deployRollup = async (
|
|
|
670
689
|
logger.verbose(`Not the owner of the gse, skipping rollup addition`);
|
|
671
690
|
}
|
|
672
691
|
|
|
673
|
-
|
|
692
|
+
const activeAttestorCount = await rollupContract.getActiveAttesterCount();
|
|
693
|
+
const queuedAttestorCount = await rollupContract.getEntryQueueLength();
|
|
694
|
+
logger.info(`Rollup has ${activeAttestorCount} active attestors and ${queuedAttestorCount} queued attestors`);
|
|
695
|
+
|
|
696
|
+
const shouldAddValidators = activeAttestorCount === 0n && queuedAttestorCount === 0n;
|
|
697
|
+
|
|
698
|
+
if (
|
|
699
|
+
args.initialValidators &&
|
|
700
|
+
shouldAddValidators &&
|
|
701
|
+
(await gseContract.read.isRollupRegistered([rollupContract.address]))
|
|
702
|
+
) {
|
|
674
703
|
await addMultipleValidators(
|
|
675
704
|
extendedClient,
|
|
676
705
|
deployer,
|
|
@@ -886,7 +915,8 @@ export const addMultipleValidators = async (
|
|
|
886
915
|
}
|
|
887
916
|
|
|
888
917
|
const gseContract = new GSEContract(extendedClient, gseAddress);
|
|
889
|
-
const multiAdder = await deployer.deploy(MultiAdderArtifact, [rollupAddress, deployer.client.account.address])
|
|
918
|
+
const multiAdder = (await deployer.deploy(MultiAdderArtifact, [rollupAddress, deployer.client.account.address]))
|
|
919
|
+
.address;
|
|
890
920
|
|
|
891
921
|
const makeValidatorTuples = async (validator: Operator) => {
|
|
892
922
|
const registrationTuple = await gseContract.makeRegistrationTuple(validator.bn254SecretKey.getValue());
|
|
@@ -1007,11 +1037,13 @@ export const cheat_initializeFeeAssetHandler = async (
|
|
|
1007
1037
|
feeAssetHandlerAddress: EthAddress;
|
|
1008
1038
|
txHash: Hex;
|
|
1009
1039
|
}> => {
|
|
1010
|
-
const feeAssetHandlerAddress =
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1040
|
+
const feeAssetHandlerAddress = (
|
|
1041
|
+
await deployer.deploy(FeeAssetHandlerArtifact, [
|
|
1042
|
+
extendedClient.account.address,
|
|
1043
|
+
feeAssetAddress.toString(),
|
|
1044
|
+
BigInt(1e18),
|
|
1045
|
+
])
|
|
1046
|
+
).address;
|
|
1015
1047
|
logger.verbose(`Deployed FeeAssetHandler at ${feeAssetHandlerAddress}`);
|
|
1016
1048
|
|
|
1017
1049
|
const { txHash } = await deployer.sendTransaction({
|
|
@@ -1343,10 +1375,10 @@ export class L1Deployer {
|
|
|
1343
1375
|
params: ContractArtifacts<TAbi>,
|
|
1344
1376
|
args?: ContractConstructorArgs<TAbi>,
|
|
1345
1377
|
opts: { gasLimit?: bigint } = {},
|
|
1346
|
-
): Promise<EthAddress> {
|
|
1378
|
+
): Promise<{ address: EthAddress; existed: boolean }> {
|
|
1347
1379
|
this.logger.debug(`Deploying ${params.name} contract`, { args });
|
|
1348
1380
|
try {
|
|
1349
|
-
const { txHash, address, deployedLibraries } = await deployL1Contract(
|
|
1381
|
+
const { txHash, address, deployedLibraries, existed } = await deployL1Contract(
|
|
1350
1382
|
this.client,
|
|
1351
1383
|
params.contractAbi,
|
|
1352
1384
|
params.contractBytecode,
|
|
@@ -1384,7 +1416,10 @@ export class L1Deployer {
|
|
|
1384
1416
|
libraries: deployedLibraries ?? [],
|
|
1385
1417
|
});
|
|
1386
1418
|
}
|
|
1387
|
-
return
|
|
1419
|
+
return {
|
|
1420
|
+
address,
|
|
1421
|
+
existed,
|
|
1422
|
+
};
|
|
1388
1423
|
} catch (error) {
|
|
1389
1424
|
throw new Error(`Failed to deploy ${params.name}`, { cause: formatViemError(error) });
|
|
1390
1425
|
}
|
|
@@ -1442,7 +1477,12 @@ export async function deployL1Contract(
|
|
|
1442
1477
|
gasLimit?: bigint;
|
|
1443
1478
|
acceleratedTestDeployments?: boolean;
|
|
1444
1479
|
} = {},
|
|
1445
|
-
): Promise<{
|
|
1480
|
+
): Promise<{
|
|
1481
|
+
address: EthAddress;
|
|
1482
|
+
txHash: Hex | undefined;
|
|
1483
|
+
deployedLibraries?: VerificationLibraryEntry[];
|
|
1484
|
+
existed: boolean;
|
|
1485
|
+
}> {
|
|
1446
1486
|
let txHash: Hex | undefined = undefined;
|
|
1447
1487
|
let resultingAddress: Hex | null | undefined = undefined;
|
|
1448
1488
|
const deployedLibraries: VerificationLibraryEntry[] = [];
|
|
@@ -1544,6 +1584,8 @@ export async function deployL1Contract(
|
|
|
1544
1584
|
}
|
|
1545
1585
|
}
|
|
1546
1586
|
|
|
1587
|
+
let existed = false;
|
|
1588
|
+
|
|
1547
1589
|
if (saltFromOpts) {
|
|
1548
1590
|
logger?.info(`Deploying contract with salt ${saltFromOpts}`);
|
|
1549
1591
|
const { address, paddedSalt: salt, calldata } = getExpectedAddress(abi, bytecode, args, saltFromOpts);
|
|
@@ -1565,6 +1607,7 @@ export async function deployL1Contract(
|
|
|
1565
1607
|
logger?.verbose(`Deployed contract with salt ${salt} to address ${resultingAddress} in tx ${txHash}.`);
|
|
1566
1608
|
} else {
|
|
1567
1609
|
logger?.verbose(`Skipping existing deployment of contract with salt ${salt} to address ${resultingAddress}`);
|
|
1610
|
+
existed = true;
|
|
1568
1611
|
}
|
|
1569
1612
|
} else {
|
|
1570
1613
|
const deployData = encodeDeployData({ abi, bytecode, args });
|
|
@@ -1584,7 +1627,7 @@ export async function deployL1Contract(
|
|
|
1584
1627
|
}
|
|
1585
1628
|
}
|
|
1586
1629
|
|
|
1587
|
-
return { address: EthAddress.fromString(resultingAddress!), txHash, deployedLibraries };
|
|
1630
|
+
return { address: EthAddress.fromString(resultingAddress!), txHash, deployedLibraries, existed };
|
|
1588
1631
|
}
|
|
1589
1632
|
|
|
1590
1633
|
export function getExpectedAddress(
|
|
@@ -3,7 +3,7 @@ import { keccak256 } from '@aztec/foundation/crypto';
|
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
5
5
|
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
-
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
6
|
+
import type { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
7
7
|
|
|
8
8
|
import { type Hex, createPublicClient, fallback, http } from 'viem';
|
|
9
9
|
|
|
@@ -19,6 +19,10 @@ export class EthCheatCodes {
|
|
|
19
19
|
* The RPC URL to use for interacting with the chain
|
|
20
20
|
*/
|
|
21
21
|
public rpcUrls: string[],
|
|
22
|
+
/**
|
|
23
|
+
* The date provider to use for time operations
|
|
24
|
+
*/
|
|
25
|
+
public dateProvider: DateProvider | TestDateProvider,
|
|
22
26
|
/**
|
|
23
27
|
* The logger to use for the eth cheatcodes
|
|
24
28
|
*/
|
|
@@ -225,12 +229,12 @@ export class EthCheatCodes {
|
|
|
225
229
|
/**
|
|
226
230
|
* Set the next block timestamp and mines the block.
|
|
227
231
|
* Optionally resets interval mining so the next block is mined in `blockInterval` seconds from now.
|
|
228
|
-
*
|
|
232
|
+
* Always updates the injected date provider to follow L1 time.
|
|
229
233
|
* @param timestamp - The timestamp to set the next block to
|
|
230
234
|
*/
|
|
231
235
|
public async warp(
|
|
232
236
|
timestamp: number | bigint,
|
|
233
|
-
opts: { silent?: boolean; resetBlockInterval?: boolean
|
|
237
|
+
opts: { silent?: boolean; resetBlockInterval?: boolean } = {},
|
|
234
238
|
): Promise<void> {
|
|
235
239
|
let blockInterval: number | null = null;
|
|
236
240
|
try {
|
|
@@ -245,8 +249,10 @@ export class EthCheatCodes {
|
|
|
245
249
|
await this.rpcCall('evm_setNextBlockTimestamp', [Number(timestamp)]);
|
|
246
250
|
// And mine a block so the timestamp goes into effect now
|
|
247
251
|
await this.doMine();
|
|
248
|
-
// Update the date provider
|
|
249
|
-
|
|
252
|
+
// Update the injected date provider so it follows L1 time
|
|
253
|
+
if ('setTime' in this.dateProvider) {
|
|
254
|
+
this.dateProvider.setTime(Number(timestamp) * 1000);
|
|
255
|
+
}
|
|
250
256
|
} catch (err) {
|
|
251
257
|
throw new Error(`Error warping: ${err}`);
|
|
252
258
|
} finally {
|
|
@@ -2,7 +2,7 @@ import { RollupContract, type ViemPublicClient } from '@aztec/ethereum';
|
|
|
2
2
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
6
6
|
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -40,8 +40,12 @@ export class RollupCheatCodes {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
static create(
|
|
44
|
-
|
|
43
|
+
static create(
|
|
44
|
+
rpcUrls: string[],
|
|
45
|
+
addresses: Pick<L1ContractAddresses, 'rollupAddress'>,
|
|
46
|
+
dateProvider: DateProvider,
|
|
47
|
+
): RollupCheatCodes {
|
|
48
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrls, dateProvider);
|
|
45
49
|
return new RollupCheatCodes(ethCheatCodes, addresses);
|
|
46
50
|
}
|
|
47
51
|
|
|
@@ -114,8 +118,6 @@ export class RollupCheatCodes {
|
|
|
114
118
|
public async advanceToEpoch(
|
|
115
119
|
epoch: bigint | number,
|
|
116
120
|
opts: {
|
|
117
|
-
/** Optional test date provider to update with the epoch timestamp */
|
|
118
|
-
updateDateProvider?: TestDateProvider;
|
|
119
121
|
/** Offset in seconds */
|
|
120
122
|
offset?: number;
|
|
121
123
|
} = {},
|
|
@@ -133,19 +135,13 @@ export class RollupCheatCodes {
|
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
/** Warps time in L1 until the next epoch */
|
|
136
|
-
public async advanceToNextEpoch(
|
|
137
|
-
opts: {
|
|
138
|
-
/** Optional test date provider to update with the epoch timestamp */
|
|
139
|
-
updateDateProvider?: TestDateProvider;
|
|
140
|
-
} = {},
|
|
141
|
-
) {
|
|
138
|
+
public async advanceToNextEpoch() {
|
|
142
139
|
const slot = await this.getSlot();
|
|
143
140
|
const { epochDuration, slotDuration } = await this.getConfig();
|
|
144
141
|
const slotsUntilNextEpoch = epochDuration - (slot % epochDuration) + 1n;
|
|
145
142
|
const timeToNextEpoch = slotsUntilNextEpoch * slotDuration;
|
|
146
143
|
const l1Timestamp = BigInt((await this.client.getBlock()).timestamp);
|
|
147
144
|
await this.ethCheatCodes.warp(Number(l1Timestamp + timeToNextEpoch), {
|
|
148
|
-
...opts,
|
|
149
145
|
silent: true,
|
|
150
146
|
resetBlockInterval: true,
|
|
151
147
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
2
3
|
import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi';
|
|
3
4
|
import { TestERC20Abi as StakingAssetAbi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
4
5
|
|
|
@@ -30,7 +31,7 @@ export async function executeGovernanceProposal(
|
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, logger);
|
|
34
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), logger);
|
|
34
35
|
|
|
35
36
|
const timeToActive = proposal.creation + proposal.config.votingDelay;
|
|
36
37
|
logger.info(`Warping to ${timeToActive + 1n}`);
|