@aztec/ethereum 3.0.0-nightly.20251124 → 3.0.0-nightly.20251126
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 +6 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +13 -7
- package/dest/contracts/rollup.d.ts +25 -23
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +48 -41
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +4 -3
- package/dest/l1_artifacts.d.ts +1582 -763
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +1 -2
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +5 -3
- 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 +16 -8
- package/src/contracts/rollup.ts +50 -40
- package/src/deploy_l1_contracts.ts +4 -3
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +1 -2
- package/src/queries.ts +6 -3
- package/src/test/chain_monitor.ts +35 -35
- package/src/test/rollup_cheat_codes.ts +18 -22
|
@@ -69,11 +69,7 @@ export class RollupCheatCodes {
|
|
|
69
69
|
/** The pending chain tip */ pending: bigint;
|
|
70
70
|
/** The proven chain tip */ proven: bigint;
|
|
71
71
|
}> {
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
pending: res.pendingBlockNumber,
|
|
75
|
-
proven: res.provenBlockNumber,
|
|
76
|
-
};
|
|
72
|
+
return await this.rollup.read.getTips();
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
/**
|
|
@@ -81,16 +77,16 @@ export class RollupCheatCodes {
|
|
|
81
77
|
*/
|
|
82
78
|
public async debugRollup() {
|
|
83
79
|
const rollup = new RollupContract(this.client, this.rollup.address);
|
|
84
|
-
const pendingNum = await rollup.
|
|
85
|
-
const provenNum = await rollup.
|
|
80
|
+
const pendingNum = await rollup.getCheckpointNumber();
|
|
81
|
+
const provenNum = await rollup.getProvenCheckpointNumber();
|
|
86
82
|
const validators = await rollup.getAttesters();
|
|
87
83
|
const committee = await rollup.getCurrentEpochCommittee();
|
|
88
84
|
const archive = await rollup.archive();
|
|
89
85
|
const slot = await this.getSlot();
|
|
90
86
|
const epochNum = await rollup.getEpochNumberForSlotNumber(slot);
|
|
91
87
|
|
|
92
|
-
this.logger.info(`Pending
|
|
93
|
-
this.logger.info(`Proven
|
|
88
|
+
this.logger.info(`Pending checkpoint num: ${pendingNum}`);
|
|
89
|
+
this.logger.info(`Proven checkpoint num: ${provenNum}`);
|
|
94
90
|
this.logger.info(`Validators: ${validators.map(v => v.toString()).join(', ')}`);
|
|
95
91
|
this.logger.info(`Committee: ${committee?.map(v => v.toString()).join(', ')}`);
|
|
96
92
|
this.logger.info(`Archive: ${archive}`);
|
|
@@ -171,34 +167,34 @@ export class RollupCheatCodes {
|
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
/**
|
|
174
|
-
* Marks the specified
|
|
175
|
-
* @param
|
|
170
|
+
* Marks the specified checkpoint (or latest if none) as proven
|
|
171
|
+
* @param maybeCheckpointNumber - The checkpoint number to mark as proven (defaults to latest pending)
|
|
176
172
|
*/
|
|
177
|
-
public markAsProven(
|
|
173
|
+
public markAsProven(maybeCheckpointNumber?: number | bigint) {
|
|
178
174
|
return this.ethCheatCodes.execWithPausedAnvil(async () => {
|
|
179
175
|
const tipsBefore = await this.getTips();
|
|
180
176
|
const { pending, proven } = tipsBefore;
|
|
181
177
|
|
|
182
|
-
let
|
|
183
|
-
if (
|
|
184
|
-
|
|
178
|
+
let checkpointNumber = maybeCheckpointNumber;
|
|
179
|
+
if (checkpointNumber === undefined || checkpointNumber > pending) {
|
|
180
|
+
checkpointNumber = pending;
|
|
185
181
|
}
|
|
186
|
-
if (
|
|
187
|
-
this.logger.debug(`
|
|
182
|
+
if (checkpointNumber <= proven) {
|
|
183
|
+
this.logger.debug(`Checkpoint ${checkpointNumber} is already proven`);
|
|
188
184
|
return;
|
|
189
185
|
}
|
|
190
186
|
|
|
191
187
|
// @note @LHerskind this is heavily dependent on the storage layout and size of values
|
|
192
188
|
// The rollupStore is a struct and if the size of elements or the struct changes, this can break
|
|
193
|
-
const
|
|
189
|
+
const provenCheckpointNumberSlot = hexToBigInt(RollupContract.stfStorageSlot);
|
|
194
190
|
|
|
195
191
|
// Need to pack it as a single 32 byte word
|
|
196
|
-
const newValue = (BigInt(tipsBefore.pending) << 128n) | BigInt(
|
|
197
|
-
await this.ethCheatCodes.store(EthAddress.fromString(this.rollup.address),
|
|
192
|
+
const newValue = (BigInt(tipsBefore.pending) << 128n) | BigInt(checkpointNumber);
|
|
193
|
+
await this.ethCheatCodes.store(EthAddress.fromString(this.rollup.address), provenCheckpointNumberSlot, newValue);
|
|
198
194
|
|
|
199
195
|
const tipsAfter = await this.getTips();
|
|
200
196
|
if (tipsAfter.pending < tipsAfter.proven) {
|
|
201
|
-
throw new Error('Overwrote pending tip to a
|
|
197
|
+
throw new Error('Overwrote pending tip to a checkpoint in the past');
|
|
202
198
|
}
|
|
203
199
|
|
|
204
200
|
this.logger.info(
|
|
@@ -209,7 +205,7 @@ export class RollupCheatCodes {
|
|
|
209
205
|
|
|
210
206
|
/**
|
|
211
207
|
* Overrides the inProgress field of the Inbox contract state
|
|
212
|
-
* @param howMuch - How many
|
|
208
|
+
* @param howMuch - How many checkpoints to move it forward
|
|
213
209
|
*/
|
|
214
210
|
public advanceInboxInProgress(howMuch: number | bigint): Promise<bigint> {
|
|
215
211
|
return this.ethCheatCodes.execWithPausedAnvil(async () => {
|