@aztec/ethereum 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0

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.
Files changed (224) hide show
  1. package/dest/client.d.ts +25 -3
  2. package/dest/client.d.ts.map +1 -1
  3. package/dest/client.js +60 -4
  4. package/dest/config.d.ts +45 -73
  5. package/dest/config.d.ts.map +1 -1
  6. package/dest/config.js +114 -386
  7. package/dest/contracts/chain_state_override.d.ts +78 -0
  8. package/dest/contracts/chain_state_override.d.ts.map +1 -0
  9. package/dest/contracts/chain_state_override.js +137 -0
  10. package/dest/contracts/empire_base.d.ts +2 -1
  11. package/dest/contracts/empire_base.d.ts.map +1 -1
  12. package/dest/contracts/fee_asset_handler.d.ts +6 -5
  13. package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
  14. package/dest/contracts/fee_asset_handler.js +11 -9
  15. package/dest/contracts/fee_asset_price_oracle.d.ts +105 -0
  16. package/dest/contracts/fee_asset_price_oracle.d.ts.map +1 -0
  17. package/dest/contracts/fee_asset_price_oracle.js +656 -0
  18. package/dest/contracts/governance.d.ts +110 -33
  19. package/dest/contracts/governance.d.ts.map +1 -1
  20. package/dest/contracts/governance.js +207 -16
  21. package/dest/contracts/governance_proposer.d.ts +34 -1
  22. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  23. package/dest/contracts/governance_proposer.js +447 -10
  24. package/dest/contracts/gse.d.ts +4 -2
  25. package/dest/contracts/gse.d.ts.map +1 -1
  26. package/dest/contracts/gse.js +2 -2
  27. package/dest/contracts/inbox.d.ts +24 -3
  28. package/dest/contracts/inbox.d.ts.map +1 -1
  29. package/dest/contracts/inbox.js +42 -2
  30. package/dest/contracts/index.d.ts +6 -3
  31. package/dest/contracts/index.d.ts.map +1 -1
  32. package/dest/contracts/index.js +5 -2
  33. package/dest/contracts/log.d.ts +13 -0
  34. package/dest/contracts/log.d.ts.map +1 -0
  35. package/dest/contracts/log.js +1 -0
  36. package/dest/contracts/multicall.d.ts +130 -13
  37. package/dest/contracts/multicall.d.ts.map +1 -1
  38. package/dest/contracts/multicall.js +203 -93
  39. package/dest/contracts/outbox.d.ts +64 -0
  40. package/dest/contracts/outbox.d.ts.map +1 -0
  41. package/dest/contracts/outbox.js +113 -0
  42. package/dest/contracts/registry.d.ts +3 -1
  43. package/dest/contracts/registry.d.ts.map +1 -1
  44. package/dest/contracts/registry.js +30 -1
  45. package/dest/contracts/rollup.d.ts +5571 -102
  46. package/dest/contracts/rollup.d.ts.map +1 -1
  47. package/dest/contracts/rollup.js +1076 -192
  48. package/dest/contracts/{tally_slashing_proposer.d.ts → slashing_proposer.d.ts} +5 -5
  49. package/dest/contracts/slashing_proposer.d.ts.map +1 -0
  50. package/dest/contracts/{tally_slashing_proposer.js → slashing_proposer.js} +18 -13
  51. package/dest/deploy_aztec_l1_contracts.d.ts +267 -0
  52. package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -0
  53. package/dest/deploy_aztec_l1_contracts.js +424 -0
  54. package/dest/deploy_l1_contract.d.ts +68 -0
  55. package/dest/deploy_l1_contract.d.ts.map +1 -0
  56. package/dest/deploy_l1_contract.js +312 -0
  57. package/dest/forwarder_proxy.d.ts +32 -0
  58. package/dest/forwarder_proxy.d.ts.map +1 -0
  59. package/dest/forwarder_proxy.js +93 -0
  60. package/dest/foundry_binary.d.ts +13 -0
  61. package/dest/foundry_binary.d.ts.map +1 -0
  62. package/dest/foundry_binary.js +52 -0
  63. package/dest/l1_artifacts.d.ts +19674 -16606
  64. package/dest/l1_artifacts.d.ts.map +1 -1
  65. package/dest/l1_artifacts.js +9 -24
  66. package/dest/l1_contract_addresses.d.ts +61 -65
  67. package/dest/l1_contract_addresses.d.ts.map +1 -1
  68. package/dest/l1_contract_addresses.js +99 -80
  69. package/dest/l1_reader.d.ts +7 -5
  70. package/dest/l1_reader.d.ts.map +1 -1
  71. package/dest/l1_reader.js +15 -7
  72. package/dest/l1_tx_utils/config.d.ts +9 -3
  73. package/dest/l1_tx_utils/config.d.ts.map +1 -1
  74. package/dest/l1_tx_utils/config.js +34 -7
  75. package/dest/l1_tx_utils/constants.d.ts +8 -2
  76. package/dest/l1_tx_utils/constants.d.ts.map +1 -1
  77. package/dest/l1_tx_utils/constants.js +27 -2
  78. package/dest/l1_tx_utils/factory.d.ts +18 -10
  79. package/dest/l1_tx_utils/factory.d.ts.map +1 -1
  80. package/dest/l1_tx_utils/factory.js +17 -7
  81. package/dest/l1_tx_utils/fee-strategies/index.d.ts +10 -0
  82. package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -0
  83. package/dest/l1_tx_utils/fee-strategies/index.js +12 -0
  84. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +8 -0
  85. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -0
  86. package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +129 -0
  87. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +23 -0
  88. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -0
  89. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +191 -0
  90. package/dest/l1_tx_utils/fee-strategies/types.d.ts +51 -0
  91. package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -0
  92. package/dest/l1_tx_utils/fee-strategies/types.js +3 -0
  93. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
  94. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
  95. package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +42 -0
  96. package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
  97. package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
  98. package/dest/l1_tx_utils/index-blobs.js +2 -0
  99. package/dest/l1_tx_utils/index.d.ts +4 -1
  100. package/dest/l1_tx_utils/index.d.ts.map +1 -1
  101. package/dest/l1_tx_utils/index.js +3 -0
  102. package/dest/l1_tx_utils/interfaces.d.ts +2 -2
  103. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -1
  104. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +252 -0
  105. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -0
  106. package/dest/l1_tx_utils/l1_fee_analyzer.js +568 -0
  107. package/dest/l1_tx_utils/l1_tx_utils.d.ts +26 -7
  108. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
  109. package/dest/l1_tx_utils/l1_tx_utils.js +202 -92
  110. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +4 -15
  111. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
  112. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +63 -165
  113. package/dest/l1_tx_utils/tx_delayer.d.ts +58 -0
  114. package/dest/l1_tx_utils/tx_delayer.d.ts.map +1 -0
  115. package/dest/{test → l1_tx_utils}/tx_delayer.js +70 -39
  116. package/dest/l1_tx_utils/types.d.ts +27 -1
  117. package/dest/l1_tx_utils/types.d.ts.map +1 -1
  118. package/dest/l1_tx_utils/types.js +10 -0
  119. package/dest/publisher_manager.d.ts +34 -7
  120. package/dest/publisher_manager.d.ts.map +1 -1
  121. package/dest/publisher_manager.js +119 -8
  122. package/dest/queries.d.ts +14 -3
  123. package/dest/queries.d.ts.map +1 -1
  124. package/dest/queries.js +80 -7
  125. package/dest/test/blob_kzg_warmup.d.ts +19 -0
  126. package/dest/test/blob_kzg_warmup.d.ts.map +1 -0
  127. package/dest/test/blob_kzg_warmup.js +64 -0
  128. package/dest/test/chain_monitor.d.ts +55 -4
  129. package/dest/test/chain_monitor.d.ts.map +1 -1
  130. package/dest/test/chain_monitor.js +105 -5
  131. package/dest/test/eth_cheat_codes.d.ts +49 -6
  132. package/dest/test/eth_cheat_codes.d.ts.map +1 -1
  133. package/dest/test/eth_cheat_codes.js +93 -43
  134. package/dest/test/index.d.ts +2 -3
  135. package/dest/test/index.d.ts.map +1 -1
  136. package/dest/test/index.js +1 -2
  137. package/dest/test/rollup_cheat_codes.d.ts +64 -4
  138. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  139. package/dest/test/rollup_cheat_codes.js +109 -8
  140. package/dest/test/start_anvil.d.ts +24 -2
  141. package/dest/test/start_anvil.d.ts.map +1 -1
  142. package/dest/test/start_anvil.js +182 -32
  143. package/dest/test/upgrade_utils.js +2 -2
  144. package/dest/types.d.ts +57 -2
  145. package/dest/types.d.ts.map +1 -1
  146. package/dest/utils.d.ts +24 -4
  147. package/dest/utils.d.ts.map +1 -1
  148. package/dest/utils.js +112 -16
  149. package/package.json +31 -15
  150. package/src/client.ts +66 -2
  151. package/src/config.ts +153 -469
  152. package/src/contracts/README.md +157 -0
  153. package/src/contracts/chain_state_override.ts +200 -0
  154. package/src/contracts/empire_base.ts +1 -1
  155. package/src/contracts/fee_asset_handler.ts +10 -7
  156. package/src/contracts/fee_asset_price_oracle.ts +285 -0
  157. package/src/contracts/governance.ts +279 -13
  158. package/src/contracts/governance_proposer.ts +64 -3
  159. package/src/contracts/gse.ts +7 -2
  160. package/src/contracts/inbox.ts +64 -4
  161. package/src/contracts/index.ts +5 -2
  162. package/src/contracts/log.ts +13 -0
  163. package/src/contracts/multicall.ts +247 -103
  164. package/src/contracts/outbox.ts +132 -0
  165. package/src/contracts/registry.ts +31 -1
  166. package/src/contracts/rollup.ts +789 -154
  167. package/src/contracts/{tally_slashing_proposer.ts → slashing_proposer.ts} +18 -14
  168. package/src/deploy_aztec_l1_contracts.ts +664 -0
  169. package/src/deploy_l1_contract.ts +362 -0
  170. package/src/forwarder_proxy.ts +108 -0
  171. package/src/foundry_binary.ts +57 -0
  172. package/src/l1_artifacts.ts +12 -35
  173. package/src/l1_contract_addresses.ts +120 -92
  174. package/src/l1_reader.ts +25 -10
  175. package/src/l1_tx_utils/config.ts +47 -9
  176. package/src/l1_tx_utils/constants.ts +13 -2
  177. package/src/l1_tx_utils/factory.ts +31 -31
  178. package/src/l1_tx_utils/fee-strategies/index.ts +22 -0
  179. package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +163 -0
  180. package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +245 -0
  181. package/src/l1_tx_utils/fee-strategies/types.ts +56 -0
  182. package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +108 -0
  183. package/src/l1_tx_utils/index-blobs.ts +2 -0
  184. package/src/l1_tx_utils/index.ts +3 -0
  185. package/src/l1_tx_utils/interfaces.ts +1 -1
  186. package/src/l1_tx_utils/l1_fee_analyzer.ts +875 -0
  187. package/src/l1_tx_utils/l1_tx_utils.ts +194 -72
  188. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +77 -211
  189. package/src/{test → l1_tx_utils}/tx_delayer.ts +97 -58
  190. package/src/l1_tx_utils/types.ts +32 -0
  191. package/src/publisher_manager.ts +145 -12
  192. package/src/queries.ts +87 -7
  193. package/src/test/blob_kzg_warmup.ts +65 -0
  194. package/src/test/chain_monitor.ts +150 -4
  195. package/src/test/eth_cheat_codes.ts +84 -47
  196. package/src/test/index.ts +1 -2
  197. package/src/test/rollup_cheat_codes.ts +136 -8
  198. package/src/test/start_anvil.ts +213 -31
  199. package/src/test/upgrade_utils.ts +2 -2
  200. package/src/types.ts +62 -0
  201. package/src/utils.ts +128 -19
  202. package/dest/contracts/empire_slashing_proposer.d.ts +0 -66
  203. package/dest/contracts/empire_slashing_proposer.d.ts.map +0 -1
  204. package/dest/contracts/empire_slashing_proposer.js +0 -200
  205. package/dest/contracts/tally_slashing_proposer.d.ts.map +0 -1
  206. package/dest/deploy_l1_contracts.d.ts +0 -673
  207. package/dest/deploy_l1_contracts.d.ts.map +0 -1
  208. package/dest/deploy_l1_contracts.js +0 -1491
  209. package/dest/index.d.ts +0 -18
  210. package/dest/index.d.ts.map +0 -1
  211. package/dest/index.js +0 -17
  212. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +0 -26
  213. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +0 -1
  214. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +0 -26
  215. package/dest/test/delayed_tx_utils.d.ts +0 -13
  216. package/dest/test/delayed_tx_utils.d.ts.map +0 -1
  217. package/dest/test/delayed_tx_utils.js +0 -28
  218. package/dest/test/tx_delayer.d.ts +0 -36
  219. package/dest/test/tx_delayer.d.ts.map +0 -1
  220. package/src/contracts/empire_slashing_proposer.ts +0 -265
  221. package/src/deploy_l1_contracts.ts +0 -1869
  222. package/src/index.ts +0 -17
  223. package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +0 -77
  224. package/src/test/delayed_tx_utils.ts +0 -52
@@ -1,4 +1,5 @@
1
- import { InboxContract, type RollupContract } from '@aztec/ethereum/contracts';
1
+ import type { ManaMinFeeComponents, RollupContract } from '@aztec/ethereum/contracts';
2
+ import { InboxContract } from '@aztec/ethereum/contracts';
2
3
  import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
3
4
  import { EthAddress } from '@aztec/foundation/eth-address';
4
5
  import { createLogger } from '@aztec/foundation/log';
@@ -9,6 +10,20 @@ import { EventEmitter } from 'events';
9
10
 
10
11
  import type { ViemClient } from '../types.js';
11
12
 
13
+ /** L2 fee data reported by the chain monitor. */
14
+ export type L2FeeData = ManaMinFeeComponents & {
15
+ /** Total minimum fee per mana in Fee Juice (sum of sequencerCost + proverCost + congestionCost). */
16
+ minFeePerMana: bigint;
17
+ /** L1 base fee observed by the oracle. */
18
+ l1BaseFee: bigint;
19
+ /** L1 blob fee observed by the oracle. */
20
+ l1BlobFee: bigint;
21
+ /** ETH per fee asset exchange rate (1e12 precision). */
22
+ ethPerFeeAsset: bigint;
23
+ /** Mana target per checkpoint. */
24
+ manaTarget: bigint;
25
+ };
26
+
12
27
  export type ChainMonitorEventMap = {
13
28
  'l1-block': [{ l1BlockNumber: number; timestamp: bigint }];
14
29
  checkpoint: [
@@ -18,11 +33,23 @@ export type ChainMonitorEventMap = {
18
33
  'l2-messages': [{ totalL2Messages: number; l1BlockNumber: number }];
19
34
  'l2-epoch': [{ l2EpochNumber: EpochNumber; timestamp: bigint; committee: EthAddress[] | undefined }];
20
35
  'l2-slot': [{ l2SlotNumber: SlotNumber; timestamp: bigint }];
36
+ 'l2-fees': [L2FeeData];
37
+ };
38
+
39
+ /** Options for tuning what the {@link ChainMonitor} polls on each new L1 block. */
40
+ export type ChainMonitorOptions = {
41
+ /**
42
+ * Whether to fetch L2 fee/oracle data (5 extra rollup reads per new L1 block) and emit `l2-fees`.
43
+ * Defaults to `true`. Set to `false` for tests that only care about slot/checkpoint/proven state to
44
+ * avoid the extra round-trips.
45
+ */
46
+ includeFeeData?: boolean;
21
47
  };
22
48
 
23
49
  /** Utility class that polls the chain on quick intervals and logs new L1 blocks, L2 blocks, and L2 proofs. */
24
50
  export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
25
51
  private readonly l1Client: ViemClient;
52
+ private readonly includeFeeData: boolean;
26
53
  private inbox: InboxContract | undefined;
27
54
  private handle: NodeJS.Timeout | undefined;
28
55
  // eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
@@ -44,15 +71,19 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
44
71
  public l2EpochNumber!: EpochNumber;
45
72
  /** Current L2 slot number */
46
73
  public l2SlotNumber!: SlotNumber;
74
+ /** Current L2 fee data (components of the minimum fee per mana). */
75
+ public l2FeeData!: L2FeeData;
47
76
 
48
77
  constructor(
49
78
  private readonly rollup: RollupContract,
50
79
  private readonly dateProvider: DateProvider = new DateProvider(),
51
80
  private readonly logger = createLogger('aztecjs:utils:chain_monitor'),
52
81
  private readonly intervalMs = 200,
82
+ options: ChainMonitorOptions = {},
53
83
  ) {
54
84
  super();
55
85
  this.l1Client = rollup.client;
86
+ this.includeFeeData = options.includeFeeData ?? true;
56
87
  }
57
88
 
58
89
  start() {
@@ -76,7 +107,7 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
76
107
  }
77
108
  }
78
109
 
79
- private async getInbox() {
110
+ protected async getInbox() {
80
111
  if (!this.inbox) {
81
112
  const { inboxAddress } = await this.rollup.getRollupAddresses();
82
113
  this.inbox = new InboxContract(this.l1Client, inboxAddress);
@@ -155,9 +186,9 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
155
186
  let committee: EthAddress[] | undefined;
156
187
  if (l2Epoch !== this.l2EpochNumber) {
157
188
  this.l2EpochNumber = l2Epoch;
158
- committee = (await this.rollup.getCurrentEpochCommittee())?.map(addr => EthAddress.fromString(addr));
189
+ committee = await this.rollup.getCurrentEpochCommittee();
159
190
  this.emit('l2-epoch', { l2EpochNumber: l2Epoch, timestamp, committee });
160
- msg += ` starting new epoch ${this.l2EpochNumber} `;
191
+ msg += ` starting new epoch ${this.l2EpochNumber}`;
161
192
  }
162
193
 
163
194
  if (l2SlotNumber !== this.l2SlotNumber) {
@@ -165,6 +196,15 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
165
196
  this.emit('l2-slot', { l2SlotNumber, timestamp });
166
197
  }
167
198
 
199
+ if (this.includeFeeData) {
200
+ const feeData = await this.fetchFeeData(timestamp);
201
+ if (this.hasFeeDataChanged(feeData)) {
202
+ msg += ` with L2 min fee ${feeData.minFeePerMana}`;
203
+ this.l2FeeData = feeData;
204
+ this.emit('l2-fees', feeData);
205
+ }
206
+ }
207
+
168
208
  this.logger.info(msg, {
169
209
  currentTimestamp: this.dateProvider.nowInSeconds(),
170
210
  l1Timestamp: timestamp,
@@ -175,6 +215,7 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
175
215
  provenCheckpointNumber: this.provenCheckpointNumber,
176
216
  totalL2Messages: this.totalL2Messages,
177
217
  committee,
218
+ ...this.l2FeeData,
178
219
  });
179
220
 
180
221
  return this;
@@ -195,6 +236,11 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
195
236
  });
196
237
  }
197
238
 
239
+ public async waitUntilNextL2Slot(): Promise<void> {
240
+ const targetSlot = SlotNumber.add((await this.run()).l2SlotNumber, 1);
241
+ return this.waitUntilL2Slot(targetSlot);
242
+ }
243
+
198
244
  public waitUntilL1Block(block: number | bigint): Promise<void> {
199
245
  const targetBlock = typeof block === 'bigint' ? block.valueOf() : block;
200
246
  if (this.l1BlockNumber >= targetBlock) {
@@ -241,4 +287,104 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
241
287
  this.on('checkpoint', listener);
242
288
  });
243
289
  }
290
+
291
+ /**
292
+ * Resolves with the first `checkpoint` event whose payload satisfies `match`. Unlike
293
+ * {@link waitUntilCheckpoint} (which waits for a target number), this lets callers wait for an
294
+ * arbitrary checkpoint property (e.g. one published in the first half of its slot). Rejects after
295
+ * `opts.timeout` ms if provided; otherwise waits indefinitely.
296
+ *
297
+ * By default this is purely event-driven and only resolves on the *next* matching checkpoint that
298
+ * arrives after the call. Set `checkCurrentCheckpoint` to also test the current checkpoint first (via
299
+ * a fresh {@link run} snapshot) and short-circuit if it already satisfies `match`. Use it only for
300
+ * latching state predicates (e.g. "checkpoint number has passed N"), where an already-satisfied
301
+ * result is valid and you want to avoid missing an advance that landed before the listener attached.
302
+ * Do NOT set it when the predicate depends on observing the checkpoint live (e.g. one published
303
+ * mid-slot that the caller then times against wall-clock), since it may return a checkpoint whose
304
+ * slot has already elapsed.
305
+ */
306
+ public async waitForCheckpoint(
307
+ match: (event: ChainMonitorEventMap['checkpoint'][0]) => boolean,
308
+ opts: { timeout?: number; checkCurrentCheckpoint?: boolean } = {},
309
+ ): Promise<ChainMonitorEventMap['checkpoint'][0]> {
310
+ if (opts.checkCurrentCheckpoint) {
311
+ await this.run();
312
+ const current: ChainMonitorEventMap['checkpoint'][0] = {
313
+ checkpointNumber: this.checkpointNumber,
314
+ l1BlockNumber: this.l1BlockNumber,
315
+ l2SlotNumber: this.l2SlotNumber,
316
+ timestamp: this.checkpointTimestamp,
317
+ };
318
+ if (match(current)) {
319
+ return current;
320
+ }
321
+ }
322
+ return new Promise((resolve, reject) => {
323
+ let timer: NodeJS.Timeout | undefined;
324
+ const listener = (event: ChainMonitorEventMap['checkpoint'][0]) => {
325
+ if (match(event)) {
326
+ if (timer) {
327
+ clearTimeout(timer);
328
+ }
329
+ this.off('checkpoint', listener);
330
+ resolve(event);
331
+ }
332
+ };
333
+ if (opts.timeout !== undefined) {
334
+ timer = setTimeout(() => {
335
+ this.off('checkpoint', listener);
336
+ reject(new Error(`Timed out after ${opts.timeout}ms waiting for a matching checkpoint`));
337
+ }, opts.timeout);
338
+ }
339
+ this.on('checkpoint', listener);
340
+ });
341
+ }
342
+
343
+ /** Resolves once the proven checkpoint number reaches `checkpointNumber`. */
344
+ public waitUntilCheckpointProven(checkpointNumber: CheckpointNumber): Promise<void> {
345
+ if (this.provenCheckpointNumber >= checkpointNumber) {
346
+ return Promise.resolve();
347
+ }
348
+ return new Promise(resolve => {
349
+ const listener = (data: { provenCheckpointNumber: CheckpointNumber; timestamp: bigint }) => {
350
+ if (data.provenCheckpointNumber >= checkpointNumber) {
351
+ this.off('checkpoint-proven', listener);
352
+ resolve();
353
+ }
354
+ };
355
+ this.on('checkpoint-proven', listener);
356
+ });
357
+ }
358
+
359
+ private async fetchFeeData(timestamp: bigint): Promise<L2FeeData> {
360
+ const [components, minFeePerMana, l1Fees, ethPerFeeAsset, manaTarget] = await Promise.all([
361
+ this.rollup.getManaMinFeeComponentsAt(timestamp, true),
362
+ this.rollup.getManaMinFeeAt(timestamp, true),
363
+ this.rollup.getL1FeesAt(timestamp),
364
+ this.rollup.getEthPerFeeAsset(),
365
+ this.rollup.getManaTarget(),
366
+ ]);
367
+ return {
368
+ ...components,
369
+ minFeePerMana,
370
+ l1BaseFee: l1Fees.baseFee,
371
+ l1BlobFee: l1Fees.blobFee,
372
+ ethPerFeeAsset,
373
+ manaTarget,
374
+ };
375
+ }
376
+
377
+ private hasFeeDataChanged(newData: L2FeeData): boolean {
378
+ if (!this.l2FeeData) {
379
+ return true;
380
+ }
381
+ return (
382
+ this.l2FeeData.sequencerCost !== newData.sequencerCost ||
383
+ this.l2FeeData.proverCost !== newData.proverCost ||
384
+ this.l2FeeData.congestionCost !== newData.congestionCost ||
385
+ this.l2FeeData.l1BaseFee !== newData.l1BaseFee ||
386
+ this.l2FeeData.l1BlobFee !== newData.l1BlobFee ||
387
+ this.l2FeeData.ethPerFeeAsset !== newData.ethPerFeeAsset
388
+ );
389
+ }
244
390
  }
@@ -1,5 +1,5 @@
1
1
  import { toBigIntBE, toHex } from '@aztec/foundation/bigint-buffer';
2
- import { keccak256 } from '@aztec/foundation/crypto';
2
+ import { keccak256 } from '@aztec/foundation/crypto/keccak';
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';
@@ -35,7 +35,7 @@ export class EthCheatCodes {
35
35
  public chain: Chain = foundry,
36
36
  ) {
37
37
  this.publicClient = createPublicClient({
38
- transport: fallback(this.rpcUrls.map(url => http(url))),
38
+ transport: fallback(this.rpcUrls.map(url => http(url, { batch: false }))),
39
39
  chain: chain,
40
40
  });
41
41
  }
@@ -85,14 +85,26 @@ export class EthCheatCodes {
85
85
  }
86
86
 
87
87
  /**
88
- * Get the current timestamp
89
- * @returns The current timestamp
88
+ * Get the timestamp of the latest mined L1 block.
89
+ * Note: this is NOT the current time — it's the discrete timestamp of the last block.
90
+ * Between blocks, the actual chain time advances but no new block reflects it.
91
+ * @returns The latest block timestamp in seconds
90
92
  */
91
- public async timestamp(): Promise<number> {
93
+ public async lastBlockTimestamp(): Promise<number> {
92
94
  const res = await this.doRpcCall('eth_getBlockByNumber', ['latest', true]);
93
95
  return parseInt(res.timestamp, 16);
94
96
  }
95
97
 
98
+ /**
99
+ * Get the timestamp of the pending L1 block — the block that anvil will mine next.
100
+ * Reflects any prior `setNextBlockTimestamp` call or the configured block interval.
101
+ * @returns The pending block timestamp in seconds.
102
+ */
103
+ public async nextBlockTimestamp(): Promise<number> {
104
+ const res = await this.doRpcCall('eth_getBlockByNumber', ['pending', false]);
105
+ return parseInt(res.timestamp, 16);
106
+ }
107
+
96
108
  /**
97
109
  * Advance the chain by a number of blocks
98
110
  * @param numberOfBlocks - The number of blocks to mine
@@ -194,6 +206,22 @@ export class EthCheatCodes {
194
206
  }
195
207
  }
196
208
 
209
+ /**
210
+ * Starts interval mining from a freshly mined block and syncs the date provider to the block timestamp.
211
+ */
212
+ public async startIntervalMiningWithFreshBlock(seconds: number): Promise<void> {
213
+ if (seconds <= 0) {
214
+ throw new Error(`Interval mining requires a positive interval, got ${seconds}`);
215
+ }
216
+
217
+ await this.setAutomine(false);
218
+ await this.setIntervalMining(0, { silent: true });
219
+ await this.evmMine();
220
+ await this.syncDateProvider();
221
+ await this.setIntervalMining(seconds);
222
+ this.logger.warn(`Started L1 interval mining at ${seconds} seconds from a fresh block`);
223
+ }
224
+
197
225
  /**
198
226
  * Set the automine status of the underlying anvil chain
199
227
  * @param automine - The automine status to set
@@ -466,58 +494,67 @@ export class EthCheatCodes {
466
494
  }
467
495
 
468
496
  /**
469
- * Mines an empty block by temporarily removing all pending transactions from the mempool,
470
- * mining a block, and then re-adding the transactions back to the pool.
497
+ * Mines empty blocks while leaving any pending transactions untouched in the mempool.
498
+ *
499
+ * Never manipulates the mempool, so it is immune to the race that dropping and re-adding txs has against a
500
+ * concurrent publisher that is monitoring and re-broadcasting the same in-flight tx (with that approach the
501
+ * in-flight tx could reappear in the pool and be swept into the "empty" block, mining a proposal the caller
502
+ * expected to stay pending). Works in two steps: first the block gas limit is temporarily lowered below the
503
+ * intrinsic cost of any transaction (21000 gas) and the blocks are mined, so no pending tx is includable;
504
+ * then those blocks are reorged out and replaced with empty blocks mined at the restored gas limit. The
505
+ * reorg is needed because anvil applies a new gas limit only to future blocks: without it the just-mined
506
+ * blocks would keep the tiny gas limit, and an `eth_call` against `latest` (whose gas is capped by the
507
+ * block gas limit) would revert with "intrinsic gas too high".
508
+ *
509
+ * The replacement blocks advance L1 time. `anvil_reorg` stamps each replacement as `parent + N*interval`,
510
+ * so on its own it would freeze L1 time at the parent timestamp; callers that measure elapsed L1 time
511
+ * (L1TxUtils stall/timeout detection, `syncDateProvider`-driven slot advancement) rely on it moving
512
+ * forward. We reproduce the wall-clock advance the mine step just made (at least 1s per block) via a
513
+ * temporary block-timestamp interval, then restore any pre-existing interval.
471
514
  */
472
515
  public async mineEmptyBlock(blockCount: number = 1): Promise<void> {
473
516
  await this.execWithPausedAnvil(async () => {
474
- // Get all pending and queued transactions from the pool
475
- const txs = await this.getTxPoolContents();
476
-
477
- this.logger.debug(`Found ${txs.length} transactions in pool`);
478
-
479
- // Get raw transactions before dropping them
480
- const rawTxs: Hex[] = [];
481
- for (const tx of txs) {
482
- try {
483
- const rawTx = await this.doRpcCall('debug_getRawTransaction', [tx.hash]);
484
- if (rawTx) {
485
- rawTxs.push(rawTx);
486
- this.logger.debug(`Got raw tx for ${tx.hash}`);
487
- } else {
488
- this.logger.warn(`No raw tx found for ${tx.hash}`);
489
- }
490
- } catch {
491
- this.logger.warn(`Failed to get raw transaction for ${tx.hash}`);
492
- }
517
+ const originalGasLimit = await this.getBlockGasLimit();
518
+ const parentTimestamp = await this.lastBlockTimestamp();
519
+ // anvil has no getter for the block-timestamp interval, but the pending block is stamped
520
+ // `latest + interval`, so this delta is the standing interval (0 when none is set).
521
+ const priorInterval = (await this.nextBlockTimestamp()) - parentTimestamp;
522
+ try {
523
+ await this.setBlockGasLimit(1n);
524
+ await this.doMine(blockCount);
525
+ } finally {
526
+ await this.setBlockGasLimit(originalGasLimit);
493
527
  }
494
-
495
- this.logger.debug(`Retrieved ${rawTxs.length} raw transactions`);
496
-
497
- // Drop all transactions from the mempool
498
- await this.doRpcCall('anvil_dropAllTransactions', []);
499
-
500
- // Mine an empty block
501
- await this.doMine(blockCount);
502
-
503
- // Re-add the transactions to the pool
504
- for (const rawTx of rawTxs) {
505
- try {
506
- const txHash = await this.doRpcCall('eth_sendRawTransaction', [rawTx]);
507
- this.logger.debug(`Re-added transaction ${txHash}`);
508
- } catch (err) {
509
- this.logger.warn(`Failed to re-add transaction: ${err}`);
528
+ const advance = (await this.lastBlockTimestamp()) - parentTimestamp;
529
+ const perBlockInterval = Math.max(1, Math.floor(advance / blockCount));
530
+ // Replace the tiny-gas-limit blocks with empty blocks at the restored gas limit, keeping the same
531
+ // height. The reorged-out blocks held no transactions, so nothing returns to the pool.
532
+ await this.doRpcCall('anvil_setBlockTimestampInterval', [perBlockInterval]);
533
+ try {
534
+ await this.doRpcCall('anvil_reorg', [blockCount, []]);
535
+ } finally {
536
+ if (priorInterval > 0) {
537
+ await this.doRpcCall('anvil_setBlockTimestampInterval', [priorInterval]);
538
+ } else {
539
+ await this.doRpcCall('anvil_removeBlockTimestampInterval', []);
510
540
  }
511
541
  }
512
-
513
- if (rawTxs.length !== txs.length) {
514
- this.logger.warn(`Failed to add all txs back: had ${txs.length} but re-added ${rawTxs.length}`);
515
- }
516
542
  });
517
543
 
518
544
  this.logger.warn(`Mined ${blockCount} empty L1 ${pluralize('block', blockCount)}`);
519
545
  }
520
546
 
547
+ /** Returns the gas limit of the latest mined L1 block. */
548
+ public async getBlockGasLimit(): Promise<bigint> {
549
+ const block = await this.doRpcCall('eth_getBlockByNumber', ['latest', false]);
550
+ return BigInt(block.gasLimit);
551
+ }
552
+
553
+ /** Sets the block gas limit applied to subsequently mined L1 blocks. */
554
+ public async setBlockGasLimit(gasLimit: bigint): Promise<void> {
555
+ await this.doRpcCall('anvil_setBlockGasLimit', [toHex(gasLimit)]);
556
+ }
557
+
521
558
  public async execWithPausedAnvil<T>(fn: () => Promise<T>): Promise<T> {
522
559
  const [blockInterval, wasAutoMining] = await Promise.all([this.getIntervalMining(), this.isAutoMining()]);
523
560
  try {
@@ -552,7 +589,7 @@ export class EthCheatCodes {
552
589
  }
553
590
 
554
591
  public async syncDateProvider() {
555
- const timestamp = await this.timestamp();
592
+ const timestamp = await this.lastBlockTimestamp();
556
593
  if ('setTime' in this.dateProvider) {
557
594
  this.dateProvider.setTime(timestamp * 1000);
558
595
  }
package/src/test/index.ts CHANGED
@@ -1,8 +1,7 @@
1
- export * from './delayed_tx_utils.js';
1
+ export * from './blob_kzg_warmup.js';
2
2
  export * from './eth_cheat_codes.js';
3
3
  export * from './eth_cheat_codes_with_state.js';
4
4
  export * from './start_anvil.js';
5
- export * from './tx_delayer.js';
6
5
  export * from './upgrade_utils.js';
7
6
  export * from './chain_monitor.js';
8
7
  export * from './rollup_cheat_codes.js';
@@ -1,8 +1,10 @@
1
- import { RollupContract, type ViemPublicClient } from '@aztec/ethereum';
1
+ import { OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
2
2
  import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
3
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
3
4
  import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
4
5
  import { EthAddress } from '@aztec/foundation/eth-address';
5
6
  import { createLogger } from '@aztec/foundation/log';
7
+ import { retryUntil } from '@aztec/foundation/retry';
6
8
  import type { DateProvider } from '@aztec/foundation/timer';
7
9
  import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
8
10
 
@@ -14,6 +16,7 @@ import {
14
16
  getContract,
15
17
  hexToBigInt,
16
18
  http,
19
+ keccak256,
17
20
  } from 'viem';
18
21
 
19
22
  import { EthCheatCodes } from './eth_cheat_codes.js';
@@ -31,7 +34,7 @@ export class RollupCheatCodes {
31
34
  ) {
32
35
  this.client = createPublicClient({
33
36
  chain: ethCheatCodes.chain,
34
- transport: fallback(ethCheatCodes.rpcUrls.map(url => http(url))),
37
+ transport: fallback(ethCheatCodes.rpcUrls.map(url => http(url, { batch: false }))),
35
38
  });
36
39
  this.rollup = getContract({
37
40
  abi: RollupAbi,
@@ -52,7 +55,26 @@ export class RollupCheatCodes {
52
55
  /** Returns the current slot */
53
56
  public async getSlot(): Promise<SlotNumber> {
54
57
  const ts = BigInt((await this.client.getBlock()).timestamp);
55
- return SlotNumber.fromBigInt(await this.rollup.read.getSlotAt([ts]));
58
+ return this.getSlotAt(ts);
59
+ }
60
+
61
+ /** Returns the slot number at a given timestamp. */
62
+ public async getSlotAt(timestamp: bigint): Promise<SlotNumber> {
63
+ return SlotNumber.fromBigInt(await this.rollup.read.getSlotAt([timestamp]));
64
+ }
65
+
66
+ /** Returns the timestamp for the start of a given slot. */
67
+ public async getTimestampForSlot(slot: SlotNumber): Promise<bigint> {
68
+ return await this.rollup.read.getTimestampForSlot([BigInt(slot)]);
69
+ }
70
+
71
+ /** Returns the number of seconds until the start of the given slot based on L1 block timestamp. */
72
+ public async getSecondsUntilSlot(slot: SlotNumber): Promise<number> {
73
+ const [currentTimestamp, targetTimestamp] = await Promise.all([
74
+ this.client.getBlock().then(b => BigInt(b.timestamp)),
75
+ this.rollup.read.getTimestampForSlot([BigInt(slot)]),
76
+ ]);
77
+ return Math.max(0, Number(targetTimestamp - currentTimestamp));
56
78
  }
57
79
 
58
80
  /** Returns the current epoch */
@@ -123,11 +145,11 @@ export class RollupCheatCodes {
123
145
  } = {},
124
146
  ) {
125
147
  const { epochDuration: slotsInEpoch } = await this.getConfig();
126
- const slotNumber = SlotNumber(epoch * Number(slotsInEpoch));
148
+ const slotNumber = SlotNumber(Number(epoch) * Number(slotsInEpoch));
127
149
  const timestamp = (await this.rollup.read.getTimestampForSlot([BigInt(slotNumber)])) + BigInt(opts.offset ?? 0);
128
150
  try {
129
151
  await this.ethCheatCodes.warp(Number(timestamp), { ...opts, silent: true, resetBlockInterval: true });
130
- this.logger.warn(`Warped to epoch ${epoch}`);
152
+ this.logger.warn(`Warped to epoch ${epoch}`, { offset: opts.offset, timestamp });
131
153
  } catch (err) {
132
154
  this.logger.warn(`Warp to epoch ${epoch} failed: ${err}`);
133
155
  }
@@ -158,6 +180,21 @@ export class RollupCheatCodes {
158
180
  return [timestamp, nextSlot];
159
181
  }
160
182
 
183
+ /**
184
+ * Warps L1 time to the start of an explicit absolute slot. Unlike `advanceSlots(N)` which is
185
+ * relative to the current L1 timestamp at call time and therefore races with real-time
186
+ * progression between query and warp, this lands at the slot regardless of latency.
187
+ *
188
+ * Throws if the requested slot is in the past relative to current L1 time (anvil cannot
189
+ * rewind).
190
+ */
191
+ public async advanceToSlot(slot: SlotNumber) {
192
+ const timestamp = await this.rollup.read.getTimestampForSlot([BigInt(slot)]);
193
+ await this.ethCheatCodes.warp(Number(timestamp), { silent: true, resetBlockInterval: true });
194
+ this.logger.warn(`Advanced to slot ${slot}`, { timestamp });
195
+ return timestamp;
196
+ }
197
+
161
198
  /**
162
199
  * Warps time in L1 equivalent to however many slots.
163
200
  * @param howMany - The number of slots to advance.
@@ -175,7 +212,7 @@ export class RollupCheatCodes {
175
212
  * Marks the specified checkpoint (or latest if none) as proven
176
213
  * @param maybeCheckpointNumber - The checkpoint number to mark as proven (defaults to latest pending)
177
214
  */
178
- public markAsProven(maybeCheckpointNumber?: number | bigint) {
215
+ public markAsProven(maybeCheckpointNumber?: CheckpointNumber) {
179
216
  return this.ethCheatCodes.execWithPausedAnvil(async () => {
180
217
  const tipsBefore = await this.getTips();
181
218
  const { pending, proven } = tipsBefore;
@@ -208,6 +245,56 @@ export class RollupCheatCodes {
208
245
  });
209
246
  }
210
247
 
248
+ /**
249
+ * Polls the rollup until its current epoch reaches `epoch`. Unlike {@link advanceToEpoch} this does
250
+ * not warp the L1 clock; it only waits for the chain to reach `epoch` through external activity.
251
+ */
252
+ public async waitForEpoch(epoch: EpochNumber, opts: { timeout?: number; interval?: number } = {}): Promise<void> {
253
+ await retryUntil(
254
+ async () => (await this.getEpoch()) >= epoch || undefined,
255
+ `rollup epoch >= ${epoch}`,
256
+ opts.timeout ?? 60,
257
+ opts.interval ?? 1,
258
+ );
259
+ }
260
+
261
+ /**
262
+ * Polls the rollup until its current slot reaches `slot`. Unlike {@link advanceToSlot} this does not
263
+ * warp the L1 clock; it only waits for the chain to reach `slot` through external activity.
264
+ */
265
+ public async waitForSlot(slot: SlotNumber, opts: { timeout?: number; interval?: number } = {}): Promise<void> {
266
+ await retryUntil(
267
+ async () => (await this.getSlot()) >= slot || undefined,
268
+ `rollup slot >= ${slot}`,
269
+ opts.timeout ?? 60,
270
+ opts.interval ?? 1,
271
+ );
272
+ }
273
+
274
+ /**
275
+ * Polls the rollup until its pending checkpoint settles below `checkpoint` on a freshly mined, non-zero
276
+ * checkpoint, and returns that new pending checkpoint number. Reads the L1 rollup contract directly
277
+ * rather than a node, since a rollback lands on L1 first.
278
+ *
279
+ * A prune can momentarily drop the pending checkpoint to 0 before the post-deadline propose mines its
280
+ * replacement, so a caller detecting a rollback wants the new lower checkpoint, not that transient
281
+ * empty state — hence the non-zero guard.
282
+ */
283
+ public async waitForCheckpointBelow(
284
+ checkpoint: CheckpointNumber,
285
+ opts: { timeout?: number; interval?: number } = {},
286
+ ): Promise<CheckpointNumber> {
287
+ return await retryUntil(
288
+ async () => {
289
+ const { pending } = await this.getTips();
290
+ return pending > 0 && pending < checkpoint ? pending : undefined;
291
+ },
292
+ `rollup checkpoint in (0, ${checkpoint})`,
293
+ opts.timeout ?? 60,
294
+ opts.interval ?? 1,
295
+ );
296
+ }
297
+
211
298
  /**
212
299
  * Overrides the inProgress field of the Inbox contract state
213
300
  * @param howMuch - How many checkpoints to move it forward
@@ -249,6 +336,17 @@ export class RollupCheatCodes {
249
336
  });
250
337
  }
251
338
 
339
+ public insertOutbox(epoch: EpochNumber, numCheckpointsInEpoch: number, outHash: bigint) {
340
+ return this.ethCheatCodes.execWithPausedAnvil(async () => {
341
+ const outboxAddress = await this.rollup.read.getOutbox();
342
+ const epochRootSlot = OutboxContract.getEpochRootStorageSlot(epoch, numCheckpointsInEpoch);
343
+ await this.ethCheatCodes.store(EthAddress.fromString(outboxAddress), epochRootSlot, outHash);
344
+ this.logger.warn(
345
+ `Advanced outbox to epoch ${epoch} numCheckpointsInEpoch ${numCheckpointsInEpoch} with out hash ${outHash}`,
346
+ );
347
+ });
348
+ }
349
+
252
350
  /**
253
351
  * Executes an action impersonated as the owner of the Rollup contract.
254
352
  * @param action - The action to execute
@@ -294,7 +392,8 @@ export class RollupCheatCodes {
294
392
  }
295
393
 
296
394
  /**
297
- * Directly updates proving cost per mana.
395
+ * Directly updates proving cost per mana. Throws if the on-chain tx reverts
396
+ * (e.g. rate-limit cooldown, step cap, or floor) instead of silently succeeding.
298
397
  * @param ethValue - The new proving cost per mana in ETH
299
398
  */
300
399
  public async setProvingCostPerMana(ethValue: bigint) {
@@ -304,8 +403,37 @@ export class RollupCheatCodes {
304
403
  chain: this.client.chain,
305
404
  gasLimit: 1000000n,
306
405
  });
307
- await this.client.waitForTransactionReceipt({ hash });
406
+ const receipt = await this.client.waitForTransactionReceipt({ hash });
407
+ if (receipt.status !== 'success') {
408
+ throw new Error(
409
+ `setProvingCostPerMana(${ethValue}) reverted on L1 (tx ${hash}). ` +
410
+ `Likely FeeLib rate-limit (30-day cooldown or 1.5x step cap); ` +
411
+ `use clearProvingCostCooldown() between successive updates.`,
412
+ );
413
+ }
308
414
  this.logger.warn(`Updated proving cost per mana to ${ethValue}`);
309
415
  });
310
416
  }
417
+
418
+ /**
419
+ * Resets the 30-day proving-cost update cooldown enforced by FeeLib.updateProvingCostPerMana
420
+ * by zeroing `FeeStore.provingCostLastUpdate` directly in contract storage. Use between
421
+ * successive setProvingCostPerMana / bumpProvingCostPerMana calls so the later update can
422
+ * land instead of reverting. Does not touch L1 time, so PXE/tx-expiration state stays intact.
423
+ *
424
+ * @note This is tightly coupled to the `FeeStore` layout in
425
+ * l1-contracts/src/core/libraries/rollup/FeeLib.sol:
426
+ * slot + 0: CompressedFeeConfig config (uint256)
427
+ * slot + 1: L1GasOracleValues l1GasOracleValues (14+14+4 bytes, packed)
428
+ * slot + 2: uint64 provingCostLastUpdate (only member — zeroing the slot is safe)
429
+ * If the struct layout changes, update the offset below.
430
+ */
431
+ public async clearProvingCostCooldown() {
432
+ const feeStoreBaseSlot = hexToBigInt(keccak256(Buffer.from('aztec.fee.storage', 'utf-8')));
433
+ const provingCostLastUpdateSlot = feeStoreBaseSlot + 2n;
434
+ await this.ethCheatCodes.store(EthAddress.fromString(this.rollup.address), provingCostLastUpdateSlot, 0n, {
435
+ silent: true,
436
+ });
437
+ this.logger.warn(`Cleared proving-cost update cooldown`);
438
+ }
311
439
  }