@aztec/aztec-node 0.0.1-commit.f2ce05ee → 0.0.1-commit.f504929
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 +237 -82
- package/dest/sentinel/sentinel.d.ts +2 -2
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +53 -27
- package/dest/sentinel/store.d.ts +2 -2
- package/dest/sentinel/store.d.ts.map +1 -1
- package/dest/sentinel/store.js +11 -7
- package/package.json +27 -25
- package/src/aztec-node/config.ts +24 -8
- package/src/aztec-node/server.ts +299 -99
- package/src/sentinel/sentinel.ts +56 -23
- package/src/sentinel/store.ts +12 -12
|
@@ -8,6 +8,15 @@ import { OffenseType, WANT_TO_SLASH_EVENT } from '@aztec/slasher';
|
|
|
8
8
|
import { L2BlockStream, getAttestationInfoFromPublishedCheckpoint } from '@aztec/stdlib/block';
|
|
9
9
|
import { getEpochAtSlot, getSlotRangeForEpoch, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
10
10
|
import EventEmitter from 'node:events';
|
|
11
|
+
/** Maps a validator status to its category: proposer or attestation. */ function statusToCategory(status) {
|
|
12
|
+
switch(status){
|
|
13
|
+
case 'attestation-sent':
|
|
14
|
+
case 'attestation-missed':
|
|
15
|
+
return 'attestation';
|
|
16
|
+
default:
|
|
17
|
+
return 'proposer';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
11
20
|
export class Sentinel extends EventEmitter {
|
|
12
21
|
epochCache;
|
|
13
22
|
archiver;
|
|
@@ -82,16 +91,14 @@ export class Sentinel extends EventEmitter {
|
|
|
82
91
|
return;
|
|
83
92
|
}
|
|
84
93
|
const blockNumber = event.block.number;
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
this.logger.error(`Failed to get block ${blockNumber}
|
|
88
|
-
block
|
|
89
|
-
});
|
|
94
|
+
const header = await this.archiver.getBlockHeader(blockNumber);
|
|
95
|
+
if (!header) {
|
|
96
|
+
this.logger.error(`Failed to get block header ${blockNumber}`);
|
|
90
97
|
return;
|
|
91
98
|
}
|
|
92
99
|
// TODO(palla/slash): We should only be computing proven performance if this is
|
|
93
100
|
// a full proof epoch and not a partial one, otherwise we'll end up with skewed stats.
|
|
94
|
-
const epoch = getEpochAtSlot(
|
|
101
|
+
const epoch = getEpochAtSlot(header.getSlot(), this.epochCache.getL1Constants());
|
|
95
102
|
this.logger.debug(`Computing proven performance for epoch ${epoch}`);
|
|
96
103
|
const performance = await this.computeProvenPerformance(epoch);
|
|
97
104
|
this.logger.info(`Computed proven performance for epoch ${epoch}`, performance);
|
|
@@ -100,7 +107,11 @@ export class Sentinel extends EventEmitter {
|
|
|
100
107
|
}
|
|
101
108
|
async computeProvenPerformance(epoch) {
|
|
102
109
|
const [fromSlot, toSlot] = getSlotRangeForEpoch(epoch, this.epochCache.getL1Constants());
|
|
103
|
-
const { committee } = await this.epochCache.getCommittee(fromSlot);
|
|
110
|
+
const { committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(fromSlot);
|
|
111
|
+
if (isEscapeHatchOpen) {
|
|
112
|
+
this.logger.info(`Skipping proven performance for epoch ${epoch} - escape hatch is open`);
|
|
113
|
+
return {};
|
|
114
|
+
}
|
|
104
115
|
if (!committee) {
|
|
105
116
|
this.logger.trace(`No committee found for slot ${fromSlot}`);
|
|
106
117
|
return {};
|
|
@@ -242,7 +253,12 @@ export class Sentinel extends EventEmitter {
|
|
|
242
253
|
* Gathers committee and proposer data for a given slot, computes slot stats,
|
|
243
254
|
* and updates overall stats.
|
|
244
255
|
*/ async processSlot(slot) {
|
|
245
|
-
const { epoch, seed, committee } = await this.epochCache.getCommittee(slot);
|
|
256
|
+
const { epoch, seed, committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(slot);
|
|
257
|
+
if (isEscapeHatchOpen) {
|
|
258
|
+
this.logger.info(`Skipping slot ${slot} at epoch ${epoch} - escape hatch is open`);
|
|
259
|
+
this.lastProcessedSlot = slot;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
246
262
|
if (!committee || committee.length === 0) {
|
|
247
263
|
this.logger.trace(`No committee found for slot ${slot} at epoch ${epoch}`);
|
|
248
264
|
this.lastProcessedSlot = slot;
|
|
@@ -263,17 +279,17 @@ export class Sentinel extends EventEmitter {
|
|
|
263
279
|
committee
|
|
264
280
|
});
|
|
265
281
|
// Check if there is an L2 block in L1 for this L2 slot
|
|
266
|
-
// Here we get all attestations for the
|
|
267
|
-
// or all attestations for all proposals in the slot if no
|
|
282
|
+
// Here we get all checkpoint attestations for the checkpoint at the given slot,
|
|
283
|
+
// or all checkpoint attestations for all proposals in the slot if no checkpoint was mined.
|
|
268
284
|
// We gather from both p2p (contains the ones seen on the p2p layer) and archiver
|
|
269
|
-
// (contains the ones synced from mined
|
|
270
|
-
const
|
|
271
|
-
const p2pAttested = await this.p2p.getCheckpointAttestationsForSlot(slot,
|
|
285
|
+
// (contains the ones synced from mined checkpoints, which we may have missed from p2p).
|
|
286
|
+
const checkpoint = this.slotNumberToCheckpoint.get(slot);
|
|
287
|
+
const p2pAttested = await this.p2p.getCheckpointAttestationsForSlot(slot, checkpoint?.archive);
|
|
272
288
|
// Filter out attestations with invalid signatures
|
|
273
289
|
const p2pAttestors = p2pAttested.map((a)=>a.getSender()).filter((s)=>s !== undefined);
|
|
274
290
|
const attestors = new Set([
|
|
275
291
|
...p2pAttestors.map((a)=>a.toString()),
|
|
276
|
-
...
|
|
292
|
+
...checkpoint?.attestors.map((a)=>a.toString()) ?? []
|
|
277
293
|
].filter((addr)=>proposer.toString() !== addr));
|
|
278
294
|
// We assume that there was a block proposal if at least one of the validators (other than the proposer) attested to it.
|
|
279
295
|
// It could be the case that every single validator failed, and we could differentiate it by having
|
|
@@ -281,17 +297,26 @@ export class Sentinel extends EventEmitter {
|
|
|
281
297
|
// But we'll leave that corner case out to reduce pressure on the node.
|
|
282
298
|
// TODO(palla/slash): This breaks if a given node has more than one validator in the current committee,
|
|
283
299
|
// since they will attest to their own proposal it even if it's not re-executable.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
300
|
+
let status;
|
|
301
|
+
if (checkpoint) {
|
|
302
|
+
status = 'checkpoint-mined';
|
|
303
|
+
} else if (attestors.size > 0) {
|
|
304
|
+
status = 'checkpoint-proposed';
|
|
305
|
+
} else {
|
|
306
|
+
// No checkpoint on L1 and no checkpoint attestations seen. Check if block proposals were sent for this slot.
|
|
307
|
+
const hasBlockProposals = await this.p2p.hasBlockProposalsForSlot(slot);
|
|
308
|
+
status = hasBlockProposals ? 'checkpoint-missed' : 'blocks-missed';
|
|
309
|
+
}
|
|
310
|
+
this.logger.debug(`Checkpoint status for slot ${slot}: ${status}`, {
|
|
311
|
+
...checkpoint,
|
|
287
312
|
slot
|
|
288
313
|
});
|
|
289
|
-
// Get attestors that failed their
|
|
290
|
-
const missedAttestors = new Set(
|
|
314
|
+
// Get attestors that failed their checkpoint attestation duties, but only if there was a checkpoint proposed or mined
|
|
315
|
+
const missedAttestors = new Set(status === 'blocks-missed' || status === 'checkpoint-missed' ? [] : committee.filter((v)=>!attestors.has(v.toString()) && !proposer.equals(v)).map((v)=>v.toString()));
|
|
291
316
|
this.logger.debug(`Retrieved ${attestors.size} attestors out of ${committee.length} for slot ${slot}`, {
|
|
292
|
-
|
|
317
|
+
status,
|
|
293
318
|
proposer: proposer.toString(),
|
|
294
|
-
...
|
|
319
|
+
...checkpoint,
|
|
295
320
|
slot,
|
|
296
321
|
attestors: [
|
|
297
322
|
...attestors
|
|
@@ -304,7 +329,7 @@ export class Sentinel extends EventEmitter {
|
|
|
304
329
|
// Compute the status for each validator in the committee
|
|
305
330
|
const statusFor = (who)=>{
|
|
306
331
|
if (who === proposer.toString()) {
|
|
307
|
-
return
|
|
332
|
+
return status;
|
|
308
333
|
} else if (attestors.has(who)) {
|
|
309
334
|
return 'attestation-sent';
|
|
310
335
|
} else if (missedAttestors.has(who)) {
|
|
@@ -361,15 +386,16 @@ export class Sentinel extends EventEmitter {
|
|
|
361
386
|
computeStatsForValidator(address, allHistory, fromSlot, toSlot) {
|
|
362
387
|
let history = fromSlot ? allHistory.filter((h)=>BigInt(h.slot) >= fromSlot) : allHistory;
|
|
363
388
|
history = toSlot ? history.filter((h)=>BigInt(h.slot) <= toSlot) : history;
|
|
364
|
-
const lastProposal = history.filter((h)=>h.status === '
|
|
389
|
+
const lastProposal = history.filter((h)=>h.status === 'checkpoint-proposed' || h.status === 'checkpoint-mined').at(-1);
|
|
365
390
|
const lastAttestation = history.filter((h)=>h.status === 'attestation-sent').at(-1);
|
|
366
391
|
return {
|
|
367
392
|
address: EthAddress.fromString(address),
|
|
368
393
|
lastProposal: this.computeFromSlot(lastProposal?.slot),
|
|
369
394
|
lastAttestation: this.computeFromSlot(lastAttestation?.slot),
|
|
370
395
|
totalSlots: history.length,
|
|
371
|
-
missedProposals: this.computeMissed(history, '
|
|
372
|
-
'
|
|
396
|
+
missedProposals: this.computeMissed(history, 'proposer', [
|
|
397
|
+
'checkpoint-missed',
|
|
398
|
+
'blocks-missed'
|
|
373
399
|
]),
|
|
374
400
|
missedAttestations: this.computeMissed(history, 'attestation', [
|
|
375
401
|
'attestation-missed'
|
|
@@ -377,8 +403,8 @@ export class Sentinel extends EventEmitter {
|
|
|
377
403
|
history
|
|
378
404
|
};
|
|
379
405
|
}
|
|
380
|
-
computeMissed(history,
|
|
381
|
-
const relevantHistory = history.filter((h)=>!
|
|
406
|
+
computeMissed(history, computeOverCategory, filter) {
|
|
407
|
+
const relevantHistory = history.filter((h)=>!computeOverCategory || statusToCategory(h.status) === computeOverCategory);
|
|
382
408
|
const filteredHistory = relevantHistory.filter((h)=>filter.includes(h.status));
|
|
383
409
|
return {
|
|
384
410
|
currentStreak: countWhile([
|
package/dest/sentinel/store.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ValidatorStatusHistory, ValidatorStatusInSlot, ValidatorsEpochPerf
|
|
|
5
5
|
export declare class SentinelStore {
|
|
6
6
|
private store;
|
|
7
7
|
private config;
|
|
8
|
-
static readonly SCHEMA_VERSION =
|
|
8
|
+
static readonly SCHEMA_VERSION = 3;
|
|
9
9
|
private readonly historyMap;
|
|
10
10
|
private readonly provenMap;
|
|
11
11
|
constructor(store: AztecAsyncKVStore, config: {
|
|
@@ -32,4 +32,4 @@ export declare class SentinelStore {
|
|
|
32
32
|
private statusToNumber;
|
|
33
33
|
private statusFromNumber;
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZW50aW5lbC9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzFFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUUzRCxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEtBQUssRUFDVixzQkFBc0IsRUFDdEIscUJBQXFCLEVBQ3JCLDBCQUEwQixFQUMzQixNQUFNLDBCQUEwQixDQUFDO0FBRWxDLHFCQUFhLGFBQWE7SUFXdEIsT0FBTyxDQUFDLEtBQUs7SUFDYixPQUFPLENBQUMsTUFBTTtJQVhoQixnQkFBdUIsY0FBYyxLQUFLO0lBRzFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsVUFBVSxDQUF1QztJQUlsRSxPQUFP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QUFDLGdCQUFnQjtDQWtCekIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/sentinel/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,qBAAa,aAAa;IAWtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,MAAM;IAXhB,gBAAuB,cAAc,KAAK;IAG1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuC;IAIlE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuC;IAEjE,YACU,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,+BAA+B,EAAE,MAAM,CAAA;KAAE,EAInF;IAEM,gBAAgB,WAEtB;IAEM,kCAAkC,WAExC;IAEY,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,iBAM/F;IAEY,oBAAoB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC,CAGnH;YAEa,sCAAsC;IA6BvC,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAAC,iBAQjH;YAEa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/sentinel/store.ts"],"names":[],"m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AoB;IAM5B,OAAO,CAAC,sBAAsB;IAa9B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,gBAAgB;CAkBzB"}
|
package/dest/sentinel/store.js
CHANGED
|
@@ -4,7 +4,7 @@ import { BufferReader, numToUInt8, numToUInt32BE, serializeToBuffer } from '@azt
|
|
|
4
4
|
export class SentinelStore {
|
|
5
5
|
store;
|
|
6
6
|
config;
|
|
7
|
-
static SCHEMA_VERSION =
|
|
7
|
+
static SCHEMA_VERSION = 3;
|
|
8
8
|
// a map from validator address to their ValidatorStatusHistory
|
|
9
9
|
historyMap;
|
|
10
10
|
// a map from validator address to their historical proven epoch performance
|
|
@@ -134,16 +134,18 @@ export class SentinelStore {
|
|
|
134
134
|
}
|
|
135
135
|
statusToNumber(status) {
|
|
136
136
|
switch(status){
|
|
137
|
-
case '
|
|
137
|
+
case 'checkpoint-mined':
|
|
138
138
|
return 1;
|
|
139
|
-
case '
|
|
139
|
+
case 'checkpoint-proposed':
|
|
140
140
|
return 2;
|
|
141
|
-
case '
|
|
141
|
+
case 'checkpoint-missed':
|
|
142
142
|
return 3;
|
|
143
143
|
case 'attestation-sent':
|
|
144
144
|
return 4;
|
|
145
145
|
case 'attestation-missed':
|
|
146
146
|
return 5;
|
|
147
|
+
case 'blocks-missed':
|
|
148
|
+
return 6;
|
|
147
149
|
default:
|
|
148
150
|
{
|
|
149
151
|
const _exhaustive = status;
|
|
@@ -154,15 +156,17 @@ export class SentinelStore {
|
|
|
154
156
|
statusFromNumber(status) {
|
|
155
157
|
switch(status){
|
|
156
158
|
case 1:
|
|
157
|
-
return '
|
|
159
|
+
return 'checkpoint-mined';
|
|
158
160
|
case 2:
|
|
159
|
-
return '
|
|
161
|
+
return 'checkpoint-proposed';
|
|
160
162
|
case 3:
|
|
161
|
-
return '
|
|
163
|
+
return 'checkpoint-missed';
|
|
162
164
|
case 4:
|
|
163
165
|
return 'attestation-sent';
|
|
164
166
|
case 5:
|
|
165
167
|
return 'attestation-missed';
|
|
168
|
+
case 6:
|
|
169
|
+
return 'blocks-missed';
|
|
166
170
|
default:
|
|
167
171
|
throw new Error(`Unknown status: ${status}`);
|
|
168
172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.f504929",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,30 +65,32 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
69
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
70
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/node-
|
|
80
|
-
"@aztec/
|
|
81
|
-
"@aztec/
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/
|
|
84
|
-
"@aztec/
|
|
85
|
-
"@aztec/
|
|
86
|
-
"@aztec/
|
|
87
|
-
"@aztec/
|
|
88
|
-
"@aztec/
|
|
89
|
-
"@aztec/
|
|
90
|
-
"@aztec/
|
|
91
|
-
"@aztec/
|
|
68
|
+
"@aztec/archiver": "0.0.1-commit.f504929",
|
|
69
|
+
"@aztec/bb-prover": "0.0.1-commit.f504929",
|
|
70
|
+
"@aztec/blob-client": "0.0.1-commit.f504929",
|
|
71
|
+
"@aztec/blob-lib": "0.0.1-commit.f504929",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.f504929",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.f504929",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.f504929",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.f504929",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.f504929",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.f504929",
|
|
78
|
+
"@aztec/merkle-tree": "0.0.1-commit.f504929",
|
|
79
|
+
"@aztec/node-keystore": "0.0.1-commit.f504929",
|
|
80
|
+
"@aztec/node-lib": "0.0.1-commit.f504929",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.f504929",
|
|
82
|
+
"@aztec/p2p": "0.0.1-commit.f504929",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.f504929",
|
|
84
|
+
"@aztec/prover-client": "0.0.1-commit.f504929",
|
|
85
|
+
"@aztec/prover-node": "0.0.1-commit.f504929",
|
|
86
|
+
"@aztec/sequencer-client": "0.0.1-commit.f504929",
|
|
87
|
+
"@aztec/simulator": "0.0.1-commit.f504929",
|
|
88
|
+
"@aztec/slasher": "0.0.1-commit.f504929",
|
|
89
|
+
"@aztec/stdlib": "0.0.1-commit.f504929",
|
|
90
|
+
"@aztec/telemetry-client": "0.0.1-commit.f504929",
|
|
91
|
+
"@aztec/validator-client": "0.0.1-commit.f504929",
|
|
92
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.f504929",
|
|
93
|
+
"@aztec/world-state": "0.0.1-commit.f504929",
|
|
92
94
|
"koa": "^2.16.1",
|
|
93
95
|
"koa-router": "^13.1.1",
|
|
94
96
|
"tslib": "^2.4.0",
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -13,9 +13,14 @@ import {
|
|
|
13
13
|
import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
14
14
|
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
|
|
15
15
|
import { type ProverClientUserConfig, proverClientConfigMappings } from '@aztec/prover-client/config';
|
|
16
|
+
import {
|
|
17
|
+
type ProverNodeConfig,
|
|
18
|
+
proverNodeConfigMappings,
|
|
19
|
+
specificProverNodeConfigMappings,
|
|
20
|
+
} from '@aztec/prover-node/config';
|
|
16
21
|
import {
|
|
17
22
|
type SequencerClientConfig,
|
|
18
|
-
type
|
|
23
|
+
type SequencerTxSenderConfig,
|
|
19
24
|
sequencerClientConfigMappings,
|
|
20
25
|
} from '@aztec/sequencer-client/config';
|
|
21
26
|
import { slasherConfigMappings } from '@aztec/slasher';
|
|
@@ -46,16 +51,18 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
46
51
|
SharedNodeConfig &
|
|
47
52
|
GenesisStateConfig &
|
|
48
53
|
NodeRPCConfig &
|
|
49
|
-
SlasherConfig &
|
|
54
|
+
SlasherConfig &
|
|
55
|
+
ProverNodeConfig & {
|
|
50
56
|
/** L1 contracts addresses */
|
|
51
57
|
l1Contracts: L1ContractAddresses;
|
|
52
58
|
/** Whether the validator is disabled for this node */
|
|
53
59
|
disableValidator: boolean;
|
|
54
60
|
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
55
61
|
skipArchiverInitialSync: boolean;
|
|
56
|
-
|
|
57
62
|
/** A flag to force verification of tx Chonk proofs. Only used for testnet */
|
|
58
63
|
debugForceTxProofVerification: boolean;
|
|
64
|
+
/** Whether to enable the prover node as a subsystem. */
|
|
65
|
+
enableProverNode: boolean;
|
|
59
66
|
};
|
|
60
67
|
|
|
61
68
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
@@ -63,6 +70,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
63
70
|
...keyStoreConfigMappings,
|
|
64
71
|
...archiverConfigMappings,
|
|
65
72
|
...sequencerClientConfigMappings,
|
|
73
|
+
...proverNodeConfigMappings,
|
|
66
74
|
...validatorClientConfigMappings,
|
|
67
75
|
...proverClientConfigMappings,
|
|
68
76
|
...worldStateConfigMappings,
|
|
@@ -72,6 +80,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
72
80
|
...genesisStateConfigMappings,
|
|
73
81
|
...nodeRpcConfigMappings,
|
|
74
82
|
...slasherConfigMappings,
|
|
83
|
+
...specificProverNodeConfigMappings,
|
|
75
84
|
l1Contracts: {
|
|
76
85
|
description: 'The deployed L1 contract addresses',
|
|
77
86
|
nested: l1ContractAddressesMapping,
|
|
@@ -91,6 +100,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
91
100
|
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
92
101
|
...booleanConfigHelper(false),
|
|
93
102
|
},
|
|
103
|
+
enableProverNode: {
|
|
104
|
+
env: 'ENABLE_PROVER_NODE',
|
|
105
|
+
description: 'Whether to enable the prover node as a subsystem.',
|
|
106
|
+
...booleanConfigHelper(false),
|
|
107
|
+
},
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
/**
|
|
@@ -101,7 +115,7 @@ export function getConfigEnvVars(): AztecNodeConfig {
|
|
|
101
115
|
return getConfigFromMappings<AztecNodeConfig>(aztecNodeConfigMappings);
|
|
102
116
|
}
|
|
103
117
|
|
|
104
|
-
type ConfigRequiredToBuildKeyStore =
|
|
118
|
+
type ConfigRequiredToBuildKeyStore = SequencerClientConfig & SharedNodeConfig & ValidatorClientConfig;
|
|
105
119
|
|
|
106
120
|
function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
|
|
107
121
|
const validatorKeyStores: ValidatorKeyStore[] = [];
|
|
@@ -120,7 +134,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
|
|
|
120
134
|
feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
|
|
121
135
|
coinbase: config.coinbase ?? config.validatorAddresses[0],
|
|
122
136
|
remoteSigner: config.web3SignerUrl,
|
|
123
|
-
publisher: config.
|
|
137
|
+
publisher: config.sequencerPublisherAddresses ?? [],
|
|
124
138
|
});
|
|
125
139
|
|
|
126
140
|
const keyStore: KeyStore = {
|
|
@@ -145,8 +159,10 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
145
159
|
const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
|
|
146
160
|
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
147
161
|
|
|
148
|
-
const publisherKeys = config.
|
|
149
|
-
? config.
|
|
162
|
+
const publisherKeys = config.sequencerPublisherPrivateKeys
|
|
163
|
+
? config.sequencerPublisherPrivateKeys.map((k: { getValue: () => string }) =>
|
|
164
|
+
ethPrivateKeySchema.parse(k.getValue()),
|
|
165
|
+
)
|
|
150
166
|
: [];
|
|
151
167
|
|
|
152
168
|
validatorKeyStores.push({
|
|
@@ -168,7 +184,7 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
168
184
|
}
|
|
169
185
|
|
|
170
186
|
export function createKeyStoreForValidator(
|
|
171
|
-
config:
|
|
187
|
+
config: SequencerTxSenderConfig & SequencerClientConfig & SharedNodeConfig,
|
|
172
188
|
): KeyStore | undefined {
|
|
173
189
|
if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
|
|
174
190
|
return createKeyStoreFromWeb3Signer(config);
|