@aztec/aztec-node 0.0.1-commit.8f9871590 → 0.0.1-commit.9117c5f5a

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.
@@ -139,15 +139,15 @@ export class Sentinel extends (EventEmitter as new () => WatcherEmitter) impleme
139
139
  return;
140
140
  }
141
141
  const blockNumber = event.block.number;
142
- const block = await this.archiver.getL2Block(blockNumber);
143
- if (!block) {
144
- this.logger.error(`Failed to get block ${blockNumber}`, { block });
142
+ const header = await this.archiver.getBlockHeader(blockNumber);
143
+ if (!header) {
144
+ this.logger.error(`Failed to get block header ${blockNumber}`);
145
145
  return;
146
146
  }
147
147
 
148
148
  // TODO(palla/slash): We should only be computing proven performance if this is
149
149
  // a full proof epoch and not a partial one, otherwise we'll end up with skewed stats.
150
- const epoch = getEpochAtSlot(block.header.getSlot(), this.epochCache.getL1Constants());
150
+ const epoch = getEpochAtSlot(header.getSlot(), this.epochCache.getL1Constants());
151
151
  this.logger.debug(`Computing proven performance for epoch ${epoch}`);
152
152
  const performance = await this.computeProvenPerformance(epoch);
153
153
  this.logger.info(`Computed proven performance for epoch ${epoch}`, performance);
@@ -158,7 +158,11 @@ export class Sentinel extends (EventEmitter as new () => WatcherEmitter) impleme
158
158
 
159
159
  protected async computeProvenPerformance(epoch: EpochNumber): Promise<ValidatorsEpochPerformance> {
160
160
  const [fromSlot, toSlot] = getSlotRangeForEpoch(epoch, this.epochCache.getL1Constants());
161
- const { committee } = await this.epochCache.getCommittee(fromSlot);
161
+ const { committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(fromSlot);
162
+ if (isEscapeHatchOpen) {
163
+ this.logger.info(`Skipping proven performance for epoch ${epoch} - escape hatch is open`);
164
+ return {};
165
+ }
162
166
  if (!committee) {
163
167
  this.logger.trace(`No committee found for slot ${fromSlot}`);
164
168
  return {};
@@ -327,7 +331,12 @@ export class Sentinel extends (EventEmitter as new () => WatcherEmitter) impleme
327
331
  * and updates overall stats.
328
332
  */
329
333
  protected async processSlot(slot: SlotNumber) {
330
- const { epoch, seed, committee } = await this.epochCache.getCommittee(slot);
334
+ const { epoch, seed, committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(slot);
335
+ if (isEscapeHatchOpen) {
336
+ this.logger.info(`Skipping slot ${slot} at epoch ${epoch} - escape hatch is open`);
337
+ this.lastProcessedSlot = slot;
338
+ return;
339
+ }
331
340
  if (!committee || committee.length === 0) {
332
341
  this.logger.trace(`No committee found for slot ${slot} at epoch ${epoch}`);
333
342
  this.lastProcessedSlot = slot;