@aztec/slasher 1.0.0-nightly.20250607 → 1.0.0-nightly.20250610
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/slasher_client.d.ts
CHANGED
|
@@ -48,12 +48,12 @@ export declare class SlasherClient {
|
|
|
48
48
|
private unwatchCallbacks;
|
|
49
49
|
static new(config: SlasherConfig, l1Contracts: Pick<L1ReaderConfig['l1Contracts'], 'rollupAddress' | 'slashFactoryAddress'>, l1TxUtils: L1TxUtils, watchers: Watcher[], dateProvider: DateProvider): Promise<SlasherClient>;
|
|
50
50
|
constructor(config: SlasherConfig, slashFactoryContract: GetContractReturnType<typeof SlashFactoryAbi, ExtendedViemWalletClient>, slashingProposer: SlashingProposerContract, l1TxUtils: L1TxUtils, watchers: Watcher[], dateProvider: DateProvider, log?: import("@aztec/foundation/log").Logger);
|
|
51
|
-
start():
|
|
51
|
+
start(): void;
|
|
52
52
|
/**
|
|
53
53
|
* Allows consumers to stop the instance of the slasher client.
|
|
54
54
|
* 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
|
|
55
55
|
*/
|
|
56
|
-
stop():
|
|
56
|
+
stop(): void;
|
|
57
57
|
clearMonitoredPayloads(): void;
|
|
58
58
|
/**
|
|
59
59
|
* Update the config of the slasher client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher_client.d.ts","sourceRoot":"","sources":["../src/slasher_client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,SAAS,EAGT,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAEL,KAAK,qBAAqB,EAK3B,MAAM,MA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C;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;;;;;OAMG;YACW,mBAAmB;IA4BjC;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;YASV,uBAAuB;CAUtC"}
|
package/dest/slasher_client.js
CHANGED
|
@@ -65,7 +65,7 @@ import { WANT_TO_SLASH_EVENT, bigIntToOffense } from './config.js';
|
|
|
65
65
|
this.unwatchCallbacks = [];
|
|
66
66
|
}
|
|
67
67
|
//////////////////// Public methods ////////////////////
|
|
68
|
-
|
|
68
|
+
start() {
|
|
69
69
|
this.log.info('Starting Slasher client...');
|
|
70
70
|
// detect when new payloads are created
|
|
71
71
|
this.unwatchCallbacks.push(this.watchSlashFactoryEvents());
|
|
@@ -76,9 +76,6 @@ import { WANT_TO_SLASH_EVENT, bigIntToOffense } from './config.js';
|
|
|
76
76
|
// start each watcher, who will signal the slasher client when they want to slash
|
|
77
77
|
const wantToSlashCb = this.wantToSlash.bind(this);
|
|
78
78
|
for (const watcher of this.watchers){
|
|
79
|
-
if (watcher.start) {
|
|
80
|
-
await watcher.start();
|
|
81
|
-
}
|
|
82
79
|
watcher.on(WANT_TO_SLASH_EVENT, wantToSlashCb);
|
|
83
80
|
this.unwatchCallbacks.push(()=>watcher.removeListener(WANT_TO_SLASH_EVENT, wantToSlashCb));
|
|
84
81
|
}
|
|
@@ -86,16 +83,11 @@ import { WANT_TO_SLASH_EVENT, bigIntToOffense } from './config.js';
|
|
|
86
83
|
/**
|
|
87
84
|
* Allows consumers to stop the instance of the slasher client.
|
|
88
85
|
* 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
|
|
89
|
-
*/
|
|
86
|
+
*/ stop() {
|
|
90
87
|
this.log.debug('Stopping Slasher client...');
|
|
91
88
|
for (const cb of this.unwatchCallbacks){
|
|
92
89
|
cb();
|
|
93
90
|
}
|
|
94
|
-
for (const watcher of this.watchers){
|
|
95
|
-
if (watcher.stop) {
|
|
96
|
-
await watcher.stop();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
91
|
this.log.info('Slasher client stopped.');
|
|
100
92
|
}
|
|
101
93
|
clearMonitoredPayloads() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/slasher",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250610",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
54
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
55
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
56
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
57
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
58
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
53
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250610",
|
|
54
|
+
"@aztec/ethereum": "1.0.0-nightly.20250610",
|
|
55
|
+
"@aztec/foundation": "1.0.0-nightly.20250610",
|
|
56
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250610",
|
|
57
|
+
"@aztec/stdlib": "1.0.0-nightly.20250610",
|
|
58
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250610",
|
|
59
59
|
"source-map-support": "^0.5.21",
|
|
60
60
|
"tslib": "^2.4.0",
|
|
61
61
|
"viem": "2.23.7",
|
package/src/slasher_client.ts
CHANGED
|
@@ -87,6 +87,7 @@ export class SlasherClient {
|
|
|
87
87
|
abi: SlashFactoryAbi,
|
|
88
88
|
client: l1TxUtils.client,
|
|
89
89
|
});
|
|
90
|
+
|
|
90
91
|
return new SlasherClient(config, slashFactoryContract, slashingProposer, l1TxUtils, watchers, dateProvider);
|
|
91
92
|
}
|
|
92
93
|
|
|
@@ -102,7 +103,7 @@ export class SlasherClient {
|
|
|
102
103
|
|
|
103
104
|
//////////////////// Public methods ////////////////////
|
|
104
105
|
|
|
105
|
-
public
|
|
106
|
+
public start() {
|
|
106
107
|
this.log.info('Starting Slasher client...');
|
|
107
108
|
|
|
108
109
|
// detect when new payloads are created
|
|
@@ -117,9 +118,6 @@ export class SlasherClient {
|
|
|
117
118
|
// start each watcher, who will signal the slasher client when they want to slash
|
|
118
119
|
const wantToSlashCb = this.wantToSlash.bind(this);
|
|
119
120
|
for (const watcher of this.watchers) {
|
|
120
|
-
if (watcher.start) {
|
|
121
|
-
await watcher.start();
|
|
122
|
-
}
|
|
123
121
|
watcher.on(WANT_TO_SLASH_EVENT, wantToSlashCb);
|
|
124
122
|
this.unwatchCallbacks.push(() => watcher.removeListener(WANT_TO_SLASH_EVENT, wantToSlashCb));
|
|
125
123
|
}
|
|
@@ -129,16 +127,11 @@ export class SlasherClient {
|
|
|
129
127
|
* Allows consumers to stop the instance of the slasher client.
|
|
130
128
|
* 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
|
|
131
129
|
*/
|
|
132
|
-
public
|
|
130
|
+
public stop() {
|
|
133
131
|
this.log.debug('Stopping Slasher client...');
|
|
134
132
|
for (const cb of this.unwatchCallbacks) {
|
|
135
133
|
cb();
|
|
136
134
|
}
|
|
137
|
-
for (const watcher of this.watchers) {
|
|
138
|
-
if (watcher.stop) {
|
|
139
|
-
await watcher.stop();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
135
|
this.log.info('Slasher client stopped.');
|
|
143
136
|
}
|
|
144
137
|
|