@aztec/aztec-node 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/aztec-node/server.d.ts +4 -1
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +48 -27
- package/package.json +23 -23
- package/src/aztec-node/server.ts +51 -29
|
@@ -7,6 +7,7 @@ import { DateProvider } from '@aztec/foundation/timer';
|
|
|
7
7
|
import { SiblingPath } from '@aztec/foundation/trees';
|
|
8
8
|
import { type P2P } from '@aztec/p2p';
|
|
9
9
|
import { SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
|
|
10
|
+
import { EpochPruneWatcher, SlasherClient } from '@aztec/slasher';
|
|
10
11
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
12
|
import type { InBlock, L2Block, L2BlockNumber, L2BlockSource, PublishedL2Block } from '@aztec/stdlib/block';
|
|
12
13
|
import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress, NodeInfo, ProtocolContractAddresses } from '@aztec/stdlib/contract';
|
|
@@ -35,7 +36,9 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
35
36
|
protected readonly l1ToL2MessageSource: L1ToL2MessageSource;
|
|
36
37
|
protected readonly worldStateSynchronizer: WorldStateSynchronizer;
|
|
37
38
|
protected readonly sequencer: SequencerClient | undefined;
|
|
39
|
+
protected readonly slasherClient: SlasherClient | undefined;
|
|
38
40
|
protected readonly validatorsSentinel: Sentinel | undefined;
|
|
41
|
+
protected readonly epochPruneWatcher: EpochPruneWatcher | undefined;
|
|
39
42
|
protected readonly l1ChainId: number;
|
|
40
43
|
protected readonly version: number;
|
|
41
44
|
protected readonly globalVariableBuilder: GlobalVariableBuilderInterface;
|
|
@@ -47,7 +50,7 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
47
50
|
private isUploadingSnapshot;
|
|
48
51
|
private txQueue;
|
|
49
52
|
readonly tracer: Tracer;
|
|
50
|
-
constructor(config: AztecNodeConfig, p2pClient: P2P, blockSource: L2BlockSource & Partial<Service>, logsSource: L2LogsSource, contractDataSource: ContractDataSource, l1ToL2MessageSource: L1ToL2MessageSource, worldStateSynchronizer: WorldStateSynchronizer, sequencer: SequencerClient | undefined, validatorsSentinel: Sentinel | undefined, l1ChainId: number, version: number, globalVariableBuilder: GlobalVariableBuilderInterface, packageVersion: string, proofVerifier: ClientProtocolCircuitVerifier, telemetry?: TelemetryClient, log?: Logger);
|
|
53
|
+
constructor(config: AztecNodeConfig, p2pClient: P2P, blockSource: L2BlockSource & Partial<Service>, logsSource: L2LogsSource, contractDataSource: ContractDataSource, l1ToL2MessageSource: L1ToL2MessageSource, worldStateSynchronizer: WorldStateSynchronizer, sequencer: SequencerClient | undefined, slasherClient: SlasherClient | undefined, validatorsSentinel: Sentinel | undefined, epochPruneWatcher: EpochPruneWatcher | undefined, l1ChainId: number, version: number, globalVariableBuilder: GlobalVariableBuilderInterface, packageVersion: string, proofVerifier: ClientProtocolCircuitVerifier, telemetry?: TelemetryClient, log?: Logger);
|
|
51
54
|
getWorldStateSyncStatus(): Promise<WorldStateSyncStatus>;
|
|
52
55
|
getL2Tips(): Promise<import("@aztec/stdlib/block").L2Tips>;
|
|
53
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/aztec-node/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/aztec-node/server.ts"],"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ics } from './node_metrics.js';
|
|
|
49
49
|
l1ToL2MessageSource;
|
|
50
50
|
worldStateSynchronizer;
|
|
51
51
|
sequencer;
|
|
52
|
+
slasherClient;
|
|
52
53
|
validatorsSentinel;
|
|
54
|
+
epochPruneWatcher;
|
|
53
55
|
l1ChainId;
|
|
54
56
|
version;
|
|
55
57
|
globalVariableBuilder;
|
|
@@ -63,7 +65,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
63
65
|
// Serial queue to ensure that we only send one tx at a time
|
|
64
66
|
txQueue;
|
|
65
67
|
tracer;
|
|
66
|
-
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, validatorsSentinel, l1ChainId, version, globalVariableBuilder, packageVersion, proofVerifier, telemetry = getTelemetryClient(), log = createLogger('node')){
|
|
68
|
+
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, slasherClient, validatorsSentinel, epochPruneWatcher, l1ChainId, version, globalVariableBuilder, packageVersion, proofVerifier, telemetry = getTelemetryClient(), log = createLogger('node')){
|
|
67
69
|
this.config = config;
|
|
68
70
|
this.p2pClient = p2pClient;
|
|
69
71
|
this.blockSource = blockSource;
|
|
@@ -72,7 +74,9 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
72
74
|
this.l1ToL2MessageSource = l1ToL2MessageSource;
|
|
73
75
|
this.worldStateSynchronizer = worldStateSynchronizer;
|
|
74
76
|
this.sequencer = sequencer;
|
|
77
|
+
this.slasherClient = slasherClient;
|
|
75
78
|
this.validatorsSentinel = validatorsSentinel;
|
|
79
|
+
this.epochPruneWatcher = epochPruneWatcher;
|
|
76
80
|
this.l1ChainId = l1ChainId;
|
|
77
81
|
this.version = version;
|
|
78
82
|
this.globalVariableBuilder = globalVariableBuilder;
|
|
@@ -123,9 +127,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
123
127
|
...config.l1Contracts,
|
|
124
128
|
...l1ContractsAddresses
|
|
125
129
|
};
|
|
126
|
-
const
|
|
127
|
-
const l1TxUtils = new L1TxUtilsWithBlobs(l1Client, log, config);
|
|
128
|
-
const rollupContract = new RollupContract(l1Client, config.l1Contracts.rollupAddress.toString());
|
|
130
|
+
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
129
131
|
const [l1GenesisTime, slotDuration, rollupVersionFromRollup] = await Promise.all([
|
|
130
132
|
rollupContract.getL1GenesisTime(),
|
|
131
133
|
rollupContract.getSlotDuration(),
|
|
@@ -161,12 +163,12 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
161
163
|
if (validatorsSentinel && config.slashInactivityEnabled) {
|
|
162
164
|
watchers.push(validatorsSentinel);
|
|
163
165
|
}
|
|
166
|
+
let epochPruneWatcher;
|
|
164
167
|
if (config.slashPruneEnabled) {
|
|
165
|
-
|
|
168
|
+
epochPruneWatcher = new EpochPruneWatcher(archiver, epochCache, config.slashPrunePenalty, config.slashPruneMaxPenalty);
|
|
169
|
+
await epochPruneWatcher.start();
|
|
166
170
|
watchers.push(epochPruneWatcher);
|
|
167
171
|
}
|
|
168
|
-
const slasherClient = await SlasherClient.new(config, config.l1Contracts, l1TxUtils, watchers, dateProvider);
|
|
169
|
-
await slasherClient.start();
|
|
170
172
|
const blockBuilder = new BlockBuilder({
|
|
171
173
|
l1GenesisTime,
|
|
172
174
|
slotDuration: Number(slotDuration),
|
|
@@ -182,25 +184,42 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
182
184
|
blockSource: archiver
|
|
183
185
|
});
|
|
184
186
|
log.verbose(`All Aztec Node subsystems synced`);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
187
|
+
let sequencer;
|
|
188
|
+
let slasherClient;
|
|
189
|
+
let l1TxUtils;
|
|
190
|
+
let l1Client;
|
|
191
|
+
if (config.publisherPrivateKey) {
|
|
192
|
+
// we can still run a slasher client if a private key is provided
|
|
193
|
+
l1Client = createExtendedL1Client(config.l1RpcUrls, config.publisherPrivateKey, ethereumChain.chainInfo);
|
|
194
|
+
l1TxUtils = new L1TxUtilsWithBlobs(l1Client, log, config);
|
|
195
|
+
slasherClient = await SlasherClient.new(config, config.l1Contracts, l1TxUtils, watchers, dateProvider);
|
|
196
|
+
slasherClient.start();
|
|
197
|
+
}
|
|
198
|
+
// Validator enabled, create/start relevant service
|
|
199
|
+
if (!config.disableValidator) {
|
|
200
|
+
// This shouldn't happen, validators need a publisher private key.
|
|
201
|
+
if (!config.publisherPrivateKey) {
|
|
202
|
+
throw new Error('A publisher private key is required to run a validator');
|
|
203
|
+
}
|
|
204
|
+
sequencer = await SequencerClient.new(config, {
|
|
205
|
+
// if deps were provided, they should override the defaults,
|
|
206
|
+
// or things that we created in this function
|
|
207
|
+
...deps,
|
|
208
|
+
epochCache,
|
|
209
|
+
l1TxUtils,
|
|
210
|
+
validatorClient,
|
|
211
|
+
p2pClient,
|
|
212
|
+
worldStateSynchronizer,
|
|
213
|
+
slasherClient: slasherClient,
|
|
214
|
+
blockBuilder,
|
|
215
|
+
l2BlockSource: archiver,
|
|
216
|
+
l1ToL2MessageSource: archiver,
|
|
217
|
+
telemetry,
|
|
218
|
+
dateProvider,
|
|
219
|
+
blobSinkClient
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return new AztecNodeService(config, p2pClient, archiver, archiver, archiver, archiver, worldStateSynchronizer, sequencer, slasherClient, validatorsSentinel, epochPruneWatcher, ethereumChain.chainInfo.id, config.rollupVersion, new GlobalVariableBuilder(config), packageVersion, proofVerifier, telemetry, log);
|
|
204
223
|
}
|
|
205
224
|
/**
|
|
206
225
|
* Returns the sequencer client instance.
|
|
@@ -385,6 +404,8 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
385
404
|
this.log.info(`Stopping Aztec Node`);
|
|
386
405
|
await this.txQueue.end();
|
|
387
406
|
await tryStop(this.validatorsSentinel);
|
|
407
|
+
await tryStop(this.epochPruneWatcher);
|
|
408
|
+
this.slasherClient?.stop();
|
|
388
409
|
await tryStop(this.proofVerifier);
|
|
389
410
|
await tryStop(this.sequencer);
|
|
390
411
|
await tryStop(this.p2pClient);
|
|
@@ -666,7 +687,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
666
687
|
throw failedTxs[0].error;
|
|
667
688
|
}
|
|
668
689
|
const [processedTx] = processedTxs;
|
|
669
|
-
return new PublicSimulationOutput(processedTx.revertReason, processedTx.
|
|
690
|
+
return new PublicSimulationOutput(processedTx.revertReason, processedTx.globalVariables, processedTx.txEffect, returns, processedTx.gasUsed);
|
|
670
691
|
} finally{
|
|
671
692
|
await merkleTreeFork.close();
|
|
672
693
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250610",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -61,28 +61,28 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
65
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
66
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
67
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
68
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
69
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
70
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
71
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
72
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
73
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
74
|
-
"@aztec/node-lib": "1.0.0-nightly.
|
|
75
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
76
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
77
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
78
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
79
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
80
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
81
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
82
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
83
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
84
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
85
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
64
|
+
"@aztec/archiver": "1.0.0-nightly.20250610",
|
|
65
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250610",
|
|
66
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250610",
|
|
67
|
+
"@aztec/constants": "1.0.0-nightly.20250610",
|
|
68
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250610",
|
|
69
|
+
"@aztec/ethereum": "1.0.0-nightly.20250610",
|
|
70
|
+
"@aztec/foundation": "1.0.0-nightly.20250610",
|
|
71
|
+
"@aztec/kv-store": "1.0.0-nightly.20250610",
|
|
72
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250610",
|
|
73
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250610",
|
|
74
|
+
"@aztec/node-lib": "1.0.0-nightly.20250610",
|
|
75
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250610",
|
|
76
|
+
"@aztec/p2p": "1.0.0-nightly.20250610",
|
|
77
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250610",
|
|
78
|
+
"@aztec/prover-client": "1.0.0-nightly.20250610",
|
|
79
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250610",
|
|
80
|
+
"@aztec/simulator": "1.0.0-nightly.20250610",
|
|
81
|
+
"@aztec/slasher": "1.0.0-nightly.20250610",
|
|
82
|
+
"@aztec/stdlib": "1.0.0-nightly.20250610",
|
|
83
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250610",
|
|
84
|
+
"@aztec/validator-client": "1.0.0-nightly.20250610",
|
|
85
|
+
"@aztec/world-state": "1.0.0-nightly.20250610",
|
|
86
86
|
"koa": "^2.16.1",
|
|
87
87
|
"koa-router": "^12.0.0",
|
|
88
88
|
"tslib": "^2.4.0",
|
package/src/aztec-node/server.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '@aztec/constants';
|
|
12
12
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
13
13
|
import {
|
|
14
|
+
type ExtendedViemWalletClient,
|
|
14
15
|
type L1ContractAddresses,
|
|
15
16
|
RegistryContract,
|
|
16
17
|
RollupContract,
|
|
@@ -125,7 +126,9 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
125
126
|
protected readonly l1ToL2MessageSource: L1ToL2MessageSource,
|
|
126
127
|
protected readonly worldStateSynchronizer: WorldStateSynchronizer,
|
|
127
128
|
protected readonly sequencer: SequencerClient | undefined,
|
|
129
|
+
protected readonly slasherClient: SlasherClient | undefined,
|
|
128
130
|
protected readonly validatorsSentinel: Sentinel | undefined,
|
|
131
|
+
protected readonly epochPruneWatcher: EpochPruneWatcher | undefined,
|
|
129
132
|
protected readonly l1ChainId: number,
|
|
130
133
|
protected readonly version: number,
|
|
131
134
|
protected readonly globalVariableBuilder: GlobalVariableBuilderInterface,
|
|
@@ -199,10 +202,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
199
202
|
// Overwrite the passed in vars.
|
|
200
203
|
config.l1Contracts = { ...config.l1Contracts, ...l1ContractsAddresses };
|
|
201
204
|
|
|
202
|
-
const
|
|
203
|
-
const l1TxUtils = new L1TxUtilsWithBlobs(l1Client, log, config);
|
|
204
|
-
|
|
205
|
-
const rollupContract = new RollupContract(l1Client, config.l1Contracts.rollupAddress.toString());
|
|
205
|
+
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
206
206
|
const [l1GenesisTime, slotDuration, rollupVersionFromRollup] = await Promise.all([
|
|
207
207
|
rollupContract.getL1GenesisTime(),
|
|
208
208
|
rollupContract.getSlotDuration(),
|
|
@@ -261,19 +261,19 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
261
261
|
if (validatorsSentinel && config.slashInactivityEnabled) {
|
|
262
262
|
watchers.push(validatorsSentinel);
|
|
263
263
|
}
|
|
264
|
+
|
|
265
|
+
let epochPruneWatcher: EpochPruneWatcher | undefined;
|
|
264
266
|
if (config.slashPruneEnabled) {
|
|
265
|
-
|
|
267
|
+
epochPruneWatcher = new EpochPruneWatcher(
|
|
266
268
|
archiver,
|
|
267
269
|
epochCache,
|
|
268
270
|
config.slashPrunePenalty,
|
|
269
271
|
config.slashPruneMaxPenalty,
|
|
270
272
|
);
|
|
273
|
+
await epochPruneWatcher.start();
|
|
271
274
|
watchers.push(epochPruneWatcher);
|
|
272
275
|
}
|
|
273
276
|
|
|
274
|
-
const slasherClient = await SlasherClient.new(config, config.l1Contracts, l1TxUtils, watchers, dateProvider);
|
|
275
|
-
await slasherClient.start();
|
|
276
|
-
|
|
277
277
|
const blockBuilder = new BlockBuilder(
|
|
278
278
|
{
|
|
279
279
|
l1GenesisTime,
|
|
@@ -298,26 +298,44 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
298
298
|
});
|
|
299
299
|
log.verbose(`All Aztec Node subsystems synced`);
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
301
|
+
let sequencer: SequencerClient | undefined;
|
|
302
|
+
let slasherClient: SlasherClient | undefined;
|
|
303
|
+
let l1TxUtils: L1TxUtilsWithBlobs | undefined;
|
|
304
|
+
let l1Client: ExtendedViemWalletClient | undefined;
|
|
305
|
+
|
|
306
|
+
if (config.publisherPrivateKey) {
|
|
307
|
+
// we can still run a slasher client if a private key is provided
|
|
308
|
+
l1Client = createExtendedL1Client(config.l1RpcUrls, config.publisherPrivateKey, ethereumChain.chainInfo);
|
|
309
|
+
l1TxUtils = new L1TxUtilsWithBlobs(l1Client, log, config);
|
|
310
|
+
slasherClient = await SlasherClient.new(config, config.l1Contracts, l1TxUtils, watchers, dateProvider);
|
|
311
|
+
slasherClient.start();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Validator enabled, create/start relevant service
|
|
315
|
+
if (!config.disableValidator) {
|
|
316
|
+
// This shouldn't happen, validators need a publisher private key.
|
|
317
|
+
if (!config.publisherPrivateKey) {
|
|
318
|
+
throw new Error('A publisher private key is required to run a validator');
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
sequencer = await SequencerClient.new(config, {
|
|
322
|
+
// if deps were provided, they should override the defaults,
|
|
323
|
+
// or things that we created in this function
|
|
324
|
+
...deps,
|
|
325
|
+
epochCache,
|
|
326
|
+
l1TxUtils,
|
|
327
|
+
validatorClient,
|
|
328
|
+
p2pClient,
|
|
329
|
+
worldStateSynchronizer,
|
|
330
|
+
slasherClient: slasherClient!,
|
|
331
|
+
blockBuilder,
|
|
332
|
+
l2BlockSource: archiver,
|
|
333
|
+
l1ToL2MessageSource: archiver,
|
|
334
|
+
telemetry,
|
|
335
|
+
dateProvider,
|
|
336
|
+
blobSinkClient,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
321
339
|
|
|
322
340
|
return new AztecNodeService(
|
|
323
341
|
config,
|
|
@@ -328,7 +346,9 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
328
346
|
archiver,
|
|
329
347
|
worldStateSynchronizer,
|
|
330
348
|
sequencer,
|
|
349
|
+
slasherClient,
|
|
331
350
|
validatorsSentinel,
|
|
351
|
+
epochPruneWatcher,
|
|
332
352
|
ethereumChain.chainInfo.id,
|
|
333
353
|
config.rollupVersion,
|
|
334
354
|
new GlobalVariableBuilder(config),
|
|
@@ -568,6 +588,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
568
588
|
this.log.info(`Stopping Aztec Node`);
|
|
569
589
|
await this.txQueue.end();
|
|
570
590
|
await tryStop(this.validatorsSentinel);
|
|
591
|
+
await tryStop(this.epochPruneWatcher);
|
|
592
|
+
this.slasherClient?.stop();
|
|
571
593
|
await tryStop(this.proofVerifier);
|
|
572
594
|
await tryStop(this.sequencer);
|
|
573
595
|
await tryStop(this.p2pClient);
|
|
@@ -962,7 +984,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
962
984
|
const [processedTx] = processedTxs;
|
|
963
985
|
return new PublicSimulationOutput(
|
|
964
986
|
processedTx.revertReason,
|
|
965
|
-
processedTx.
|
|
987
|
+
processedTx.globalVariables,
|
|
966
988
|
processedTx.txEffect,
|
|
967
989
|
returns,
|
|
968
990
|
processedTx.gasUsed,
|