@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.
- package/dest/aztec-node/config.d.ts +7 -4
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +10 -2
- package/dest/aztec-node/server.d.ts +19 -6
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +226 -80
- package/dest/sentinel/sentinel.d.ts +1 -1
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +15 -8
- package/package.json +27 -25
- package/src/aztec-node/config.ts +24 -8
- package/src/aztec-node/server.ts +293 -98
- package/src/sentinel/sentinel.ts +15 -6
package/src/sentinel/sentinel.ts
CHANGED
|
@@ -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
|
|
143
|
-
if (!
|
|
144
|
-
this.logger.error(`Failed to get block ${blockNumber}
|
|
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(
|
|
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;
|