@aztec/slasher 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa
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 +90 -76
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +53 -41
- package/dest/factory/create_facade.d.ts +5 -4
- package/dest/factory/create_facade.d.ts.map +1 -1
- package/dest/factory/create_facade.js +26 -3
- package/dest/factory/create_implementation.d.ts +7 -8
- package/dest/factory/create_implementation.d.ts.map +1 -1
- package/dest/factory/create_implementation.js +8 -56
- package/dest/factory/get_settings.d.ts +4 -4
- package/dest/factory/get_settings.d.ts.map +1 -1
- package/dest/factory/get_settings.js +3 -3
- package/dest/factory/index.d.ts +2 -2
- package/dest/factory/index.d.ts.map +1 -1
- package/dest/factory/index.js +1 -1
- package/dest/generated/slasher-defaults.d.ts +21 -0
- package/dest/generated/slasher-defaults.d.ts.map +1 -0
- package/dest/generated/slasher-defaults.js +21 -0
- package/dest/index.d.ts +6 -4
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +5 -3
- package/dest/metrics.d.ts +7 -0
- package/dest/metrics.d.ts.map +1 -0
- package/dest/metrics.js +11 -0
- package/dest/null_slasher_client.d.ts +5 -5
- package/dest/null_slasher_client.d.ts.map +1 -1
- package/dest/null_slasher_client.js +1 -4
- package/dest/slash_offenses_collector.d.ts +10 -9
- package/dest/slash_offenses_collector.d.ts.map +1 -1
- package/dest/slash_offenses_collector.js +50 -30
- package/dest/slash_round_monitor.d.ts +5 -4
- package/dest/slash_round_monitor.d.ts.map +1 -1
- package/dest/slasher_client.d.ts +114 -0
- package/dest/slasher_client.d.ts.map +1 -0
- package/dest/{tally_slasher_client.js → slasher_client.js} +55 -45
- package/dest/slasher_client_facade.d.ts +9 -10
- package/dest/slasher_client_facade.d.ts.map +1 -1
- package/dest/slasher_client_facade.js +6 -9
- package/dest/slasher_client_interface.d.ts +9 -22
- package/dest/slasher_client_interface.d.ts.map +1 -1
- package/dest/slasher_client_interface.js +1 -4
- package/dest/stores/offenses_store.d.ts +12 -12
- package/dest/stores/offenses_store.d.ts.map +1 -1
- package/dest/stores/offenses_store.js +64 -39
- package/dest/stores/schema_version.d.ts +1 -1
- package/dest/test/dummy_watcher.d.ts +1 -1
- package/dest/test/dummy_watcher.d.ts.map +1 -1
- 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 +29 -15
- package/dest/watchers/attestations_block_watcher.d.ts.map +1 -1
- package/dest/watchers/attestations_block_watcher.js +91 -69
- 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 +18 -15
- package/src/config.ts +61 -41
- package/src/factory/create_facade.ts +35 -6
- package/src/factory/create_implementation.ts +25 -106
- package/src/factory/get_settings.ts +8 -8
- package/src/factory/index.ts +1 -1
- package/src/generated/slasher-defaults.ts +23 -0
- package/src/index.ts +5 -3
- package/src/metrics.ts +19 -0
- package/src/null_slasher_client.ts +4 -7
- package/src/slash_offenses_collector.ts +70 -32
- package/src/slash_round_monitor.ts +3 -2
- package/src/{tally_slasher_client.ts → slasher_client.ts} +82 -58
- package/src/slasher_client_facade.ts +9 -13
- package/src/slasher_client_interface.ts +8 -22
- package/src/stores/offenses_store.ts +76 -48
- package/src/watcher.ts +9 -1
- package/src/watchers/attestations_block_watcher.ts +108 -88
- 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/empire_slasher_client.d.ts +0 -189
- package/dest/empire_slasher_client.d.ts.map +0 -1
- package/dest/empire_slasher_client.js +0 -572
- package/dest/stores/payloads_store.d.ts +0 -29
- package/dest/stores/payloads_store.d.ts.map +0 -1
- package/dest/stores/payloads_store.js +0 -125
- package/dest/tally_slasher_client.d.ts +0 -129
- package/dest/tally_slasher_client.d.ts.map +0 -1
- package/dest/watchers/epoch_prune_watcher.d.ts +0 -37
- package/dest/watchers/epoch_prune_watcher.d.ts.map +0 -1
- package/dest/watchers/epoch_prune_watcher.js +0 -135
- package/src/empire_slasher_client.ts +0 -656
- package/src/stores/payloads_store.ts +0 -146
- package/src/watchers/epoch_prune_watcher.ts +0 -192
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
+
import { RollupContract, SlasherContract, SlashingProposerContract } from '@aztec/ethereum/contracts';
|
|
3
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
5
|
+
import type { Prettify } from '@aztec/foundation/types';
|
|
6
|
+
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
7
|
+
import { type Offense, type ProposerSlashAction, type ProposerSlashActionProvider } from '@aztec/stdlib/slashing';
|
|
8
|
+
import type { Hex } from 'viem';
|
|
9
|
+
import { SlasherMetrics } from './metrics.js';
|
|
10
|
+
import { SlashOffensesCollector, type SlashOffensesCollectorConfig, type SlashOffensesCollectorSettings } from './slash_offenses_collector.js';
|
|
11
|
+
import { SlashRoundMonitor, type SlashRoundMonitorSettings } from './slash_round_monitor.js';
|
|
12
|
+
import type { SlasherClientInterface } from './slasher_client_interface.js';
|
|
13
|
+
import type { SlasherOffensesStore } from './stores/offenses_store.js';
|
|
14
|
+
import type { Watcher } from './watcher.js';
|
|
15
|
+
/** Settings used in the slasher client, loaded from the L1 contracts during initialization */
|
|
16
|
+
export type SlasherSettings = Prettify<SlashRoundMonitorSettings & SlashOffensesCollectorSettings & {
|
|
17
|
+
slashingLifetimeInRounds: number;
|
|
18
|
+
slashingExecutionDelayInRounds: number;
|
|
19
|
+
slashingRoundSizeInEpochs: number;
|
|
20
|
+
slashingOffsetInRounds: number;
|
|
21
|
+
slashingQuorumSize: number;
|
|
22
|
+
slashingAmounts: [bigint, bigint, bigint];
|
|
23
|
+
/** Committee size for block proposal */
|
|
24
|
+
targetCommitteeSize: number;
|
|
25
|
+
}>;
|
|
26
|
+
export type SlasherClientConfig = SlashOffensesCollectorConfig & Pick<SlasherConfig, 'slashValidatorsAlways' | 'slashValidatorsNever' | 'slashExecuteRoundsLookBack' | 'slashMaxPayloadSize'>;
|
|
27
|
+
/**
|
|
28
|
+
* The Slasher client is responsible for managing slashable offenses using
|
|
29
|
+
* the consensus-based slashing model where proposers vote on individual validator offenses.
|
|
30
|
+
*
|
|
31
|
+
* The client subscribes to several slash watchers that emit offenses and tracks them. When the slasher is the
|
|
32
|
+
* proposer, it votes for which validators from past epochs should be slashed based on collected offenses.
|
|
33
|
+
* Voting is handled by the sequencer publisher, the slasher client does not interact with L1 directly.
|
|
34
|
+
* The client also monitors rounds and executes slashing when rounds become executable after reaching quorum.
|
|
35
|
+
*
|
|
36
|
+
* Voting and offense collection
|
|
37
|
+
* - Time is divided into rounds (ROUND_SIZE slots each). During each round, block proposers can submit votes
|
|
38
|
+
* indicating which validators from SLASH_OFFSET_IN_ROUNDS rounds ago should be slashed.
|
|
39
|
+
* - Votes are encoded as bytes where each validator's vote is represented by 2 bits indicating the slash amount (0-3 slash units)
|
|
40
|
+
* for the validator in the committee being slashed.
|
|
41
|
+
* - When gathering offenses for round N, the system looks at offenses from round N-2 (where 2 is the hardcoded
|
|
42
|
+
* offset), giving time to detect offenses and vote on them in a later round.
|
|
43
|
+
* - Each offense carries an epoch or block identifier to differentiate multiple offenses by the same validator.
|
|
44
|
+
*
|
|
45
|
+
* Quorum and execution
|
|
46
|
+
* - After a round ends, there is an execution delay period for review so the VETOER in the Slasher can veto
|
|
47
|
+
* if needed.
|
|
48
|
+
* - Once the delay passes, anyone can call executeRound() to tally votes and execute slashing.
|
|
49
|
+
* - Validators that reach the quorum threshold are slashed. A vote for slashing N units is also considered
|
|
50
|
+
* a vote for slashing N-1, N-2, ..., 1 units. The system slashes for the largest amount that reaches quorum.
|
|
51
|
+
* - The client monitors executable rounds and triggers execution when appropriate.
|
|
52
|
+
*/
|
|
53
|
+
export declare class SlasherClient implements ProposerSlashActionProvider, SlasherClientInterface {
|
|
54
|
+
private config;
|
|
55
|
+
private settings;
|
|
56
|
+
private slashingProposer;
|
|
57
|
+
private slasher;
|
|
58
|
+
private rollup;
|
|
59
|
+
private epochCache;
|
|
60
|
+
private dateProvider;
|
|
61
|
+
private offensesStore;
|
|
62
|
+
private log;
|
|
63
|
+
private readonly metrics;
|
|
64
|
+
protected unwatchCallbacks: (() => void)[];
|
|
65
|
+
protected roundMonitor: SlashRoundMonitor;
|
|
66
|
+
protected offensesCollector: SlashOffensesCollector;
|
|
67
|
+
constructor(config: SlasherClientConfig, settings: SlasherSettings, slashingProposer: SlashingProposerContract, slasher: SlasherContract, rollup: RollupContract, watchers: Watcher[], epochCache: EpochCache, dateProvider: DateProvider, offensesStore: SlasherOffensesStore, log?: import("@aztec/foundation/log").Logger, metrics?: SlasherMetrics);
|
|
68
|
+
start(): Promise<void>;
|
|
69
|
+
/** Stop the slasher client */
|
|
70
|
+
stop(): Promise<void>;
|
|
71
|
+
/** Returns the current config */
|
|
72
|
+
getConfig(): SlasherConfig;
|
|
73
|
+
/** Update the config of the slasher client */
|
|
74
|
+
updateConfig(config: Partial<SlasherConfig>): void;
|
|
75
|
+
/** Triggered on a time basis when we enter a new slashing round. Clears expired offenses. */
|
|
76
|
+
protected handleNewRound(round: bigint): Promise<void>;
|
|
77
|
+
/** Called when we see a RoundExecuted event on the SlashingProposer (just for logging). */
|
|
78
|
+
protected handleRoundExecuted(round: bigint, slashCount: bigint, l1BlockHash: Hex): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the actions the proposer should take for slashing
|
|
81
|
+
* @param slotNumber - The current slot number
|
|
82
|
+
* @returns The actions to take
|
|
83
|
+
*/
|
|
84
|
+
getProposerActions(slotNumber: SlotNumber): Promise<ProposerSlashAction[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Returns an execute slash action if there are any rounds ready to be executed.
|
|
87
|
+
* Returns the oldest slash action if there are multiple rounds pending execution.
|
|
88
|
+
*/
|
|
89
|
+
protected getExecuteSlashAction(slotNumber: SlotNumber): Promise<ProposerSlashAction | undefined>;
|
|
90
|
+
private tryGetRoundExecuteAction;
|
|
91
|
+
/** Returns a vote action based on offenses from the target round (with offset applied) */
|
|
92
|
+
protected getVoteOffensesAction(slotNumber: SlotNumber): Promise<ProposerSlashAction | undefined>;
|
|
93
|
+
/** Returns the committees that were active during the timespan of a given round */
|
|
94
|
+
private collectCommitteesActiveDuringRound;
|
|
95
|
+
/**
|
|
96
|
+
* Gather offenses to be slashed on a given round.
|
|
97
|
+
* Round N slashes validators from round N - slashOffsetInRounds.
|
|
98
|
+
* @param round - The round to get offenses for, defaults to current round
|
|
99
|
+
* @returns Array of pending offenses for the round with offset applied
|
|
100
|
+
*/
|
|
101
|
+
gatherOffensesForRound(round?: bigint): Promise<Offense[]>;
|
|
102
|
+
/** Returns all offenses stored */
|
|
103
|
+
getOffenses(): Promise<Offense[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the round to be slashed given the current round by applying the slash offset.
|
|
106
|
+
* During round N, we cannot slash the validators from the epochs of the same round, since the round is not over,
|
|
107
|
+
* and besides we would be asking the current validators to vote to slash themselves. So during round N we look at the
|
|
108
|
+
* epochs spanned during round N - SLASH_OFFSET_IN_ROUNDS. This offset means that the epochs we slash are complete,
|
|
109
|
+
* and also gives nodes time to detect any misbehavior (eg slashing for prunes requires the proof submission window to
|
|
110
|
+
* pass).
|
|
111
|
+
*/
|
|
112
|
+
private getSlashedRound;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xhc2hlcl9jbGllbnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9zbGFzaGVyX2NsaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEVBQUUsY0FBYyxFQUFFLGVBQWUsRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRXRHLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUc3RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN4RCxPQUFPLEtBQUssRUFBRSxhQUFhLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNyRSxPQUFPLEVBQ0wsS0FBSyxPQUFPLEVBRVosS0FBSyxtQkFBbUIsRUFDeEIsS0FBSywyQkFBMkIsRUFJakMsTUFBTSx3QkFBd0IsQ0FBQztBQUdoQyxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFaEMsT0FBTyxFQUFF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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"}
|
|
@@ -2,12 +2,13 @@ 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 {
|
|
6
|
-
import {
|
|
5
|
+
import { OffenseType, getEpochsForRound, getOffenseTypeName, getSlashConsensusVotesFromOffenses } from '@aztec/stdlib/slashing';
|
|
6
|
+
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
7
|
+
import { SlasherMetrics } from './metrics.js';
|
|
7
8
|
import { SlashOffensesCollector } from './slash_offenses_collector.js';
|
|
8
9
|
import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
9
10
|
/**
|
|
10
|
-
* The
|
|
11
|
+
* The Slasher client is responsible for managing slashable offenses using
|
|
11
12
|
* the consensus-based slashing model where proposers vote on individual validator offenses.
|
|
12
13
|
*
|
|
13
14
|
* The client subscribes to several slash watchers that emit offenses and tracks them. When the slasher is the
|
|
@@ -31,62 +32,54 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
31
32
|
* - Validators that reach the quorum threshold are slashed. A vote for slashing N units is also considered
|
|
32
33
|
* a vote for slashing N-1, N-2, ..., 1 units. The system slashes for the largest amount that reaches quorum.
|
|
33
34
|
* - The client monitors executable rounds and triggers execution when appropriate.
|
|
34
|
-
|
|
35
|
-
* Differences from Empire model
|
|
36
|
-
* - No fixed slash payloads - votes are for individual validator offenses encoded in bytes
|
|
37
|
-
* - The L1 contract determines which offenses reach quorum rather than nodes agreeing on a payload
|
|
38
|
-
* - Proposers vote directly on which validators to slash and by how much
|
|
39
|
-
* - Uses a slash offset to vote on validators from past rounds (e.g., round N votes on round N-2)
|
|
40
|
-
*/ export class TallySlasherClient {
|
|
35
|
+
*/ export class SlasherClient {
|
|
41
36
|
config;
|
|
42
37
|
settings;
|
|
43
|
-
|
|
38
|
+
slashingProposer;
|
|
44
39
|
slasher;
|
|
45
40
|
rollup;
|
|
46
41
|
epochCache;
|
|
47
42
|
dateProvider;
|
|
48
43
|
offensesStore;
|
|
49
44
|
log;
|
|
45
|
+
metrics;
|
|
50
46
|
unwatchCallbacks;
|
|
51
47
|
roundMonitor;
|
|
52
48
|
offensesCollector;
|
|
53
|
-
constructor(config, settings,
|
|
49
|
+
constructor(config, settings, slashingProposer, slasher, rollup, watchers, epochCache, dateProvider, offensesStore, log = createLogger('slasher:consensus'), metrics = new SlasherMetrics(getTelemetryClient())){
|
|
54
50
|
this.config = config;
|
|
55
51
|
this.settings = settings;
|
|
56
|
-
this.
|
|
52
|
+
this.slashingProposer = slashingProposer;
|
|
57
53
|
this.slasher = slasher;
|
|
58
54
|
this.rollup = rollup;
|
|
59
55
|
this.epochCache = epochCache;
|
|
60
56
|
this.dateProvider = dateProvider;
|
|
61
57
|
this.offensesStore = offensesStore;
|
|
62
58
|
this.log = log;
|
|
59
|
+
this.metrics = metrics;
|
|
63
60
|
this.unwatchCallbacks = [];
|
|
64
61
|
this.roundMonitor = new SlashRoundMonitor(settings, dateProvider);
|
|
65
62
|
this.offensesCollector = new SlashOffensesCollector(config, settings, watchers, offensesStore);
|
|
66
63
|
}
|
|
67
64
|
async start() {
|
|
68
|
-
this.log.debug('Starting
|
|
65
|
+
this.log.debug('Starting slasher client...');
|
|
69
66
|
this.roundMonitor.start();
|
|
70
67
|
await this.offensesCollector.start();
|
|
71
68
|
// Listen for RoundExecuted events
|
|
72
|
-
this.unwatchCallbacks.push(this.
|
|
69
|
+
this.unwatchCallbacks.push(this.slashingProposer.listenToRoundExecuted(({ round, slashCount, l1BlockHash })=>void this.handleRoundExecuted(round, slashCount, l1BlockHash).catch((err)=>this.log.error('Error handling round executed', err))));
|
|
73
70
|
// Check for round changes
|
|
74
71
|
this.unwatchCallbacks.push(this.roundMonitor.listenToNewRound((round)=>this.handleNewRound(round)));
|
|
75
|
-
this.log.info(`Started
|
|
72
|
+
this.log.info(`Started slasher client`);
|
|
76
73
|
return Promise.resolve();
|
|
77
74
|
}
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
*/ async stop() {
|
|
81
|
-
this.log.debug('Stopping Tally Slasher client...');
|
|
75
|
+
/** Stop the slasher client */ async stop() {
|
|
76
|
+
this.log.debug('Stopping slasher client...');
|
|
82
77
|
for (const unwatchCallback of this.unwatchCallbacks){
|
|
83
78
|
unwatchCallback();
|
|
84
79
|
}
|
|
85
80
|
this.roundMonitor.stop();
|
|
86
81
|
await this.offensesCollector.stop();
|
|
87
|
-
|
|
88
|
-
await sleep(2000);
|
|
89
|
-
this.log.info('Tally Slasher client stopped');
|
|
82
|
+
this.log.info('Slasher client stopped');
|
|
90
83
|
}
|
|
91
84
|
/** Returns the current config */ getConfig() {
|
|
92
85
|
return this.config;
|
|
@@ -98,10 +91,11 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
98
91
|
};
|
|
99
92
|
}
|
|
100
93
|
/** Triggered on a time basis when we enter a new slashing round. Clears expired offenses. */ async handleNewRound(round) {
|
|
101
|
-
this.log.info(`Starting new
|
|
94
|
+
this.log.info(`Starting new slashing round ${round}`);
|
|
102
95
|
await this.offensesCollector.handleNewRound(round);
|
|
103
96
|
}
|
|
104
|
-
/** Called when we see a RoundExecuted event on the
|
|
97
|
+
/** Called when we see a RoundExecuted event on the SlashingProposer (just for logging). */ async handleRoundExecuted(round, slashCount, l1BlockHash) {
|
|
98
|
+
this.metrics.recordRoundExecuted();
|
|
105
99
|
const slashes = await this.rollup.getSlashEvents(l1BlockHash);
|
|
106
100
|
this.log.info(`Slashing round ${round} has been executed with ${slashCount} slashes`, {
|
|
107
101
|
slashes
|
|
@@ -173,7 +167,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
173
167
|
};
|
|
174
168
|
this.log.debug(`Testing if slashing round ${executableRound} is executable`, logData);
|
|
175
169
|
try {
|
|
176
|
-
const roundInfo = await this.
|
|
170
|
+
const roundInfo = await this.slashingProposer.getRound(executableRound);
|
|
177
171
|
logData = {
|
|
178
172
|
...logData,
|
|
179
173
|
roundInfo
|
|
@@ -189,19 +183,19 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
189
183
|
return undefined;
|
|
190
184
|
}
|
|
191
185
|
// Check if round is ready to execute at the given slot
|
|
192
|
-
const isReadyToExecute = await this.
|
|
186
|
+
const isReadyToExecute = await this.slashingProposer.isRoundReadyToExecute(executableRound, slotNumber);
|
|
193
187
|
if (!isReadyToExecute) {
|
|
194
188
|
this.log.warn(`Round ${executableRound} is not ready to execute at slot ${slotNumber} according to contract check`, logData);
|
|
195
189
|
return undefined;
|
|
196
190
|
}
|
|
197
191
|
// Check if the round yields any slashing at all
|
|
198
|
-
const { actions: slashActions, committees } = await this.
|
|
192
|
+
const { actions: slashActions, committees } = await this.slashingProposer.getTally(executableRound);
|
|
199
193
|
if (slashActions.length === 0) {
|
|
200
194
|
this.log.verbose(`Round ${executableRound} does not resolve in any slashing`, logData);
|
|
201
195
|
return undefined;
|
|
202
196
|
}
|
|
203
197
|
// Check if the slash payload is vetoed
|
|
204
|
-
const payload = await this.
|
|
198
|
+
const payload = await this.slashingProposer.getPayload(executableRound);
|
|
205
199
|
const isVetoed = await this.slasher.isPayloadVetoed(payload.address);
|
|
206
200
|
if (isVetoed) {
|
|
207
201
|
this.log.warn(`Round ${executableRound} payload is vetoed (skipping execution)`, {
|
|
@@ -210,8 +204,12 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
210
204
|
});
|
|
211
205
|
return undefined;
|
|
212
206
|
}
|
|
207
|
+
const slashActionsWithAmounts = slashActions.map((action)=>({
|
|
208
|
+
validator: action.validator.toString(),
|
|
209
|
+
slashAmount: action.slashAmount.toString()
|
|
210
|
+
}));
|
|
213
211
|
this.log.info(`Round ${executableRound} is ready to execute with ${slashActions.length} slashes`, {
|
|
214
|
-
slashActions,
|
|
212
|
+
slashActions: slashActionsWithAmounts,
|
|
215
213
|
payloadAddress: payload.address.toString(),
|
|
216
214
|
...logData
|
|
217
215
|
});
|
|
@@ -255,7 +253,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
255
253
|
slotNumber,
|
|
256
254
|
currentRound,
|
|
257
255
|
slashedRound,
|
|
258
|
-
|
|
256
|
+
offensesFromAlwaysSlash: offensesFromAlwaysSlash.map(getOffenseLogData),
|
|
259
257
|
slashValidatorsAlways: this.config.slashValidatorsAlways
|
|
260
258
|
});
|
|
261
259
|
}
|
|
@@ -264,7 +262,7 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
264
262
|
slotNumber,
|
|
265
263
|
currentRound,
|
|
266
264
|
slashedRound,
|
|
267
|
-
offensesToForgive,
|
|
265
|
+
offensesToForgive: offensesToForgive.map(getOffenseLogData),
|
|
268
266
|
slashValidatorsNever: this.config.slashValidatorsNever
|
|
269
267
|
});
|
|
270
268
|
}
|
|
@@ -276,25 +274,36 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
276
274
|
});
|
|
277
275
|
return undefined;
|
|
278
276
|
}
|
|
279
|
-
this.log.
|
|
277
|
+
this.log.debug(`Computing slash votes for ${offensesToSlash.length} offenses`, {
|
|
280
278
|
slotNumber,
|
|
281
279
|
currentRound,
|
|
282
280
|
slashedRound,
|
|
283
|
-
offensesToSlash
|
|
281
|
+
offensesToSlash: offensesToSlash.map(getOffenseLogData)
|
|
284
282
|
});
|
|
285
283
|
const committees = await this.collectCommitteesActiveDuringRound(slashedRound);
|
|
286
284
|
const epochsForCommittees = getEpochsForRound(slashedRound, this.settings);
|
|
287
|
-
const
|
|
285
|
+
const { slashMaxPayloadSize } = this.config;
|
|
286
|
+
const votes = getSlashConsensusVotesFromOffenses(offensesToSlash, committees, epochsForCommittees.map((e)=>BigInt(e)), {
|
|
287
|
+
...this.settings,
|
|
288
|
+
maxSlashedValidators: slashMaxPayloadSize
|
|
289
|
+
}, this.log);
|
|
288
290
|
if (votes.every((v)=>v === 0)) {
|
|
289
291
|
this.log.warn(`Computed votes for offenses are all zero. Skipping vote.`, {
|
|
290
292
|
slotNumber,
|
|
291
293
|
currentRound,
|
|
292
294
|
slashedRound,
|
|
293
|
-
offensesToSlash,
|
|
295
|
+
offensesToSlash: offensesToSlash.map(getOffenseLogData),
|
|
294
296
|
committees
|
|
295
297
|
});
|
|
296
298
|
return undefined;
|
|
297
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
|
+
});
|
|
298
307
|
this.log.debug(`Computed votes for slashing ${offensesToSlash.length} offenses`, {
|
|
299
308
|
slashedRound,
|
|
300
309
|
currentRound,
|
|
@@ -315,14 +324,8 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
315
324
|
return Promise.all(epochsToSlash.map((epoch)=>this.epochCache.getCommitteeForEpoch(epoch).then((c)=>c.committee ?? emptyCommittee)));
|
|
316
325
|
}
|
|
317
326
|
/**
|
|
318
|
-
* Get slash payloads is NOT SUPPORTED in tally model
|
|
319
|
-
* @throws Error indicating this operation is not supported
|
|
320
|
-
*/ getSlashPayloads() {
|
|
321
|
-
return Promise.reject(new Error('Tally slashing model does not support slash payloads'));
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
327
|
* Gather offenses to be slashed on a given round.
|
|
325
|
-
*
|
|
328
|
+
* Round N slashes validators from round N - slashOffsetInRounds.
|
|
326
329
|
* @param round - The round to get offenses for, defaults to current round
|
|
327
330
|
* @returns Array of pending offenses for the round with offset applied
|
|
328
331
|
*/ async gatherOffensesForRound(round) {
|
|
@@ -332,8 +335,8 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
332
335
|
}
|
|
333
336
|
return await this.offensesStore.getOffensesForRound(targetRound);
|
|
334
337
|
}
|
|
335
|
-
/** Returns all
|
|
336
|
-
return this.offensesStore.
|
|
338
|
+
/** Returns all offenses stored */ getOffenses() {
|
|
339
|
+
return this.offensesStore.getOffenses();
|
|
337
340
|
}
|
|
338
341
|
/**
|
|
339
342
|
* Returns the round to be slashed given the current round by applying the slash offset.
|
|
@@ -347,3 +350,10 @@ import { SlashRoundMonitor } from './slash_round_monitor.js';
|
|
|
347
350
|
return round - BigInt(this.settings.slashingOffsetInRounds);
|
|
348
351
|
}
|
|
349
352
|
}
|
|
353
|
+
function getOffenseLogData(offense) {
|
|
354
|
+
return {
|
|
355
|
+
...offense,
|
|
356
|
+
validator: offense.validator.toString(),
|
|
357
|
+
offenseType: getOffenseTypeName(offense.offenseType)
|
|
358
|
+
};
|
|
359
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import type { ViemClient } from '@aztec/ethereum';
|
|
3
2
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import {
|
|
3
|
+
import type { ViemClient } from '@aztec/ethereum/types';
|
|
4
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
5
5
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
6
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
7
6
|
import { AztecLMDBStoreV2 } from '@aztec/kv-store/lmdb-v2';
|
|
8
7
|
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
9
|
-
import type {
|
|
8
|
+
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
9
|
+
import type { Offense, ProposerSlashAction } from '@aztec/stdlib/slashing';
|
|
10
10
|
import type { SlasherClientInterface } from './slasher_client_interface.js';
|
|
11
11
|
import type { Watcher } from './watcher.js';
|
|
12
12
|
/**
|
|
@@ -18,26 +18,25 @@ export declare class SlasherClientFacade implements SlasherClientInterface {
|
|
|
18
18
|
private config;
|
|
19
19
|
private rollup;
|
|
20
20
|
private l1Client;
|
|
21
|
-
private slashFactoryAddress;
|
|
22
21
|
private watchers;
|
|
23
22
|
private epochCache;
|
|
24
23
|
private dateProvider;
|
|
25
24
|
private kvStore;
|
|
25
|
+
private rollupRegisteredAtL2Slot;
|
|
26
26
|
private logger;
|
|
27
27
|
private client;
|
|
28
28
|
private unwatch;
|
|
29
29
|
constructor(config: SlasherConfig & DataStoreConfig & {
|
|
30
30
|
ethereumSlotDuration: number;
|
|
31
|
-
}, rollup: RollupContract, l1Client: ViemClient,
|
|
31
|
+
}, rollup: RollupContract, l1Client: ViemClient, watchers: Watcher[], epochCache: EpochCache, dateProvider: DateProvider, kvStore: AztecLMDBStoreV2, rollupRegisteredAtL2Slot: SlotNumber, logger?: import("@aztec/foundation/log").Logger);
|
|
32
32
|
start(): Promise<void>;
|
|
33
33
|
stop(): Promise<void>;
|
|
34
34
|
getConfig(): SlasherConfig;
|
|
35
35
|
updateConfig(config: Partial<SlasherConfig>): void;
|
|
36
|
-
getSlashPayloads(): Promise<SlashPayloadRound[]>;
|
|
37
36
|
gatherOffensesForRound(round?: bigint): Promise<Offense[]>;
|
|
38
|
-
|
|
39
|
-
getProposerActions(slotNumber:
|
|
37
|
+
getOffenses(): Promise<Offense[]>;
|
|
38
|
+
getProposerActions(slotNumber: SlotNumber): Promise<ProposerSlashAction[]>;
|
|
40
39
|
private createSlasherClient;
|
|
41
40
|
private handleSlasherChange;
|
|
42
41
|
}
|
|
43
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xhc2hlcl9jbGllbnRfZmFjYWRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvc2xhc2hlcl9jbGllbnRfZmFjYWRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNoRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDeEQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFbEUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzNELE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JFLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzlELE9BQ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BUyxJQUFJLGFBQWEsQ0FFaEM7SUFFTSxZQUFZLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxhQUFhLENBQUMsR0FBRyxJQUFJLENBSXhEO0lBRU0sc0JBQXNCLENBQUMsS0FBSyxDQUFDLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUVoRTtJQUVNLFdBQVcsSUFBSSxPQUFPLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FFdkM7SUFFTSxrQkFBa0IsQ0FBQyxVQUFVLEVBQUUsVUFBVSxHQUFHLE9BQU8sQ0FBQyxtQkFBbUIsRUFBRSxDQUFDLENBRWhGO0lBRUQsT0FBTyxDQUFDLG1CQUFtQjtZQWNiLG1CQUFtQjtDQU1sQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher_client_facade.d.ts","sourceRoot":"","sources":["../src/slasher_client_facade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"slasher_client_facade.d.ts","sourceRoot":"","sources":["../src/slasher_client_facade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE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AmB;YAcb,mBAAmB;CAMlC"}
|
|
@@ -8,23 +8,23 @@ import { createSlasherImplementation } from './factory/create_implementation.js'
|
|
|
8
8
|
config;
|
|
9
9
|
rollup;
|
|
10
10
|
l1Client;
|
|
11
|
-
slashFactoryAddress;
|
|
12
11
|
watchers;
|
|
13
12
|
epochCache;
|
|
14
13
|
dateProvider;
|
|
15
14
|
kvStore;
|
|
15
|
+
rollupRegisteredAtL2Slot;
|
|
16
16
|
logger;
|
|
17
17
|
client;
|
|
18
18
|
unwatch;
|
|
19
|
-
constructor(config, rollup, l1Client,
|
|
19
|
+
constructor(config, rollup, l1Client, watchers, epochCache, dateProvider, kvStore, rollupRegisteredAtL2Slot, logger = createLogger('slasher')){
|
|
20
20
|
this.config = config;
|
|
21
21
|
this.rollup = rollup;
|
|
22
22
|
this.l1Client = l1Client;
|
|
23
|
-
this.slashFactoryAddress = slashFactoryAddress;
|
|
24
23
|
this.watchers = watchers;
|
|
25
24
|
this.epochCache = epochCache;
|
|
26
25
|
this.dateProvider = dateProvider;
|
|
27
26
|
this.kvStore = kvStore;
|
|
27
|
+
this.rollupRegisteredAtL2Slot = rollupRegisteredAtL2Slot;
|
|
28
28
|
this.logger = logger;
|
|
29
29
|
}
|
|
30
30
|
async start() {
|
|
@@ -52,20 +52,17 @@ import { createSlasherImplementation } from './factory/create_implementation.js'
|
|
|
52
52
|
this.client?.updateConfig(config);
|
|
53
53
|
this.watchers.forEach((watcher)=>watcher.updateConfig?.(config));
|
|
54
54
|
}
|
|
55
|
-
getSlashPayloads() {
|
|
56
|
-
return this.client?.getSlashPayloads() ?? Promise.reject(new Error('Slasher client not initialized'));
|
|
57
|
-
}
|
|
58
55
|
gatherOffensesForRound(round) {
|
|
59
56
|
return this.client?.gatherOffensesForRound(round) ?? Promise.reject(new Error('Slasher client not initialized'));
|
|
60
57
|
}
|
|
61
|
-
|
|
62
|
-
return this.client?.
|
|
58
|
+
getOffenses() {
|
|
59
|
+
return this.client?.getOffenses() ?? Promise.reject(new Error('Slasher client not initialized'));
|
|
63
60
|
}
|
|
64
61
|
getProposerActions(slotNumber) {
|
|
65
62
|
return this.client?.getProposerActions(slotNumber) ?? Promise.reject(new Error('Slasher client not initialized'));
|
|
66
63
|
}
|
|
67
64
|
createSlasherClient() {
|
|
68
|
-
return createSlasherImplementation(this.config, this.rollup, this.l1Client, this.
|
|
65
|
+
return createSlasherImplementation(this.config, this.rollup, this.l1Client, this.watchers, this.epochCache, this.dateProvider, this.kvStore, this.rollupRegisteredAtL2Slot, this.logger);
|
|
69
66
|
}
|
|
70
67
|
async handleSlasherChange() {
|
|
71
68
|
this.logger.warn('Slasher contract changed, recreating slasher client');
|
|
@@ -1,38 +1,25 @@
|
|
|
1
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
2
|
-
import type { Offense, ProposerSlashAction
|
|
3
|
-
/**
|
|
4
|
-
* Common interface for slasher clients used by the Aztec node.
|
|
5
|
-
* Both Empire and Consensus slasher clients implement this interface.
|
|
6
|
-
*/
|
|
3
|
+
import type { Offense, ProposerSlashAction } from '@aztec/stdlib/slashing';
|
|
4
|
+
/** Common interface for slasher clients used by the Aztec node. */
|
|
7
5
|
export interface SlasherClientInterface {
|
|
8
6
|
/** Start the slasher client */
|
|
9
7
|
start(): Promise<void>;
|
|
10
8
|
/** Stop the slasher client */
|
|
11
9
|
stop(): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Get slash payloads for the Empire model.
|
|
14
|
-
* The Consensus model should throw an error when this is called.
|
|
15
|
-
*/
|
|
16
|
-
getSlashPayloads(): Promise<SlashPayloadRound[]>;
|
|
17
|
-
/**
|
|
18
|
-
* Gather offenses for a given round, defaults to current.
|
|
19
|
-
* Used by both Empire and Consensus models.
|
|
20
|
-
*/
|
|
10
|
+
/** Gather offenses for a given round, defaults to current. */
|
|
21
11
|
gatherOffensesForRound(round?: bigint): Promise<Offense[]>;
|
|
22
|
-
/** Returns all
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Update the configuration.
|
|
26
|
-
* Used by both Empire and Consensus models.
|
|
27
|
-
*/
|
|
12
|
+
/** Returns all offenses */
|
|
13
|
+
getOffenses(): Promise<Offense[]>;
|
|
14
|
+
/** Update the configuration. */
|
|
28
15
|
updateConfig(config: Partial<SlasherConfig>): void;
|
|
29
16
|
/**
|
|
30
17
|
* Get the actions the proposer should take for slashing.
|
|
31
18
|
* @param slotNumber - The current slot number
|
|
32
19
|
* @returns The actions to take
|
|
33
20
|
*/
|
|
34
|
-
getProposerActions(slotNumber:
|
|
21
|
+
getProposerActions(slotNumber: SlotNumber): Promise<ProposerSlashAction[]>;
|
|
35
22
|
/** Returns the current config */
|
|
36
23
|
getConfig(): SlasherConfig;
|
|
37
24
|
}
|
|
38
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xhc2hlcl9jbGllbnRfaW50ZXJmYWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvc2xhc2hlcl9jbGllbnRfaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2xFLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JFLE9BQU8sS0FBSyxFQUFFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTNFLG1FQUFtRTtBQUNuRSxNQUFNLFdBQVcsc0JBQXNCO0lBQ3JDLCtCQUErQjtJQUMvQixLQUFLLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0lBRXZCLDhCQUE4QjtJQUM5QixJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0lBRXRCLDhEQUE4RDtJQUM5RCxzQkFBc0IsQ0FBQyxLQUFLLENBQUMsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUM7SUFFM0QsMkJBQTJCO0lBQzNCLFdBQVcsSUFBSSxPQUFPLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztJQUVsQyxnQ0FBZ0M7SUFDaEMsWUFBWSxDQUFDLE1BQU0sRUFBRSxPQUFPLENBQUMsYUFBYSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBRW5EOzs7O09BSUc7SUFDSCxrQkFBa0IsQ0FBQyxVQUFVLEVBQUUsVUFBVSxHQUFHLE9BQU8sQ0FBQyxtQkFBbUIsRUFBRSxDQUFDLENBQUM7SUFFM0UsaUNBQWlDO0lBQ2pDLFNBQVMsSUFBSSxhQUFhLENBQUM7Q0FDNUIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher_client_interface.d.ts","sourceRoot":"","sources":["../src/slasher_client_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"slasher_client_interface.d.ts","sourceRoot":"","sources":["../src/slasher_client_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,+BAA+B;IAC/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,8BAA8B;IAC9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB,8DAA8D;IAC9D,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAE3D,2BAA2B;IAC3B,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC,gCAAgC;IAChC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IAEnD;;;;OAIG;IACH,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAE3E,iCAAiC;IACjC,SAAS,IAAI,aAAa,CAAC;CAC5B"}
|
|
@@ -1,14 +1,15 @@
|
|
|
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;
|
|
7
10
|
/** Map from offense key to offense data */
|
|
8
11
|
private offenses;
|
|
9
|
-
/**
|
|
10
|
-
private offensesSlashed;
|
|
11
|
-
/** Multimap from round to offense keys (only used for consensus based slashing) */
|
|
12
|
+
/** Multimap from round to offense keys */
|
|
12
13
|
private roundsOffenses;
|
|
13
14
|
private log;
|
|
14
15
|
constructor(kvStore: AztecAsyncKVStore, settings: {
|
|
@@ -16,22 +17,21 @@ export declare class SlasherOffensesStore {
|
|
|
16
17
|
epochDuration: number;
|
|
17
18
|
slashOffenseExpirationRounds?: number;
|
|
18
19
|
});
|
|
19
|
-
/** Returns all offenses
|
|
20
|
-
|
|
20
|
+
/** Returns all offenses */
|
|
21
|
+
getOffenses(): Promise<Offense[]>;
|
|
21
22
|
/** Returns all offenses tracked for the given round */
|
|
22
23
|
getOffensesForRound(round: bigint): Promise<Offense[]>;
|
|
23
|
-
/** Returns whether an offense is pending (ie not marked as slashed) */
|
|
24
|
-
hasPendingOffense(offense: OffenseIdentifier): Promise<boolean>;
|
|
25
24
|
/** Returns whether we have seen this offense */
|
|
26
25
|
hasOffense(offense: OffenseIdentifier): Promise<boolean>;
|
|
27
|
-
/** Adds a new offense
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
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>;
|
|
31
30
|
/** Prunes all offenses expired from the store */
|
|
32
31
|
clearExpiredOffenses(currentRound: bigint): Promise<number>;
|
|
33
32
|
/** Generate a unique key for an offense */
|
|
34
33
|
private getOffenseKey;
|
|
35
34
|
private getRoundKey;
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2ZmZW5zZXNfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZXMvb2ZmZW5zZXNfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQXFDLE1BQU0saUJBQWlCLENBQUM7QUFDNUYsT0FBTyxFQUNMLEtBQUssT0FBTyxFQUNaLEtBQUssaUJBQWlCLEVBSXZCLE1BQU0sd0JBQXdCLENBQUM7QUFFaEMsZUFBTyxNQUFNLGNBQWMsSUFBSSxDQUFDO0FBRWhDLEtBQUssbUJBQW1CLEdBQUcsSUFBSSxDQUFDLE9BQU8sRUFBRSxh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pRDtJQUNwQyxvQkFBb0IsQ0FBQyxZQUFZLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FxQ3ZFO0lBRUQsMkNBQTJDO0lBQzNDLE9BQU8sQ0FBQyxhQUFhO0lBSXJCLE9BQU8sQ0FBQyxXQUFXO0NBR3BCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offenses_store.d.ts","sourceRoot":"","sources":["../../src/stores/offenses_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"offenses_store.d.ts","sourceRoot":"","sources":["../../src/stores/offenses_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAIvB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,KAAK,mBAAmB,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAAC,GAAG;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,qBAAa,oBAAoB;IAU7B,OAAO,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,mBAA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