@aztec/ethereum 3.0.0-nightly.20251123 → 3.0.0-nightly.20251125
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.js +3 -3
- package/dest/contracts/rollup.d.ts +23 -22
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +39 -38
- package/dest/deploy_l1_contracts.js +2 -2
- package/dest/l1_artifacts.d.ts +1151 -755
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/test/chain_monitor.d.ts +13 -13
- package/dest/test/chain_monitor.d.ts.map +1 -1
- package/dest/test/chain_monitor.js +28 -28
- package/dest/test/rollup_cheat_codes.d.ts +4 -4
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +18 -22
- package/package.json +5 -5
- package/src/config.ts +3 -3
- package/src/contracts/rollup.ts +43 -38
- package/src/deploy_l1_contracts.ts +2 -2
- package/src/test/chain_monitor.ts +35 -35
- package/src/test/rollup_cheat_codes.ts +18 -22
package/dest/config.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export declare const getRewardConfig: (networkName: NetworkNames) => {
|
|
|
101
101
|
sequencerBps: number;
|
|
102
102
|
rewardDistributor: `0x${string}`;
|
|
103
103
|
booster: `0x${string}`;
|
|
104
|
-
|
|
104
|
+
checkpointReward: bigint;
|
|
105
105
|
};
|
|
106
106
|
export declare const getRewardBoostConfig: () => {
|
|
107
107
|
increment: number;
|
package/dest/config.js
CHANGED
|
@@ -19,7 +19,7 @@ export const DefaultL1ContractsConfig = {
|
|
|
19
19
|
slashingExecutionDelayInRounds: 0,
|
|
20
20
|
slashingVetoer: EthAddress.ZERO,
|
|
21
21
|
governanceProposerRoundSize: 300,
|
|
22
|
-
manaTarget: BigInt(
|
|
22
|
+
manaTarget: BigInt(100e6),
|
|
23
23
|
provingCostPerMana: BigInt(100),
|
|
24
24
|
exitDelaySeconds: 2 * 24 * 60 * 60,
|
|
25
25
|
slasherFlavor: 'tally',
|
|
@@ -118,13 +118,13 @@ const DefaultRewardConfig = {
|
|
|
118
118
|
sequencerBps: 8000,
|
|
119
119
|
rewardDistributor: EthAddress.ZERO.toString(),
|
|
120
120
|
booster: EthAddress.ZERO.toString(),
|
|
121
|
-
|
|
121
|
+
checkpointReward: 500n * 10n ** 18n
|
|
122
122
|
};
|
|
123
123
|
const MainnetRewardConfig = {
|
|
124
124
|
sequencerBps: 7_000,
|
|
125
125
|
rewardDistributor: EthAddress.ZERO.toString(),
|
|
126
126
|
booster: EthAddress.ZERO.toString(),
|
|
127
|
-
|
|
127
|
+
checkpointReward: 400n * 10n ** 18n
|
|
128
128
|
};
|
|
129
129
|
export const getRewardConfig = (networkName)=>{
|
|
130
130
|
switch(networkName){
|
|
@@ -112,9 +112,9 @@ export declare class RollupContract {
|
|
|
112
112
|
getOwner(): Promise<`0x${string}`>;
|
|
113
113
|
getActiveAttesterCount(): Promise<bigint>;
|
|
114
114
|
getSlashingProposerAddress(): Promise<EthAddress>;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
getCheckpointReward(): Promise<bigint>;
|
|
116
|
+
getCheckpointNumber(): Promise<bigint>;
|
|
117
|
+
getProvenCheckpointNumber(): Promise<bigint>;
|
|
118
118
|
getSlotNumber(): Promise<bigint>;
|
|
119
119
|
getL1FeesAt(timestamp: bigint): Promise<{
|
|
120
120
|
baseFee: bigint;
|
|
@@ -128,7 +128,7 @@ export declare class RollupContract {
|
|
|
128
128
|
getCurrentEpochCommittee(): Promise<readonly `0x${string}`[] | undefined>;
|
|
129
129
|
getCurrentProposer(): Promise<`0x${string}`>;
|
|
130
130
|
getProposerAt(timestamp: bigint): Promise<`0x${string}`>;
|
|
131
|
-
|
|
131
|
+
getCheckpoint(checkpointNumber: bigint | number): Promise<{
|
|
132
132
|
archive: `0x${string}`;
|
|
133
133
|
headerHash: `0x${string}`;
|
|
134
134
|
blobCommitmentsHash: `0x${string}`;
|
|
@@ -144,15 +144,15 @@ export declare class RollupContract {
|
|
|
144
144
|
};
|
|
145
145
|
}>;
|
|
146
146
|
getTips(): Promise<{
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
pending: bigint;
|
|
148
|
+
proven: bigint;
|
|
149
149
|
}>;
|
|
150
150
|
getTimestampForSlot(slot: bigint): Promise<bigint>;
|
|
151
151
|
getEntryQueueLength(): Promise<bigint>;
|
|
152
152
|
getAvailableValidatorFlushes(): Promise<bigint>;
|
|
153
153
|
getNextFlushableEpoch(): Promise<bigint>;
|
|
154
154
|
getCurrentEpochNumber(): Promise<bigint>;
|
|
155
|
-
|
|
155
|
+
getEpochNumberForCheckpoint(checkpointNumber: bigint): Promise<bigint>;
|
|
156
156
|
getRollupAddresses(): Promise<L1RollupContractAddresses>;
|
|
157
157
|
getFeeJuicePortal(): Promise<EthAddress>;
|
|
158
158
|
getEpochNumberForSlotNumber(slotNumber: bigint): Promise<bigint>;
|
|
@@ -175,38 +175,39 @@ export declare class RollupContract {
|
|
|
175
175
|
* @dev Throws if unable to propose
|
|
176
176
|
*
|
|
177
177
|
* @param archive - The archive that we expect to be current state
|
|
178
|
-
* @return [slot,
|
|
178
|
+
* @return [slot, checkpointNumber, timeOfNextL1Slot] - If you can propose, the L2 slot number, checkpoint number and
|
|
179
|
+
* timestamp of the next L1 block
|
|
179
180
|
* @throws otherwise
|
|
180
181
|
*/
|
|
181
182
|
canProposeAtNextEthBlock(archive: Buffer, account: `0x${string}` | Account, slotDuration: bigint | number, opts?: {
|
|
182
|
-
|
|
183
|
+
forcePendingCheckpointNumber?: number;
|
|
183
184
|
}): Promise<{
|
|
184
185
|
slot: bigint;
|
|
185
|
-
|
|
186
|
+
checkpointNumber: bigint;
|
|
186
187
|
timeOfNextL1Slot: bigint;
|
|
187
188
|
}>;
|
|
188
189
|
/**
|
|
189
|
-
* Returns a state override that sets the pending
|
|
190
|
-
* Requires querying the current state of the contract to get the current proven
|
|
190
|
+
* Returns a state override that sets the pending checkpoint number to the specified value. Useful for simulations.
|
|
191
|
+
* Requires querying the current state of the contract to get the current proven checkpoint number, as they are both
|
|
191
192
|
* stored in the same slot. If the argument is undefined, it returns an empty override.
|
|
192
193
|
*/
|
|
193
|
-
|
|
194
|
+
makePendingCheckpointNumberOverride(forcePendingCheckpointNumber: number | undefined): Promise<StateOverride>;
|
|
194
195
|
/** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */
|
|
195
|
-
buildInvalidateBadAttestationRequest(
|
|
196
|
+
buildInvalidateBadAttestationRequest(checkpointNumber: number, attestationsAndSigners: ViemCommitteeAttestations, committee: EthAddress[], invalidIndex: number): L1TxRequest;
|
|
196
197
|
/** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */
|
|
197
|
-
buildInvalidateInsufficientAttestationsRequest(
|
|
198
|
+
buildInvalidateInsufficientAttestationsRequest(checkpointNumber: number, attestationsAndSigners: ViemCommitteeAttestations, committee: EthAddress[]): L1TxRequest;
|
|
198
199
|
/** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */
|
|
199
|
-
getHasSubmittedProof(epochNumber: number,
|
|
200
|
+
getHasSubmittedProof(epochNumber: number, numberOfCheckpointsInEpoch: number, prover: Hex | EthAddress): Promise<boolean>;
|
|
200
201
|
getManaBaseFeeAt(timestamp: bigint, inFeeAsset: boolean): Promise<bigint>;
|
|
201
202
|
getSlotAt(timestamp: bigint): Promise<bigint>;
|
|
202
|
-
status(
|
|
203
|
+
status(checkpointNumber: bigint, options?: {
|
|
203
204
|
blockNumber?: bigint;
|
|
204
205
|
}): Promise<readonly [bigint, `0x${string}`, bigint, `0x${string}`, `0x${string}`, bigint]>;
|
|
205
206
|
canPruneAtTime(timestamp: bigint, options?: {
|
|
206
207
|
blockNumber?: bigint;
|
|
207
208
|
}): Promise<boolean>;
|
|
208
209
|
archive(): Promise<`0x${string}`>;
|
|
209
|
-
archiveAt(
|
|
210
|
+
archiveAt(checkpointNumber: bigint): Promise<`0x${string}`>;
|
|
210
211
|
getSequencerRewards(address: Hex | EthAddress): Promise<bigint>;
|
|
211
212
|
getSpecificProverRewardsForEpoch(epoch: bigint, prover: Hex | EthAddress): Promise<bigint>;
|
|
212
213
|
getAttesters(): Promise<`0x${string}`[]>;
|
|
@@ -230,14 +231,14 @@ export declare class RollupContract {
|
|
|
230
231
|
};
|
|
231
232
|
}>;
|
|
232
233
|
getStatus(address: Hex | EthAddress): Promise<number>;
|
|
233
|
-
getBlobCommitmentsHash(
|
|
234
|
+
getBlobCommitmentsHash(checkpointNumber: bigint): Promise<`0x${string}`>;
|
|
234
235
|
getCurrentBlobCommitmentsHash(): Promise<`0x${string}`>;
|
|
235
236
|
getStakingAsset(): Promise<`0x${string}`>;
|
|
236
237
|
getRewardConfig(): Promise<{
|
|
237
238
|
rewardDistributor: `0x${string}`;
|
|
238
239
|
sequencerBps: number;
|
|
239
240
|
booster: `0x${string}`;
|
|
240
|
-
|
|
241
|
+
checkpointReward: bigint;
|
|
241
242
|
}>;
|
|
242
243
|
setupEpoch(l1TxUtils: L1TxUtils): Promise<{
|
|
243
244
|
receipt: import("viem").TransactionReceipt;
|
|
@@ -251,8 +252,8 @@ export declare class RollupContract {
|
|
|
251
252
|
oldSlasher: `0x${string}`;
|
|
252
253
|
newSlasher: `0x${string}`;
|
|
253
254
|
}) => unknown): WatchContractEventReturnType;
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
listenToCheckpointInvalidated(callback: (args: {
|
|
256
|
+
checkpointNumber: bigint;
|
|
256
257
|
}) => unknown): WatchContractEventReturnType;
|
|
257
258
|
getSlashEvents(l1BlockHash: Hex): Promise<{
|
|
258
259
|
amount: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/contracts/rollup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,E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AAgC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,UAAU;IAOlE,YAAY;IAWlB,eAAe,CAAC,OAAO,EAAE,GAAG,GAAG,UAAU;;;;;;;;;;;;;;;;;;;IAOzC,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,UAAU;IAOnC,sBAAsB,CAAC,gBAAgB,EAAE,MAAM;IAI/C,6BAA6B;IAI7B,eAAe;IAIf,eAAe;;;;;;IAIf,UAAU,CAAC,SAAS,EAAE,SAAS;;;;IAW/B,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM;;;;IAWtC,sBAAsB,CAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,GACpF,4BAA4B;IAgBxB,6BAA6B,CAClC,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,GACxD,4BAA4B;IAgBlB,cAAc,CAAC,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAE,EAAE,CAAC;IAQ3F,aAAa,CAClB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO,GACpE,4BAA4B;CAchC"}
|
package/dest/contracts/rollup.js
CHANGED
|
@@ -199,14 +199,14 @@ export class RollupContract {
|
|
|
199
199
|
}
|
|
200
200
|
return await slasher.getProposer();
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
return this.rollup.read.
|
|
202
|
+
getCheckpointReward() {
|
|
203
|
+
return this.rollup.read.getCheckpointReward();
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
return this.rollup.read.
|
|
205
|
+
getCheckpointNumber() {
|
|
206
|
+
return this.rollup.read.getPendingCheckpointNumber();
|
|
207
207
|
}
|
|
208
|
-
|
|
209
|
-
return this.rollup.read.
|
|
208
|
+
getProvenCheckpointNumber() {
|
|
209
|
+
return this.rollup.read.getProvenCheckpointNumber();
|
|
210
210
|
}
|
|
211
211
|
getSlotNumber() {
|
|
212
212
|
return this.rollup.read.getCurrentSlot();
|
|
@@ -284,9 +284,9 @@ export class RollupContract {
|
|
|
284
284
|
});
|
|
285
285
|
return result;
|
|
286
286
|
}
|
|
287
|
-
|
|
288
|
-
return this.rollup.read.
|
|
289
|
-
BigInt(
|
|
287
|
+
getCheckpoint(checkpointNumber) {
|
|
288
|
+
return this.rollup.read.getCheckpoint([
|
|
289
|
+
BigInt(checkpointNumber)
|
|
290
290
|
]);
|
|
291
291
|
}
|
|
292
292
|
getTips() {
|
|
@@ -309,9 +309,9 @@ export class RollupContract {
|
|
|
309
309
|
getCurrentEpochNumber() {
|
|
310
310
|
return this.rollup.read.getCurrentEpoch();
|
|
311
311
|
}
|
|
312
|
-
|
|
313
|
-
return this.rollup.read.
|
|
314
|
-
BigInt(
|
|
312
|
+
getEpochNumberForCheckpoint(checkpointNumber) {
|
|
313
|
+
return this.rollup.read.getEpochForCheckpoint([
|
|
314
|
+
BigInt(checkpointNumber)
|
|
315
315
|
]);
|
|
316
316
|
}
|
|
317
317
|
async getRollupAddresses() {
|
|
@@ -365,7 +365,8 @@ export class RollupContract {
|
|
|
365
365
|
* @dev Throws if unable to propose
|
|
366
366
|
*
|
|
367
367
|
* @param archive - The archive that we expect to be current state
|
|
368
|
-
* @return [slot,
|
|
368
|
+
* @return [slot, checkpointNumber, timeOfNextL1Slot] - If you can propose, the L2 slot number, checkpoint number and
|
|
369
|
+
* timestamp of the next L1 block
|
|
369
370
|
* @throws otherwise
|
|
370
371
|
*/ async canProposeAtNextEthBlock(archive, account, slotDuration, opts = {}) {
|
|
371
372
|
if (typeof slotDuration === 'number') {
|
|
@@ -375,7 +376,7 @@ export class RollupContract {
|
|
|
375
376
|
const timeOfNextL1Slot = latestBlock.timestamp + slotDuration;
|
|
376
377
|
const who = typeof account === 'string' ? account : account.address;
|
|
377
378
|
try {
|
|
378
|
-
const { result: [slot,
|
|
379
|
+
const { result: [slot, checkpointNumber] } = await this.client.simulateContract({
|
|
379
380
|
address: this.address,
|
|
380
381
|
abi: RollupAbi,
|
|
381
382
|
functionName: 'canProposeAtTime',
|
|
@@ -385,11 +386,11 @@ export class RollupContract {
|
|
|
385
386
|
who
|
|
386
387
|
],
|
|
387
388
|
account,
|
|
388
|
-
stateOverride: await this.
|
|
389
|
+
stateOverride: await this.makePendingCheckpointNumberOverride(opts.forcePendingCheckpointNumber)
|
|
389
390
|
});
|
|
390
391
|
return {
|
|
391
392
|
slot,
|
|
392
|
-
|
|
393
|
+
checkpointNumber,
|
|
393
394
|
timeOfNextL1Slot
|
|
394
395
|
};
|
|
395
396
|
} catch (err) {
|
|
@@ -397,11 +398,11 @@ export class RollupContract {
|
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
400
|
/**
|
|
400
|
-
* Returns a state override that sets the pending
|
|
401
|
-
* Requires querying the current state of the contract to get the current proven
|
|
401
|
+
* Returns a state override that sets the pending checkpoint number to the specified value. Useful for simulations.
|
|
402
|
+
* Requires querying the current state of the contract to get the current proven checkpoint number, as they are both
|
|
402
403
|
* stored in the same slot. If the argument is undefined, it returns an empty override.
|
|
403
|
-
*/ async
|
|
404
|
-
if (
|
|
404
|
+
*/ async makePendingCheckpointNumberOverride(forcePendingCheckpointNumber) {
|
|
405
|
+
if (forcePendingCheckpointNumber === undefined) {
|
|
405
406
|
return [];
|
|
406
407
|
}
|
|
407
408
|
const slot = RollupContract.stfStorageSlot;
|
|
@@ -409,8 +410,8 @@ export class RollupContract {
|
|
|
409
410
|
address: this.address,
|
|
410
411
|
slot
|
|
411
412
|
});
|
|
412
|
-
const
|
|
413
|
-
const newValue = BigInt(
|
|
413
|
+
const currentProvenCheckpointNumber = currentValue ? hexToBigInt(currentValue) & (1n << 128n) - 1n : 0n;
|
|
414
|
+
const newValue = BigInt(forcePendingCheckpointNumber) << 128n | currentProvenCheckpointNumber;
|
|
414
415
|
return [
|
|
415
416
|
{
|
|
416
417
|
address: this.address,
|
|
@@ -423,14 +424,14 @@ export class RollupContract {
|
|
|
423
424
|
}
|
|
424
425
|
];
|
|
425
426
|
}
|
|
426
|
-
/** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(
|
|
427
|
+
/** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(checkpointNumber, attestationsAndSigners, committee, invalidIndex) {
|
|
427
428
|
return {
|
|
428
429
|
to: this.address,
|
|
429
430
|
data: encodeFunctionData({
|
|
430
431
|
abi: RollupAbi,
|
|
431
432
|
functionName: 'invalidateBadAttestation',
|
|
432
433
|
args: [
|
|
433
|
-
BigInt(
|
|
434
|
+
BigInt(checkpointNumber),
|
|
434
435
|
attestationsAndSigners,
|
|
435
436
|
committee.map((addr)=>addr.toString()),
|
|
436
437
|
BigInt(invalidIndex)
|
|
@@ -438,27 +439,27 @@ export class RollupContract {
|
|
|
438
439
|
})
|
|
439
440
|
};
|
|
440
441
|
}
|
|
441
|
-
/** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(
|
|
442
|
+
/** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(checkpointNumber, attestationsAndSigners, committee) {
|
|
442
443
|
return {
|
|
443
444
|
to: this.address,
|
|
444
445
|
data: encodeFunctionData({
|
|
445
446
|
abi: RollupAbi,
|
|
446
447
|
functionName: 'invalidateInsufficientAttestations',
|
|
447
448
|
args: [
|
|
448
|
-
BigInt(
|
|
449
|
+
BigInt(checkpointNumber),
|
|
449
450
|
attestationsAndSigners,
|
|
450
451
|
committee.map((addr)=>addr.toString())
|
|
451
452
|
]
|
|
452
453
|
})
|
|
453
454
|
};
|
|
454
455
|
}
|
|
455
|
-
/** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber,
|
|
456
|
+
/** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber, numberOfCheckpointsInEpoch, prover) {
|
|
456
457
|
if (prover instanceof EthAddress) {
|
|
457
458
|
prover = prover.toString();
|
|
458
459
|
}
|
|
459
460
|
return this.rollup.read.getHasSubmitted([
|
|
460
461
|
BigInt(epochNumber),
|
|
461
|
-
BigInt(
|
|
462
|
+
BigInt(numberOfCheckpointsInEpoch),
|
|
462
463
|
prover
|
|
463
464
|
]);
|
|
464
465
|
}
|
|
@@ -473,10 +474,10 @@ export class RollupContract {
|
|
|
473
474
|
timestamp
|
|
474
475
|
]);
|
|
475
476
|
}
|
|
476
|
-
async status(
|
|
477
|
+
async status(checkpointNumber, options) {
|
|
477
478
|
await checkBlockTag(options?.blockNumber, this.client);
|
|
478
479
|
return this.rollup.read.status([
|
|
479
|
-
|
|
480
|
+
checkpointNumber
|
|
480
481
|
], options);
|
|
481
482
|
}
|
|
482
483
|
async canPruneAtTime(timestamp, options) {
|
|
@@ -488,9 +489,9 @@ export class RollupContract {
|
|
|
488
489
|
archive() {
|
|
489
490
|
return this.rollup.read.archive();
|
|
490
491
|
}
|
|
491
|
-
archiveAt(
|
|
492
|
+
archiveAt(checkpointNumber) {
|
|
492
493
|
return this.rollup.read.archiveAt([
|
|
493
|
-
|
|
494
|
+
checkpointNumber
|
|
494
495
|
]);
|
|
495
496
|
}
|
|
496
497
|
getSequencerRewards(address) {
|
|
@@ -536,9 +537,9 @@ export class RollupContract {
|
|
|
536
537
|
address
|
|
537
538
|
]);
|
|
538
539
|
}
|
|
539
|
-
getBlobCommitmentsHash(
|
|
540
|
+
getBlobCommitmentsHash(checkpointNumber) {
|
|
540
541
|
return this.rollup.read.getBlobCommitmentsHash([
|
|
541
|
-
|
|
542
|
+
checkpointNumber
|
|
542
543
|
]);
|
|
543
544
|
}
|
|
544
545
|
getCurrentBlobCommitmentsHash() {
|
|
@@ -584,14 +585,14 @@ export class RollupContract {
|
|
|
584
585
|
}
|
|
585
586
|
});
|
|
586
587
|
}
|
|
587
|
-
|
|
588
|
-
return this.rollup.watchEvent.
|
|
588
|
+
listenToCheckpointInvalidated(callback) {
|
|
589
|
+
return this.rollup.watchEvent.CheckpointInvalidated({}, {
|
|
589
590
|
onLogs: (logs)=>{
|
|
590
591
|
for (const log of logs){
|
|
591
592
|
const args = log.args;
|
|
592
|
-
if (args.
|
|
593
|
+
if (args.checkpointNumber !== undefined) {
|
|
593
594
|
callback({
|
|
594
|
-
|
|
595
|
+
checkpointNumber: args.checkpointNumber
|
|
595
596
|
});
|
|
596
597
|
}
|
|
597
598
|
}
|
|
@@ -310,8 +310,8 @@ export const deploySharedContracts = async (l1Client, deployer, args, logger)=>{
|
|
|
310
310
|
const registry = new RegistryContract(l1Client, registryAddress);
|
|
311
311
|
/* -------------------------------------------------------------------------- */ /* FUND REWARD DISTRIBUTOR START */ /* -------------------------------------------------------------------------- */ const rewardDistributorAddress = await registry.getRewardDistributor();
|
|
312
312
|
if (!args.existingTokenAddress) {
|
|
313
|
-
const
|
|
314
|
-
const funding =
|
|
313
|
+
const checkpointReward = getRewardConfig(networkName).checkpointReward;
|
|
314
|
+
const funding = checkpointReward * 200000n;
|
|
315
315
|
const { txHash: fundRewardDistributorTxHash } = await deployer.sendTransaction({
|
|
316
316
|
to: feeAssetAddress.toString(),
|
|
317
317
|
data: encodeFunctionData({
|