@aztec/aztec-node 0.0.1-commit.c0b82b2 → 0.0.1-commit.c2eed6949
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 +2 -2
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +1 -1
- package/dest/aztec-node/server.d.ts +19 -19
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +216 -128
- package/dest/sentinel/factory.d.ts +2 -2
- package/dest/sentinel/factory.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +8 -8
- package/package.json +26 -27
- package/src/aztec-node/config.ts +1 -1
- package/src/aztec-node/server.ts +216 -126
- package/src/sentinel/factory.ts +1 -1
- package/src/sentinel/sentinel.ts +8 -8
|
@@ -372,15 +372,16 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
|
372
372
|
}
|
|
373
373
|
var _dec, _initProto;
|
|
374
374
|
import { createArchiver } from '@aztec/archiver';
|
|
375
|
-
import { BBCircuitVerifier,
|
|
375
|
+
import { BBCircuitVerifier, BatchChonkVerifier, QueuedIVCVerifier } from '@aztec/bb-prover';
|
|
376
|
+
import { TestCircuitVerifier } from '@aztec/bb-prover/test';
|
|
376
377
|
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
377
378
|
import { Blob } from '@aztec/blob-lib';
|
|
378
379
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
379
380
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
380
|
-
import { getPublicClient } from '@aztec/ethereum/client';
|
|
381
|
+
import { getPublicClient, makeL1HttpTransport } from '@aztec/ethereum/client';
|
|
381
382
|
import { RegistryContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
382
|
-
import { BlockNumber
|
|
383
|
-
import { compactArray, pick, unique } from '@aztec/foundation/collection';
|
|
383
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
384
|
+
import { chunkBy, compactArray, pick, unique } from '@aztec/foundation/collection';
|
|
384
385
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
385
386
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
386
387
|
import { BadRequestError } from '@aztec/foundation/json-rpc';
|
|
@@ -413,7 +414,7 @@ import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
|
413
414
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
414
415
|
import { FullNodeCheckpointsBuilder as CheckpointsBuilder, FullNodeCheckpointsBuilder, NodeKeystoreAdapter, ValidatorClient, createBlockProposalHandler, createValidatorClient } from '@aztec/validator-client';
|
|
415
416
|
import { createWorldStateSynchronizer } from '@aztec/world-state';
|
|
416
|
-
import { createPublicClient
|
|
417
|
+
import { createPublicClient } from 'viem';
|
|
417
418
|
import { createSentinel } from '../sentinel/factory.js';
|
|
418
419
|
import { createKeyStoreForValidator } from './config.js';
|
|
419
420
|
import { NodeMetrics } from './node_metrics.js';
|
|
@@ -440,7 +441,8 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
440
441
|
globalVariableBuilder;
|
|
441
442
|
epochCache;
|
|
442
443
|
packageVersion;
|
|
443
|
-
|
|
444
|
+
peerProofVerifier;
|
|
445
|
+
rpcProofVerifier;
|
|
444
446
|
telemetry;
|
|
445
447
|
log;
|
|
446
448
|
blobClient;
|
|
@@ -461,7 +463,7 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
461
463
|
// Prevent two snapshot operations to happen simultaneously
|
|
462
464
|
isUploadingSnapshot;
|
|
463
465
|
tracer;
|
|
464
|
-
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, proverNode, slasherClient, validatorsSentinel, epochPruneWatcher, l1ChainId, version, globalVariableBuilder, epochCache, packageVersion,
|
|
466
|
+
constructor(config, p2pClient, blockSource, logsSource, contractDataSource, l1ToL2MessageSource, worldStateSynchronizer, sequencer, proverNode, slasherClient, validatorsSentinel, epochPruneWatcher, l1ChainId, version, globalVariableBuilder, epochCache, packageVersion, peerProofVerifier, rpcProofVerifier, telemetry = getTelemetryClient(), log = createLogger('node'), blobClient, validatorClient, keyStoreManager, debugLogStore = new NullDebugLogStore()){
|
|
465
467
|
this.config = config;
|
|
466
468
|
this.p2pClient = p2pClient;
|
|
467
469
|
this.blockSource = blockSource;
|
|
@@ -479,7 +481,8 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
479
481
|
this.globalVariableBuilder = globalVariableBuilder;
|
|
480
482
|
this.epochCache = epochCache;
|
|
481
483
|
this.packageVersion = packageVersion;
|
|
482
|
-
this.
|
|
484
|
+
this.peerProofVerifier = peerProofVerifier;
|
|
485
|
+
this.rpcProofVerifier = rpcProofVerifier;
|
|
483
486
|
this.telemetry = telemetry;
|
|
484
487
|
this.log = log;
|
|
485
488
|
this.blobClient = blobClient;
|
|
@@ -499,6 +502,9 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
499
502
|
throw new Error('debugLogStore should never be enabled when realProofs are set');
|
|
500
503
|
}
|
|
501
504
|
}
|
|
505
|
+
/** @internal Exposed for testing — returns the RPC proof verifier. */ getProofVerifier() {
|
|
506
|
+
return this.rpcProofVerifier;
|
|
507
|
+
}
|
|
502
508
|
async getWorldStateSyncStatus() {
|
|
503
509
|
const status = await this.worldStateSynchronizer.status();
|
|
504
510
|
return status.syncSummary;
|
|
@@ -559,9 +565,9 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
559
565
|
}
|
|
560
566
|
const publicClient = createPublicClient({
|
|
561
567
|
chain: ethereumChain.chainInfo,
|
|
562
|
-
transport:
|
|
563
|
-
|
|
564
|
-
|
|
568
|
+
transport: makeL1HttpTransport(config.l1RpcUrls, {
|
|
569
|
+
timeout: config.l1HttpTimeoutMS
|
|
570
|
+
}),
|
|
565
571
|
pollingInterval: config.viemPollingIntervalMS
|
|
566
572
|
});
|
|
567
573
|
const l1ContractsAddresses = await RegistryContract.collectAddresses(publicClient, config.l1Contracts.registryAddress, config.rollupVersion ?? 'canonical');
|
|
@@ -571,10 +577,11 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
571
577
|
...l1ContractsAddresses
|
|
572
578
|
};
|
|
573
579
|
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
574
|
-
const [l1GenesisTime, slotDuration, rollupVersionFromRollup] = await Promise.all([
|
|
580
|
+
const [l1GenesisTime, slotDuration, rollupVersionFromRollup, rollupManaLimit] = await Promise.all([
|
|
575
581
|
rollupContract.getL1GenesisTime(),
|
|
576
582
|
rollupContract.getSlotDuration(),
|
|
577
|
-
rollupContract.getVersion()
|
|
583
|
+
rollupContract.getVersion(),
|
|
584
|
+
rollupContract.getManaLimit().then(Number)
|
|
578
585
|
]);
|
|
579
586
|
config.rollupVersion ??= Number(rollupVersionFromRollup);
|
|
580
587
|
if (config.rollupVersion !== Number(rollupVersionFromRollup)) {
|
|
@@ -596,7 +603,17 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
596
603
|
});
|
|
597
604
|
// now create the merkle trees and the world state synchronizer
|
|
598
605
|
const worldStateSynchronizer = await createWorldStateSynchronizer(config, archiver, options.prefilledPublicData, telemetry);
|
|
599
|
-
const
|
|
606
|
+
const useRealVerifiers = config.realProofs || config.debugForceTxProofVerification;
|
|
607
|
+
let peerProofVerifier;
|
|
608
|
+
let rpcProofVerifier;
|
|
609
|
+
if (useRealVerifiers) {
|
|
610
|
+
peerProofVerifier = await BatchChonkVerifier.new(config, config.bbChonkVerifyMaxBatch, 'peer');
|
|
611
|
+
const rpcVerifier = await BBCircuitVerifier.new(config);
|
|
612
|
+
rpcProofVerifier = new QueuedIVCVerifier(rpcVerifier, config.numConcurrentIVCVerifiers);
|
|
613
|
+
} else {
|
|
614
|
+
peerProofVerifier = new TestCircuitVerifier(config.proverTestVerificationDelayMs);
|
|
615
|
+
rpcProofVerifier = new TestCircuitVerifier(config.proverTestVerificationDelayMs);
|
|
616
|
+
}
|
|
600
617
|
let debugLogStore;
|
|
601
618
|
if (!config.realProofs) {
|
|
602
619
|
log.warn(`Aztec node is accepting fake proofs`);
|
|
@@ -605,22 +622,22 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
605
622
|
} else {
|
|
606
623
|
debugLogStore = new NullDebugLogStore();
|
|
607
624
|
}
|
|
608
|
-
const proofVerifier = new QueuedIVCVerifier(config, circuitVerifier);
|
|
609
625
|
const proverOnly = config.enableProverNode && config.disableValidator;
|
|
610
626
|
if (proverOnly) {
|
|
611
627
|
log.info('Starting in prover-only mode: skipping validator, sequencer, sentinel, and slasher subsystems');
|
|
612
628
|
}
|
|
613
629
|
// create the tx pool and the p2p client, which will need the l2 block source
|
|
614
|
-
const p2pClient = await createP2PClient(config, archiver,
|
|
615
|
-
// We should really not be modifying the config object
|
|
616
|
-
config.txPublicSetupAllowList = config.txPublicSetupAllowList ?? await getDefaultAllowedSetupFunctions();
|
|
630
|
+
const p2pClient = await createP2PClient(config, archiver, peerProofVerifier, worldStateSynchronizer, epochCache, packageVersion, dateProvider, telemetry, deps.p2pClientDeps);
|
|
617
631
|
// We'll accumulate sentinel watchers here
|
|
618
632
|
const watchers = [];
|
|
619
|
-
// Create FullNodeCheckpointsBuilder for block proposal handling and tx validation
|
|
633
|
+
// Create FullNodeCheckpointsBuilder for block proposal handling and tx validation.
|
|
634
|
+
// Override maxTxsPerCheckpoint with the validator-specific limit if set.
|
|
620
635
|
const validatorCheckpointsBuilder = new FullNodeCheckpointsBuilder({
|
|
621
636
|
...config,
|
|
622
637
|
l1GenesisTime,
|
|
623
|
-
slotDuration: Number(slotDuration)
|
|
638
|
+
slotDuration: Number(slotDuration),
|
|
639
|
+
rollupManaLimit,
|
|
640
|
+
maxTxsPerCheckpoint: config.validateMaxTxsPerCheckpoint
|
|
624
641
|
}, worldStateSynchronizer, archiver, dateProvider, telemetry);
|
|
625
642
|
let validatorClient;
|
|
626
643
|
if (!proverOnly) {
|
|
@@ -635,7 +652,8 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
635
652
|
blockSource: archiver,
|
|
636
653
|
l1ToL2MessageSource: archiver,
|
|
637
654
|
keyStoreManager,
|
|
638
|
-
blobClient
|
|
655
|
+
blobClient,
|
|
656
|
+
slashingProtectionDb: deps.slashingProtectionDb
|
|
639
657
|
});
|
|
640
658
|
// If we have a validator client, register it as a source of offenses for the slasher,
|
|
641
659
|
// and have it register callbacks on the p2p client *before* we start it, otherwise messages
|
|
@@ -646,21 +664,23 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
646
664
|
await validatorClient.registerHandlers();
|
|
647
665
|
}
|
|
648
666
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
}
|
|
668
|
+
// If there's no validator client, create a BlockProposalHandler to handle block proposals
|
|
669
|
+
// for monitoring or reexecution. Reexecution (default) allows us to follow the pending chain,
|
|
670
|
+
// while non-reexecution is used for validating the proposals and collecting their txs.
|
|
671
|
+
if (!validatorClient) {
|
|
672
|
+
const reexecute = !!config.alwaysReexecuteBlockProposals;
|
|
673
|
+
log.info(`Setting up block proposal handler` + (reexecute ? ' with reexecution of proposals' : ''));
|
|
674
|
+
createBlockProposalHandler(config, {
|
|
675
|
+
checkpointsBuilder: validatorCheckpointsBuilder,
|
|
676
|
+
worldState: worldStateSynchronizer,
|
|
677
|
+
epochCache,
|
|
678
|
+
blockSource: archiver,
|
|
679
|
+
l1ToL2MessageSource: archiver,
|
|
680
|
+
p2pClient,
|
|
681
|
+
dateProvider,
|
|
682
|
+
telemetry
|
|
683
|
+
}).register(p2pClient, reexecute);
|
|
664
684
|
}
|
|
665
685
|
// Start world state and wait for it to sync to the archiver.
|
|
666
686
|
await worldStateSynchronizer.start();
|
|
@@ -692,6 +712,13 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
692
712
|
await attestationsBlockWatcher?.start();
|
|
693
713
|
log.info(`All p2p services started`);
|
|
694
714
|
}).catch((err)=>log.error('Failed to start p2p services after archiver sync', err));
|
|
715
|
+
const globalVariableBuilder = new GlobalVariableBuilder(dateProvider, publicClient, {
|
|
716
|
+
l1Contracts: config.l1Contracts,
|
|
717
|
+
ethereumSlotDuration: config.ethereumSlotDuration,
|
|
718
|
+
rollupVersion: BigInt(config.rollupVersion),
|
|
719
|
+
l1GenesisTime,
|
|
720
|
+
slotDuration: Number(slotDuration)
|
|
721
|
+
});
|
|
695
722
|
// Validator enabled, create/start relevant service
|
|
696
723
|
let sequencer;
|
|
697
724
|
let slasherClient;
|
|
@@ -718,16 +745,34 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
718
745
|
dateProvider,
|
|
719
746
|
kzg: Blob.getViemKzgInstance()
|
|
720
747
|
});
|
|
748
|
+
// Create a funder L1TxUtils from the keystore funding account (if configured)
|
|
749
|
+
const fundingSigner = keyStoreManager?.createFundingSigner();
|
|
750
|
+
let funderL1TxUtils;
|
|
751
|
+
if (fundingSigner) {
|
|
752
|
+
const [funder] = await createL1TxUtilsFromSigners(publicClient, [
|
|
753
|
+
fundingSigner
|
|
754
|
+
], {
|
|
755
|
+
...config,
|
|
756
|
+
scope: 'sequencer'
|
|
757
|
+
}, {
|
|
758
|
+
telemetry,
|
|
759
|
+
logger: log.createChild('l1-tx-utils:funder'),
|
|
760
|
+
dateProvider
|
|
761
|
+
});
|
|
762
|
+
funderL1TxUtils = funder;
|
|
763
|
+
}
|
|
721
764
|
// Create and start the sequencer client
|
|
722
765
|
const checkpointsBuilder = new CheckpointsBuilder({
|
|
723
766
|
...config,
|
|
724
767
|
l1GenesisTime,
|
|
725
|
-
slotDuration: Number(slotDuration)
|
|
768
|
+
slotDuration: Number(slotDuration),
|
|
769
|
+
rollupManaLimit
|
|
726
770
|
}, worldStateSynchronizer, archiver, dateProvider, telemetry, debugLogStore);
|
|
727
771
|
sequencer = await SequencerClient.new(config, {
|
|
728
772
|
...deps,
|
|
729
773
|
epochCache,
|
|
730
774
|
l1TxUtils,
|
|
775
|
+
funderL1TxUtils,
|
|
731
776
|
validatorClient,
|
|
732
777
|
p2pClient,
|
|
733
778
|
worldStateSynchronizer,
|
|
@@ -738,7 +783,8 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
738
783
|
telemetry,
|
|
739
784
|
dateProvider,
|
|
740
785
|
blobClient,
|
|
741
|
-
nodeKeyStore: keyStoreManager
|
|
786
|
+
nodeKeyStore: keyStoreManager,
|
|
787
|
+
globalVariableBuilder
|
|
742
788
|
});
|
|
743
789
|
}
|
|
744
790
|
if (!options.dontStartSequencer && sequencer) {
|
|
@@ -768,13 +814,7 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
768
814
|
log.info(`Prover node subsystem created but not started`);
|
|
769
815
|
}
|
|
770
816
|
}
|
|
771
|
-
const
|
|
772
|
-
...config,
|
|
773
|
-
rollupVersion: BigInt(config.rollupVersion),
|
|
774
|
-
l1GenesisTime,
|
|
775
|
-
slotDuration: Number(slotDuration)
|
|
776
|
-
});
|
|
777
|
-
const node = new AztecNodeService(config, p2pClient, archiver, archiver, archiver, archiver, worldStateSynchronizer, sequencer, proverNode, slasherClient, validatorsSentinel, epochPruneWatcher, ethereumChain.chainInfo.id, config.rollupVersion, globalVariableBuilder, epochCache, packageVersion, proofVerifier, telemetry, log, blobClient, validatorClient, keyStoreManager, debugLogStore);
|
|
817
|
+
const node = new AztecNodeService(config, p2pClient, archiver, archiver, archiver, archiver, worldStateSynchronizer, sequencer, proverNode, slasherClient, validatorsSentinel, epochPruneWatcher, ethereumChain.chainInfo.id, config.rollupVersion, globalVariableBuilder, epochCache, packageVersion, peerProofVerifier, rpcProofVerifier, telemetry, log, blobClient, validatorClient, keyStoreManager, debugLogStore);
|
|
778
818
|
return node;
|
|
779
819
|
}
|
|
780
820
|
/**
|
|
@@ -805,7 +845,10 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
805
845
|
return Promise.resolve(this.p2pClient.getEnr()?.encodeTxt());
|
|
806
846
|
}
|
|
807
847
|
async getAllowedPublicSetup() {
|
|
808
|
-
return
|
|
848
|
+
return [
|
|
849
|
+
...await getDefaultAllowedSetupFunctions(),
|
|
850
|
+
...this.config.txPublicSetupAllowListExtend ?? []
|
|
851
|
+
];
|
|
809
852
|
}
|
|
810
853
|
/**
|
|
811
854
|
* Method to determine if the node is ready to accept transactions.
|
|
@@ -883,6 +926,9 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
883
926
|
async getCheckpointedBlocks(from, limit) {
|
|
884
927
|
return await this.blockSource.getCheckpointedBlocks(from, limit) ?? [];
|
|
885
928
|
}
|
|
929
|
+
getCheckpointsDataForEpoch(epochNumber) {
|
|
930
|
+
return this.blockSource.getCheckpointsDataForEpoch(epochNumber);
|
|
931
|
+
}
|
|
886
932
|
/**
|
|
887
933
|
* Method to fetch the current min L2 fees.
|
|
888
934
|
* @returns The current min L2 fees.
|
|
@@ -910,6 +956,9 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
910
956
|
async getCheckpointedBlockNumber() {
|
|
911
957
|
return await this.blockSource.getCheckpointedL2BlockNumber();
|
|
912
958
|
}
|
|
959
|
+
getCheckpointNumber() {
|
|
960
|
+
return this.blockSource.getCheckpointNumber();
|
|
961
|
+
}
|
|
913
962
|
/**
|
|
914
963
|
* Method to fetch the version of the package.
|
|
915
964
|
* @returns The node package version
|
|
@@ -935,28 +984,36 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
935
984
|
return this.contractDataSource.getContract(address);
|
|
936
985
|
}
|
|
937
986
|
async getPrivateLogsByTags(tags, page, referenceBlock) {
|
|
987
|
+
let upToBlockNumber;
|
|
938
988
|
if (referenceBlock) {
|
|
939
989
|
const initialBlockHash = await this.#getInitialHeaderHash();
|
|
940
|
-
if (
|
|
990
|
+
if (referenceBlock.equals(initialBlockHash)) {
|
|
991
|
+
upToBlockNumber = BlockNumber(0);
|
|
992
|
+
} else {
|
|
941
993
|
const header = await this.blockSource.getBlockHeaderByHash(referenceBlock);
|
|
942
994
|
if (!header) {
|
|
943
995
|
throw new Error(`Block ${referenceBlock.toString()} not found in the node. This might indicate a reorg has occurred.`);
|
|
944
996
|
}
|
|
997
|
+
upToBlockNumber = header.globalVariables.blockNumber;
|
|
945
998
|
}
|
|
946
999
|
}
|
|
947
|
-
return this.logsSource.getPrivateLogsByTags(tags, page);
|
|
1000
|
+
return this.logsSource.getPrivateLogsByTags(tags, page, upToBlockNumber);
|
|
948
1001
|
}
|
|
949
1002
|
async getPublicLogsByTagsFromContract(contractAddress, tags, page, referenceBlock) {
|
|
1003
|
+
let upToBlockNumber;
|
|
950
1004
|
if (referenceBlock) {
|
|
951
1005
|
const initialBlockHash = await this.#getInitialHeaderHash();
|
|
952
|
-
if (
|
|
1006
|
+
if (referenceBlock.equals(initialBlockHash)) {
|
|
1007
|
+
upToBlockNumber = BlockNumber(0);
|
|
1008
|
+
} else {
|
|
953
1009
|
const header = await this.blockSource.getBlockHeaderByHash(referenceBlock);
|
|
954
1010
|
if (!header) {
|
|
955
1011
|
throw new Error(`Block ${referenceBlock.toString()} not found in the node. This might indicate a reorg has occurred.`);
|
|
956
1012
|
}
|
|
1013
|
+
upToBlockNumber = header.globalVariables.blockNumber;
|
|
957
1014
|
}
|
|
958
1015
|
}
|
|
959
|
-
return this.logsSource.getPublicLogsByTagsFromContract(contractAddress, tags, page);
|
|
1016
|
+
return this.logsSource.getPublicLogsByTagsFromContract(contractAddress, tags, page, upToBlockNumber);
|
|
960
1017
|
}
|
|
961
1018
|
/**
|
|
962
1019
|
* Gets public logs based on the provided filter.
|
|
@@ -1029,7 +1086,10 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1029
1086
|
await tryStop(this.validatorsSentinel);
|
|
1030
1087
|
await tryStop(this.epochPruneWatcher);
|
|
1031
1088
|
await tryStop(this.slasherClient);
|
|
1032
|
-
await
|
|
1089
|
+
await Promise.all([
|
|
1090
|
+
tryStop(this.peerProofVerifier),
|
|
1091
|
+
tryStop(this.rpcProofVerifier)
|
|
1092
|
+
]);
|
|
1033
1093
|
await tryStop(this.sequencer);
|
|
1034
1094
|
await tryStop(this.proverNode);
|
|
1035
1095
|
await tryStop(this.p2pClient);
|
|
@@ -1071,70 +1131,82 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1071
1131
|
return compactArray(await Promise.all(txHashes.map((txHash)=>this.getTxByHash(txHash))));
|
|
1072
1132
|
}
|
|
1073
1133
|
async findLeavesIndexes(referenceBlock, treeId, leafValues) {
|
|
1074
|
-
const committedDb = await this
|
|
1134
|
+
const committedDb = await this.getWorldState(referenceBlock);
|
|
1075
1135
|
const maybeIndices = await committedDb.findLeafIndices(treeId, leafValues.map((x)=>x.toBuffer()));
|
|
1076
|
-
//
|
|
1077
|
-
const
|
|
1078
|
-
// Now we find the block numbers for the indices
|
|
1079
|
-
const blockNumbers = await committedDb.getBlockNumbersForLeafIndices(treeId,
|
|
1080
|
-
//
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1136
|
+
// Filter out undefined values to query block numbers only for found leaves
|
|
1137
|
+
const definedIndices = maybeIndices.filter((x)=>x !== undefined);
|
|
1138
|
+
// Now we find the block numbers for the defined indices
|
|
1139
|
+
const blockNumbers = await committedDb.getBlockNumbersForLeafIndices(treeId, definedIndices);
|
|
1140
|
+
// Build a map from leaf index to block number
|
|
1141
|
+
const indexToBlockNumber = new Map();
|
|
1142
|
+
for(let i = 0; i < definedIndices.length; i++){
|
|
1143
|
+
const blockNumber = blockNumbers[i];
|
|
1144
|
+
if (blockNumber === undefined) {
|
|
1145
|
+
throw new Error(`Block number is undefined for leaf index ${definedIndices[i]} in tree ${MerkleTreeId[treeId]}`);
|
|
1084
1146
|
}
|
|
1147
|
+
indexToBlockNumber.set(definedIndices[i], blockNumber);
|
|
1085
1148
|
}
|
|
1086
1149
|
// Get unique block numbers in order to optimize num calls to getLeafValue function.
|
|
1087
1150
|
const uniqueBlockNumbers = [
|
|
1088
|
-
...new Set(
|
|
1151
|
+
...new Set(indexToBlockNumber.values())
|
|
1089
1152
|
];
|
|
1090
|
-
// Now we obtain the block hashes from the archive tree
|
|
1091
|
-
// (note that block number corresponds to the leaf index in the archive tree).
|
|
1153
|
+
// Now we obtain the block hashes from the archive tree (block number = leaf index in archive tree).
|
|
1092
1154
|
const blockHashes = await Promise.all(uniqueBlockNumbers.map((blockNumber)=>{
|
|
1093
1155
|
return committedDb.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(blockNumber));
|
|
1094
1156
|
}));
|
|
1095
|
-
//
|
|
1157
|
+
// Build a map from block number to block hash
|
|
1158
|
+
const blockNumberToHash = new Map();
|
|
1096
1159
|
for(let i = 0; i < uniqueBlockNumbers.length; i++){
|
|
1097
|
-
|
|
1160
|
+
const blockHash = blockHashes[i];
|
|
1161
|
+
if (blockHash === undefined) {
|
|
1098
1162
|
throw new Error(`Block hash is undefined for block number ${uniqueBlockNumbers[i]}`);
|
|
1099
1163
|
}
|
|
1164
|
+
blockNumberToHash.set(uniqueBlockNumbers[i], blockHash);
|
|
1100
1165
|
}
|
|
1101
1166
|
// Create DataInBlock objects by combining indices, blockNumbers and blockHashes and return them.
|
|
1102
|
-
return maybeIndices.map((index
|
|
1167
|
+
return maybeIndices.map((index)=>{
|
|
1103
1168
|
if (index === undefined) {
|
|
1104
1169
|
return undefined;
|
|
1105
1170
|
}
|
|
1106
|
-
const blockNumber =
|
|
1171
|
+
const blockNumber = indexToBlockNumber.get(index);
|
|
1107
1172
|
if (blockNumber === undefined) {
|
|
1108
|
-
|
|
1173
|
+
throw new Error(`Block number not found for leaf index ${index} in tree ${MerkleTreeId[treeId]}`);
|
|
1109
1174
|
}
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
return undefined;
|
|
1175
|
+
const blockHash = blockNumberToHash.get(blockNumber);
|
|
1176
|
+
if (blockHash === undefined) {
|
|
1177
|
+
throw new Error(`Block hash not found for block number ${blockNumber}`);
|
|
1114
1178
|
}
|
|
1115
1179
|
return {
|
|
1116
|
-
l2BlockNumber:
|
|
1180
|
+
l2BlockNumber: blockNumber,
|
|
1117
1181
|
l2BlockHash: new BlockHash(blockHash),
|
|
1118
1182
|
data: index
|
|
1119
1183
|
};
|
|
1120
1184
|
});
|
|
1121
1185
|
}
|
|
1122
1186
|
async getBlockHashMembershipWitness(referenceBlock, blockHash) {
|
|
1123
|
-
|
|
1187
|
+
// The Noir circuit checks the archive membership proof against `anchor_block_header.last_archive.root`,
|
|
1188
|
+
// which is the archive tree root BEFORE the anchor block was added (i.e. the state after block N-1).
|
|
1189
|
+
// So we need the world state at block N-1, not block N, to produce a sibling path matching that root.
|
|
1190
|
+
const referenceBlockNumber = await this.resolveBlockNumber(referenceBlock);
|
|
1191
|
+
if (referenceBlockNumber === BlockNumber.ZERO) {
|
|
1192
|
+
// Block 0 (the initial block) has an empty archive, so no membership witness can exist.
|
|
1193
|
+
return undefined;
|
|
1194
|
+
}
|
|
1195
|
+
const committedDb = await this.getWorldState(BlockNumber(referenceBlockNumber - 1));
|
|
1124
1196
|
const [pathAndIndex] = await committedDb.findSiblingPaths(MerkleTreeId.ARCHIVE, [
|
|
1125
1197
|
blockHash
|
|
1126
1198
|
]);
|
|
1127
1199
|
return pathAndIndex === undefined ? undefined : MembershipWitness.fromSiblingPath(pathAndIndex.index, pathAndIndex.path);
|
|
1128
1200
|
}
|
|
1129
1201
|
async getNoteHashMembershipWitness(referenceBlock, noteHash) {
|
|
1130
|
-
const committedDb = await this
|
|
1202
|
+
const committedDb = await this.getWorldState(referenceBlock);
|
|
1131
1203
|
const [pathAndIndex] = await committedDb.findSiblingPaths(MerkleTreeId.NOTE_HASH_TREE, [
|
|
1132
1204
|
noteHash
|
|
1133
1205
|
]);
|
|
1134
1206
|
return pathAndIndex === undefined ? undefined : MembershipWitness.fromSiblingPath(pathAndIndex.index, pathAndIndex.path);
|
|
1135
1207
|
}
|
|
1136
1208
|
async getL1ToL2MessageMembershipWitness(referenceBlock, l1ToL2Message) {
|
|
1137
|
-
const db = await this
|
|
1209
|
+
const db = await this.getWorldState(referenceBlock);
|
|
1138
1210
|
const [witness] = await db.findSiblingPaths(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, [
|
|
1139
1211
|
l1ToL2Message
|
|
1140
1212
|
]);
|
|
@@ -1147,9 +1219,9 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1147
1219
|
witness.path
|
|
1148
1220
|
];
|
|
1149
1221
|
}
|
|
1150
|
-
async
|
|
1222
|
+
async getL1ToL2MessageCheckpoint(l1ToL2Message) {
|
|
1151
1223
|
const messageIndex = await this.l1ToL2MessageSource.getL1ToL2MessageIndex(l1ToL2Message);
|
|
1152
|
-
return messageIndex ?
|
|
1224
|
+
return messageIndex ? InboxLeaf.checkpointNumberFromIndex(messageIndex) : undefined;
|
|
1153
1225
|
}
|
|
1154
1226
|
/**
|
|
1155
1227
|
* Returns whether an L1 to L2 message is synced by archiver and if it's ready to be included in a block.
|
|
@@ -1166,23 +1238,11 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1166
1238
|
*/ async getL2ToL1Messages(epoch) {
|
|
1167
1239
|
// Assumes `getCheckpointedBlocksForEpoch` returns blocks in ascending order of block number.
|
|
1168
1240
|
const checkpointedBlocks = await this.blockSource.getCheckpointedBlocksForEpoch(epoch);
|
|
1169
|
-
const blocksInCheckpoints =
|
|
1170
|
-
let previousSlotNumber = SlotNumber.ZERO;
|
|
1171
|
-
let checkpointIndex = -1;
|
|
1172
|
-
for (const checkpointedBlock of checkpointedBlocks){
|
|
1173
|
-
const block = checkpointedBlock.block;
|
|
1174
|
-
const slotNumber = block.header.globalVariables.slotNumber;
|
|
1175
|
-
if (slotNumber !== previousSlotNumber) {
|
|
1176
|
-
checkpointIndex++;
|
|
1177
|
-
blocksInCheckpoints.push([]);
|
|
1178
|
-
previousSlotNumber = slotNumber;
|
|
1179
|
-
}
|
|
1180
|
-
blocksInCheckpoints[checkpointIndex].push(block);
|
|
1181
|
-
}
|
|
1241
|
+
const blocksInCheckpoints = chunkBy(checkpointedBlocks, (cb)=>cb.block.header.globalVariables.slotNumber).map((group)=>group.map((cb)=>cb.block));
|
|
1182
1242
|
return blocksInCheckpoints.map((blocks)=>blocks.map((block)=>block.body.txEffects.map((txEffect)=>txEffect.l2ToL1Msgs)));
|
|
1183
1243
|
}
|
|
1184
1244
|
async getNullifierMembershipWitness(referenceBlock, nullifier) {
|
|
1185
|
-
const db = await this
|
|
1245
|
+
const db = await this.getWorldState(referenceBlock);
|
|
1186
1246
|
const [witness] = await db.findSiblingPaths(MerkleTreeId.NULLIFIER_TREE, [
|
|
1187
1247
|
nullifier.toBuffer()
|
|
1188
1248
|
]);
|
|
@@ -1196,36 +1256,22 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1196
1256
|
}
|
|
1197
1257
|
return new NullifierMembershipWitness(index, leafPreimage, path);
|
|
1198
1258
|
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
* @param referenceBlock - The block parameter (block number, block hash, or 'latest') at which to get the data
|
|
1202
|
-
* (which contains the root of the nullifier tree in which we are searching for the nullifier).
|
|
1203
|
-
* @param nullifier - Nullifier we try to find the low nullifier witness for.
|
|
1204
|
-
* @returns The low nullifier membership witness (if found).
|
|
1205
|
-
* @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
|
|
1206
|
-
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
1207
|
-
* we are trying to prove non-inclusion for.
|
|
1208
|
-
*
|
|
1209
|
-
* Note: This function returns the membership witness of the nullifier itself and not the low nullifier when
|
|
1210
|
-
* the nullifier already exists in the tree. This is because the `getPreviousValueIndex` function returns the
|
|
1211
|
-
* index of the nullifier itself when it already exists in the tree.
|
|
1212
|
-
* TODO: This is a confusing behavior and we should eventually address that.
|
|
1213
|
-
*/ async getLowNullifierMembershipWitness(referenceBlock, nullifier) {
|
|
1214
|
-
const committedDb = await this.#getWorldState(referenceBlock);
|
|
1259
|
+
async getLowNullifierMembershipWitness(referenceBlock, nullifier) {
|
|
1260
|
+
const committedDb = await this.getWorldState(referenceBlock);
|
|
1215
1261
|
const findResult = await committedDb.getPreviousValueIndex(MerkleTreeId.NULLIFIER_TREE, nullifier.toBigInt());
|
|
1216
1262
|
if (!findResult) {
|
|
1217
1263
|
return undefined;
|
|
1218
1264
|
}
|
|
1219
1265
|
const { index, alreadyPresent } = findResult;
|
|
1220
1266
|
if (alreadyPresent) {
|
|
1221
|
-
|
|
1267
|
+
throw new Error(`Cannot prove nullifier non-inclusion: nullifier ${nullifier.toBigInt()} already exists in the tree`);
|
|
1222
1268
|
}
|
|
1223
1269
|
const preimageData = await committedDb.getLeafPreimage(MerkleTreeId.NULLIFIER_TREE, index);
|
|
1224
1270
|
const siblingPath = await committedDb.getSiblingPath(MerkleTreeId.NULLIFIER_TREE, BigInt(index));
|
|
1225
1271
|
return new NullifierMembershipWitness(BigInt(index), preimageData, siblingPath);
|
|
1226
1272
|
}
|
|
1227
1273
|
async getPublicDataWitness(referenceBlock, leafSlot) {
|
|
1228
|
-
const committedDb = await this
|
|
1274
|
+
const committedDb = await this.getWorldState(referenceBlock);
|
|
1229
1275
|
const lowLeafResult = await committedDb.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot.toBigInt());
|
|
1230
1276
|
if (!lowLeafResult) {
|
|
1231
1277
|
return undefined;
|
|
@@ -1236,7 +1282,7 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1236
1282
|
}
|
|
1237
1283
|
}
|
|
1238
1284
|
async getPublicStorageAt(referenceBlock, contract, slot) {
|
|
1239
|
-
const committedDb = await this
|
|
1285
|
+
const committedDb = await this.getWorldState(referenceBlock);
|
|
1240
1286
|
const leafSlot = await computePublicDataTreeLeafSlot(contract, slot);
|
|
1241
1287
|
const lowLeafResult = await committedDb.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot.toBigInt());
|
|
1242
1288
|
if (!lowLeafResult || !lowLeafResult.alreadyPresent) {
|
|
@@ -1315,7 +1361,7 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1315
1361
|
});
|
|
1316
1362
|
const processor = publicProcessorFactory.create(merkleTreeFork, newGlobalVariables, config);
|
|
1317
1363
|
// REFACTOR: Consider merging ProcessReturnValues into ProcessedTx
|
|
1318
|
-
const [processedTxs, failedTxs, _usedTxs, returns,
|
|
1364
|
+
const [processedTxs, failedTxs, _usedTxs, returns, debugLogs] = await processor.process([
|
|
1319
1365
|
tx
|
|
1320
1366
|
]);
|
|
1321
1367
|
// REFACTOR: Consider returning the error rather than throwing
|
|
@@ -1333,19 +1379,26 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1333
1379
|
}
|
|
1334
1380
|
async isValidTx(tx, { isSimulation, skipFeeEnforcement } = {}) {
|
|
1335
1381
|
const db = this.worldStateSynchronizer.getCommitted();
|
|
1336
|
-
const verifier = isSimulation ? undefined : this.
|
|
1382
|
+
const verifier = isSimulation ? undefined : this.rpcProofVerifier;
|
|
1337
1383
|
// We accept transactions if they are not expired by the next slot (checked based on the ExpirationTimestamp field)
|
|
1338
1384
|
const { ts: nextSlotTimestamp } = this.epochCache.getEpochAndSlotInNextL1Slot();
|
|
1339
1385
|
const blockNumber = BlockNumber(await this.blockSource.getBlockNumber() + 1);
|
|
1386
|
+
const l1Constants = await this.blockSource.getL1Constants();
|
|
1340
1387
|
const validator = createTxValidatorForAcceptingTxsOverRPC(db, this.contractDataSource, verifier, {
|
|
1341
1388
|
timestamp: nextSlotTimestamp,
|
|
1342
1389
|
blockNumber,
|
|
1343
1390
|
l1ChainId: this.l1ChainId,
|
|
1344
1391
|
rollupVersion: this.version,
|
|
1345
|
-
setupAllowList:
|
|
1392
|
+
setupAllowList: [
|
|
1393
|
+
...await getDefaultAllowedSetupFunctions(),
|
|
1394
|
+
...this.config.txPublicSetupAllowListExtend ?? []
|
|
1395
|
+
],
|
|
1346
1396
|
gasFees: await this.getCurrentMinFees(),
|
|
1347
1397
|
skipFeeEnforcement,
|
|
1348
|
-
txsPermitted: !this.config.disableTransactions
|
|
1398
|
+
txsPermitted: !this.config.disableTransactions,
|
|
1399
|
+
rollupManaLimit: l1Constants.rollupManaLimit,
|
|
1400
|
+
maxBlockL2Gas: this.config.validateMaxL2BlockGas,
|
|
1401
|
+
maxBlockDAGas: this.config.validateMaxDABlockGas
|
|
1349
1402
|
}, this.log.getBindings());
|
|
1350
1403
|
return await validator.validateTx(tx);
|
|
1351
1404
|
}
|
|
@@ -1368,7 +1421,18 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1368
1421
|
archiver.updateConfig(config);
|
|
1369
1422
|
}
|
|
1370
1423
|
if (newConfig.realProofs !== this.config.realProofs) {
|
|
1371
|
-
|
|
1424
|
+
await Promise.all([
|
|
1425
|
+
tryStop(this.peerProofVerifier),
|
|
1426
|
+
tryStop(this.rpcProofVerifier)
|
|
1427
|
+
]);
|
|
1428
|
+
if (newConfig.realProofs) {
|
|
1429
|
+
this.peerProofVerifier = await BatchChonkVerifier.new(newConfig, newConfig.bbChonkVerifyMaxBatch, 'peer');
|
|
1430
|
+
const rpcVerifier = await BBCircuitVerifier.new(newConfig);
|
|
1431
|
+
this.rpcProofVerifier = new QueuedIVCVerifier(rpcVerifier, newConfig.numConcurrentIVCVerifiers);
|
|
1432
|
+
} else {
|
|
1433
|
+
this.peerProofVerifier = new TestCircuitVerifier();
|
|
1434
|
+
this.rpcProofVerifier = new TestCircuitVerifier();
|
|
1435
|
+
}
|
|
1372
1436
|
}
|
|
1373
1437
|
this.config = newConfig;
|
|
1374
1438
|
}
|
|
@@ -1565,7 +1629,7 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1565
1629
|
* Returns an instance of MerkleTreeOperations having first ensured the world state is fully synched
|
|
1566
1630
|
* @param block - The block parameter (block number, block hash, or 'latest') at which to get the data.
|
|
1567
1631
|
* @returns An instance of a committed MerkleTreeOperations
|
|
1568
|
-
*/ async
|
|
1632
|
+
*/ async getWorldState(block) {
|
|
1569
1633
|
let blockSyncedTo = BlockNumber.ZERO;
|
|
1570
1634
|
try {
|
|
1571
1635
|
// Attempt to sync the world state if necessary
|
|
@@ -1577,6 +1641,8 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1577
1641
|
this.log.debug(`Using committed db for block 'latest', world state synced upto ${blockSyncedTo}`);
|
|
1578
1642
|
return this.worldStateSynchronizer.getCommitted();
|
|
1579
1643
|
}
|
|
1644
|
+
// Get the block number, either directly from the parameter or by quering the archiver with the block hash
|
|
1645
|
+
let blockNumber;
|
|
1580
1646
|
if (BlockHash.isBlockHash(block)) {
|
|
1581
1647
|
const initialBlockHash = await this.#getInitialHeaderHash();
|
|
1582
1648
|
if (block.equals(initialBlockHash)) {
|
|
@@ -1587,19 +1653,41 @@ _dec = trackSpan('AztecNodeService.simulatePublicCalls', (tx)=>({
|
|
|
1587
1653
|
if (!header) {
|
|
1588
1654
|
throw new Error(`Block hash ${block.toString()} not found when querying world state. If the node API has been queried with anchor block hash possibly a reorg has occurred.`);
|
|
1589
1655
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
}
|
|
1594
|
-
//
|
|
1595
|
-
{
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1656
|
+
blockNumber = header.getBlockNumber();
|
|
1657
|
+
} else {
|
|
1658
|
+
blockNumber = block;
|
|
1659
|
+
}
|
|
1660
|
+
// Check it's within world state sync range
|
|
1661
|
+
if (blockNumber > blockSyncedTo) {
|
|
1662
|
+
throw new Error(`Queried block ${block} not yet synced by the node (node is synced upto ${blockSyncedTo}).`);
|
|
1663
|
+
}
|
|
1664
|
+
this.log.debug(`Using snapshot for block ${blockNumber}, world state synced upto ${blockSyncedTo}`);
|
|
1665
|
+
const snapshot = this.worldStateSynchronizer.getSnapshot(blockNumber);
|
|
1666
|
+
// Double-check world-state synced to the same block hash as was requested
|
|
1667
|
+
if (BlockHash.isBlockHash(block)) {
|
|
1668
|
+
const blockHash = await snapshot.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(blockNumber));
|
|
1669
|
+
if (!blockHash || !new BlockHash(blockHash).equals(block)) {
|
|
1670
|
+
throw new Error(`Block hash ${block.toString()} not found in world state at block number ${blockNumber}. If the node API has been queried with anchor block hash possibly a reorg has occurred.`);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return snapshot;
|
|
1674
|
+
}
|
|
1675
|
+
/** Resolves a block parameter to a block number. */ async resolveBlockNumber(block) {
|
|
1676
|
+
if (block === 'latest') {
|
|
1677
|
+
return BlockNumber(await this.blockSource.getBlockNumber());
|
|
1678
|
+
}
|
|
1679
|
+
if (BlockHash.isBlockHash(block)) {
|
|
1680
|
+
const initialBlockHash = await this.#getInitialHeaderHash();
|
|
1681
|
+
if (block.equals(initialBlockHash)) {
|
|
1682
|
+
return BlockNumber.ZERO;
|
|
1683
|
+
}
|
|
1684
|
+
const header = await this.blockSource.getBlockHeaderByHash(block);
|
|
1685
|
+
if (!header) {
|
|
1686
|
+
throw new Error(`Block hash ${block.toString()} not found.`);
|
|
1599
1687
|
}
|
|
1600
|
-
|
|
1601
|
-
return this.worldStateSynchronizer.getSnapshot(blockNumber);
|
|
1688
|
+
return header.getBlockNumber();
|
|
1602
1689
|
}
|
|
1690
|
+
return block;
|
|
1603
1691
|
}
|
|
1604
1692
|
/**
|
|
1605
1693
|
* Ensure we fully sync the world state
|