@aztec-labs/epoch-cache 6.0.0-rc.3 → 6.0.0

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.
@@ -1,13 +1,15 @@
1
1
  import { createEthereumChain } from '@aztec-labs/ethereum/chain';
2
2
  import { makeL1HttpTransport } from '@aztec-labs/ethereum/client';
3
- import { NoCommitteeError, RollupContract } from '@aztec-labs/ethereum/contracts';
3
+ import { RollupContract, isEpochNotStableError } from '@aztec-labs/ethereum/contracts';
4
4
  import { getFinalizedL1Block } from '@aztec-labs/ethereum/queries';
5
- import { SlotNumber } from '@aztec-labs/foundation/branded-types';
5
+ import { maxBigint } from '@aztec-labs/foundation/bigint';
6
+ import { EpochNumber, SlotNumber } from '@aztec-labs/foundation/branded-types';
6
7
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
7
8
  import { createLogger } from '@aztec-labs/foundation/log';
8
9
  import { DateProvider } from '@aztec-labs/foundation/timer';
9
- import { getEpochAtSlot, getEpochNumberAtTimestamp, getNextL1SlotTimestamp, getSlotAtNextL1Block, getSlotAtTimestamp, getSlotRangeForEpoch, getStartTimestampForEpoch, getTimestampForSlot } from '@aztec-labs/stdlib/epoch-helpers';
10
+ import { getEpochAtSlot, getEpochNumberAtTimestamp, getNextL1SlotTimestamp, getSlotAtNextL1Block, getSlotAtTimestamp, getSlotRangeForEpoch, getTimestampForSlot, getTimestampRangeForEpoch } from '@aztec-labs/stdlib/epoch-helpers';
10
11
  import { createPublicClient, encodeAbiParameters, keccak256 } from 'viem';
12
+ import { toCommitteeLookup, withoutMembers } from './committee_lookup.js';
11
13
  import { getEpochCacheConfigEnvVars } from './config.js';
12
14
  /** The proposer pipelines by building one slot ahead. */ export const PROPOSER_PIPELINING_SLOT_OFFSET = 1;
13
15
  /**
@@ -158,18 +160,21 @@ import { getEpochCacheConfigEnvVars } from './config.js';
158
160
  const [startSlot] = getSlotRangeForEpoch(epoch, this.l1constants);
159
161
  return this.getCommittee(startSlot);
160
162
  }
161
- /** Returns whether the escape hatch is open for the given epoch. */ async isEscapeHatchOpen(epoch) {
162
- const info = await this.getCommitteeForEpoch(epoch);
163
- return info.isEscapeHatchOpen;
163
+ /** Returns whether the escape hatch is open for the given epoch. */ async lookupEscapeHatch(epoch) {
164
+ const lookup = await this.getCommitteeForEpoch(epoch);
165
+ return lookup.state === 'unstable' ? lookup : {
166
+ state: lookup.state,
167
+ isEscapeHatchOpen: lookup.isEscapeHatchOpen
168
+ };
164
169
  }
165
170
  /**
166
171
  * Returns whether the escape hatch is open for the epoch containing the given slot.
167
172
  *
168
173
  * This is a lightweight helper intended for callers that already have a slot number and only
169
174
  * need the escape hatch flag (without pulling full committee info).
170
- */ async isEscapeHatchOpenAtSlot(slot = 'now') {
175
+ */ async lookupEscapeHatchAtSlot(slot = 'now') {
171
176
  const epoch = slot === 'now' ? this.getEpochNow() : slot === 'next' ? this.getEpochAndSlotInNextL1Slot().epoch : getEpochAtSlot(slot, this.l1constants);
172
- return await this.isEscapeHatchOpen(epoch);
177
+ return await this.lookupEscapeHatch(epoch);
173
178
  }
174
179
  /**
175
180
  * Get the current validator set.
@@ -177,36 +182,41 @@ import { getEpochCacheConfigEnvVars } from './config.js';
177
182
  * Returns cached data if the entry is finalized or still fresh (queried less than one
178
183
  * Ethereum slot ago). Stale non-finalized entries are re-queried, and concurrent callers
179
184
  * coalesce on the same in-flight promise so the L1 query happens only once.
185
+ *
186
+ * Returns `unstable` while the epoch's sample seed can still change on L1. Callers should treat that as "not known
187
+ * yet": the same query returns the committee once the seed is fixed.
180
188
  */ async getCommittee(slot = 'now') {
181
189
  const { epoch, ts } = this.getEpochAndTimestamp(slot);
190
+ const entry = await this.getEntry(epoch, ts);
191
+ if (entry.kind === 'unstable') {
192
+ return {
193
+ state: 'unstable',
194
+ epoch,
195
+ l1BlockNumber: entry.l1BlockNumber
196
+ };
197
+ }
198
+ return entry.data;
199
+ }
200
+ /** Returns the cached entry for an epoch, awaits the in-flight fetch for it, or starts a new one. */ async getEntry(epoch, ts) {
182
201
  const cached = this.cache.get(epoch);
183
202
  // In-flight promise: another caller is already fetching this epoch — just await it.
184
203
  if (cached instanceof Promise) {
185
- return (await cached).data;
204
+ return cached;
186
205
  }
187
206
  // Resolved entry: return it if finalized or still fresh.
188
- if (cached && (cached.finalized || !this.isStale(cached))) {
189
- return cached.data;
190
- }
191
- // Stale non-finalized entry: do a lightweight refresh first (check block hash + finalized ts).
192
- // Only fall back to a full re-fetch if the L1 block was reorged.
193
- if (cached) {
194
- const promise = this.refreshStaleEntry(cached, epoch, ts);
195
- this.cache.set(epoch, promise);
196
- try {
197
- return (await promise).data;
198
- } catch (err) {
199
- this.cache.set(epoch, cached);
200
- throw err;
201
- }
207
+ if (cached && (cached.kind === 'committee' && cached.finalized || !this.isStale(cached))) {
208
+ return cached;
202
209
  }
203
- // No entry at all: full fetch.
204
- const promise = this.fetchAndCache(epoch, ts);
210
+ // Stale non-finalized entry: do a lightweight refresh first (check block hash + finalized block).
211
+ // Only fall back to a full re-fetch if the L1 block was reorged. Otherwise, do a full fetch.
212
+ const promise = cached?.kind === 'committee' ? this.refreshStaleEntry(cached, epoch, ts) : this.fetchAndCache(epoch, ts);
205
213
  this.cache.set(epoch, promise);
206
214
  try {
207
- return (await promise).data;
215
+ return await promise;
208
216
  } catch (err) {
209
- this.cache.delete(epoch);
217
+ if (this.cache.get(epoch) === promise) {
218
+ this.cache.delete(epoch);
219
+ }
210
220
  throw err;
211
221
  }
212
222
  }
@@ -230,33 +240,59 @@ import { getEpochCacheConfigEnvVars } from './config.js';
230
240
  const nowSeconds = BigInt(this.dateProvider.nowInSeconds());
231
241
  return nowSeconds - entry.lastRefreshL1Timestamp >= BigInt(this.l1constants.ethereumSlotDuration);
232
242
  }
233
- /** Whether a cached epoch entry has been marked as finalized. Returns undefined if not cached or still in-flight. */ isFinalized(epoch) {
243
+ /** Whether a cached epoch entry is finalized. Undefined if not cached, in-flight or unstable. */ isFinalized(epoch) {
234
244
  const entry = this.cache.get(epoch);
235
- if (!entry || entry instanceof Promise) {
245
+ if (!entry || entry instanceof Promise || entry.kind !== 'committee') {
236
246
  return undefined;
237
247
  }
238
248
  return entry.finalized;
239
249
  }
240
- /** Returns the latest L1 timestamp stored in the cached entry. Undefined if not cached or in-flight. */ getCachedLastRefreshL1Timestamp(epoch) {
250
+ /** Returns the latest L1 timestamp stored in the cached entry. Undefined if not cached, in-flight or unstable. */ getCachedLastRefreshL1Timestamp(epoch) {
241
251
  const entry = this.cache.get(epoch);
242
- if (!entry || entry instanceof Promise) {
252
+ if (!entry || entry instanceof Promise || entry.kind !== 'committee') {
243
253
  return undefined;
244
254
  }
245
255
  return entry.lastRefreshL1Timestamp;
246
256
  }
247
- /** Computes the sampling timestamp for an epoch's committee data. */ getSamplingTimestamp(epoch) {
248
- const { lagInEpochsForRandao, epochDuration, slotDuration } = this.l1constants;
249
- const epochStartTs = getStartTimestampForEpoch(epoch, this.l1constants);
250
- return epochStartTs - BigInt(lagInEpochsForRandao) * BigInt(epochDuration) * BigInt(slotDuration);
257
+ /**
258
+ * Whether the sample seed for `epoch` is fixed as of the given L1 block. The seed for epoch E hashes the randao
259
+ * that L1 checkpoints in epoch S = E - lagInEpochsForRandao, under the key start(S). It is fixed once that randao
260
+ * is written, or once no later L1 block can land in S, since any later checkpoint is keyed at a later epoch's start.
261
+ */ async isSeedFixed(epoch, block) {
262
+ const { targetCommitteeSize, lagInEpochsForRandao } = this.l1constants;
263
+ // The seed is irrelevant when the committee is empty and anyone may propose.
264
+ if (targetCommitteeSize === 0) {
265
+ return true;
266
+ }
267
+ // Epochs sampled before genesis read the zero randao that precedes the genesis checkpoint.
268
+ const samplingEpoch = BigInt(epoch) - BigInt(lagInEpochsForRandao);
269
+ if (samplingEpoch < 0n) {
270
+ return true;
271
+ }
272
+ // A block in S's last L1 slot is S's last block, as L1 blocks are at least one Ethereum slot apart. Waiting for a
273
+ // block past S would also cost E's second slot, which a pipelined proposer decides on while the tip is still in S.
274
+ const [samplingEpochStart, samplingEpochLastL1Slot] = getTimestampRangeForEpoch(EpochNumber.fromBigInt(samplingEpoch), this.l1constants);
275
+ if (block.timestamp >= samplingEpochLastL1Slot) {
276
+ return true;
277
+ }
278
+ if (block.timestamp < samplingEpochStart) {
279
+ return false;
280
+ }
281
+ // v6 views don't revert while S's randao can still change, so read S's commitment, which setupEpoch stores after
282
+ // checkpointing that randao. Drop this once every supported rollup reverts with EpochNotStable (v7 onwards).
283
+ return await this.rollup.isEpochSetUp(EpochNumber.fromBigInt(samplingEpoch), {
284
+ blockNumber: block.number
285
+ });
251
286
  }
252
287
  /**
253
288
  * Lightweight refresh for a stale non-finalized entry. Queries only the block hash at
254
- * the original block number and the finalized block timestamp — avoids the expensive
289
+ * the original block number and the finalized block — avoids the expensive
255
290
  * getCommitteeAt and getSampleSeedAt calls on the rollup contract.
256
291
  *
257
292
  * If the block hash still matches (no L1 reorg), we keep the existing data and just
258
293
  * update the provenance timestamp. If the finalized block has caught up, we promote the
259
- * entry to finalized. If there was a reorg (hash mismatch), we fall back to a full fetch.
294
+ * entry to finalized. If there was a reorg (hash mismatch), we fall back to a full fetch,
295
+ * and drop the stale entry if that fetch fails.
260
296
  */ async refreshStaleEntry(stale, epoch, ts) {
261
297
  const [blockAtOriginal, l1FinalizedBlock, latestBlock] = await Promise.all([
262
298
  this.rollup.client.getBlock({
@@ -267,21 +303,22 @@ import { getEpochCacheConfigEnvVars } from './config.js';
267
303
  this.rollup.client.getBlock({
268
304
  includeTransactions: false
269
305
  })
270
- ]);
306
+ ]).catch((err)=>{
307
+ this.cache.set(epoch, stale);
308
+ throw err;
309
+ });
271
310
  if (blockAtOriginal.hash === stale.lastQueryL1BlockHash) {
272
311
  // No reorg: the data is still valid. Check if we can now mark it as finalized.
273
- const samplingTs = this.getSamplingTimestamp(epoch);
274
- const finalized = !!(stale.data.committee && stale.data.committee.length > 0) && l1FinalizedBlock !== undefined && samplingTs <= l1FinalizedBlock.timestamp;
275
312
  const refreshed = {
276
313
  ...stale,
277
314
  lastRefreshL1Timestamp: latestBlock.timestamp,
278
- finalized
315
+ finalized: this.isEntryFinalized(stale.data, stale.lastQueryL1BlockNumber, l1FinalizedBlock)
279
316
  };
280
317
  this.cache.set(epoch, refreshed);
281
318
  return refreshed;
282
319
  }
283
320
  // Reorg detected: block hash mismatch. Do a full re-fetch.
284
- // Pass the already-fetched block timestamps to avoid redundant queries.
321
+ // Pass the already-fetched blocks to avoid redundant queries.
285
322
  this.log.warn(`L1 reorg detected for epoch ${epoch}: block ${stale.lastQueryL1BlockNumber} hash changed`, {
286
323
  epoch,
287
324
  expectedHash: stale.lastQueryL1BlockHash,
@@ -292,50 +329,88 @@ import { getEpochCacheConfigEnvVars } from './config.js';
292
329
  finalizedBlock: l1FinalizedBlock
293
330
  });
294
331
  }
332
+ /** Fetches an epoch's entry with {@link fetchEntry} and stores it in the cache. */ async fetchAndCache(epoch, ts, prefetched) {
333
+ const entry = await this.fetchEntry(epoch, ts, prefetched);
334
+ this.cache.set(epoch, entry);
335
+ this.purgeCache();
336
+ return entry;
337
+ }
295
338
  /**
296
- * Fetches committee data from L1, determines finalization status, and stores in the cache.
297
- *
298
- * Uses `lagInEpochsForRandao` (the binding constraint, always <= lagInEpochsForValidatorSet)
299
- * and computes the sampling timestamp from the epoch start to match the L1 contract's logic.
300
- *
301
- * When called from refreshStaleEntry after a reorg, the latest and finalized blocks are
302
- * passed in to avoid redundant L1 queries.
303
- */ async fetchAndCache(epoch, ts, prefetched) {
304
- const [committee, seedBuffer, latestBlock, finalizedBlock, isEscapeHatchOpen] = await Promise.all([
305
- this.rollup.getCommitteeAt(ts),
306
- this.rollup.getSampleSeedAt(ts),
307
- prefetched?.latestBlock ?? this.rollup.client.getBlock({
308
- includeTransactions: false
339
+ * Reads an epoch's committee from L1 and determines its finalization status, or returns an unstable marker if the
340
+ * epoch's seed can still change as of the latest L1 block. When called from refreshStaleEntry after a reorg, the
341
+ * latest and finalized blocks are passed in to avoid redundant L1 queries.
342
+ */ async fetchEntry(epoch, ts, prefetched) {
343
+ // Pin the rollup reads to one L1 block so the entry's provenance matches the data it holds. The escape hatch flag
344
+ // is only partly pinned: the hatch address is resolved at the latest block, and any read error counts as closed.
345
+ const latestBlock = prefetched?.latestBlock ?? await this.rollup.client.getBlock({
346
+ includeTransactions: false
347
+ });
348
+ const blockNumber = latestBlock.number;
349
+ const unstable = {
350
+ kind: 'unstable',
351
+ l1BlockNumber: blockNumber,
352
+ lastRefreshL1Timestamp: maxBigint(latestBlock.timestamp, BigInt(this.dateProvider.nowInSeconds()))
353
+ };
354
+ if (!await this.isSeedFixed(epoch, latestBlock)) {
355
+ this.log.debug(`Committee for epoch ${epoch} is not stable yet as of L1 block ${blockNumber}`, {
356
+ epoch,
357
+ l1BlockNumber: blockNumber,
358
+ l1BlockTimestamp: latestBlock.timestamp
359
+ });
360
+ return unstable;
361
+ }
362
+ const reads = await Promise.all([
363
+ this.rollup.getCommitteeAt(ts, {
364
+ blockNumber
365
+ }),
366
+ this.rollup.getSampleSeedAt(ts, {
367
+ blockNumber
309
368
  }),
310
369
  prefetched !== undefined ? prefetched.finalizedBlock : getFinalizedL1Block(this.rollup.client),
311
- this.rollup.isEscapeHatchOpen(epoch)
312
- ]);
313
- const samplingTs = this.getSamplingTimestamp(epoch);
314
- if (samplingTs > latestBlock.timestamp) {
315
- throw new Error(`Cannot query committee for future epoch ${epoch}: ` + `sampling timestamp ${samplingTs} is beyond latest L1 block at ${latestBlock.timestamp}. ` + `Check your Ethereum node is synced.`);
370
+ this.rollup.isEscapeHatchOpen(epoch, {
371
+ blockNumber
372
+ })
373
+ ]).catch((err)=>{
374
+ if (isEpochNotStableError(err)) {
375
+ return undefined;
376
+ }
377
+ throw err;
378
+ });
379
+ if (!reads) {
380
+ return unstable;
381
+ }
382
+ const [committee, seedBuffer, finalizedBlock, isEscapeHatchOpen] = reads;
383
+ // Reads by block number follow the canonical chain, so a reorg mid-fetch could mix the seed check above with
384
+ // committee data from another fork. Confirm the queried block is still canonical before trusting the reads.
385
+ const queriedBlock = await this.rollup.client.getBlock({
386
+ blockNumber,
387
+ includeTransactions: false
388
+ });
389
+ if (queriedBlock.hash !== latestBlock.hash) {
390
+ throw new Error(`L1 block ${blockNumber} was reorged out while reading the committee for epoch ${epoch}`);
316
391
  }
317
- // Empty committees are never marked finalized so they always get re-queried after TTL.
318
- // If L1 has no finalized block yet (devnet startup), entries stay unfinalized.
319
- const hasCommittee = !!(committee && committee.length > 0);
320
- const finalized = hasCommittee && finalizedBlock !== undefined && samplingTs <= finalizedBlock.timestamp;
321
- const data = {
322
- committee,
392
+ const data = toCommitteeLookup(committee, {
323
393
  seed: seedBuffer.toBigInt(),
324
394
  epoch,
325
395
  isEscapeHatchOpen
326
- };
396
+ });
327
397
  const entry = {
398
+ kind: 'committee',
328
399
  data,
329
- lastQueryL1BlockNumber: latestBlock.number,
400
+ lastQueryL1BlockNumber: blockNumber,
330
401
  lastQueryL1BlockHash: latestBlock.hash,
331
402
  lastRefreshL1Timestamp: latestBlock.timestamp,
332
- finalized
403
+ finalized: this.isEntryFinalized(data, blockNumber, finalizedBlock)
333
404
  };
334
- this.cache.set(epoch, entry);
335
- this.purgeCache();
336
405
  return entry;
337
406
  }
338
407
  /**
408
+ * An entry's committee and seed are final once the L1 block it was read at is finalized (the escape hatch flag is
409
+ * not). Entries without members are never marked finalized, so they get re-queried after the TTL.
410
+ */ isEntryFinalized(data, queryL1BlockNumber, finalizedBlock) {
411
+ return data.state === 'members' && finalizedBlock !== undefined && finalizedBlock.number >= queryL1BlockNumber;
412
+ }
413
+ /**
339
414
  * Get the ABI encoding of the proposer index - see ValidatorSelectionLib.sol computeProposerIndex
340
415
  */ getProposerIndexEncoding(epoch, slot, seed) {
341
416
  return encodeAbiParameters([
@@ -384,59 +459,46 @@ import { getEpochCacheConfigEnvVars } from './config.js';
384
459
  nextSlot
385
460
  };
386
461
  }
387
- /**
388
- * Get the proposer attester address in the given L2 slot
389
- * @returns The proposer attester address. If the committee does not exist, we throw a NoCommitteeError.
390
- * If the committee is empty (i.e. target committee size is 0, and anyone can propose), we return undefined.
391
- */ getProposerAttesterAddressInSlot(slot) {
392
- const epochAndSlot = this.getEpochAndSlotAtSlot(slot);
393
- return this.getProposerAttesterAddressAt(epochAndSlot);
462
+ /** Looks up the proposer for the given L2 slot. */ lookupProposer(slot) {
463
+ return this.lookupProposerAt(this.getEpochAndSlotAtSlot(slot));
394
464
  }
395
- /**
396
- * Get the proposer attester address in the next slot
397
- * @returns The proposer attester address. If the committee does not exist, we throw a NoCommitteeError.
398
- * If the committee is empty (i.e. target committee size is 0, and anyone can propose), we return undefined.
399
- */ getProposerAttesterAddressInNextSlot() {
400
- const epochAndSlot = this.getEpochAndSlotInNextL1Slot();
401
- return this.getProposerAttesterAddressAt(epochAndSlot);
465
+ /** Looks up the proposer for the L2 slot of the next L1 slot. */ lookupProposerInNextSlot() {
466
+ return this.lookupProposerAt(this.getEpochAndSlotInNextL1Slot());
402
467
  }
403
- /**
404
- * Get the proposer attester address at a given epoch and slot
405
- * @param when - The epoch and slot to get the proposer attester address at
406
- * @returns The proposer attester address. If the committee does not exist, we throw a NoCommitteeError.
407
- * If the committee is empty (i.e. target committee size is 0, and anyone can propose), we return undefined.
408
- */ async getProposerAttesterAddressAt(when) {
409
- const { epoch, slot } = when;
410
- const { committee, seed } = await this.getCommittee(slot);
411
- if (!committee) {
412
- throw new NoCommitteeError();
413
- } else if (committee.length === 0) {
414
- return undefined;
415
- }
416
- const proposerIndex = this.computeProposerIndex(slot, epoch, seed, BigInt(committee.length));
417
- return committee[Number(proposerIndex)];
468
+ async lookupProposerAt({ slot }) {
469
+ return this.proposerFromCommitteeLookup(await this.getCommittee(slot), slot);
418
470
  }
419
- getProposerFromEpochCommittee(epochCommitteeInfo, slot) {
420
- if (!epochCommitteeInfo.committee || epochCommitteeInfo.committee.length === 0) {
421
- return undefined;
471
+ /** Derives the proposer for a slot from its epoch's committee lookup. */ proposerFromCommitteeLookup(lookup, slot) {
472
+ if (lookup.state !== 'members') {
473
+ return withoutMembers(lookup);
422
474
  }
423
- const proposerIndex = this.computeProposerIndex(slot, epochCommitteeInfo.epoch, epochCommitteeInfo.seed, BigInt(epochCommitteeInfo.committee.length));
424
- return epochCommitteeInfo.committee[Number(proposerIndex)];
475
+ const { committee, epoch, seed } = lookup;
476
+ const proposerIndex = this.computeProposerIndex(slot, epoch, seed, BigInt(committee.length));
477
+ return {
478
+ state: 'members',
479
+ proposer: committee[Number(proposerIndex)]
480
+ };
425
481
  }
426
- /** Check if a validator is in the given slot's committee */ async isInCommittee(slot, validator) {
427
- const { committee } = await this.getCommittee(slot);
428
- if (!committee) {
429
- return false;
482
+ /** Check if a validator is in the given slot's committee */ async lookupMembership(slot, validator) {
483
+ const lookup = await this.getCommittee(slot);
484
+ if (lookup.state !== 'members') {
485
+ return withoutMembers(lookup);
430
486
  }
431
- return committee.some((v)=>v.equals(validator));
487
+ return {
488
+ state: 'members',
489
+ inCommittee: lookup.committee.some((v)=>v.equals(validator))
490
+ };
432
491
  }
433
492
  /** From the set of given addresses, return all that are on the committee for the given slot */ async filterInCommittee(slot, validators) {
434
- const { committee } = await this.getCommittee(slot);
435
- if (!committee) {
436
- return [];
493
+ const lookup = await this.getCommittee(slot);
494
+ if (lookup.state !== 'members') {
495
+ return withoutMembers(lookup);
437
496
  }
438
- const committeeSet = new Set(committee.map((v)=>v.toString()));
439
- return validators.filter((v)=>committeeSet.has(v.toString()));
497
+ const committeeSet = new Set(lookup.committee.map((v)=>v.toString()));
498
+ return {
499
+ state: 'members',
500
+ inCommittee: validators.filter((v)=>committeeSet.has(v.toString()))
501
+ };
440
502
  }
441
503
  async getRegisteredValidators() {
442
504
  const validatorRefreshIntervalMs = this.config.validatorRefreshIntervalSeconds * 1000;
package/dest/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './committee_lookup.js';
1
2
  export * from './epoch_cache.js';
2
3
  export * from './config.js';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsYUFBYSxDQUFDIn0=
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxhQUFhLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
package/dest/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './committee_lookup.js';
1
2
  export * from './epoch_cache.js';
2
3
  export * from './config.js';
@@ -1,2 +1,3 @@
1
+ export * from './lookups.js';
1
2
  export * from './test_epoch_cache.js';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUMifQ==
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsdUJBQXVCLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC"}
@@ -1 +1,2 @@
1
+ export * from './lookups.js';
1
2
  export * from './test_epoch_cache.js';
@@ -0,0 +1,16 @@
1
+ import { EpochNumber } from '@aztec-labs/foundation/branded-types';
2
+ import type { EthAddress } from '@aztec-labs/foundation/eth-address';
3
+ import { type CommitteeMembershipLookup, type EpochCommitteeInfo, type EscapeHatchLookup, type KnownCommitteeLookup, type ProposerLookup, type UnstableCommittee } from '../committee_lookup.js';
4
+ /** Builds a committee lookup from a committee as L1 returns it: `undefined` is `none` and `[]` is `open`. */
5
+ export declare function makeCommitteeLookup({ committee, ...info }: {
6
+ committee: EthAddress[] | undefined;
7
+ } & Partial<EpochCommitteeInfo>): KnownCommitteeLookup;
8
+ /** Builds a proposer lookup: `undefined` is an `open` committee, as the proposer getter used to report it. */
9
+ export declare function makeProposerLookup(proposer: EthAddress | undefined): ProposerLookup;
10
+ /** Builds a membership lookup for a `members` committee. */
11
+ export declare function makeMembershipLookup<T>(inCommittee: T): CommitteeMembershipLookup<T>;
12
+ /** Builds an escape hatch lookup for a `members` committee. */
13
+ export declare function makeEscapeHatchLookup(isEscapeHatchOpen: boolean): EscapeHatchLookup;
14
+ /** Builds the lookup for a committee whose seed is not fixed on L1 yet. */
15
+ export declare function makeUn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yxHQUFHLGlCQUFpQixDQUVuRjtBQUVELDJFQUEyRTtBQUMzRSx3QkFBZ0IscUJBQXFCLENBQUMsS0FBSyxHQUFFLFdBQThCLEVBQUUsYUFBYSxTQUFLLEdBQUcsaUJBQWlCLENBRWxIIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookups.d.ts","sourceRoot":"","sources":["../../src/test/lookups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC,6GAA6G;AAC7G,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IAAE,SAAS,EAAE,UAAU,EAAE,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,oBAAoB,CAE9F;AAED,8GAA8G;AAC9G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,cAAc,CAEnF;AAED,4DAA4D;AAC5D,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAEpF;AAED,+DAA+D;AAC/D,wBAAgB,qBAAqB,CAAC,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,CAEnF;AAED,2EAA2E;AAC3E,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,WAA8B,EAAE,aAAa,SAAK,GAAG,iBAAiB,CAElH"}
@@ -0,0 +1,37 @@
1
+ import { EpochNumber } from '@aztec-labs/foundation/branded-types';
2
+ import { toCommitteeLookup } from '../committee_lookup.js';
3
+ /** Builds a committee lookup from a committee as L1 returns it: `undefined` is `none` and `[]` is `open`. */ export function makeCommitteeLookup({ committee, ...info }) {
4
+ return toCommitteeLookup(committee, {
5
+ epoch: EpochNumber.ZERO,
6
+ seed: 0n,
7
+ isEscapeHatchOpen: false,
8
+ ...info
9
+ });
10
+ }
11
+ /** Builds a proposer lookup: `undefined` is an `open` committee, as the proposer getter used to report it. */ export function makeProposerLookup(proposer) {
12
+ return proposer === undefined ? {
13
+ state: 'open'
14
+ } : {
15
+ state: 'members',
16
+ proposer
17
+ };
18
+ }
19
+ /** Builds a membership lookup for a `members` committee. */ export function makeMembershipLookup(inCommittee) {
20
+ return {
21
+ state: 'members',
22
+ inCommittee
23
+ };
24
+ }
25
+ /** Builds an escape hatch lookup for a `members` committee. */ export function makeEscapeHatchLookup(isEscapeHatchOpen) {
26
+ return {
27
+ state: 'members',
28
+ isEscapeHatchOpen
29
+ };
30
+ }
31
+ /** Builds the lookup for a committee whose seed is not fixed on L1 yet. */ export function makeUnstableCommittee(epoch = EpochNumber.ZERO, l1BlockNumber = 0n) {
32
+ return {
33
+ state: 'unstable',
34
+ epoch,
35
+ l1BlockNumber
36
+ };
37
+ }
@@ -1,7 +1,8 @@
1
1
  import { EpochNumber, SlotNumber } from '@aztec-labs/foundation/branded-types';
2
2
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
3
3
  import type { L1RollupConstants } from '@aztec-labs/stdlib/epoch-helpers';
4
- import { type EpochAndSlot, type EpochCacheInterface, type EpochCommitteeInfo, type SlotTag } from '../epoch_cache.js';
4
+ import { type CommitteeMembershipLookup, type EscapeHatchLookup, type KnownCommitteeLookup, type ProposerLookup } from '../committee_lookup.js';
5
+ import { type EpochAndSlot, type EpochCacheInterface, type SlotTag } from '../epoch_cache.js';
5
6
  /**
6
7
  * A test implementation of EpochCacheInterface that allows manual configuration
7
8
  * of committee, proposer, slot, and escape hatch state for use in tests.
@@ -26,7 +27,7 @@ export declare class TestEpochCache implements EpochCacheInterface {
26
27
  */
27
28
  setCommittee(committee: EthAddress[]): this;
28
29
  /**
29
- * Sets the proposer address returned by getProposerAttesterAddressInSlot.
30
+ * Sets the proposer address returned by lookupProposer.
30
31
  * @param proposer - The address of the current proposer.
31
32
  */
32
33
  setProposer(proposer: EthAddress | undefined): this;
@@ -57,7 +58,9 @@ export declare class TestEpochCache implements EpochCacheInterface {
57
58
  setL1Constants(constants: Partial<L1RollupConstants>): this;
58
59
  getL1Constants(): L1RollupConstants;
59
60
  getLagInEpochsForValidatorSet(): number;
60
- getCommittee(_slot?: SlotTag): Promise<EpochCommitteeInfo>;
61
+ /** An empty committee is `open`, as the real cache reports a target committee size of zero. */
62
+ getCommittee(_slot?: SlotTag): Promise<KnownCommitteeLookup>;
63
+ private getCommitteeLookup;
61
64
  getSlotNow(): SlotNumber;
62
65
  getTargetSlot(): SlotNumber;
63
66
  getEpochNow(): EpochNumber;
@@ -81,11 +84,12 @@ export declare class TestEpochCache implements EpochCacheInterface {
81
84
  targetSlot: SlotNumber;
82
85
  nextSlot: SlotNumber;
83
86
  };
84
- getProposerAttesterAddressInSlot(_slot: SlotNumber): Promise<EthAddress | undefined>;
87
+ /** An unset proposer is an `open` committee, independently of the committee set with {@link setCommittee}. */
88
+ lookupProposer(_slot: SlotNumber): Promise<ProposerLookup>;
85
89
  getRegisteredValidators(): Promise<EthAddress[]>;
86
- isInCommittee(_slot: SlotTag, validator: EthAddress): Promise<boolean>;
87
- filterInCommittee(_slot: SlotTag, validators: EthAddress[]): Promise<EthAddress[]>;
88
- isEscapeHatchOpen(_epoch: EpochNumber): Promise<boolean>;
89
- isEscapeHatchOpenAtSlot(_slot?: SlotTag): Promise<boolean>;
90
+ lookupMembership(_slot: SlotTag, validator: EthAddress): Promise<CommitteeMembershipLookup<boolean>>;
91
+ filterInCommittee(_slot: SlotTag, validators: EthAddress[]): Promise<CommitteeMembershipLookup<EthAddress[]>>;
92
+ lookupEscapeHatch(_epoch: EpochNumber): Promise<EscapeHatchLookup>;
93
+ lookupEscapeHatchAtSlot(_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