@aztec/aztec-node 0.0.1-commit.b655e406 → 0.0.1-commit.c7c42ec
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 +5 -2
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +7 -1
- package/dest/aztec-node/node_metrics.d.ts +1 -1
- package/dest/aztec-node/node_metrics.d.ts.map +1 -1
- package/dest/aztec-node/server.d.ts +36 -47
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +91 -51
- package/dest/bin/index.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/sentinel/config.d.ts +1 -1
- package/dest/sentinel/factory.d.ts +1 -1
- package/dest/sentinel/index.d.ts +1 -1
- package/dest/sentinel/sentinel.d.ts +20 -19
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +23 -16
- package/dest/sentinel/store.d.ts +6 -5
- package/dest/sentinel/store.d.ts.map +1 -1
- package/dest/sentinel/store.js +3 -2
- package/dest/test/index.d.ts +1 -1
- package/package.json +28 -27
- package/src/aztec-node/config.ts +12 -8
- package/src/aztec-node/server.ts +150 -96
- package/src/sentinel/sentinel.ts +47 -35
- package/src/sentinel/store.ts +11 -10
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { countWhile, filterAsync, fromEntries, getEntries, mapValues } from '@aztec/foundation/collection';
|
|
2
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -19,6 +20,7 @@ export class Sentinel extends EventEmitter {
|
|
|
19
20
|
l2TipsStore;
|
|
20
21
|
initialSlot;
|
|
21
22
|
lastProcessedSlot;
|
|
23
|
+
// eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
|
|
22
24
|
slotNumberToBlock;
|
|
23
25
|
constructor(epochCache, archiver, p2p, store, config, logger = createLogger('node:sentinel')){
|
|
24
26
|
super(), this.epochCache = epochCache, this.archiver = archiver, this.p2p = p2p, this.store = store, this.config = config, this.logger = logger, this.slotNumberToBlock = new Map();
|
|
@@ -38,7 +40,7 @@ export class Sentinel extends EventEmitter {
|
|
|
38
40
|
}
|
|
39
41
|
/** Loads initial slot and initializes blockstream. We will not process anything at or before the initial slot. */ async init() {
|
|
40
42
|
this.initialSlot = this.epochCache.getEpochAndSlotNow().slot;
|
|
41
|
-
const startingBlock = await this.archiver.getBlockNumber();
|
|
43
|
+
const startingBlock = BlockNumber(await this.archiver.getBlockNumber());
|
|
42
44
|
this.logger.info(`Starting validator sentinel with initial slot ${this.initialSlot} and block ${startingBlock}`);
|
|
43
45
|
this.blockStream = new L2BlockStream(this.archiver, this.l2TipsStore, this, this.logger, {
|
|
44
46
|
startingBlock
|
|
@@ -53,7 +55,7 @@ export class Sentinel extends EventEmitter {
|
|
|
53
55
|
// Store mapping from slot to archive, block number, and attestors
|
|
54
56
|
for (const block of event.blocks){
|
|
55
57
|
this.slotNumberToBlock.set(block.block.header.getSlot(), {
|
|
56
|
-
blockNumber: block.block.number,
|
|
58
|
+
blockNumber: BlockNumber(block.block.number),
|
|
57
59
|
archive: block.block.archive.root.toString(),
|
|
58
60
|
attestors: getAttestationInfoFromPublishedL2Block(block).filter((a)=>a.status === 'recovered-from-signature').map((a)=>a.address)
|
|
59
61
|
});
|
|
@@ -74,7 +76,7 @@ export class Sentinel extends EventEmitter {
|
|
|
74
76
|
if (event.type !== 'chain-proven') {
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
|
-
const blockNumber = event.block.number;
|
|
79
|
+
const blockNumber = BlockNumber(event.block.number);
|
|
78
80
|
const block = await this.archiver.getBlock(blockNumber);
|
|
79
81
|
if (!block) {
|
|
80
82
|
this.logger.error(`Failed to get block ${blockNumber}`, {
|
|
@@ -131,13 +133,15 @@ export class Sentinel extends EventEmitter {
|
|
|
131
133
|
}
|
|
132
134
|
// Get all historical performance for this validator
|
|
133
135
|
const allPerformance = await this.store.getProvenPerformance(validator);
|
|
136
|
+
// Sort by epoch descending to get most recent first, keep only epochs strictly before the current one, and get the first N
|
|
137
|
+
const pastEpochs = allPerformance.sort((a, b)=>Number(b.epoch - a.epoch)).filter((p)=>p.epoch < currentEpoch);
|
|
134
138
|
// If we don't have enough historical data, don't slash
|
|
135
|
-
if (
|
|
139
|
+
if (pastEpochs.length < requiredConsecutiveEpochs) {
|
|
136
140
|
this.logger.debug(`Not enough historical data for slashing ${validator} for inactivity (${allPerformance.length} epochs < ${requiredConsecutiveEpochs} required)`);
|
|
137
141
|
return false;
|
|
138
142
|
}
|
|
139
|
-
//
|
|
140
|
-
return
|
|
143
|
+
// Check that we have at least requiredConsecutiveEpochs and that all of them are above the inactivity threshold
|
|
144
|
+
return pastEpochs.slice(0, requiredConsecutiveEpochs).every((p)=>p.missed / p.total >= this.config.slashInactivityTargetPercentage);
|
|
141
145
|
}
|
|
142
146
|
async handleProvenPerformance(epoch, performance) {
|
|
143
147
|
if (this.config.slashInactivityPenalty === 0n) {
|
|
@@ -155,7 +159,7 @@ export class Sentinel extends EventEmitter {
|
|
|
155
159
|
validator: EthAddress.fromString(address),
|
|
156
160
|
amount: this.config.slashInactivityPenalty,
|
|
157
161
|
offenseType: OffenseType.INACTIVITY,
|
|
158
|
-
epochOrSlot: epoch
|
|
162
|
+
epochOrSlot: BigInt(epoch)
|
|
159
163
|
}));
|
|
160
164
|
if (criminals.length > 0) {
|
|
161
165
|
this.logger.verbose(`Identified ${criminals.length} validators to slash due to inactivity in at least ${epochThreshold} consecutive epochs`, {
|
|
@@ -190,7 +194,11 @@ export class Sentinel extends EventEmitter {
|
|
|
190
194
|
* We also don't move past the archiver last synced L2 slot, as we don't want to process data that is not yet available.
|
|
191
195
|
* Last, we check the p2p is synced with the archiver, so it has pulled all attestations from it.
|
|
192
196
|
*/ async isReadyToProcess(currentSlot) {
|
|
193
|
-
|
|
197
|
+
if (currentSlot < 2) {
|
|
198
|
+
this.logger.trace(`Current slot ${currentSlot} too early.`);
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
const targetSlot = SlotNumber(currentSlot - 2);
|
|
194
202
|
if (this.lastProcessedSlot && this.lastProcessedSlot >= targetSlot) {
|
|
195
203
|
this.logger.trace(`Already processed slot ${targetSlot}`, {
|
|
196
204
|
lastProcessedSlot: this.lastProcessedSlot
|
|
@@ -314,7 +322,7 @@ export class Sentinel extends EventEmitter {
|
|
|
314
322
|
await this.store.getHistory(v)
|
|
315
323
|
]))) : await this.store.getHistories();
|
|
316
324
|
const slotNow = this.epochCache.getEpochAndSlotNow().slot;
|
|
317
|
-
fromSlot ??= (this.lastProcessedSlot ?? slotNow) -
|
|
325
|
+
fromSlot ??= SlotNumber(Math.max((this.lastProcessedSlot ?? slotNow) - this.store.getHistoryLength(), 0));
|
|
318
326
|
toSlot ??= this.lastProcessedSlot ?? slotNow;
|
|
319
327
|
const stats = mapValues(histories, (history, address)=>this.computeStatsForValidator(address, history ?? [], fromSlot, toSlot));
|
|
320
328
|
return {
|
|
@@ -330,25 +338,24 @@ export class Sentinel extends EventEmitter {
|
|
|
330
338
|
return undefined;
|
|
331
339
|
}
|
|
332
340
|
const slotNow = this.epochCache.getEpochAndSlotNow().slot;
|
|
333
|
-
const effectiveFromSlot = fromSlot ?? (this.lastProcessedSlot ?? slotNow) -
|
|
341
|
+
const effectiveFromSlot = fromSlot ?? SlotNumber(Math.max((this.lastProcessedSlot ?? slotNow) - this.store.getHistoryLength(), 0));
|
|
334
342
|
const effectiveToSlot = toSlot ?? this.lastProcessedSlot ?? slotNow;
|
|
335
343
|
const historyLength = BigInt(this.store.getHistoryLength());
|
|
336
|
-
if (effectiveToSlot - effectiveFromSlot > historyLength) {
|
|
337
|
-
throw new Error(`Slot range (${effectiveToSlot - effectiveFromSlot}) exceeds history length (${historyLength}). ` + `Requested range: ${effectiveFromSlot} to ${effectiveToSlot}.`);
|
|
344
|
+
if (BigInt(effectiveToSlot) - BigInt(effectiveFromSlot) > historyLength) {
|
|
345
|
+
throw new Error(`Slot range (${BigInt(effectiveToSlot) - BigInt(effectiveFromSlot)}) exceeds history length (${historyLength}). ` + `Requested range: ${effectiveFromSlot} to ${effectiveToSlot}.`);
|
|
338
346
|
}
|
|
339
347
|
const validator = this.computeStatsForValidator(validatorAddress.toString(), history, effectiveFromSlot, effectiveToSlot);
|
|
340
|
-
const allTimeProvenPerformance = await this.store.getProvenPerformance(validatorAddress);
|
|
341
348
|
return {
|
|
342
349
|
validator,
|
|
343
|
-
allTimeProvenPerformance,
|
|
350
|
+
allTimeProvenPerformance: await this.store.getProvenPerformance(validatorAddress),
|
|
344
351
|
lastProcessedSlot: this.lastProcessedSlot,
|
|
345
352
|
initialSlot: this.initialSlot,
|
|
346
353
|
slotWindow: this.store.getHistoryLength()
|
|
347
354
|
};
|
|
348
355
|
}
|
|
349
356
|
computeStatsForValidator(address, allHistory, fromSlot, toSlot) {
|
|
350
|
-
let history = fromSlot ? allHistory.filter((h)=>h.slot >= fromSlot) : allHistory;
|
|
351
|
-
history = toSlot ? history.filter((h)=>h.slot <= toSlot) : history;
|
|
357
|
+
let history = fromSlot ? allHistory.filter((h)=>BigInt(h.slot) >= fromSlot) : allHistory;
|
|
358
|
+
history = toSlot ? history.filter((h)=>BigInt(h.slot) <= toSlot) : history;
|
|
352
359
|
const lastProposal = history.filter((h)=>h.status === 'block-proposed' || h.status === 'block-mined').at(-1);
|
|
353
360
|
const lastAttestation = history.filter((h)=>h.status === 'attestation-sent').at(-1);
|
|
354
361
|
return {
|
package/dest/sentinel/store.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
4
|
import type { ValidatorStatusHistory, ValidatorStatusInSlot, ValidatorsEpochPerformance } from '@aztec/stdlib/validators';
|
|
4
5
|
export declare class SentinelStore {
|
|
5
6
|
private store;
|
|
6
7
|
private config;
|
|
7
|
-
static readonly SCHEMA_VERSION
|
|
8
|
+
static readonly SCHEMA_VERSION: number;
|
|
8
9
|
private readonly historyMap;
|
|
9
10
|
private readonly provenMap;
|
|
10
11
|
constructor(store: AztecAsyncKVStore, config: {
|
|
@@ -13,14 +14,14 @@ export declare class SentinelStore {
|
|
|
13
14
|
});
|
|
14
15
|
getHistoryLength(): number;
|
|
15
16
|
getHistoricProvenPerformanceLength(): number;
|
|
16
|
-
updateProvenPerformance(epoch:
|
|
17
|
+
updateProvenPerformance(epoch: EpochNumber, performance: ValidatorsEpochPerformance): Promise<void>;
|
|
17
18
|
getProvenPerformance(who: EthAddress): Promise<{
|
|
18
19
|
missed: number;
|
|
19
20
|
total: number;
|
|
20
|
-
epoch:
|
|
21
|
+
epoch: EpochNumber;
|
|
21
22
|
}[]>;
|
|
22
23
|
private pushValidatorProvenPerformanceForEpoch;
|
|
23
|
-
updateValidators(slot:
|
|
24
|
+
updateValidators(slot: SlotNumber, statuses: Record<`0x${string}`, ValidatorStatusInSlot | undefined>): Promise<void>;
|
|
24
25
|
private pushValidatorStatusForSlot;
|
|
25
26
|
getHistories(): Promise<Record<`0x${string}`, ValidatorStatusHistory>>;
|
|
26
27
|
getHistory(address: EthAddress): Promise<ValidatorStatusHistory | undefined>;
|
|
@@ -31,4 +32,4 @@ export declare class SentinelStore {
|
|
|
31
32
|
private statusToNumber;
|
|
32
33
|
private statusFromNumber;
|
|
33
34
|
}
|
|
34
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZW50aW5lbC9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1h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FBRSxRQUFRLEVBQUUsTUFBTSxDQUFDLEtBQUssTUFBTSxFQUFFLEVBQUUscUJBQXFCLEdBQUcsU0FBUyxDQUFDLGlCQVFqSDtZQUVhLDBCQUEwQjtJQVkzQixZQUFZLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLE1BQU0sRUFBRSxFQUFFLHNCQUFzQixDQUFDLENBQUMsQ0FNbEY7SUFFWSxVQUFVLENBQUMsT0FBTyxFQUFFLFVBQVUsR0FBRyxPQUFPLENBQUMsc0JBQXNCLEdBQUcsU0FBUyxDQUFDLENBR3hGO0lBRUQsT0FBTyxDQUFDLG9CQUFvQjtJQU01QixPQUFPLENBQUMsc0JBQXNCO0lBYTlCLE9BQU8sQ0FBQyxnQkFBZ0I7SUFNeEIsT0FBTyxDQUFDLGtCQUFrQjtJQVcxQixPQUFPLENBQUMsY0FBYztJQW1CdEIsT0FBTyxDQUFDLGdCQUFnQjtDQWdCekIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/sentinel/store.ts"],"names":[],"mappings":"AAAA,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,
|
|
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,iB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js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import { BufferReader, numToUInt8, numToUInt32BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
4
|
export class SentinelStore {
|
|
@@ -105,7 +106,7 @@ export class SentinelStore {
|
|
|
105
106
|
const performance = [];
|
|
106
107
|
while(!reader.isEmpty()){
|
|
107
108
|
performance.push({
|
|
108
|
-
epoch:
|
|
109
|
+
epoch: EpochNumber(reader.readNumber()),
|
|
109
110
|
missed: reader.readNumber(),
|
|
110
111
|
total: reader.readNumber()
|
|
111
112
|
});
|
|
@@ -122,7 +123,7 @@ export class SentinelStore {
|
|
|
122
123
|
const reader = new BufferReader(buffer);
|
|
123
124
|
const history = [];
|
|
124
125
|
while(!reader.isEmpty()){
|
|
125
|
-
const slot =
|
|
126
|
+
const slot = SlotNumber(reader.readNumber());
|
|
126
127
|
const status = this.statusFromNumber(reader.readUInt8());
|
|
127
128
|
history.push({
|
|
128
129
|
slot,
|
package/dest/test/index.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ export declare class TestAztecNodeService extends AztecNodeService {
|
|
|
28
28
|
epochCache: EpochCacheInterface;
|
|
29
29
|
packageVersion: string;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDOUQsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sWUFBWSxDQUFDO0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0FBQztJQUMvQyxTQUFTLEVBQUUsZUFBZSxHQUFHLFNBQVMsQ0FBQztJQUN2QyxhQUFhLEVBQUUsc0JBQXNCLEdBQUcsU0FBUyxDQUFDO0lBQ2xELGtCQUFrQixFQUFFLFFBQVEsR0FBRyxTQUFTLENBQUM7SUFDekMsaUJBQWlCLEVBQUUsaUJBQWlCLEdBQUcsU0FBUyxDQUFDO0lBQ2pELFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIsT0FBTyxFQUFFLE1BQU0sQ0FBQztJQUNoQixxQkFBcUIsRUFBRSw4QkFBOEIsQ0FBQztJQUN0RCxVQUFVLEVBQUUsbUJBQW1CLENBQUM7SUFDaEMsY0FBYyxFQUFFLE1BQU0sQ0FBQztDQUN2QyJ9
|
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.c7c42ec",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "node --no-warnings ./dest/bin",
|
|
22
22
|
"start:debug": "node --no-warnings --inspect ./dest/bin",
|
|
23
|
-
"build": "yarn clean && tsc
|
|
24
|
-
"build:dev": "tsc
|
|
23
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
24
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
25
25
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
26
26
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
27
27
|
},
|
|
@@ -66,38 +66,39 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
70
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
71
|
-
"@aztec/blob-
|
|
72
|
-
"@aztec/constants": "0.0.1-commit.
|
|
73
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
74
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
75
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
76
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
77
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
78
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
79
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
80
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
81
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
82
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
83
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
84
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
85
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
86
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
87
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
88
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
89
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
90
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
91
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
69
|
+
"@aztec/archiver": "0.0.1-commit.c7c42ec",
|
|
70
|
+
"@aztec/bb-prover": "0.0.1-commit.c7c42ec",
|
|
71
|
+
"@aztec/blob-client": "0.0.1-commit.c7c42ec",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.c7c42ec",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.c7c42ec",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.c7c42ec",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.c7c42ec",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.c7c42ec",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.c7c42ec",
|
|
78
|
+
"@aztec/merkle-tree": "0.0.1-commit.c7c42ec",
|
|
79
|
+
"@aztec/node-keystore": "0.0.1-commit.c7c42ec",
|
|
80
|
+
"@aztec/node-lib": "0.0.1-commit.c7c42ec",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.c7c42ec",
|
|
82
|
+
"@aztec/p2p": "0.0.1-commit.c7c42ec",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.c7c42ec",
|
|
84
|
+
"@aztec/prover-client": "0.0.1-commit.c7c42ec",
|
|
85
|
+
"@aztec/sequencer-client": "0.0.1-commit.c7c42ec",
|
|
86
|
+
"@aztec/simulator": "0.0.1-commit.c7c42ec",
|
|
87
|
+
"@aztec/slasher": "0.0.1-commit.c7c42ec",
|
|
88
|
+
"@aztec/stdlib": "0.0.1-commit.c7c42ec",
|
|
89
|
+
"@aztec/telemetry-client": "0.0.1-commit.c7c42ec",
|
|
90
|
+
"@aztec/validator-client": "0.0.1-commit.c7c42ec",
|
|
91
|
+
"@aztec/world-state": "0.0.1-commit.c7c42ec",
|
|
92
92
|
"koa": "^2.16.1",
|
|
93
93
|
"koa-router": "^13.1.1",
|
|
94
94
|
"tslib": "^2.4.0",
|
|
95
|
-
"viem": "npm:@
|
|
95
|
+
"viem": "npm:@aztec/viem@2.38.2"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@jest/globals": "^30.0.0",
|
|
99
99
|
"@types/jest": "^30.0.0",
|
|
100
100
|
"@types/node": "^22.15.17",
|
|
101
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
101
102
|
"jest": "^30.0.0",
|
|
102
103
|
"jest-mock-extended": "^4.0.0",
|
|
103
104
|
"ts-node": "^10.9.1",
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type L1ContractAddresses,
|
|
5
|
-
genesisStateConfigMappings,
|
|
6
|
-
l1ContractAddressesMapping,
|
|
7
|
-
} from '@aztec/ethereum';
|
|
2
|
+
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
|
|
3
|
+
import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
8
4
|
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
9
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
6
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
@@ -57,6 +53,9 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
57
53
|
disableValidator: boolean;
|
|
58
54
|
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
59
55
|
skipArchiverInitialSync: boolean;
|
|
56
|
+
|
|
57
|
+
/** A flag to force verification of tx Chonk proofs. Only used for testnet */
|
|
58
|
+
debugForceTxProofVerification: boolean;
|
|
60
59
|
};
|
|
61
60
|
|
|
62
61
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
@@ -87,6 +86,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
87
86
|
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
88
87
|
...booleanConfigHelper(false),
|
|
89
88
|
},
|
|
89
|
+
debugForceTxProofVerification: {
|
|
90
|
+
env: 'DEBUG_FORCE_TX_PROOF_VERIFICATION',
|
|
91
|
+
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
92
|
+
...booleanConfigHelper(false),
|
|
93
|
+
},
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
/**
|
|
@@ -132,7 +136,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
|
|
|
132
136
|
function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
|
|
133
137
|
const validatorKeyStores: ValidatorKeyStore[] = [];
|
|
134
138
|
const ethPrivateKeys = config.validatorPrivateKeys
|
|
135
|
-
? config.validatorPrivateKeys.getValue().map(x => ethPrivateKeySchema.parse(x))
|
|
139
|
+
? config.validatorPrivateKeys.getValue().map((x: string) => ethPrivateKeySchema.parse(x))
|
|
136
140
|
: [];
|
|
137
141
|
|
|
138
142
|
if (!ethPrivateKeys.length) {
|
|
@@ -142,7 +146,7 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
142
146
|
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
143
147
|
|
|
144
148
|
const publisherKeys = config.publisherPrivateKeys
|
|
145
|
-
? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
|
|
149
|
+
? config.publisherPrivateKeys.map((k: { getValue: () => string }) => ethPrivateKeySchema.parse(k.getValue()))
|
|
146
150
|
: [];
|
|
147
151
|
|
|
148
152
|
validatorKeyStores.push({
|