@aztec/ethereum 3.0.0-nightly.20250916 → 3.0.0-nightly.20250918
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.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +42 -73
- package/dest/contracts/rollup.d.ts +6 -0
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +3 -0
- package/dest/deploy_l1_contracts.js +1 -1
- package/dest/l1_artifacts.d.ts +77 -27
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.d.ts +4 -2
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +5 -3
- package/dest/test/rollup_cheat_codes.d.ts +6 -1
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +34 -1
- package/dest/zkPassportVerifierAddress.js +1 -1
- package/package.json +5 -5
- package/src/config.ts +44 -78
- package/src/contracts/rollup.ts +4 -0
- package/src/deploy_l1_contracts.ts +1 -1
- package/src/test/eth_cheat_codes.ts +11 -4
- package/src/test/rollup_cheat_codes.ts +43 -2
- package/src/zkPassportVerifierAddress.ts +1 -1
package/src/config.ts
CHANGED
|
@@ -79,12 +79,12 @@ export const DefaultL1ContractsConfig = {
|
|
|
79
79
|
aztecTargetCommitteeSize: 48,
|
|
80
80
|
lagInEpochs: 2,
|
|
81
81
|
aztecProofSubmissionEpochs: 1, // you have a full epoch to submit a proof after the epoch to prove ends
|
|
82
|
-
activationThreshold:
|
|
83
|
-
ejectionThreshold:
|
|
84
|
-
localEjectionThreshold:
|
|
85
|
-
slashAmountSmall:
|
|
86
|
-
slashAmountMedium:
|
|
87
|
-
slashAmountLarge:
|
|
82
|
+
activationThreshold: 100n * 10n ** 18n,
|
|
83
|
+
ejectionThreshold: 50n * 10n ** 18n,
|
|
84
|
+
localEjectionThreshold: 98n * 10n ** 18n,
|
|
85
|
+
slashAmountSmall: 10n * 10n ** 18n,
|
|
86
|
+
slashAmountMedium: 20n * 10n ** 18n,
|
|
87
|
+
slashAmountLarge: 50n * 10n ** 18n,
|
|
88
88
|
slashingRoundSizeInEpochs: 4,
|
|
89
89
|
slashingLifetimeInRounds: 5,
|
|
90
90
|
slashingExecutionDelayInRounds: 0, // round N may be submitted in round N + 1
|
|
@@ -128,31 +128,32 @@ const StagingPublicGovernanceConfiguration = {
|
|
|
128
128
|
|
|
129
129
|
const TestnetGovernanceConfiguration = {
|
|
130
130
|
proposeConfig: {
|
|
131
|
-
lockDelay:
|
|
132
|
-
lockAmount:
|
|
131
|
+
lockDelay: 10n * 365n * 24n * 60n * 60n,
|
|
132
|
+
lockAmount: 1250n * 200_000n * 10n ** 18n,
|
|
133
133
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
|
|
135
|
+
votingDelay: 12n * 60n * 60n, // 12 hours
|
|
136
|
+
votingDuration: 1n * 24n * 60n * 60n, // 1 day
|
|
137
|
+
executionDelay: 12n * 60n * 60n, // 12 hours
|
|
138
|
+
gracePeriod: 1n * 24n * 60n * 60n, // 1 day
|
|
139
|
+
quorum: 2n * 10n ** 17n, // 20%
|
|
140
|
+
requiredYeaMargin: 1n * 10n ** 17n, // 10%
|
|
141
|
+
minimumVotes: 1250n * 200_000n * 10n ** 18n,
|
|
141
142
|
};
|
|
142
143
|
|
|
143
144
|
const StagingIgnitionGovernanceConfiguration = {
|
|
144
145
|
proposeConfig: {
|
|
145
|
-
lockDelay:
|
|
146
|
-
lockAmount:
|
|
146
|
+
lockDelay: 10n * 365n * 24n * 60n * 60n,
|
|
147
|
+
lockAmount: 1250n * 200_000n * 10n ** 18n,
|
|
147
148
|
},
|
|
148
149
|
|
|
149
|
-
votingDelay: 60n,
|
|
150
|
-
votingDuration: 60n * 60n,
|
|
151
|
-
executionDelay: 60n,
|
|
152
|
-
gracePeriod:
|
|
153
|
-
quorum:
|
|
154
|
-
requiredYeaMargin:
|
|
155
|
-
minimumVotes:
|
|
150
|
+
votingDelay: 7n * 24n * 60n * 60n,
|
|
151
|
+
votingDuration: 7n * 24n * 60n * 60n,
|
|
152
|
+
executionDelay: 30n * 24n * 60n * 60n,
|
|
153
|
+
gracePeriod: 7n * 24n * 60n * 60n,
|
|
154
|
+
quorum: 2n * 10n ** 17n, // 20%
|
|
155
|
+
requiredYeaMargin: 1n * 10n ** 17n, // 10%
|
|
156
|
+
minimumVotes: 1250n * 200_000n * 10n ** 18n,
|
|
156
157
|
};
|
|
157
158
|
|
|
158
159
|
export const getGovernanceConfiguration = (networkName: NetworkNames) => {
|
|
@@ -175,10 +176,10 @@ export const getGovernanceConfiguration = (networkName: NetworkNames) => {
|
|
|
175
176
|
// for it seems overkill
|
|
176
177
|
|
|
177
178
|
const DefaultRewardConfig = {
|
|
178
|
-
sequencerBps:
|
|
179
|
+
sequencerBps: 8000,
|
|
179
180
|
rewardDistributor: EthAddress.ZERO.toString(),
|
|
180
181
|
booster: EthAddress.ZERO.toString(),
|
|
181
|
-
blockReward:
|
|
182
|
+
blockReward: 500n * 10n ** 18n,
|
|
182
183
|
};
|
|
183
184
|
|
|
184
185
|
export const getRewardConfig = (networkName: NetworkNames) => {
|
|
@@ -193,51 +194,16 @@ export const getRewardConfig = (networkName: NetworkNames) => {
|
|
|
193
194
|
}
|
|
194
195
|
};
|
|
195
196
|
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
maxScore: 5000000,
|
|
207
|
-
a: 5000,
|
|
208
|
-
k: 1000000,
|
|
209
|
-
minimum: 100000,
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const TestnetRewardBoostConfig = {
|
|
213
|
-
increment: 125000,
|
|
214
|
-
maxScore: 15000000,
|
|
215
|
-
a: 1000,
|
|
216
|
-
k: 1000000,
|
|
217
|
-
minimum: 100000,
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const StagingIgnitionRewardBoostConfig = {
|
|
221
|
-
increment: 200000,
|
|
222
|
-
maxScore: 5000000,
|
|
223
|
-
a: 5000,
|
|
224
|
-
k: 1000000,
|
|
225
|
-
minimum: 100000,
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export const getRewardBoostConfig = (networkName: NetworkNames) => {
|
|
229
|
-
switch (networkName) {
|
|
230
|
-
case 'local':
|
|
231
|
-
return LocalRewardBoostConfig;
|
|
232
|
-
case 'staging-public':
|
|
233
|
-
return StagingPublicRewardBoostConfig;
|
|
234
|
-
case 'testnet':
|
|
235
|
-
return TestnetRewardBoostConfig;
|
|
236
|
-
case 'staging-ignition':
|
|
237
|
-
return StagingIgnitionRewardBoostConfig;
|
|
238
|
-
default:
|
|
239
|
-
throw new Error(`Unrecognized network name: ${networkName}`);
|
|
240
|
-
}
|
|
197
|
+
export const getRewardBoostConfig = () => {
|
|
198
|
+
// The reward configuration is specified with a precision of 1e5, and we use the same across
|
|
199
|
+
// all networks.
|
|
200
|
+
return {
|
|
201
|
+
increment: 125000, // 1.25
|
|
202
|
+
maxScore: 15000000, // 150
|
|
203
|
+
a: 1000, // 0.01
|
|
204
|
+
k: 1000000, // 10
|
|
205
|
+
minimum: 100000, // 1
|
|
206
|
+
};
|
|
241
207
|
};
|
|
242
208
|
|
|
243
209
|
// Similar to the above, no need for environment variables for this.
|
|
@@ -259,18 +225,18 @@ const StagingPublicEntryQueueConfig = {
|
|
|
259
225
|
|
|
260
226
|
const TestnetEntryQueueConfig = {
|
|
261
227
|
bootstrapValidatorSetSize: 750n,
|
|
262
|
-
bootstrapFlushSize:
|
|
263
|
-
normalFlushSizeMin:
|
|
228
|
+
bootstrapFlushSize: 32n,
|
|
229
|
+
normalFlushSizeMin: 32n,
|
|
264
230
|
normalFlushSizeQuotient: 2475n,
|
|
265
|
-
maxQueueFlushSize: 32n,
|
|
231
|
+
maxQueueFlushSize: 32n,
|
|
266
232
|
};
|
|
267
233
|
|
|
268
234
|
const StagingIgnitionEntryQueueConfig = {
|
|
269
|
-
bootstrapValidatorSetSize:
|
|
270
|
-
bootstrapFlushSize:
|
|
235
|
+
bootstrapValidatorSetSize: 1250n,
|
|
236
|
+
bootstrapFlushSize: 8n,
|
|
271
237
|
normalFlushSizeMin: 1n,
|
|
272
|
-
normalFlushSizeQuotient:
|
|
273
|
-
maxQueueFlushSize:
|
|
238
|
+
normalFlushSizeQuotient: 2048n,
|
|
239
|
+
maxQueueFlushSize: 8n,
|
|
274
240
|
};
|
|
275
241
|
|
|
276
242
|
export const getEntryQueueConfig = (networkName: NetworkNames) => {
|
package/src/contracts/rollup.ts
CHANGED
|
@@ -713,6 +713,10 @@ export class RollupContract {
|
|
|
713
713
|
return this.rollup.read.getStakingAsset();
|
|
714
714
|
}
|
|
715
715
|
|
|
716
|
+
getRewardConfig() {
|
|
717
|
+
return this.rollup.read.getRewardConfig();
|
|
718
|
+
}
|
|
719
|
+
|
|
716
720
|
setupEpoch(l1TxUtils: L1TxUtils) {
|
|
717
721
|
return l1TxUtils.sendAndMonitorTransaction({
|
|
718
722
|
to: this.address,
|
|
@@ -551,7 +551,7 @@ export const deployRollup = async (
|
|
|
551
551
|
provingCostPerMana: args.provingCostPerMana,
|
|
552
552
|
rewardConfig: rewardConfig,
|
|
553
553
|
version: 0,
|
|
554
|
-
rewardBoostConfig: getRewardBoostConfig(
|
|
554
|
+
rewardBoostConfig: getRewardBoostConfig(),
|
|
555
555
|
stakingQueueConfig: getEntryQueueConfig(networkName),
|
|
556
556
|
exitDelaySeconds: BigInt(args.exitDelaySeconds),
|
|
557
557
|
slasherFlavor: slasherFlavorToSolidityEnum(args.slasherFlavor),
|
|
@@ -277,14 +277,21 @@ export class EthCheatCodes {
|
|
|
277
277
|
* @param slot - The storage slot
|
|
278
278
|
* @param value - The value to set the storage slot to
|
|
279
279
|
*/
|
|
280
|
-
public async store(
|
|
280
|
+
public async store(
|
|
281
|
+
contract: EthAddress,
|
|
282
|
+
slot: bigint,
|
|
283
|
+
value: bigint,
|
|
284
|
+
opts: { silent?: boolean } = {},
|
|
285
|
+
): Promise<void> {
|
|
281
286
|
// for the rpc call, we need to change value to be a 32 byte hex string.
|
|
282
287
|
try {
|
|
283
288
|
await this.rpcCall('hardhat_setStorageAt', [contract.toString(), toHex(slot), toHex(value, true)]);
|
|
284
289
|
} catch (err) {
|
|
285
290
|
throw new Error(`Error setting storage for contract ${contract} at ${slot}: ${err}`);
|
|
286
291
|
}
|
|
287
|
-
|
|
292
|
+
if (!opts.silent) {
|
|
293
|
+
this.logger.warn(`Set L1 storage for contract ${contract} at ${slot} to ${value}`);
|
|
294
|
+
}
|
|
288
295
|
}
|
|
289
296
|
|
|
290
297
|
/**
|
|
@@ -434,7 +441,7 @@ export class EthCheatCodes {
|
|
|
434
441
|
return this.rpcCall('trace_transaction', [txHash]);
|
|
435
442
|
}
|
|
436
443
|
|
|
437
|
-
public async execWithPausedAnvil(fn: () => Promise<
|
|
444
|
+
public async execWithPausedAnvil<T>(fn: () => Promise<T>): Promise<T> {
|
|
438
445
|
const [blockInterval, wasAutoMining] = await Promise.all([this.getIntervalMining(), this.isAutoMining()]);
|
|
439
446
|
try {
|
|
440
447
|
if (blockInterval !== null) {
|
|
@@ -445,7 +452,7 @@ export class EthCheatCodes {
|
|
|
445
452
|
await this.setAutomine(false, { silent: true });
|
|
446
453
|
}
|
|
447
454
|
|
|
448
|
-
await fn();
|
|
455
|
+
return await fn();
|
|
449
456
|
} finally {
|
|
450
457
|
try {
|
|
451
458
|
// restore automine if necessary
|
|
@@ -112,14 +112,14 @@ export class RollupCheatCodes {
|
|
|
112
112
|
* @param opts - Options
|
|
113
113
|
*/
|
|
114
114
|
public async advanceToEpoch(
|
|
115
|
-
epoch: bigint,
|
|
115
|
+
epoch: bigint | number,
|
|
116
116
|
opts: {
|
|
117
117
|
/** Optional test date provider to update with the epoch timestamp */
|
|
118
118
|
updateDateProvider?: TestDateProvider;
|
|
119
119
|
} = {},
|
|
120
120
|
) {
|
|
121
121
|
const { epochDuration: slotsInEpoch } = await this.getConfig();
|
|
122
|
-
const timestamp = await this.rollup.read.getTimestampForSlot([epoch * slotsInEpoch]);
|
|
122
|
+
const timestamp = await this.rollup.read.getTimestampForSlot([BigInt(epoch) * slotsInEpoch]);
|
|
123
123
|
try {
|
|
124
124
|
await this.ethCheatCodes.warp(Number(timestamp), { ...opts, silent: true, resetBlockInterval: true });
|
|
125
125
|
this.logger.warn(`Warped to epoch ${epoch}`);
|
|
@@ -208,6 +208,47 @@ export class RollupCheatCodes {
|
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Overrides the inProgress field of the Inbox contract state
|
|
213
|
+
* @param howMuch - How many blocks to move it forward
|
|
214
|
+
*/
|
|
215
|
+
public advanceInboxInProgress(howMuch: number | bigint): Promise<bigint> {
|
|
216
|
+
return this.ethCheatCodes.execWithPausedAnvil(async () => {
|
|
217
|
+
// Storage slot 2 contains the InboxState struct
|
|
218
|
+
const inboxStateSlot = 2n;
|
|
219
|
+
|
|
220
|
+
// Get inbox and its current state values
|
|
221
|
+
const inboxAddress = await this.rollup.read.getInbox();
|
|
222
|
+
const currentStateValue = await this.ethCheatCodes.load(EthAddress.fromString(inboxAddress), inboxStateSlot);
|
|
223
|
+
|
|
224
|
+
// Extract current values from the packed storage slot
|
|
225
|
+
// Storage layout: rollingHash (128 bits) | totalMessagesInserted (64 bits) | inProgress (64 bits)
|
|
226
|
+
const currentRollingHash = currentStateValue & ((1n << 128n) - 1n);
|
|
227
|
+
const currentTotalMessages = (currentStateValue >> 128n) & ((1n << 64n) - 1n);
|
|
228
|
+
const currentInProgress = currentStateValue >> 192n;
|
|
229
|
+
const newInProgress = currentInProgress + BigInt(howMuch);
|
|
230
|
+
|
|
231
|
+
// Pack new values: rollingHash (low 128 bits) | totalMessages (middle 64 bits) | inProgress (high 64 bits)
|
|
232
|
+
const newValue = (BigInt(newInProgress) << 192n) | (currentTotalMessages << 128n) | currentRollingHash;
|
|
233
|
+
|
|
234
|
+
await this.ethCheatCodes.store(EthAddress.fromString(inboxAddress), inboxStateSlot, newValue, {
|
|
235
|
+
silent: true,
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
this.logger.warn(`Inbox inProgress advanced from ${currentInProgress} to ${newInProgress}`, {
|
|
239
|
+
inbox: inboxAddress,
|
|
240
|
+
oldValue: '0x' + currentStateValue.toString(16),
|
|
241
|
+
newValue: '0x' + newValue.toString(16),
|
|
242
|
+
rollingHash: currentRollingHash,
|
|
243
|
+
totalMessages: currentTotalMessages,
|
|
244
|
+
oldInProgress: currentInProgress,
|
|
245
|
+
newInProgress,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
return newInProgress;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
211
252
|
/**
|
|
212
253
|
* Executes an action impersonated as the owner of the Rollup contract.
|
|
213
254
|
* @param action - The action to execute
|
|
@@ -4,7 +4,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
4
4
|
* The address of the zk passport verifier on sepolia
|
|
5
5
|
* get address from: ROOT/l1-contracts/lib/circuits/src/solidity/deployments/deployment-11155111.json
|
|
6
6
|
*/
|
|
7
|
-
export const ZK_PASSPORT_VERIFIER_ADDRESS = EthAddress.fromString('
|
|
7
|
+
export const ZK_PASSPORT_VERIFIER_ADDRESS = EthAddress.fromString('0xBec82dec0747C9170D760D5aba9cc44929B17C05');
|
|
8
8
|
/**
|
|
9
9
|
* The default domain of the zk passport site
|
|
10
10
|
*/
|