@aztec/aztec-node 0.0.1-commit.9b94fc1 → 0.0.1-commit.c7c42ec
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 +35 -46
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +85 -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 +141 -89
- 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,15 +24,17 @@ 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';
|
|
37
|
+
import { GasFees } from '@aztec/stdlib/gas';
|
|
32
38
|
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
33
39
|
import { AztecNodeAdminConfigSchema } from '@aztec/stdlib/interfaces/client';
|
|
34
40
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
@@ -66,11 +72,12 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
66
72
|
proofVerifier;
|
|
67
73
|
telemetry;
|
|
68
74
|
log;
|
|
75
|
+
blobClient;
|
|
69
76
|
metrics;
|
|
70
77
|
// Prevent two snapshot operations to happen simultaneously
|
|
71
78
|
isUploadingSnapshot;
|
|
72
79
|
tracer;
|
|
73
|
-
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){
|
|
74
81
|
this.config = config;
|
|
75
82
|
this.p2pClient = p2pClient;
|
|
76
83
|
this.blockSource = blockSource;
|
|
@@ -90,6 +97,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
90
97
|
this.proofVerifier = proofVerifier;
|
|
91
98
|
this.telemetry = telemetry;
|
|
92
99
|
this.log = log;
|
|
100
|
+
this.blobClient = blobClient;
|
|
93
101
|
this.isUploadingSnapshot = false;
|
|
94
102
|
this.metrics = new NodeMetrics(telemetry, 'AztecNodeService');
|
|
95
103
|
this.tracer = telemetry.getTracer('AztecNodeService');
|
|
@@ -115,9 +123,6 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
115
123
|
const packageVersion = getPackageVersion() ?? '';
|
|
116
124
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
117
125
|
const dateProvider = deps.dateProvider ?? new DateProvider();
|
|
118
|
-
const blobSinkClient = deps.blobSinkClient ?? createBlobSinkClient(config, {
|
|
119
|
-
logger: createLogger('node:blob-sink:client')
|
|
120
|
-
});
|
|
121
126
|
const ethereumChain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
122
127
|
// Build a key store from file if given or from environment otherwise
|
|
123
128
|
let keyStoreManager;
|
|
@@ -148,7 +153,9 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
148
153
|
}
|
|
149
154
|
const publicClient = createPublicClient({
|
|
150
155
|
chain: ethereumChain.chainInfo,
|
|
151
|
-
transport: fallback(config.l1RpcUrls.map((url)=>http(url
|
|
156
|
+
transport: fallback(config.l1RpcUrls.map((url)=>http(url, {
|
|
157
|
+
batch: false
|
|
158
|
+
}))),
|
|
152
159
|
pollingInterval: config.viemPollingIntervalMS
|
|
153
160
|
});
|
|
154
161
|
const l1ContractsAddresses = await RegistryContract.collectAddresses(publicClient, config.l1Contracts.registryAddress, config.rollupVersion ?? 'canonical');
|
|
@@ -167,13 +174,27 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
167
174
|
if (config.rollupVersion !== Number(rollupVersionFromRollup)) {
|
|
168
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}).`);
|
|
169
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
|
+
});
|
|
170
191
|
// attempt snapshot sync if possible
|
|
171
192
|
await trySnapshotSync(config, log);
|
|
172
193
|
const epochCache = await EpochCache.create(config.l1Contracts.rollupAddress, config, {
|
|
173
194
|
dateProvider
|
|
174
195
|
});
|
|
175
196
|
const archiver = await createArchiver(config, {
|
|
176
|
-
|
|
197
|
+
blobClient,
|
|
177
198
|
epochCache,
|
|
178
199
|
telemetry,
|
|
179
200
|
dateProvider
|
|
@@ -182,7 +203,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
182
203
|
});
|
|
183
204
|
// now create the merkle trees and the world state synchronizer
|
|
184
205
|
const worldStateSynchronizer = await createWorldStateSynchronizer(config, archiver, options.prefilledPublicData, telemetry);
|
|
185
|
-
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);
|
|
186
207
|
if (!config.realProofs) {
|
|
187
208
|
log.warn(`Aztec node is accepting fake proofs`);
|
|
188
209
|
}
|
|
@@ -207,7 +228,8 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
207
228
|
blockBuilder,
|
|
208
229
|
blockSource: archiver,
|
|
209
230
|
l1ToL2MessageSource: archiver,
|
|
210
|
-
keyStoreManager
|
|
231
|
+
keyStoreManager,
|
|
232
|
+
fileStoreBlobUploadClient: fileStoreUploadClient
|
|
211
233
|
});
|
|
212
234
|
// If we have a validator client, register it as a source of offenses for the slasher,
|
|
213
235
|
// and have it register callbacks on the p2p client *before* we start it, otherwise messages
|
|
@@ -262,13 +284,20 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
262
284
|
// Validator enabled, create/start relevant service
|
|
263
285
|
let sequencer;
|
|
264
286
|
let slasherClient;
|
|
265
|
-
if (!config.disableValidator) {
|
|
287
|
+
if (!config.disableValidator && validatorClient) {
|
|
266
288
|
// We create a slasher only if we have a sequencer, since all slashing actions go through the sequencer publisher
|
|
267
289
|
// as they are executed when the node is selected as proposer.
|
|
268
290
|
const validatorAddresses = keyStoreManager ? NodeKeystoreAdapter.fromKeyStoreManager(keyStoreManager).getAddresses() : [];
|
|
269
291
|
slasherClient = await createSlasher(config, config.l1Contracts, getPublicClient(config), watchers, dateProvider, epochCache, validatorAddresses, undefined);
|
|
270
292
|
await slasherClient.start();
|
|
271
|
-
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(), {
|
|
272
301
|
...config,
|
|
273
302
|
scope: 'sequencer'
|
|
274
303
|
}, {
|
|
@@ -277,6 +306,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
277
306
|
dateProvider
|
|
278
307
|
});
|
|
279
308
|
// Create and start the sequencer client
|
|
309
|
+
const checkpointsBuilder = new CheckpointsBuilder({
|
|
310
|
+
...config,
|
|
311
|
+
l1GenesisTime,
|
|
312
|
+
slotDuration: Number(slotDuration)
|
|
313
|
+
}, archiver, dateProvider, telemetry);
|
|
280
314
|
sequencer = await SequencerClient.new(config, {
|
|
281
315
|
...deps,
|
|
282
316
|
epochCache,
|
|
@@ -285,12 +319,12 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
285
319
|
p2pClient,
|
|
286
320
|
worldStateSynchronizer,
|
|
287
321
|
slasherClient,
|
|
288
|
-
|
|
322
|
+
checkpointsBuilder,
|
|
289
323
|
l2BlockSource: archiver,
|
|
290
324
|
l1ToL2MessageSource: archiver,
|
|
291
325
|
telemetry,
|
|
292
326
|
dateProvider,
|
|
293
|
-
|
|
327
|
+
blobClient,
|
|
294
328
|
nodeKeyStore: keyStoreManager
|
|
295
329
|
});
|
|
296
330
|
}
|
|
@@ -300,7 +334,13 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
300
334
|
} else if (sequencer) {
|
|
301
335
|
log.warn(`Sequencer created but not started`);
|
|
302
336
|
}
|
|
303
|
-
|
|
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);
|
|
304
344
|
}
|
|
305
345
|
/**
|
|
306
346
|
* Returns the sequencer client instance.
|
|
@@ -395,6 +435,15 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
395
435
|
*/ async getCurrentBaseFees() {
|
|
396
436
|
return await this.globalVariableBuilder.getCurrentBaseFees();
|
|
397
437
|
}
|
|
438
|
+
async getMaxPriorityFees() {
|
|
439
|
+
for await (const tx of this.p2pClient.iteratePendingTxs()){
|
|
440
|
+
return tx.getGasSettings().maxPriorityFeesPerGas;
|
|
441
|
+
}
|
|
442
|
+
return GasFees.from({
|
|
443
|
+
feePerDaGas: 0n,
|
|
444
|
+
feePerL2Gas: 0n
|
|
445
|
+
});
|
|
446
|
+
}
|
|
398
447
|
/**
|
|
399
448
|
* Method to fetch the latest block number synchronized by the node.
|
|
400
449
|
* @returns The block number.
|
|
@@ -428,22 +477,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
428
477
|
getContract(address) {
|
|
429
478
|
return this.contractDataSource.getContract(address);
|
|
430
479
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
* @param from - The block number from which to begin retrieving logs.
|
|
434
|
-
* @param limit - The maximum number of blocks to retrieve logs from.
|
|
435
|
-
* @returns An array of private logs from the specified range of blocks.
|
|
436
|
-
*/ getPrivateLogs(from, limit) {
|
|
437
|
-
return this.logsSource.getPrivateLogs(from, limit);
|
|
480
|
+
getPrivateLogsByTags(tags) {
|
|
481
|
+
return this.logsSource.getPrivateLogsByTags(tags);
|
|
438
482
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
* @param tags - The tags to filter the logs by.
|
|
442
|
-
* @param logsPerTag - The maximum number of logs to return for each tag. By default no limit is set
|
|
443
|
-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
444
|
-
* that tag.
|
|
445
|
-
*/ getLogsByTags(tags, logsPerTag) {
|
|
446
|
-
return this.logsSource.getLogsByTags(tags, logsPerTag);
|
|
483
|
+
getPublicLogsByTagsFromContract(contractAddress, tags) {
|
|
484
|
+
return this.logsSource.getPublicLogsByTagsFromContract(contractAddress, tags);
|
|
447
485
|
}
|
|
448
486
|
/**
|
|
449
487
|
* Gets public logs based on the provided filter.
|
|
@@ -512,6 +550,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
512
550
|
await tryStop(this.p2pClient);
|
|
513
551
|
await tryStop(this.worldStateSynchronizer);
|
|
514
552
|
await tryStop(this.blockSource);
|
|
553
|
+
await tryStop(this.blobClient);
|
|
515
554
|
await tryStop(this.telemetry);
|
|
516
555
|
this.log.info(`Stopped Aztec Node`);
|
|
517
556
|
}
|
|
@@ -567,7 +606,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
567
606
|
// Now we obtain the block hashes from the archive tree by calling await `committedDb.getLeafValue(treeId, index)`
|
|
568
607
|
// (note that block number corresponds to the leaf index in the archive tree).
|
|
569
608
|
const blockHashes = await Promise.all(uniqueBlockNumbers.map((blockNumber)=>{
|
|
570
|
-
return committedDb.getLeafValue(MerkleTreeId.ARCHIVE, blockNumber);
|
|
609
|
+
return committedDb.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(blockNumber));
|
|
571
610
|
}));
|
|
572
611
|
// If any of the block hashes are undefined, we throw an error.
|
|
573
612
|
for(let i = 0; i < uniqueBlockNumbers.length; i++){
|
|
@@ -575,7 +614,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
575
614
|
throw new Error(`Block hash is undefined for block number ${uniqueBlockNumbers[i]}`);
|
|
576
615
|
}
|
|
577
616
|
}
|
|
578
|
-
// Create
|
|
617
|
+
// Create DataInBlock objects by combining indices, blockNumbers and blockHashes and return them.
|
|
579
618
|
return maybeIndices.map((index, i)=>{
|
|
580
619
|
if (index === undefined) {
|
|
581
620
|
return undefined;
|
|
@@ -590,7 +629,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
590
629
|
return undefined;
|
|
591
630
|
}
|
|
592
631
|
return {
|
|
593
|
-
l2BlockNumber: Number(blockNumber),
|
|
632
|
+
l2BlockNumber: BlockNumber(Number(blockNumber)),
|
|
594
633
|
l2BlockHash: L2BlockHash.fromField(blockHash),
|
|
595
634
|
data: index
|
|
596
635
|
};
|
|
@@ -649,7 +688,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
649
688
|
}
|
|
650
689
|
async getL1ToL2MessageBlock(l1ToL2Message) {
|
|
651
690
|
const messageIndex = await this.l1ToL2MessageSource.getL1ToL2MessageIndex(l1ToL2Message);
|
|
652
|
-
return messageIndex ? InboxLeaf.
|
|
691
|
+
return messageIndex ? BlockNumber.fromCheckpointNumber(InboxLeaf.checkpointNumberFromIndex(messageIndex)) : undefined;
|
|
653
692
|
}
|
|
654
693
|
/**
|
|
655
694
|
* Returns whether an L1 to L2 message is synced by archiver and if it's ready to be included in a block.
|
|
@@ -767,7 +806,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
767
806
|
* Returns the currently committed block header, or the initial header if no blocks have been produced.
|
|
768
807
|
* @returns The current committed block header.
|
|
769
808
|
*/ async getBlockHeader(blockNumber = 'latest') {
|
|
770
|
-
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);
|
|
771
810
|
}
|
|
772
811
|
/**
|
|
773
812
|
* Get a block header specified by its hash.
|
|
@@ -795,7 +834,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
795
834
|
throw new BadRequestError(`Transaction total gas limit ${txGasLimit + teardownGasLimit} (${txGasLimit} + ${teardownGasLimit}) exceeds maximum gas limit ${this.config.rpcSimulatePublicMaxGasLimit} for simulation`);
|
|
796
835
|
}
|
|
797
836
|
const txHash = tx.getTxHash();
|
|
798
|
-
const blockNumber = await this.blockSource.getBlockNumber() + 1;
|
|
837
|
+
const blockNumber = BlockNumber(await this.blockSource.getBlockNumber() + 1);
|
|
799
838
|
// If sequencer is not initialized, we just set these values to zero for simulation.
|
|
800
839
|
const coinbase = EthAddress.ZERO;
|
|
801
840
|
const feeRecipient = AztecAddress.ZERO;
|
|
@@ -813,8 +852,10 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
813
852
|
collectDebugLogs: true,
|
|
814
853
|
collectHints: false,
|
|
815
854
|
collectCallMetadata: true,
|
|
816
|
-
|
|
817
|
-
|
|
855
|
+
collectStatistics: false,
|
|
856
|
+
collectionLimits: CollectionLimitsConfig.from({
|
|
857
|
+
maxDebugLogMemoryReads: this.config.rpcSimulatePublicMaxDebugLogMemoryReads
|
|
858
|
+
})
|
|
818
859
|
});
|
|
819
860
|
const processor = publicProcessorFactory.create(merkleTreeFork, newGlobalVariables, config);
|
|
820
861
|
// REFACTOR: Consider merging ProcessReturnValues into ProcessedTx
|
|
@@ -839,7 +880,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
839
880
|
const verifier = isSimulation ? undefined : this.proofVerifier;
|
|
840
881
|
// We accept transactions if they are not expired by the next slot (checked based on the IncludeByTimestamp field)
|
|
841
882
|
const { ts: nextSlotTimestamp } = this.epochCache.getEpochAndSlotInNextL1Slot();
|
|
842
|
-
const blockNumber = await this.blockSource.getBlockNumber() + 1;
|
|
883
|
+
const blockNumber = BlockNumber(await this.blockSource.getBlockNumber() + 1);
|
|
843
884
|
const validator = createValidatorForAcceptingTxs(db, this.contractDataSource, verifier, {
|
|
844
885
|
timestamp: nextSlotTimestamp,
|
|
845
886
|
blockNumber,
|
|
@@ -999,7 +1040,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
999
1040
|
if (typeof blockNumber === 'number' && blockNumber < INITIAL_L2_BLOCK_NUM - 1) {
|
|
1000
1041
|
throw new Error('Invalid block number to get world state for: ' + blockNumber);
|
|
1001
1042
|
}
|
|
1002
|
-
let blockSyncedTo =
|
|
1043
|
+
let blockSyncedTo = BlockNumber.ZERO;
|
|
1003
1044
|
try {
|
|
1004
1045
|
// Attempt to sync the world state if necessary
|
|
1005
1046
|
blockSyncedTo = await this.#syncWorldState();
|
|
@@ -1022,7 +1063,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
1022
1063
|
* @returns A promise that fulfils once the world state is synced
|
|
1023
1064
|
*/ async #syncWorldState() {
|
|
1024
1065
|
const blockSourceHeight = await this.blockSource.getBlockNumber();
|
|
1025
|
-
return this.worldStateSynchronizer.syncImmediate(blockSourceHeight);
|
|
1066
|
+
return await this.worldStateSynchronizer.syncImmediate(blockSourceHeight);
|
|
1026
1067
|
}
|
|
1027
1068
|
}
|
|
1028
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VudGluZWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZW50aW5lbC9zZW50aW5lbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEVBQUUsV0FBVyxFQUFFLFdBQVcsRUFBRSxVQUFVLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUV2RixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFM0QsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sRUFBcUIsS0FBSyxXQUFXLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM3RSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxZQUFZLENBQU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HO0lBRUQsNkNBQTZDO0lBQ2hDLGlCQUFpQixDQUM1QixnQkFBZ0IsRUFBRSxVQUFVLEVBQzVCLFFBQVEsQ0FBQyxFQUFFLFVBQVUsRUFDckIsTUFBTSxDQUFDLEVBQUUsVUFBVSxHQUNsQixPQUFPLENBQUMsb0JBQW9CLEdBQUcsU0FBUyxDQUFDLENBa0MzQztJQUVELFNBQVMsQ0FBQyx3QkFBd0IsQ0FDaEMsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLEVBQ3RCLFVBQVUsRUFBRSxzQkFBc0IsRUFDbEMsUUFBUSxDQUFDLEVBQUUsVUFBVSxFQUNyQixNQUFNLENBQUMsRUFBRSxVQUFVLEdBQ2xCLGNBQWMsQ0FjaEI7SUFFRCxTQUFTLENBQUMsYUFBYSxDQUNyQixPQUFPLEVBQUUsc0JBQXNCLEVBQy9CLGlCQUFpQixFQUFFLG1CQUFtQixHQUFHLFNBQVMsRUFDbEQsTUFBTSxFQUFFLHFCQUFxQixFQUFFOzs7OztNQVVoQztJQUVELFNBQVMsQ0FBQyxlQUFlLENBQUMsSUFBSSxFQUFFLFVBQVUsR0FBRyxTQUFTOzs7O2tCQU1yRDtDQUNGIn0=
|
|
@@ -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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,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;;OA2DlH;IAED,wDAAwD;IACxD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAAC,iBAE3G;IAED,0DAA0D;IAC7C,YAAY,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,UAAU,EACX,GAAE;QAAE,QAAQ,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAC;QAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAmB3G;IAED,6CAA6C;IAChC,iBAAiB,CAC5B,gBAAgB,EAAE,UAAU,EAC5B,QAAQ,CAAC,EAAE,UAAU,EACrB,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAkC3C;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.c7c42ec",
|
|
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.c7c42ec",
|
|
70
|
+
"@aztec/bb-prover": "0.0.1-commit.c7c42ec",
|
|
71
|
+
"@aztec/blob-client": "0.0.1-commit.c7c42ec",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.c7c42ec",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.c7c42ec",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.c7c42ec",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.c7c42ec",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.c7c42ec",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.c7c42ec",
|
|
78
|
+
"@aztec/merkle-tree": "0.0.1-commit.c7c42ec",
|
|
79
|
+
"@aztec/node-keystore": "0.0.1-commit.c7c42ec",
|
|
80
|
+
"@aztec/node-lib": "0.0.1-commit.c7c42ec",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.c7c42ec",
|
|
82
|
+
"@aztec/p2p": "0.0.1-commit.c7c42ec",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.c7c42ec",
|
|
84
|
+
"@aztec/prover-client": "0.0.1-commit.c7c42ec",
|
|
85
|
+
"@aztec/sequencer-client": "0.0.1-commit.c7c42ec",
|
|
86
|
+
"@aztec/simulator": "0.0.1-commit.c7c42ec",
|
|
87
|
+
"@aztec/slasher": "0.0.1-commit.c7c42ec",
|
|
88
|
+
"@aztec/stdlib": "0.0.1-commit.c7c42ec",
|
|
89
|
+
"@aztec/telemetry-client": "0.0.1-commit.c7c42ec",
|
|
90
|
+
"@aztec/validator-client": "0.0.1-commit.c7c42ec",
|
|
91
|
+
"@aztec/world-state": "0.0.1-commit.c7c42ec",
|
|
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({
|