@aztec/aztec-node 0.0.1-commit.5476d83 → 0.0.1-commit.6230efd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/aztec-node/config.d.ts +5 -2
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +7 -1
- package/dest/aztec-node/server.d.ts +33 -45
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +75 -44
- package/dest/sentinel/sentinel.d.ts +3 -3
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +4 -4
- package/package.json +26 -26
- package/src/aztec-node/config.ts +12 -8
- package/src/aztec-node/server.ts +132 -88
- package/src/sentinel/sentinel.ts +5 -5
|
@@ -6,13 +6,17 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
6
6
|
}
|
|
7
7
|
import { createArchiver } from '@aztec/archiver';
|
|
8
8
|
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
9
|
-
import {
|
|
9
|
+
import { createBlobClient } from '@aztec/blob-client/client';
|
|
10
|
+
import { createReadOnlyFileStoreBlobClients, createWritableFileStoreBlobClient } from '@aztec/blob-client/filestore';
|
|
10
11
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
11
12
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
12
|
-
import {
|
|
13
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
14
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
15
|
+
import { RegistryContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
16
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
13
17
|
import { compactArray, pick } from '@aztec/foundation/collection';
|
|
18
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
14
19
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
15
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
16
20
|
import { BadRequestError } from '@aztec/foundation/json-rpc';
|
|
17
21
|
import { createLogger } from '@aztec/foundation/log';
|
|
18
22
|
import { count } from '@aztec/foundation/string';
|
|
@@ -20,13 +24,14 @@ import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
|
20
24
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
21
25
|
import { KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
|
|
22
26
|
import { trySnapshotSync, uploadSnapshot } from '@aztec/node-lib/actions';
|
|
23
|
-
import { createL1TxUtilsWithBlobsFromEthSigner } from '@aztec/node-lib/factories';
|
|
27
|
+
import { createForwarderL1TxUtilsFromEthSigner, createL1TxUtilsWithBlobsFromEthSigner } from '@aztec/node-lib/factories';
|
|
24
28
|
import { createP2PClient, getDefaultAllowedSetupFunctions } from '@aztec/p2p';
|
|
25
29
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
26
30
|
import { BlockBuilder, GlobalVariableBuilder, SequencerClient, createValidatorForAcceptingTxs } from '@aztec/sequencer-client';
|
|
31
|
+
import { CheckpointsBuilder } from '@aztec/sequencer-client';
|
|
27
32
|
import { PublicProcessorFactory } from '@aztec/simulator/server';
|
|
28
33
|
import { AttestationsBlockWatcher, EpochPruneWatcher, createSlasher } from '@aztec/slasher';
|
|
29
|
-
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
34
|
+
import { CollectionLimitsConfig, PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
30
35
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
31
36
|
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
32
37
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
@@ -67,11 +72,12 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
67
72
|
proofVerifier;
|
|
68
73
|
telemetry;
|
|
69
74
|
log;
|
|
75
|
+
blobClient;
|
|
70
76
|
metrics;
|
|
71
77
|
// Prevent two snapshot operations to happen simultaneously
|
|
72
78
|
isUploadingSnapshot;
|
|
73
79
|
tracer;
|
|
74
|
-
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, slasherClient, validatorsSentinel, epochPruneWatcher, l1ChainId, version, globalVariableBuilder, epochCache, packageVersion, proofVerifier, telemetry = getTelemetryClient(), log = createLogger('node')){
|
|
80
|
+
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, slasherClient, validatorsSentinel, epochPruneWatcher, l1ChainId, version, globalVariableBuilder, epochCache, packageVersion, proofVerifier, telemetry = getTelemetryClient(), log = createLogger('node'), blobClient){
|
|
75
81
|
this.config = config;
|
|
76
82
|
this.p2pClient = p2pClient;
|
|
77
83
|
this.blockSource = blockSource;
|
|
@@ -91,6 +97,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
91
97
|
this.proofVerifier = proofVerifier;
|
|
92
98
|
this.telemetry = telemetry;
|
|
93
99
|
this.log = log;
|
|
100
|
+
this.blobClient = blobClient;
|
|
94
101
|
this.isUploadingSnapshot = false;
|
|
95
102
|
this.metrics = new NodeMetrics(telemetry, 'AztecNodeService');
|
|
96
103
|
this.tracer = telemetry.getTracer('AztecNodeService');
|
|
@@ -116,9 +123,6 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
116
123
|
const packageVersion = getPackageVersion() ?? '';
|
|
117
124
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
118
125
|
const dateProvider = deps.dateProvider ?? new DateProvider();
|
|
119
|
-
const blobSinkClient = deps.blobSinkClient ?? createBlobSinkClient(config, {
|
|
120
|
-
logger: createLogger('node:blob-sink:client')
|
|
121
|
-
});
|
|
122
126
|
const ethereumChain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
123
127
|
// Build a key store from file if given or from environment otherwise
|
|
124
128
|
let keyStoreManager;
|
|
@@ -149,7 +153,9 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
149
153
|
}
|
|
150
154
|
const publicClient = createPublicClient({
|
|
151
155
|
chain: ethereumChain.chainInfo,
|
|
152
|
-
transport: fallback(config.l1RpcUrls.map((url)=>http(url
|
|
156
|
+
transport: fallback(config.l1RpcUrls.map((url)=>http(url, {
|
|
157
|
+
batch: false
|
|
158
|
+
}))),
|
|
153
159
|
pollingInterval: config.viemPollingIntervalMS
|
|
154
160
|
});
|
|
155
161
|
const l1ContractsAddresses = await RegistryContract.collectAddresses(publicClient, config.l1Contracts.registryAddress, config.rollupVersion ?? 'canonical');
|
|
@@ -168,13 +174,27 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
168
174
|
if (config.rollupVersion !== Number(rollupVersionFromRollup)) {
|
|
169
175
|
log.warn(`Registry looked up and returned a rollup with version (${config.rollupVersion}), but this does not match with version detected from the rollup directly: (${rollupVersionFromRollup}).`);
|
|
170
176
|
}
|
|
177
|
+
const blobFileStoreMetadata = {
|
|
178
|
+
l1ChainId: config.l1ChainId,
|
|
179
|
+
rollupVersion: config.rollupVersion,
|
|
180
|
+
rollupAddress: config.l1Contracts.rollupAddress.toString()
|
|
181
|
+
};
|
|
182
|
+
const [fileStoreClients, fileStoreUploadClient] = await Promise.all([
|
|
183
|
+
createReadOnlyFileStoreBlobClients(config.blobFileStoreUrls, blobFileStoreMetadata, log),
|
|
184
|
+
createWritableFileStoreBlobClient(config.blobFileStoreUploadUrl, blobFileStoreMetadata, log)
|
|
185
|
+
]);
|
|
186
|
+
const blobClient = deps.blobClient ?? createBlobClient(config, {
|
|
187
|
+
logger: createLogger('node:blob-client:client'),
|
|
188
|
+
fileStoreClients,
|
|
189
|
+
fileStoreUploadClient
|
|
190
|
+
});
|
|
171
191
|
// attempt snapshot sync if possible
|
|
172
192
|
await trySnapshotSync(config, log);
|
|
173
193
|
const epochCache = await EpochCache.create(config.l1Contracts.rollupAddress, config, {
|
|
174
194
|
dateProvider
|
|
175
195
|
});
|
|
176
196
|
const archiver = await createArchiver(config, {
|
|
177
|
-
|
|
197
|
+
blobClient,
|
|
178
198
|
epochCache,
|
|
179
199
|
telemetry,
|
|
180
200
|
dateProvider
|
|
@@ -183,7 +203,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
183
203
|
});
|
|
184
204
|
// now create the merkle trees and the world state synchronizer
|
|
185
205
|
const worldStateSynchronizer = await createWorldStateSynchronizer(config, archiver, options.prefilledPublicData, telemetry);
|
|
186
|
-
const circuitVerifier = config.realProofs ? await BBCircuitVerifier.new(config) : new TestCircuitVerifier(config.proverTestVerificationDelayMs);
|
|
206
|
+
const circuitVerifier = config.realProofs || config.debugForceTxProofVerification ? await BBCircuitVerifier.new(config) : new TestCircuitVerifier(config.proverTestVerificationDelayMs);
|
|
187
207
|
if (!config.realProofs) {
|
|
188
208
|
log.warn(`Aztec node is accepting fake proofs`);
|
|
189
209
|
}
|
|
@@ -208,7 +228,8 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
208
228
|
blockBuilder,
|
|
209
229
|
blockSource: archiver,
|
|
210
230
|
l1ToL2MessageSource: archiver,
|
|
211
|
-
keyStoreManager
|
|
231
|
+
keyStoreManager,
|
|
232
|
+
fileStoreBlobUploadClient: fileStoreUploadClient
|
|
212
233
|
});
|
|
213
234
|
// If we have a validator client, register it as a source of offenses for the slasher,
|
|
214
235
|
// and have it register callbacks on the p2p client *before* we start it, otherwise messages
|
|
@@ -263,13 +284,20 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
263
284
|
// Validator enabled, create/start relevant service
|
|
264
285
|
let sequencer;
|
|
265
286
|
let slasherClient;
|
|
266
|
-
if (!config.disableValidator) {
|
|
287
|
+
if (!config.disableValidator && validatorClient) {
|
|
267
288
|
// We create a slasher only if we have a sequencer, since all slashing actions go through the sequencer publisher
|
|
268
289
|
// as they are executed when the node is selected as proposer.
|
|
269
290
|
const validatorAddresses = keyStoreManager ? NodeKeystoreAdapter.fromKeyStoreManager(keyStoreManager).getAddresses() : [];
|
|
270
291
|
slasherClient = await createSlasher(config, config.l1Contracts, getPublicClient(config), watchers, dateProvider, epochCache, validatorAddresses, undefined);
|
|
271
292
|
await slasherClient.start();
|
|
272
|
-
const l1TxUtils = await
|
|
293
|
+
const l1TxUtils = config.publisherForwarderAddress ? await createForwarderL1TxUtilsFromEthSigner(publicClient, keyStoreManager.createAllValidatorPublisherSigners(), config.publisherForwarderAddress, {
|
|
294
|
+
...config,
|
|
295
|
+
scope: 'sequencer'
|
|
296
|
+
}, {
|
|
297
|
+
telemetry,
|
|
298
|
+
logger: log.createChild('l1-tx-utils'),
|
|
299
|
+
dateProvider
|
|
300
|
+
}) : await createL1TxUtilsWithBlobsFromEthSigner(publicClient, keyStoreManager.createAllValidatorPublisherSigners(), {
|
|
273
301
|
...config,
|
|
274
302
|
scope: 'sequencer'
|
|
275
303
|
}, {
|
|
@@ -278,6 +306,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
278
306
|
dateProvider
|
|
279
307
|
});
|
|
280
308
|
// Create and start the sequencer client
|
|
309
|
+
const checkpointsBuilder = new CheckpointsBuilder({
|
|
310
|
+
...config,
|
|
311
|
+
l1GenesisTime,
|
|
312
|
+
slotDuration: Number(slotDuration)
|
|
313
|
+
}, archiver, dateProvider, telemetry);
|
|
281
314
|
sequencer = await SequencerClient.new(config, {
|
|
282
315
|
...deps,
|
|
283
316
|
epochCache,
|
|
@@ -286,12 +319,12 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
286
319
|
p2pClient,
|
|
287
320
|
worldStateSynchronizer,
|
|
288
321
|
slasherClient,
|
|
289
|
-
|
|
322
|
+
checkpointsBuilder,
|
|
290
323
|
l2BlockSource: archiver,
|
|
291
324
|
l1ToL2MessageSource: archiver,
|
|
292
325
|
telemetry,
|
|
293
326
|
dateProvider,
|
|
294
|
-
|
|
327
|
+
blobClient,
|
|
295
328
|
nodeKeyStore: keyStoreManager
|
|
296
329
|
});
|
|
297
330
|
}
|
|
@@ -301,7 +334,13 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
301
334
|
} else if (sequencer) {
|
|
302
335
|
log.warn(`Sequencer created but not started`);
|
|
303
336
|
}
|
|
304
|
-
|
|
337
|
+
const globalVariableBuilder = new GlobalVariableBuilder({
|
|
338
|
+
...config,
|
|
339
|
+
rollupVersion: BigInt(config.rollupVersion),
|
|
340
|
+
l1GenesisTime,
|
|
341
|
+
slotDuration: Number(slotDuration)
|
|
342
|
+
});
|
|
343
|
+
return new AztecNodeService(config, p2pClient, archiver, archiver, archiver, archiver, worldStateSynchronizer, sequencer, slasherClient, validatorsSentinel, epochPruneWatcher, ethereumChain.chainInfo.id, config.rollupVersion, globalVariableBuilder, epochCache, packageVersion, proofVerifier, telemetry, log, blobClient);
|
|
305
344
|
}
|
|
306
345
|
/**
|
|
307
346
|
* Returns the sequencer client instance.
|
|
@@ -438,22 +477,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
438
477
|
getContract(address) {
|
|
439
478
|
return this.contractDataSource.getContract(address);
|
|
440
479
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
* @param from - The block number from which to begin retrieving logs.
|
|
444
|
-
* @param limit - The maximum number of blocks to retrieve logs from.
|
|
445
|
-
* @returns An array of private logs from the specified range of blocks.
|
|
446
|
-
*/ getPrivateLogs(from, limit) {
|
|
447
|
-
return this.logsSource.getPrivateLogs(from, limit);
|
|
480
|
+
getPrivateLogsByTags(tags) {
|
|
481
|
+
return this.logsSource.getPrivateLogsByTags(tags);
|
|
448
482
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
* @param tags - The tags to filter the logs by.
|
|
452
|
-
* @param logsPerTag - The maximum number of logs to return for each tag. By default no limit is set
|
|
453
|
-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
454
|
-
* that tag.
|
|
455
|
-
*/ getLogsByTags(tags, logsPerTag) {
|
|
456
|
-
return this.logsSource.getLogsByTags(tags, logsPerTag);
|
|
483
|
+
getPublicLogsByTagsFromContract(contractAddress, tags) {
|
|
484
|
+
return this.logsSource.getPublicLogsByTagsFromContract(contractAddress, tags);
|
|
457
485
|
}
|
|
458
486
|
/**
|
|
459
487
|
* Gets public logs based on the provided filter.
|
|
@@ -522,6 +550,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
522
550
|
await tryStop(this.p2pClient);
|
|
523
551
|
await tryStop(this.worldStateSynchronizer);
|
|
524
552
|
await tryStop(this.blockSource);
|
|
553
|
+
await tryStop(this.blobClient);
|
|
525
554
|
await tryStop(this.telemetry);
|
|
526
555
|
this.log.info(`Stopped Aztec Node`);
|
|
527
556
|
}
|
|
@@ -577,7 +606,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
577
606
|
// Now we obtain the block hashes from the archive tree by calling await `committedDb.getLeafValue(treeId, index)`
|
|
578
607
|
// (note that block number corresponds to the leaf index in the archive tree).
|
|
579
608
|
const blockHashes = await Promise.all(uniqueBlockNumbers.map((blockNumber)=>{
|
|
580
|
-
return committedDb.getLeafValue(MerkleTreeId.ARCHIVE, blockNumber);
|
|
609
|
+
return committedDb.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(blockNumber));
|
|
581
610
|
}));
|
|
582
611
|
// If any of the block hashes are undefined, we throw an error.
|
|
583
612
|
for(let i = 0; i < uniqueBlockNumbers.length; i++){
|
|
@@ -585,7 +614,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
585
614
|
throw new Error(`Block hash is undefined for block number ${uniqueBlockNumbers[i]}`);
|
|
586
615
|
}
|
|
587
616
|
}
|
|
588
|
-
// Create
|
|
617
|
+
// Create DataInBlock objects by combining indices, blockNumbers and blockHashes and return them.
|
|
589
618
|
return maybeIndices.map((index, i)=>{
|
|
590
619
|
if (index === undefined) {
|
|
591
620
|
return undefined;
|
|
@@ -600,7 +629,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
600
629
|
return undefined;
|
|
601
630
|
}
|
|
602
631
|
return {
|
|
603
|
-
l2BlockNumber: Number(blockNumber),
|
|
632
|
+
l2BlockNumber: BlockNumber(Number(blockNumber)),
|
|
604
633
|
l2BlockHash: L2BlockHash.fromField(blockHash),
|
|
605
634
|
data: index
|
|
606
635
|
};
|
|
@@ -659,7 +688,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
659
688
|
}
|
|
660
689
|
async getL1ToL2MessageBlock(l1ToL2Message) {
|
|
661
690
|
const messageIndex = await this.l1ToL2MessageSource.getL1ToL2MessageIndex(l1ToL2Message);
|
|
662
|
-
return messageIndex ? InboxLeaf.
|
|
691
|
+
return messageIndex ? BlockNumber.fromCheckpointNumber(InboxLeaf.checkpointNumberFromIndex(messageIndex)) : undefined;
|
|
663
692
|
}
|
|
664
693
|
/**
|
|
665
694
|
* Returns whether an L1 to L2 message is synced by archiver and if it's ready to be included in a block.
|
|
@@ -777,7 +806,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
777
806
|
* Returns the currently committed block header, or the initial header if no blocks have been produced.
|
|
778
807
|
* @returns The current committed block header.
|
|
779
808
|
*/ async getBlockHeader(blockNumber = 'latest') {
|
|
780
|
-
return blockNumber ===
|
|
809
|
+
return blockNumber === BlockNumber.ZERO || blockNumber === 'latest' && await this.blockSource.getBlockNumber() === BlockNumber.ZERO ? this.worldStateSynchronizer.getCommitted().getInitialHeader() : this.blockSource.getBlockHeader(blockNumber === 'latest' ? blockNumber : blockNumber);
|
|
781
810
|
}
|
|
782
811
|
/**
|
|
783
812
|
* Get a block header specified by its hash.
|
|
@@ -805,7 +834,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
805
834
|
throw new BadRequestError(`Transaction total gas limit ${txGasLimit + teardownGasLimit} (${txGasLimit} + ${teardownGasLimit}) exceeds maximum gas limit ${this.config.rpcSimulatePublicMaxGasLimit} for simulation`);
|
|
806
835
|
}
|
|
807
836
|
const txHash = tx.getTxHash();
|
|
808
|
-
const blockNumber = await this.blockSource.getBlockNumber() + 1;
|
|
837
|
+
const blockNumber = BlockNumber(await this.blockSource.getBlockNumber() + 1);
|
|
809
838
|
// If sequencer is not initialized, we just set these values to zero for simulation.
|
|
810
839
|
const coinbase = EthAddress.ZERO;
|
|
811
840
|
const feeRecipient = AztecAddress.ZERO;
|
|
@@ -823,8 +852,10 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
823
852
|
collectDebugLogs: true,
|
|
824
853
|
collectHints: false,
|
|
825
854
|
collectCallMetadata: true,
|
|
826
|
-
|
|
827
|
-
|
|
855
|
+
collectStatistics: false,
|
|
856
|
+
collectionLimits: CollectionLimitsConfig.from({
|
|
857
|
+
maxDebugLogMemoryReads: this.config.rpcSimulatePublicMaxDebugLogMemoryReads
|
|
858
|
+
})
|
|
828
859
|
});
|
|
829
860
|
const processor = publicProcessorFactory.create(merkleTreeFork, newGlobalVariables, config);
|
|
830
861
|
// REFACTOR: Consider merging ProcessReturnValues into ProcessedTx
|
|
@@ -849,7 +880,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
849
880
|
const verifier = isSimulation ? undefined : this.proofVerifier;
|
|
850
881
|
// We accept transactions if they are not expired by the next slot (checked based on the IncludeByTimestamp field)
|
|
851
882
|
const { ts: nextSlotTimestamp } = this.epochCache.getEpochAndSlotInNextL1Slot();
|
|
852
|
-
const blockNumber = await this.blockSource.getBlockNumber() + 1;
|
|
883
|
+
const blockNumber = BlockNumber(await this.blockSource.getBlockNumber() + 1);
|
|
853
884
|
const validator = createValidatorForAcceptingTxs(db, this.contractDataSource, verifier, {
|
|
854
885
|
timestamp: nextSlotTimestamp,
|
|
855
886
|
blockNumber,
|
|
@@ -1009,7 +1040,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
1009
1040
|
if (typeof blockNumber === 'number' && blockNumber < INITIAL_L2_BLOCK_NUM - 1) {
|
|
1010
1041
|
throw new Error('Invalid block number to get world state for: ' + blockNumber);
|
|
1011
1042
|
}
|
|
1012
|
-
let blockSyncedTo =
|
|
1043
|
+
let blockSyncedTo = BlockNumber.ZERO;
|
|
1013
1044
|
try {
|
|
1014
1045
|
// Attempt to sync the world state if necessary
|
|
1015
1046
|
blockSyncedTo = await this.#syncWorldState();
|
|
@@ -1032,7 +1063,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
1032
1063
|
* @returns A promise that fulfils once the world state is synced
|
|
1033
1064
|
*/ async #syncWorldState() {
|
|
1034
1065
|
const blockSourceHeight = await this.blockSource.getBlockNumber();
|
|
1035
|
-
return this.worldStateSynchronizer.syncImmediate(blockSourceHeight);
|
|
1066
|
+
return await this.worldStateSynchronizer.syncImmediate(blockSourceHeight);
|
|
1036
1067
|
}
|
|
1037
1068
|
}
|
|
1038
1069
|
_ts_decorate([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { BlockNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
5
5
|
import { type L2TipsStore } from '@aztec/kv-store/stores';
|
|
@@ -23,7 +23,7 @@ export declare class Sentinel extends Sentinel_base implements L2BlockStreamEven
|
|
|
23
23
|
protected initialSlot: SlotNumber | undefined;
|
|
24
24
|
protected lastProcessedSlot: SlotNumber | undefined;
|
|
25
25
|
protected slotNumberToBlock: Map<SlotNumber, {
|
|
26
|
-
blockNumber:
|
|
26
|
+
blockNumber: BlockNumber;
|
|
27
27
|
archive: string;
|
|
28
28
|
attestors: EthAddress[];
|
|
29
29
|
}>;
|
|
@@ -89,4 +89,4 @@ export declare class Sentinel extends Sentinel_base implements L2BlockStreamEven
|
|
|
89
89
|
} | undefined;
|
|
90
90
|
}
|
|
91
91
|
export {};
|
|
92
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
92
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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QUFxQixFQUFFOzs7OztNQVVoQztJQUVELFNBQVMsQ0FBQyxlQUFlLENBQUMsSUFBSSxFQUFFLFVBQVUsR0FBRyxTQUFTOzs7O2tCQU1yRDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/sentinel/sentinel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/sentinel/sentinel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAE/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;;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C;IAED,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,KAAK,MAAM,EAAE,EACtB,UAAU,EAAE,sBAAsB,EAClC,QAAQ,CAAC,EAAE,UAAU,EACrB,MAAM,CAAC,EAAE,UAAU,GAClB,cAAc,CAchB;IAED,SAAS,CAAC,aAAa,CACrB,OAAO,EAAE,sBAAsB,EAC/B,iBAAiB,EAAE,mBAAmB,GAAG,SAAS,EAClD,MAAM,EAAE,qBAAqB,EAAE;;;;;MAUhC;IAED,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS;;;;kBAMrD;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
|
+
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { countWhile, filterAsync, fromEntries, getEntries, mapValues } from '@aztec/foundation/collection';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -40,7 +40,7 @@ export class Sentinel extends EventEmitter {
|
|
|
40
40
|
}
|
|
41
41
|
/** Loads initial slot and initializes blockstream. We will not process anything at or before the initial slot. */ async init() {
|
|
42
42
|
this.initialSlot = this.epochCache.getEpochAndSlotNow().slot;
|
|
43
|
-
const startingBlock = await this.archiver.getBlockNumber();
|
|
43
|
+
const startingBlock = BlockNumber(await this.archiver.getBlockNumber());
|
|
44
44
|
this.logger.info(`Starting validator sentinel with initial slot ${this.initialSlot} and block ${startingBlock}`);
|
|
45
45
|
this.blockStream = new L2BlockStream(this.archiver, this.l2TipsStore, this, this.logger, {
|
|
46
46
|
startingBlock
|
|
@@ -55,7 +55,7 @@ export class Sentinel extends EventEmitter {
|
|
|
55
55
|
// Store mapping from slot to archive, block number, and attestors
|
|
56
56
|
for (const block of event.blocks){
|
|
57
57
|
this.slotNumberToBlock.set(block.block.header.getSlot(), {
|
|
58
|
-
blockNumber: block.block.number,
|
|
58
|
+
blockNumber: BlockNumber(block.block.number),
|
|
59
59
|
archive: block.block.archive.root.toString(),
|
|
60
60
|
attestors: getAttestationInfoFromPublishedL2Block(block).filter((a)=>a.status === 'recovered-from-signature').map((a)=>a.address)
|
|
61
61
|
});
|
|
@@ -76,7 +76,7 @@ export class Sentinel extends EventEmitter {
|
|
|
76
76
|
if (event.type !== 'chain-proven') {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const blockNumber = event.block.number;
|
|
79
|
+
const blockNumber = BlockNumber(event.block.number);
|
|
80
80
|
const block = await this.archiver.getBlock(blockNumber);
|
|
81
81
|
if (!block) {
|
|
82
82
|
this.logger.error(`Failed to get block ${blockNumber}`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.6230efd",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "node --no-warnings ./dest/bin",
|
|
22
22
|
"start:debug": "node --no-warnings --inspect ./dest/bin",
|
|
23
|
-
"build": "yarn clean &&
|
|
24
|
-
"build:dev": "
|
|
23
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
24
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
25
25
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
26
26
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
27
27
|
},
|
|
@@ -66,29 +66,29 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
70
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
71
|
-
"@aztec/blob-
|
|
72
|
-
"@aztec/constants": "0.0.1-commit.
|
|
73
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
74
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
75
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
76
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
77
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
78
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
79
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
80
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
81
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
82
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
83
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
84
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
85
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
86
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
87
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
88
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
89
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
90
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
91
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
69
|
+
"@aztec/archiver": "0.0.1-commit.6230efd",
|
|
70
|
+
"@aztec/bb-prover": "0.0.1-commit.6230efd",
|
|
71
|
+
"@aztec/blob-client": "0.0.1-commit.6230efd",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.6230efd",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.6230efd",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.6230efd",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.6230efd",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.6230efd",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.6230efd",
|
|
78
|
+
"@aztec/merkle-tree": "0.0.1-commit.6230efd",
|
|
79
|
+
"@aztec/node-keystore": "0.0.1-commit.6230efd",
|
|
80
|
+
"@aztec/node-lib": "0.0.1-commit.6230efd",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.6230efd",
|
|
82
|
+
"@aztec/p2p": "0.0.1-commit.6230efd",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.6230efd",
|
|
84
|
+
"@aztec/prover-client": "0.0.1-commit.6230efd",
|
|
85
|
+
"@aztec/sequencer-client": "0.0.1-commit.6230efd",
|
|
86
|
+
"@aztec/simulator": "0.0.1-commit.6230efd",
|
|
87
|
+
"@aztec/slasher": "0.0.1-commit.6230efd",
|
|
88
|
+
"@aztec/stdlib": "0.0.1-commit.6230efd",
|
|
89
|
+
"@aztec/telemetry-client": "0.0.1-commit.6230efd",
|
|
90
|
+
"@aztec/validator-client": "0.0.1-commit.6230efd",
|
|
91
|
+
"@aztec/world-state": "0.0.1-commit.6230efd",
|
|
92
92
|
"koa": "^2.16.1",
|
|
93
93
|
"koa-router": "^13.1.1",
|
|
94
94
|
"tslib": "^2.4.0",
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type L1ContractAddresses,
|
|
5
|
-
genesisStateConfigMappings,
|
|
6
|
-
l1ContractAddressesMapping,
|
|
7
|
-
} from '@aztec/ethereum';
|
|
2
|
+
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
|
|
3
|
+
import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
8
4
|
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
9
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
6
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
@@ -57,6 +53,9 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
57
53
|
disableValidator: boolean;
|
|
58
54
|
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
59
55
|
skipArchiverInitialSync: boolean;
|
|
56
|
+
|
|
57
|
+
/** A flag to force verification of tx Chonk proofs. Only used for testnet */
|
|
58
|
+
debugForceTxProofVerification: boolean;
|
|
60
59
|
};
|
|
61
60
|
|
|
62
61
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
@@ -87,6 +86,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
87
86
|
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
88
87
|
...booleanConfigHelper(false),
|
|
89
88
|
},
|
|
89
|
+
debugForceTxProofVerification: {
|
|
90
|
+
env: 'DEBUG_FORCE_TX_PROOF_VERIFICATION',
|
|
91
|
+
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
92
|
+
...booleanConfigHelper(false),
|
|
93
|
+
},
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
/**
|
|
@@ -132,7 +136,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
|
|
|
132
136
|
function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
|
|
133
137
|
const validatorKeyStores: ValidatorKeyStore[] = [];
|
|
134
138
|
const ethPrivateKeys = config.validatorPrivateKeys
|
|
135
|
-
? config.validatorPrivateKeys.getValue().map(x => ethPrivateKeySchema.parse(x))
|
|
139
|
+
? config.validatorPrivateKeys.getValue().map((x: string) => ethPrivateKeySchema.parse(x))
|
|
136
140
|
: [];
|
|
137
141
|
|
|
138
142
|
if (!ethPrivateKeys.length) {
|
|
@@ -142,7 +146,7 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
142
146
|
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
143
147
|
|
|
144
148
|
const publisherKeys = config.publisherPrivateKeys
|
|
145
|
-
? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
|
|
149
|
+
? config.publisherPrivateKeys.map((k: { getValue: () => string }) => ethPrivateKeySchema.parse(k.getValue()))
|
|
146
150
|
: [];
|
|
147
151
|
|
|
148
152
|
validatorKeyStores.push({
|