@aztec/slasher 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a
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/README.md +54 -33
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +27 -15
- package/dest/factory/create_facade.d.ts +2 -2
- package/dest/factory/create_facade.d.ts.map +1 -1
- package/dest/generated/slasher-defaults.d.ts +5 -3
- package/dest/generated/slasher-defaults.d.ts.map +1 -1
- package/dest/generated/slasher-defaults.js +4 -2
- package/dest/index.d.ts +5 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +4 -1
- package/dest/metrics.d.ts +7 -0
- package/dest/metrics.d.ts.map +1 -0
- package/dest/metrics.js +11 -0
- package/dest/slash_offenses_collector.d.ts +6 -2
- package/dest/slash_offenses_collector.d.ts.map +1 -1
- package/dest/slash_offenses_collector.js +46 -17
- package/dest/slasher_client.d.ts +4 -2
- package/dest/slasher_client.d.ts.map +1 -1
- package/dest/slasher_client.js +26 -7
- package/dest/stores/offenses_store.d.ts +9 -3
- package/dest/stores/offenses_store.d.ts.map +1 -1
- package/dest/stores/offenses_store.js +60 -18
- package/dest/watcher.d.ts +8 -1
- package/dest/watcher.d.ts.map +1 -1
- package/dest/watcher.js +1 -0
- package/dest/watchers/attestations_block_watcher.d.ts +26 -13
- package/dest/watchers/attestations_block_watcher.d.ts.map +1 -1
- package/dest/watchers/attestations_block_watcher.js +76 -61
- package/dest/watchers/attested_invalid_proposal_watcher.d.ts +42 -0
- package/dest/watchers/attested_invalid_proposal_watcher.d.ts.map +1 -0
- package/dest/watchers/attested_invalid_proposal_watcher.js +117 -0
- package/dest/watchers/broadcasted_invalid_checkpoint_proposal_watcher.d.ts +38 -0
- package/dest/watchers/broadcasted_invalid_checkpoint_proposal_watcher.d.ts.map +1 -0
- package/dest/watchers/broadcasted_invalid_checkpoint_proposal_watcher.js +138 -0
- package/dest/watchers/checkpoint_equivocation_watcher.d.ts +30 -0
- package/dest/watchers/checkpoint_equivocation_watcher.d.ts.map +1 -0
- package/dest/watchers/checkpoint_equivocation_watcher.js +69 -0
- package/dest/watchers/data_withholding_watcher.d.ts +63 -0
- package/dest/watchers/data_withholding_watcher.d.ts.map +1 -0
- package/dest/watchers/data_withholding_watcher.js +193 -0
- package/package.json +10 -10
- package/src/config.ts +32 -15
- package/src/factory/create_facade.ts +1 -1
- package/src/generated/slasher-defaults.ts +4 -2
- package/src/index.ts +4 -1
- package/src/metrics.ts +19 -0
- package/src/slash_offenses_collector.ts +60 -18
- package/src/slasher_client.ts +35 -6
- package/src/stores/offenses_store.ts +71 -20
- package/src/watcher.ts +8 -0
- package/src/watchers/attestations_block_watcher.ts +88 -82
- package/src/watchers/attested_invalid_proposal_watcher.ts +168 -0
- package/src/watchers/broadcasted_invalid_checkpoint_proposal_watcher.ts +192 -0
- package/src/watchers/checkpoint_equivocation_watcher.ts +96 -0
- package/src/watchers/data_withholding_watcher.ts +225 -0
- package/dest/watchers/epoch_prune_watcher.d.ts +0 -39
- package/dest/watchers/epoch_prune_watcher.d.ts.map +0 -1
- package/dest/watchers/epoch_prune_watcher.js +0 -179
- package/src/watchers/epoch_prune_watcher.ts +0 -256
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher_client.d.ts","sourceRoot":"","sources":["../src/slasher_client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAEtG,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,i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C1B,SAAS,IAAI,aAAa,CAEhC;IAED,8CAA8C;IACvC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,QAEjD;IAED,6FAA6F;IAC7F,UAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,iBAG3C;IAED,2FAA2F;IAC3F,UAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,iBAItF;IAED;;;;OAIG;IACU,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAOtF;IAED;;;OAGG;IACH,UAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CA0CtG;YAOa,wBAAwB;IA0EtC,0FAA0F;IAC1F,UAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CA+FtG;IAED,mFAAmF;IACnF,OAAO,CAAC,kCAAkC;IAQ1C;;;;;OAKG;IACU,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAOtE;IAED,kCAAkC;IAC3B,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAEvC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;CAIxB"}
|
package/dest/slasher_client.js
CHANGED
|
@@ -2,7 +2,9 @@ import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
|
2
2
|
import { maxBigint } from '@aztec/foundation/bigint';
|
|
3
3
|
import { compactArray, partition, times } from '@aztec/foundation/collection';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { OffenseType, getEpochsForRound, getSlashConsensusVotesFromOffenses } from '@aztec/stdlib/slashing';
|
|
5
|
+
import { OffenseType, getEpochsForRound, getOffenseTypeName, getSlashConsensusVotesFromOffenses } from '@aztec/stdlib/slashing';
|
|
6
|
+
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
7
|
+
import { SlasherMetrics } from './metrics.js';
|
|
6
8
|
import { SlashOffensesCollector } from './slash_offenses_collector.js';
|
|
7
9
|
import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
8
10
|
/**
|
|
@@ -40,10 +42,11 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
40
42
|
dateProvider;
|
|
41
43
|
offensesStore;
|
|
42
44
|
log;
|
|
45
|
+
metrics;
|
|
43
46
|
unwatchCallbacks;
|
|
44
47
|
roundMonitor;
|
|
45
48
|
offensesCollector;
|
|
46
|
-
constructor(config, settings, slashingProposer, slasher, rollup, watchers, epochCache, dateProvider, offensesStore, log = createLogger('slasher:consensus')){
|
|
49
|
+
constructor(config, settings, slashingProposer, slasher, rollup, watchers, epochCache, dateProvider, offensesStore, log = createLogger('slasher:consensus'), metrics = new SlasherMetrics(getTelemetryClient())){
|
|
47
50
|
this.config = config;
|
|
48
51
|
this.settings = settings;
|
|
49
52
|
this.slashingProposer = slashingProposer;
|
|
@@ -53,6 +56,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
53
56
|
this.dateProvider = dateProvider;
|
|
54
57
|
this.offensesStore = offensesStore;
|
|
55
58
|
this.log = log;
|
|
59
|
+
this.metrics = metrics;
|
|
56
60
|
this.unwatchCallbacks = [];
|
|
57
61
|
this.roundMonitor = new SlashRoundMonitor(settings, dateProvider);
|
|
58
62
|
this.offensesCollector = new SlashOffensesCollector(config, settings, watchers, offensesStore);
|
|
@@ -91,6 +95,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
91
95
|
await this.offensesCollector.handleNewRound(round);
|
|
92
96
|
}
|
|
93
97
|
/** Called when we see a RoundExecuted event on the SlashingProposer (just for logging). */ async handleRoundExecuted(round, slashCount, l1BlockHash) {
|
|
98
|
+
this.metrics.recordRoundExecuted();
|
|
94
99
|
const slashes = await this.rollup.getSlashEvents(l1BlockHash);
|
|
95
100
|
this.log.info(`Slashing round ${round} has been executed with ${slashCount} slashes`, {
|
|
96
101
|
slashes
|
|
@@ -248,7 +253,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
248
253
|
slotNumber,
|
|
249
254
|
currentRound,
|
|
250
255
|
slashedRound,
|
|
251
|
-
|
|
256
|
+
offensesFromAlwaysSlash: offensesFromAlwaysSlash.map(getOffenseLogData),
|
|
252
257
|
slashValidatorsAlways: this.config.slashValidatorsAlways
|
|
253
258
|
});
|
|
254
259
|
}
|
|
@@ -257,7 +262,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
257
262
|
slotNumber,
|
|
258
263
|
currentRound,
|
|
259
264
|
slashedRound,
|
|
260
|
-
offensesToForgive,
|
|
265
|
+
offensesToForgive: offensesToForgive.map(getOffenseLogData),
|
|
261
266
|
slashValidatorsNever: this.config.slashValidatorsNever
|
|
262
267
|
});
|
|
263
268
|
}
|
|
@@ -269,11 +274,11 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
269
274
|
});
|
|
270
275
|
return undefined;
|
|
271
276
|
}
|
|
272
|
-
this.log.
|
|
277
|
+
this.log.debug(`Computing slash votes for ${offensesToSlash.length} offenses`, {
|
|
273
278
|
slotNumber,
|
|
274
279
|
currentRound,
|
|
275
280
|
slashedRound,
|
|
276
|
-
offensesToSlash
|
|
281
|
+
offensesToSlash: offensesToSlash.map(getOffenseLogData)
|
|
277
282
|
});
|
|
278
283
|
const committees = await this.collectCommitteesActiveDuringRound(slashedRound);
|
|
279
284
|
const epochsForCommittees = getEpochsForRound(slashedRound, this.settings);
|
|
@@ -287,11 +292,18 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
287
292
|
slotNumber,
|
|
288
293
|
currentRound,
|
|
289
294
|
slashedRound,
|
|
290
|
-
offensesToSlash,
|
|
295
|
+
offensesToSlash: offensesToSlash.map(getOffenseLogData),
|
|
291
296
|
committees
|
|
292
297
|
});
|
|
293
298
|
return undefined;
|
|
294
299
|
}
|
|
300
|
+
this.log.info(`Voting to slash ${offensesToSlash.length} offenses`, {
|
|
301
|
+
slotNumber,
|
|
302
|
+
slashedRound,
|
|
303
|
+
currentRound,
|
|
304
|
+
votes,
|
|
305
|
+
offensesToSlash: offensesToSlash.map(getOffenseLogData)
|
|
306
|
+
});
|
|
295
307
|
this.log.debug(`Computed votes for slashing ${offensesToSlash.length} offenses`, {
|
|
296
308
|
slashedRound,
|
|
297
309
|
currentRound,
|
|
@@ -338,3 +350,10 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
338
350
|
return round - BigInt(this.settings.slashingOffsetInRounds);
|
|
339
351
|
}
|
|
340
352
|
}
|
|
353
|
+
function getOffenseLogData(offense) {
|
|
354
|
+
return {
|
|
355
|
+
...offense,
|
|
356
|
+
validator: offense.validator.toString(),
|
|
357
|
+
offenseType: getOffenseTypeName(offense.offenseType)
|
|
358
|
+
};
|
|
359
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
2
|
import { type Offense, type OffenseIdentifier } from '@aztec/stdlib/slashing';
|
|
3
3
|
export declare const SCHEMA_VERSION = 1;
|
|
4
|
+
type ClearOffensesFilter = Pick<Offense, 'offenseType' | 'epochOrSlot'> & {
|
|
5
|
+
validators?: Offense['validator'][];
|
|
6
|
+
};
|
|
4
7
|
export declare class SlasherOffensesStore {
|
|
5
8
|
private kvStore;
|
|
6
9
|
private settings;
|
|
@@ -20,12 +23,15 @@ export declare class SlasherOffensesStore {
|
|
|
20
23
|
getOffensesForRound(round: bigint): Promise<Offense[]>;
|
|
21
24
|
/** Returns whether we have seen this offense */
|
|
22
25
|
hasOffense(offense: OffenseIdentifier): Promise<boolean>;
|
|
23
|
-
/** Adds a new offense */
|
|
24
|
-
addOffense(offense: Offense): Promise<
|
|
26
|
+
/** Adds a new offense. Returns false if the offense is already pending. */
|
|
27
|
+
addOffense(offense: Offense): Promise<boolean>;
|
|
28
|
+
/** Removes pending offenses matching the given offense type, epoch/slot, and optional validators. */
|
|
29
|
+
clearOffenses(filter: ClearOffensesFilter): Promise<number>;
|
|
25
30
|
/** Prunes all offenses expired from the store */
|
|
26
31
|
clearExpiredOffenses(currentRound: bigint): Promise<number>;
|
|
27
32
|
/** Generate a unique key for an offense */
|
|
28
33
|
private getOffenseKey;
|
|
29
34
|
private getRoundKey;
|
|
30
35
|
}
|
|
31
|
-
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2ZmZW5zZXNfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZXMvb2ZmZW5zZXNfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQXFDLE1BQU0saUJBQWlCLENBQUM7QUFDNUYsT0FBTyxFQUNMLEtBQUssT0FBTyxFQUNaLEtBQUssaUJBQWlCLEVBSXZCLE1BQU0sd0JBQXdCLENBQUM7QUFFaEMsZUFBTyxNQUFNLGNBQWMsSUFBSSxDQUFDO0FBRWhDLEtBQUssbUJBQW1CLEdBQUcsSUFBSSxDQUFDLE9BQU8sRUFBRSxhQUFhLEdBQUcsYUFBYSxDQUFDLEdBQUc7SUFDeEUsVUFBVSxDQUFDLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUM7Q0FDckMsQ0FBQztBQUVGLHFCQUFhLG9CQUFvQjtJQVU3QixPQUFPLENBQUMsT0FBTztJQUNmLE9BQU8sQ0FBQyxRQUFRO0lBVmxCLDJDQUEyQztJQUMzQyxPQUFPLENBQUMsUUFBUSxDQUFnQztJQUVoRCwwQ0FBMEM7SUFDMUMsT0FBTyxDQUFDLGNB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O,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IAVlB,2CAA2C;IAC3C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,0CAA0C;IAC1C,OAAO,CAAC,cAAc,CAAqC;IAE3D,OAAO,CAAC,GAAG,CAA0C;IAErD,YACU,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,aAAa,EAAE,MAAM,CAAC;QACtB,4BAA4B,CAAC,EAAE,MAAM,CAAC;KACvC,EAIF;IAED,2BAA2B;IACd,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAM7C;IAED,uDAAuD;IAC1C,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAUlE;IAED,gDAAgD;IACnC,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAGpE;IAED,2EAA2E;IAC9D,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAkB1D;IAED,qGAAqG;IACxF,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmCvE;IAED,iDAAiD;IACpC,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCvE;IAED,2CAA2C;IAC3C,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -36,14 +36,57 @@ export class SlasherOffensesStore {
|
|
|
36
36
|
const key = this.getOffenseKey(offense);
|
|
37
37
|
return await this.offenses.getAsync(key) !== undefined;
|
|
38
38
|
}
|
|
39
|
-
/** Adds a new offense */ async addOffense(offense) {
|
|
39
|
+
/** Adds a new offense. Returns false if the offense is already pending. */ async addOffense(offense) {
|
|
40
40
|
const key = this.getOffenseKey(offense);
|
|
41
41
|
const round = getRoundForOffense(offense, this.settings);
|
|
42
|
-
await this.kvStore.transactionAsync(async ()=>{
|
|
42
|
+
const added = await this.kvStore.transactionAsync(async ()=>{
|
|
43
|
+
if (await this.offenses.getAsync(key) !== undefined) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
43
46
|
await this.offenses.set(key, serializeOffense(offense));
|
|
44
47
|
await this.roundsOffenses.set(this.getRoundKey(round), key);
|
|
48
|
+
return true;
|
|
49
|
+
});
|
|
50
|
+
if (added) {
|
|
51
|
+
this.log.trace(`Adding pending offense ${key} for round ${round}`);
|
|
52
|
+
}
|
|
53
|
+
return added;
|
|
54
|
+
}
|
|
55
|
+
/** Removes pending offenses matching the given offense type, epoch/slot, and optional validators. */ async clearOffenses(filter) {
|
|
56
|
+
return await this.kvStore.transactionAsync(async ()=>{
|
|
57
|
+
const offensesToClear = new Map();
|
|
58
|
+
if (filter.validators && filter.validators.length > 0) {
|
|
59
|
+
for (const validator of filter.validators){
|
|
60
|
+
const identifier = {
|
|
61
|
+
validator,
|
|
62
|
+
offenseType: filter.offenseType,
|
|
63
|
+
epochOrSlot: filter.epochOrSlot
|
|
64
|
+
};
|
|
65
|
+
const key = this.getOffenseKey(identifier);
|
|
66
|
+
const buffer = await this.offenses.getAsync(key);
|
|
67
|
+
if (buffer) {
|
|
68
|
+
offensesToClear.set(key, deserializeOffense(buffer));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
for await (const [key, buffer] of this.offenses.entriesAsync()){
|
|
73
|
+
const offense = deserializeOffense(buffer);
|
|
74
|
+
if (offense.offenseType === filter.offenseType && offense.epochOrSlot === filter.epochOrSlot) {
|
|
75
|
+
offensesToClear.set(key, offense);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (offensesToClear.size === 0) {
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
for (const [key, offense] of offensesToClear){
|
|
83
|
+
const round = getRoundForOffense(offense, this.settings);
|
|
84
|
+
await this.offenses.delete(key);
|
|
85
|
+
await this.roundsOffenses.deleteValue(this.getRoundKey(round), key);
|
|
86
|
+
this.log.trace(`Cleared pending offense ${key} for round ${round}`);
|
|
87
|
+
}
|
|
88
|
+
return offensesToClear.size;
|
|
45
89
|
});
|
|
46
|
-
this.log.trace(`Adding pending offense ${key} for round ${round}`);
|
|
47
90
|
}
|
|
48
91
|
/** Prunes all offenses expired from the store */ async clearExpiredOffenses(currentRound) {
|
|
49
92
|
const expirationRounds = this.settings.slashOffenseExpirationRounds ?? 0;
|
|
@@ -54,20 +97,19 @@ export class SlasherOffensesStore {
|
|
|
54
97
|
if (expiredBefore < 0) {
|
|
55
98
|
return 0; // Not enough rounds have passed to expire anything
|
|
56
99
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await this.kvStore.transactionAsync(async ()=>{
|
|
100
|
+
return await this.kvStore.transactionAsync(async ()=>{
|
|
101
|
+
// Collect expired offenses and rounds
|
|
102
|
+
const expiredRoundKeys = new Set();
|
|
103
|
+
const expiredOffenseKeys = new Set();
|
|
104
|
+
for await (const [roundKey, offenseKey] of this.roundsOffenses.entriesAsync({
|
|
105
|
+
end: this.getRoundKey(expiredBefore)
|
|
106
|
+
})){
|
|
107
|
+
expiredOffenseKeys.add(offenseKey);
|
|
108
|
+
expiredRoundKeys.add(roundKey);
|
|
109
|
+
}
|
|
110
|
+
if (expiredOffenseKeys.size === 0 && expiredRoundKeys.size === 0) {
|
|
111
|
+
return 0; // Nothing to clean up
|
|
112
|
+
}
|
|
71
113
|
for (const key of expiredOffenseKeys){
|
|
72
114
|
this.log.trace(`Deleting offense ${key}`);
|
|
73
115
|
await this.offenses.delete(key);
|
|
@@ -76,8 +118,8 @@ export class SlasherOffensesStore {
|
|
|
76
118
|
this.log.trace(`Deleting round info for ${roundKey}`);
|
|
77
119
|
await this.roundsOffenses.delete(roundKey);
|
|
78
120
|
}
|
|
121
|
+
return expiredOffenseKeys.size;
|
|
79
122
|
});
|
|
80
|
-
return expiredOffenseKeys.size;
|
|
81
123
|
}
|
|
82
124
|
/** Generate a unique key for an offense */ getOffenseKey(offense) {
|
|
83
125
|
return `${offense.validator.toString()}:${offense.offenseType}:${offense.epochOrSlot}`;
|
package/dest/watcher.d.ts
CHANGED
|
@@ -3,14 +3,21 @@ import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
|
3
3
|
import { OffenseType } from '@aztec/stdlib/slashing';
|
|
4
4
|
import type { SlasherConfig } from './config.js';
|
|
5
5
|
export declare const WANT_TO_SLASH_EVENT: "want-to-slash";
|
|
6
|
+
export declare const WANT_TO_CLEAR_SLASH_EVENT: "want-to-clear-slash";
|
|
6
7
|
export interface WantToSlashArgs {
|
|
7
8
|
validator: EthAddress;
|
|
8
9
|
amount: bigint;
|
|
9
10
|
offenseType: OffenseType;
|
|
10
11
|
epochOrSlot: bigint;
|
|
11
12
|
}
|
|
13
|
+
export interface WantToClearSlashArgs {
|
|
14
|
+
offenseType: OffenseType;
|
|
15
|
+
epochOrSlot: bigint;
|
|
16
|
+
validators?: EthAddress[];
|
|
17
|
+
}
|
|
12
18
|
export interface WatcherEventMap {
|
|
13
19
|
[WANT_TO_SLASH_EVENT]: (args: WantToSlashArgs[]) => void;
|
|
20
|
+
[WANT_TO_CLEAR_SLASH_EVENT]: (args: WantToClearSlashArgs[]) => void;
|
|
14
21
|
}
|
|
15
22
|
export type WatcherEmitter = TypedEventEmitter<WatcherEventMap>;
|
|
16
23
|
export type Watcher = WatcherEmitter & {
|
|
@@ -18,4 +25,4 @@ export type Watcher = WatcherEmitter & {
|
|
|
18
25
|
stop?: () => Promise<void>;
|
|
19
26
|
updateConfig: (config: Partial<SlasherConfig>) => void;
|
|
20
27
|
};
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sour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UFBTSxjQUFjLEdBQUcsaUJBQWlCLENBQUMsZUFBZSxDQUFDLENBQUM7QUFFaEUsTUFBTSxNQUFNLE9BQU8sR0FBRyxjQUFjLEdBQUc7SUFDckMsS0FBSyxDQUFDLEVBQUUsTUFBTSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDNUIsSUFBSSxDQUFDLEVBQUUsTUFBTSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDM0IsWUFBWSxFQUFFLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxhQUFhLENBQUMsS0FBSyxJQUFJLENBQUM7Q0FDeEQsQ0FBQyJ9
|
package/dest/watcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,mBAAmB,iBAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,mBAAmB,iBAA2B,CAAC;AAC5D,eAAO,MAAM,yBAAyB,uBAAiC,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;CAC3B;AAGD,MAAM,WAAW,eAAe;IAC9B,CAAC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACzD,CAAC,yBAAyB,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;CACrE;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAEhE,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CACxD,CAAC"}
|
package/dest/watcher.js
CHANGED
|
@@ -1,34 +1,47 @@
|
|
|
1
1
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import { type
|
|
2
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
3
|
+
import { type DescendentOfInvalidAttestationsCheckpointEvent, type InvalidCheckpointDetectedEvent, type L2BlockSourceEventEmitter } from '@aztec/stdlib/block';
|
|
3
4
|
import type { SlasherConfig } from '../config.js';
|
|
4
5
|
import { type Watcher, type WatcherEmitter } from '../watcher.js';
|
|
5
|
-
declare const AttestationsBlockWatcherConfigKeys: readonly ["
|
|
6
|
+
declare const AttestationsBlockWatcherConfigKeys: readonly ["slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty", "slashProposeInvalidAttestationsPenalty"];
|
|
6
7
|
type AttestationsBlockWatcherConfig = Pick<SlasherConfig, (typeof AttestationsBlockWatcherConfigKeys)[number]>;
|
|
7
8
|
declare const AttestationsBlockWatcher_base: new () => WatcherEmitter;
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Watches the archiver for checkpoints whose publication is itself a slashable offense.
|
|
11
|
+
*
|
|
12
|
+
* Two cases are handled, both targeting the proposer of the offending checkpoint:
|
|
13
|
+
*
|
|
14
|
+
* - Invalid-attestations checkpoint: the proposer published a checkpoint to L1 whose
|
|
15
|
+
* attestations are either insufficient (below quorum) or incorrect (signature from a
|
|
16
|
+
* non-committee member, malformed signature, etc.). Slashed via
|
|
17
|
+
* {@link OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS} or
|
|
18
|
+
* {@link OffenseType.PROPOSED_INCORRECT_ATTESTATIONS}.
|
|
19
|
+
*
|
|
20
|
+
* - Descendant of an invalid checkpoint: the proposer published a checkpoint that extends a
|
|
21
|
+
* previously-rejected one. The descendant may itself have valid attestations, but it is still
|
|
22
|
+
* unusable. Triggered by the archiver's `CheckpointBuiltOnInvalidAncestorDetected` event
|
|
23
|
+
* when the descendant has valid attestations (skipped before ingestion). Slashes the descendant's
|
|
24
|
+
* proposer via {@link OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS}.
|
|
13
25
|
*/
|
|
14
26
|
export declare class AttestationsBlockWatcher extends AttestationsBlockWatcher_base implements Watcher {
|
|
15
27
|
private l2BlockSource;
|
|
16
28
|
private epochCache;
|
|
17
29
|
private log;
|
|
18
|
-
private maxInvalidCheckpoints;
|
|
19
|
-
private invalidArchiveRoots;
|
|
20
30
|
private config;
|
|
21
31
|
private boundHandleInvalidCheckpoint;
|
|
22
|
-
|
|
32
|
+
private boundHandleDescendantOfInvalid;
|
|
33
|
+
constructor(l2BlockSource: L2BlockSourceEventEmitter, epochCache: EpochCache, config: AttestationsBlockWatcherConfig, bindings?: LoggerBindings);
|
|
23
34
|
updateConfig(newConfig: Partial<AttestationsBlockWatcherConfig>): void;
|
|
24
35
|
start(): Promise<void>;
|
|
25
36
|
stop(): Promise<void>;
|
|
26
37
|
/** Event handler for invalid checkpoints as reported by the archiver. Public for testing purposes. */
|
|
27
38
|
handleInvalidCheckpoint(event: InvalidCheckpointDetectedEvent): void;
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Event handler for valid-attestations checkpoints that build on a previously-rejected ancestor.
|
|
41
|
+
* The archiver emits this when ingesting the descendant, and we slash its proposer.
|
|
42
|
+
*/
|
|
43
|
+
handleDescendantOfInvalid(event: DescendentOfInvalidAttestationsCheckpointEvent): Promise<void>;
|
|
30
44
|
private getOffenseFromInvalidationReason;
|
|
31
|
-
private addInvalidCheckpoint;
|
|
32
45
|
}
|
|
33
46
|
export {};
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0YXRpb25zX2Jsb2NrX3dhdGNoZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93YXRjaGVycy9hdHRlc3RhdGlvbnNfYmxvY2tfd2F0Y2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFHaEQsT0FBTyxFQUFlLEtBQUssY0FBYyxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBQ3ZGLE9BQU8sRUFDTCxLQUFLLDhDQUE4QyxFQUNuRCxLQUFLLDhCQUE4QixFQUNuQyxLQUFLLHlCQUF5QixFQUcvQixNQUFNLHFCQUFxQixDQUFDO0FBTTdCLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLGNBQWMsQ0FBQztB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
|
|
|
1
|
-
{"version":3,"file":"attestations_block_watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/attestations_block_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"attestations_block_watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/attestations_block_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AACvF,OAAO,EACL,KAAK,8CAA8C,EACnD,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAG/B,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAA6C,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7G,QAAA,MAAM,kCAAkC,yHAG9B,CAAC;AAEX,KAAK,8BAA8B,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;AAE/G;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,wBAAyB,SAAQ,6BAA2C,YAAW,OAAO;IAyBvG,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,UAAU;IAzBpB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,MAAM,CAAiC;IAE/C,OAAO,CAAC,4BAA4B,CASlC;IAEF,OAAO,CAAC,8BAA8B,CAOpC;IAEF,YACU,aAAa,EAAE,yBAAyB,EACxC,UAAU,EAAE,UAAU,EAC9B,MAAM,EAAE,8BAA8B,EACtC,QAAQ,CAAC,EAAE,cAAc,EAM1B;IAEM,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,8BAA8B,CAAC,QAGrE;IAEM,KAAK,kBAUX;IAEM,IAAI,kBAUV;IAED,sGAAsG;IAC/F,uBAAuB,CAAC,KAAK,EAAE,8BAA8B,GAAG,IAAI,CAqC1E;IAED;;;OAGG;IACU,yBAAyB,CAAC,KAAK,EAAE,8CAA8C,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3G;IAED,OAAO,CAAC,gCAAgC;CAYzC"}
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { merge, pick } from '@aztec/foundation/collection';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { L2BlockSourceEvents } from '@aztec/stdlib/block';
|
|
5
|
-
import {
|
|
5
|
+
import { getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
|
|
6
|
+
import { OffenseType, getOffenseTypeName } from '@aztec/stdlib/slashing';
|
|
6
7
|
import EventEmitter from 'node:events';
|
|
7
8
|
import { WANT_TO_SLASH_EVENT } from '../watcher.js';
|
|
8
9
|
const AttestationsBlockWatcherConfigKeys = [
|
|
9
|
-
'
|
|
10
|
+
'slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty',
|
|
10
11
|
'slashProposeInvalidAttestationsPenalty'
|
|
11
12
|
];
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* Watches the archiver for checkpoints whose publication is itself a slashable offense.
|
|
15
|
+
*
|
|
16
|
+
* Two cases are handled, both targeting the proposer of the offending checkpoint:
|
|
17
|
+
*
|
|
18
|
+
* - Invalid-attestations checkpoint: the proposer published a checkpoint to L1 whose
|
|
19
|
+
* attestations are either insufficient (below quorum) or incorrect (signature from a
|
|
20
|
+
* non-committee member, malformed signature, etc.). Slashed via
|
|
21
|
+
* {@link OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS} or
|
|
22
|
+
* {@link OffenseType.PROPOSED_INCORRECT_ATTESTATIONS}.
|
|
23
|
+
*
|
|
24
|
+
* - Descendant of an invalid checkpoint: the proposer published a checkpoint that extends a
|
|
25
|
+
* previously-rejected one. The descendant may itself have valid attestations, but it is still
|
|
26
|
+
* unusable. Triggered by the archiver's `CheckpointBuiltOnInvalidAncestorDetected` event
|
|
27
|
+
* when the descendant has valid attestations (skipped before ingestion). Slashes the descendant's
|
|
28
|
+
* proposer via {@link OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS}.
|
|
17
29
|
*/ export class AttestationsBlockWatcher extends EventEmitter {
|
|
18
30
|
l2BlockSource;
|
|
19
31
|
epochCache;
|
|
20
32
|
log;
|
|
21
|
-
// Only keep track of the last N invalid checkpoints
|
|
22
|
-
maxInvalidCheckpoints;
|
|
23
|
-
// All invalid archive roots seen
|
|
24
|
-
invalidArchiveRoots;
|
|
25
33
|
config;
|
|
26
34
|
boundHandleInvalidCheckpoint;
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
boundHandleDescendantOfInvalid;
|
|
36
|
+
constructor(l2BlockSource, epochCache, config, bindings){
|
|
37
|
+
super(), this.l2BlockSource = l2BlockSource, this.epochCache = epochCache, this.boundHandleInvalidCheckpoint = (event)=>{
|
|
29
38
|
try {
|
|
30
39
|
this.handleInvalidCheckpoint(event);
|
|
31
40
|
} catch (err) {
|
|
@@ -34,7 +43,15 @@ const AttestationsBlockWatcherConfigKeys = [
|
|
|
34
43
|
reason: event.validationResult.reason
|
|
35
44
|
});
|
|
36
45
|
}
|
|
46
|
+
}, this.boundHandleDescendantOfInvalid = (event)=>{
|
|
47
|
+
this.handleDescendantOfInvalid(event).catch((err)=>{
|
|
48
|
+
this.log.error('Error handling descendant of invalid checkpoint', err, {
|
|
49
|
+
checkpointNumber: event.checkpoint.checkpointNumber,
|
|
50
|
+
ancestorCheckpointNumber: event.ancestorCheckpointNumber
|
|
51
|
+
});
|
|
52
|
+
});
|
|
37
53
|
};
|
|
54
|
+
this.log = createLogger('slasher:attestations-block-watcher', bindings);
|
|
38
55
|
this.config = pick(config, ...AttestationsBlockWatcherConfigKeys);
|
|
39
56
|
this.log.info('AttestationsBlockWatcher initialized');
|
|
40
57
|
}
|
|
@@ -44,57 +61,24 @@ const AttestationsBlockWatcherConfigKeys = [
|
|
|
44
61
|
}
|
|
45
62
|
start() {
|
|
46
63
|
this.l2BlockSource.events.on(L2BlockSourceEvents.InvalidAttestationsCheckpointDetected, this.boundHandleInvalidCheckpoint);
|
|
64
|
+
this.l2BlockSource.events.on(L2BlockSourceEvents.DescendentOfInvalidAttestationsCheckpointDetected, this.boundHandleDescendantOfInvalid);
|
|
47
65
|
return Promise.resolve();
|
|
48
66
|
}
|
|
49
67
|
stop() {
|
|
50
68
|
this.l2BlockSource.events.removeListener(L2BlockSourceEvents.InvalidAttestationsCheckpointDetected, this.boundHandleInvalidCheckpoint);
|
|
69
|
+
this.l2BlockSource.events.removeListener(L2BlockSourceEvents.DescendentOfInvalidAttestationsCheckpointDetected, this.boundHandleDescendantOfInvalid);
|
|
51
70
|
return Promise.resolve();
|
|
52
71
|
}
|
|
53
72
|
/** Event handler for invalid checkpoints as reported by the archiver. Public for testing purposes. */ handleInvalidCheckpoint(event) {
|
|
54
73
|
const { validationResult } = event;
|
|
55
|
-
const checkpoint = validationResult
|
|
56
|
-
// Check if we already have processed this checkpoint, archiver may emit the same event multiple times
|
|
57
|
-
if (this.invalidArchiveRoots.has(checkpoint.archive.toString())) {
|
|
58
|
-
this.log.trace(`Already processed invalid checkpoint ${checkpoint.checkpointNumber}`);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
74
|
+
const { reason, checkpoint } = validationResult;
|
|
61
75
|
this.log.verbose(`Detected invalid checkpoint ${checkpoint.checkpointNumber}`, {
|
|
62
76
|
...checkpoint,
|
|
63
77
|
reason: validationResult.valid === false ? validationResult.reason : 'unknown'
|
|
64
78
|
});
|
|
65
|
-
|
|
66
|
-
this.addInvalidCheckpoint(event.validationResult.checkpoint);
|
|
67
|
-
// Slash the proposer of the invalid checkpoint
|
|
68
|
-
this.slashProposer(event.validationResult);
|
|
69
|
-
// Check if the parent of this checkpoint is invalid as well, if so, we will slash its attestors as well
|
|
70
|
-
this.slashAttestorsOnAncestorInvalid(event.validationResult);
|
|
71
|
-
}
|
|
72
|
-
slashAttestorsOnAncestorInvalid(validationResult) {
|
|
73
|
-
const checkpoint = validationResult.checkpoint;
|
|
74
|
-
const parentArchive = checkpoint.lastArchive.toString();
|
|
75
|
-
if (this.invalidArchiveRoots.has(parentArchive)) {
|
|
76
|
-
const attestors = validationResult.attestors;
|
|
77
|
-
this.log.info(`Want to slash attestors of checkpoint ${checkpoint.checkpointNumber} built on invalid checkpoint`, {
|
|
78
|
-
...checkpoint,
|
|
79
|
-
...attestors,
|
|
80
|
-
parentArchive
|
|
81
|
-
});
|
|
82
|
-
this.emit(WANT_TO_SLASH_EVENT, attestors.map((attestor)=>({
|
|
83
|
-
validator: attestor,
|
|
84
|
-
amount: this.config.slashAttestDescendantOfInvalidPenalty,
|
|
85
|
-
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
|
|
86
|
-
epochOrSlot: BigInt(SlotNumber(checkpoint.slotNumber))
|
|
87
|
-
})));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
slashProposer(validationResult) {
|
|
91
|
-
const { reason, checkpoint } = validationResult;
|
|
92
|
-
const checkpointNumber = checkpoint.checkpointNumber;
|
|
93
|
-
const slot = checkpoint.slotNumber;
|
|
79
|
+
const { checkpointNumber, slotNumber: slot } = checkpoint;
|
|
94
80
|
const epochCommitteeInfo = {
|
|
95
|
-
|
|
96
|
-
seed: validationResult.seed,
|
|
97
|
-
epoch: validationResult.epoch,
|
|
81
|
+
...validationResult,
|
|
98
82
|
isEscapeHatchOpen: false
|
|
99
83
|
};
|
|
100
84
|
const proposer = this.epochCache.getProposerFromEpochCommittee(epochCommitteeInfo, slot);
|
|
@@ -110,9 +94,48 @@ const AttestationsBlockWatcherConfigKeys = [
|
|
|
110
94
|
offenseType: offense,
|
|
111
95
|
epochOrSlot: BigInt(slot)
|
|
112
96
|
};
|
|
113
|
-
this.log.info(`
|
|
97
|
+
this.log.info(`Detected invalid attestations checkpoint proposer offense`, {
|
|
114
98
|
...checkpoint,
|
|
115
|
-
|
|
99
|
+
reason,
|
|
100
|
+
validator: args.validator.toString(),
|
|
101
|
+
amount: args.amount,
|
|
102
|
+
offenseType: getOffenseTypeName(args.offenseType),
|
|
103
|
+
epochOrSlot: args.epochOrSlot
|
|
104
|
+
});
|
|
105
|
+
this.emit(WANT_TO_SLASH_EVENT, [
|
|
106
|
+
args
|
|
107
|
+
]);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Event handler for valid-attestations checkpoints that build on a previously-rejected ancestor.
|
|
111
|
+
* The archiver emits this when ingesting the descendant, and we slash its proposer.
|
|
112
|
+
*/ async handleDescendantOfInvalid(event) {
|
|
113
|
+
const { checkpoint, ancestorCheckpointNumber, ancestorArchiveRoot } = event;
|
|
114
|
+
const slot = checkpoint.slotNumber;
|
|
115
|
+
const epoch = EpochNumber(getEpochAtSlot(slot, this.epochCache.getL1Constants()));
|
|
116
|
+
const epochCommitteeInfo = await this.epochCache.getCommitteeForEpoch(epoch);
|
|
117
|
+
const proposer = this.epochCache.getProposerFromEpochCommittee({
|
|
118
|
+
...epochCommitteeInfo,
|
|
119
|
+
epoch
|
|
120
|
+
}, slot);
|
|
121
|
+
if (!proposer) {
|
|
122
|
+
this.log.warn(`No proposer found for invalid descendant checkpoint ${checkpoint.checkpointNumber} at slot ${slot}`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const args = {
|
|
126
|
+
validator: proposer,
|
|
127
|
+
amount: this.config.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty,
|
|
128
|
+
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
|
|
129
|
+
epochOrSlot: BigInt(slot)
|
|
130
|
+
};
|
|
131
|
+
this.log.info(`Detected invalid descendant checkpoint proposer offense`, {
|
|
132
|
+
...checkpoint,
|
|
133
|
+
ancestorCheckpointNumber,
|
|
134
|
+
ancestorArchiveRoot: ancestorArchiveRoot.toString(),
|
|
135
|
+
validator: args.validator.toString(),
|
|
136
|
+
amount: args.amount,
|
|
137
|
+
offenseType: getOffenseTypeName(args.offenseType),
|
|
138
|
+
epochOrSlot: args.epochOrSlot
|
|
116
139
|
});
|
|
117
140
|
this.emit(WANT_TO_SLASH_EVENT, [
|
|
118
141
|
args
|
|
@@ -131,12 +154,4 @@ const AttestationsBlockWatcherConfigKeys = [
|
|
|
131
154
|
}
|
|
132
155
|
}
|
|
133
156
|
}
|
|
134
|
-
addInvalidCheckpoint(checkpoint) {
|
|
135
|
-
this.invalidArchiveRoots.add(checkpoint.archive.toString());
|
|
136
|
-
// Prune old entries if we exceed the maximum
|
|
137
|
-
if (this.invalidArchiveRoots.size > this.maxInvalidCheckpoints) {
|
|
138
|
-
const oldestKey = this.invalidArchiveRoots.keys().next().value;
|
|
139
|
-
this.invalidArchiveRoots.delete(oldestKey);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
157
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
4
|
+
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
5
|
+
import type { P2PClient, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import { type Watcher, type WatcherEmitter } from '../watcher.js';
|
|
7
|
+
declare const AttestedInvalidProposalWatcherConfigKeys: readonly ["slashAttestInvalidCheckpointProposalPenalty"];
|
|
8
|
+
type AttestedInvalidProposalWatcherConfig = Pick<SlasherConfig, (typeof AttestedInvalidProposalWatcherConfigKeys)[number]>;
|
|
9
|
+
type P2PCheckpointAttestationSource = Pick<P2PClient, 'getCheckpointAttestationsForSlot'>;
|
|
10
|
+
type AttestedInvalidProposalWatcherOptions = {
|
|
11
|
+
scanSlotLookback?: number;
|
|
12
|
+
log?: Logger;
|
|
13
|
+
};
|
|
14
|
+
export type InvalidProposalSlotSource = {
|
|
15
|
+
hasInvalidProposals(slot: SlotNumber): boolean;
|
|
16
|
+
hasProposalEquivocation(slot: SlotNumber): boolean;
|
|
17
|
+
};
|
|
18
|
+
declare const AttestedInvalidProposalWatcher_base: new () => WatcherEmitter;
|
|
19
|
+
export declare class AttestedInvalidProposalWatcher extends AttestedInvalidProposalWatcher_base implements Watcher {
|
|
20
|
+
private readonly p2pClient;
|
|
21
|
+
private readonly invalidProposalSlotSource;
|
|
22
|
+
private readonly l2BlockSource;
|
|
23
|
+
private readonly epochCache;
|
|
24
|
+
private readonly log;
|
|
25
|
+
private readonly runningPromise;
|
|
26
|
+
private readonly emittedOffenses;
|
|
27
|
+
private readonly scanSlotLookback;
|
|
28
|
+
private config;
|
|
29
|
+
private lastScannedSlot;
|
|
30
|
+
constructor(p2pClient: P2PCheckpointAttestationSource, invalidProposalSlotSource: InvalidProposalSlotSource, l2BlockSource: Pick<L2BlockSource, 'getSyncedL2SlotNumber'>, epochCache: Pick<EpochCacheInterface, 'getSlotNow' | 'getL1Constants'>, config: AttestedInvalidProposalWatcherConfig, options?: AttestedInvalidProposalWatcherOptions);
|
|
31
|
+
updateConfig(config: Partial<SlasherConfig>): void;
|
|
32
|
+
start(): Promise<void>;
|
|
33
|
+
stop(): Promise<void>;
|
|
34
|
+
scan(): Promise<void>;
|
|
35
|
+
/** Scans a single invalid-proposal slot. */
|
|
36
|
+
scanSlot(slot: SlotNumber): Promise<void>;
|
|
37
|
+
private getSlashArgs;
|
|
38
|
+
private getSlashArgsForAttester;
|
|
39
|
+
private markAsNewOffense;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0ZWRfa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