@aztec/node-lib 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a
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/actions/snapshot-sync.d.ts +2 -2
- package/dest/actions/snapshot-sync.d.ts.map +1 -1
- package/dest/actions/snapshot-sync.js +12 -9
- package/dest/factories/l1_tx_utils.js +1 -1
- package/package.json +20 -20
- package/src/actions/snapshot-sync.ts +20 -11
- package/src/factories/l1_tx_utils.ts +1 -1
|
@@ -8,7 +8,7 @@ import { type ReadOnlyFileStore } from '@aztec/stdlib/file-store';
|
|
|
8
8
|
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
9
9
|
import { type SnapshotMetadata } from '@aztec/stdlib/snapshots';
|
|
10
10
|
import type { SharedNodeConfig } from '../config/index.js';
|
|
11
|
-
type SnapshotSyncConfig = Pick<SharedNodeConfig, 'syncMode'> & Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> & Pick<L1ContractsConfig, 'aztecEpochDuration'> & Pick<ArchiverConfig, 'archiverStoreMapSizeKb'
|
|
11
|
+
type SnapshotSyncConfig = Pick<SharedNodeConfig, 'syncMode'> & Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> & Pick<L1ContractsConfig, 'aztecEpochDuration'> & Pick<ArchiverConfig, 'archiverStoreMapSizeKb'> & DataStoreConfig & Required<Pick<DataStoreConfig, 'rollupAddress'>> & EthereumClientConfig & {
|
|
12
12
|
snapshotsUrls?: string[];
|
|
13
13
|
minL1BlocksToTriggerReplace?: number;
|
|
14
14
|
};
|
|
@@ -26,4 +26,4 @@ export declare function snapshotSync(snapshot: Pick<SnapshotMetadata, 'dataUrls'
|
|
|
26
26
|
fileStore: ReadOnlyFileStore;
|
|
27
27
|
}): Promise<void>;
|
|
28
28
|
export {};
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hcHNob3Qtc3luYy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FjdGlvbnMvc25hcHNob3Qtc3luYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBR0wsS0FBSyxjQUFjLEVBR3BCLE1BQU0saUJBQWlCLENBQUM7QUFFekIsT0FBTyxFQUFFLEtBQUssb0JBQW9CLEVBQW1CLE1BQU0sd0JBQXdCLENBQUM7QUFDcEYsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUVoRSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUdwRCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV4RCxPQUFPLEVBQUUsS0FBSyxpQkFBaUIsRUFBMkIsTUFBTSwwQkFBMEIsQ0FBQztBQUMzRixPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM5RCxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFLdEIsTUFBTSx5QkFBeUIsQ0FBQztBQU1qQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSzNELEtBQUssa0JBQWtCLEdBQUcsSUFBSSxDQUFDLGdCQUFnQixFQUFFLFVBQVUsQ0FBQyxHQUMxRCxJQUFJLENBQUMsV0FBVyxFQUFFLFdBQVcsR0FBRyxlQUFlLENBQUMsR0FDaEQsSUFBSSxDQUFDLGlCQUFpQixFQUFFLG9CQUFvQixDQUFDLEdBQzdDLElBQUksQ0FBQyxjQUFjLEVBQUUsd0JBQXdCLENBQUMsR0FDOUMsZUFBZSxHQUNmLFFBQVEsQ0FBQyxJQUFJLENBQUMsZUFBZSxFQUFFLGVBQWUsQ0FBQyxDQUFDLEdBQ2hELG9CQUFvQixHQUFHO0lBQ3JCLGFBQWEsQ0FBQyxFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQ3pCLDJCQUEyQixDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ3RDLENBQUM7QUFFSjs7O0dBR0c7QUFDSCx3QkFBc0IsZUFBZSxDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxHQUFHLEVBQUUsTUFBTSxvQkF1SzVFO0FBRUQ7O0dBRUc7QUFDSCx3QkFBc0IsWUFBWSxDQUNoQyxRQUFRLEVBQUUsSUFBSSxDQUFDLGdCQUFnQixFQUFFLFVBQVUsQ0FBQyxFQUM1QyxHQUFHLEVBQUUsTUFBTSxFQUNYLE1BQU0sRUFBRTtJQUFFLGFBQWEsRUFBRSxNQUFNLENBQUM7SUFBQyxhQUFhLEVBQUUsVUFBVSxDQUFDO0lBQUMsU0FBUyxFQUFFLGlCQUFpQixDQUFBO0NBQUUsaUJBbUQzRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-sync.d.ts","sourceRoot":"","sources":["../../src/actions/snapshot-sync.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"snapshot-sync.d.ts","sourceRoot":"","sources":["../../src/actions/snapshot-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,0BAA0B,CAAC;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,KAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAC1D,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe,CAAC,GAChD,IAAI,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAC7C,IAAI,CAAC,cAAc,EAAE,wBAAwB,CAAC,GAC9C,eAAe,GACf,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,GAChD,oBAAoB,GAAG;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC;AAEJ;;;GAGG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,oBAuK5E;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC5C,GAAG,EAAE,MAAM,EACX,MAAM,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,iBAmD3F"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ARCHIVER_DB_VERSION, ARCHIVER_STORE_NAME, createArchiverStore } from '@aztec/archiver';
|
|
1
|
+
import { ARCHIVER_DB_VERSION, ARCHIVER_STORE_NAME, createArchiverStore, getArchiverSynchPoint } from '@aztec/archiver';
|
|
2
2
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
3
3
|
import { getPublicClient } from '@aztec/ethereum/client';
|
|
4
4
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
5
5
|
import { P2P_STORE_NAME } from '@aztec/p2p';
|
|
6
|
+
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/stdlib/block';
|
|
6
7
|
import { DatabaseVersionManager } from '@aztec/stdlib/database-version/manager';
|
|
7
8
|
import { createReadOnlyFileStore } from '@aztec/stdlib/file-store';
|
|
8
9
|
import { downloadSnapshot, getLatestSnapshotMetadata, makeSnapshotPaths } from '@aztec/stdlib/snapshots';
|
|
@@ -15,7 +16,7 @@ const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12;
|
|
|
15
16
|
* Connects to a remote snapshot index and downloads the latest snapshot if the local archiver is behind.
|
|
16
17
|
* Behaviour depends on syncing mode.
|
|
17
18
|
*/ export async function trySnapshotSync(config, log) {
|
|
18
|
-
const { syncMode, snapshotsUrls, dataDirectory, l1ChainId, rollupVersion,
|
|
19
|
+
const { syncMode, snapshotsUrls, dataDirectory, l1ChainId, rollupVersion, rollupAddress } = config;
|
|
19
20
|
if (syncMode === 'full') {
|
|
20
21
|
log.debug('Snapshot sync is disabled. Running full sync.', {
|
|
21
22
|
syncMode: syncMode
|
|
@@ -30,22 +31,24 @@ const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12;
|
|
|
30
31
|
log.verbose('Snapshot sync is disabled. No local data directory defined.');
|
|
31
32
|
return false;
|
|
32
33
|
}
|
|
33
|
-
// Create an archiver store to check the current state (do this only once)
|
|
34
|
+
// Create an archiver store to check the current state (do this only once). This temporary store is only
|
|
35
|
+
// read for its sync point and never serves tagged-log queries, so the genesis block hash it carries is
|
|
36
|
+
// immaterial — pass the protocol constant.
|
|
34
37
|
log.verbose(`Creating temporary archiver data store`);
|
|
35
|
-
const archiverStore = await createArchiverStore(config);
|
|
38
|
+
const archiverStore = await createArchiverStore(config, GENESIS_BLOCK_HEADER_HASH);
|
|
36
39
|
let archiverL1BlockNumber;
|
|
37
40
|
let archiverL2BlockNumber;
|
|
38
41
|
try {
|
|
39
42
|
[archiverL1BlockNumber, archiverL2BlockNumber] = await Promise.all([
|
|
40
|
-
archiverStore
|
|
41
|
-
archiverStore.
|
|
43
|
+
getArchiverSynchPoint(archiverStore).then((s)=>s.blocksSynchedTo),
|
|
44
|
+
archiverStore.blocks.getLatestL2BlockNumber()
|
|
42
45
|
]);
|
|
43
46
|
} finally{
|
|
44
47
|
log.verbose(`Closing temporary archiver data store`, {
|
|
45
48
|
archiverL1BlockNumber,
|
|
46
49
|
archiverL2BlockNumber
|
|
47
50
|
});
|
|
48
|
-
await archiverStore.close();
|
|
51
|
+
await archiverStore.db.close();
|
|
49
52
|
}
|
|
50
53
|
const minL1BlocksToTriggerReplace = config.minL1BlocksToTriggerReplace ?? MIN_L1_BLOCKS_TO_TRIGGER_REPLACE;
|
|
51
54
|
if (syncMode === 'snapshot' && archiverL2BlockNumber !== undefined && archiverL2BlockNumber >= INITIAL_L2_BLOCK_NUM) {
|
|
@@ -64,7 +67,7 @@ const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12;
|
|
|
64
67
|
const indexMetadata = {
|
|
65
68
|
l1ChainId,
|
|
66
69
|
rollupVersion,
|
|
67
|
-
rollupAddress
|
|
70
|
+
rollupAddress
|
|
68
71
|
};
|
|
69
72
|
const snapshotCandidates = [];
|
|
70
73
|
for (const snapshotsUrl of snapshotsUrls){
|
|
@@ -141,7 +144,7 @@ const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12;
|
|
|
141
144
|
try {
|
|
142
145
|
await snapshotSync(snapshot, log, {
|
|
143
146
|
dataDirectory: config.dataDirectory,
|
|
144
|
-
rollupAddress: config.
|
|
147
|
+
rollupAddress: config.rollupAddress,
|
|
145
148
|
fileStore
|
|
146
149
|
});
|
|
147
150
|
log.info(`Snapshot synced to L1 block ${l1BlockNumber} L2 block ${l2BlockNumber}`, {
|
|
@@ -13,7 +13,7 @@ const L1_TX_STORE_NAME = 'l1-tx-utils';
|
|
|
13
13
|
const logger = deps.logger ?? createLogger('l1-tx-utils');
|
|
14
14
|
// Note that we do NOT bind them to the rollup address, since we still need to
|
|
15
15
|
// monitor and cancel txs for previous rollups to free up our nonces.
|
|
16
|
-
const noRollupConfig = omit(config, '
|
|
16
|
+
const noRollupConfig = omit(config, 'rollupAddress');
|
|
17
17
|
const kvStore = await createStore(L1_TX_STORE_NAME, L1TxStore.SCHEMA_VERSION, noRollupConfig, logger.getBindings());
|
|
18
18
|
const store = new L1TxStore(kvStore, logger);
|
|
19
19
|
const meter = deps.telemetry.getMeter('L1TxUtils');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/node-lib",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.b3d3157a",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"typedocOptions": {
|
|
6
6
|
"entryPoints": [
|
|
@@ -66,28 +66,28 @@
|
|
|
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-client": "0.0.1-commit.
|
|
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/p2p": "0.0.1-commit.
|
|
78
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
79
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
80
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
81
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
82
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
83
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
84
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
85
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
69
|
+
"@aztec/archiver": "0.0.1-commit.b3d3157a",
|
|
70
|
+
"@aztec/bb-prover": "0.0.1-commit.b3d3157a",
|
|
71
|
+
"@aztec/blob-client": "0.0.1-commit.b3d3157a",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.b3d3157a",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.b3d3157a",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.b3d3157a",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.b3d3157a",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.b3d3157a",
|
|
77
|
+
"@aztec/p2p": "0.0.1-commit.b3d3157a",
|
|
78
|
+
"@aztec/protocol-contracts": "0.0.1-commit.b3d3157a",
|
|
79
|
+
"@aztec/prover-client": "0.0.1-commit.b3d3157a",
|
|
80
|
+
"@aztec/sequencer-client": "0.0.1-commit.b3d3157a",
|
|
81
|
+
"@aztec/simulator": "0.0.1-commit.b3d3157a",
|
|
82
|
+
"@aztec/stdlib": "0.0.1-commit.b3d3157a",
|
|
83
|
+
"@aztec/telemetry-client": "0.0.1-commit.b3d3157a",
|
|
84
|
+
"@aztec/validator-client": "0.0.1-commit.b3d3157a",
|
|
85
|
+
"@aztec/world-state": "0.0.1-commit.b3d3157a",
|
|
86
86
|
"tslib": "^2.4.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
90
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
89
|
+
"@aztec/blob-lib": "0.0.1-commit.b3d3157a",
|
|
90
|
+
"@aztec/node-keystore": "0.0.1-commit.b3d3157a",
|
|
91
91
|
"@jest/globals": "^30.0.0",
|
|
92
92
|
"@types/jest": "^30.0.0",
|
|
93
93
|
"@types/node": "^22.15.17",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ARCHIVER_DB_VERSION,
|
|
3
|
+
ARCHIVER_STORE_NAME,
|
|
4
|
+
type ArchiverConfig,
|
|
5
|
+
createArchiverStore,
|
|
6
|
+
getArchiverSynchPoint,
|
|
7
|
+
} from '@aztec/archiver';
|
|
2
8
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
3
9
|
import { type EthereumClientConfig, getPublicClient } from '@aztec/ethereum/client';
|
|
4
10
|
import type { L1ContractsConfig } from '@aztec/ethereum/config';
|
|
@@ -6,6 +12,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
6
12
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
7
13
|
import type { Logger } from '@aztec/foundation/log';
|
|
8
14
|
import { P2P_STORE_NAME } from '@aztec/p2p';
|
|
15
|
+
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/stdlib/block';
|
|
9
16
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
10
17
|
import { DatabaseVersionManager } from '@aztec/stdlib/database-version/manager';
|
|
11
18
|
import { type ReadOnlyFileStore, createReadOnlyFileStore } from '@aztec/stdlib/file-store';
|
|
@@ -30,9 +37,9 @@ const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12;
|
|
|
30
37
|
type SnapshotSyncConfig = Pick<SharedNodeConfig, 'syncMode'> &
|
|
31
38
|
Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
|
|
32
39
|
Pick<L1ContractsConfig, 'aztecEpochDuration'> &
|
|
33
|
-
Pick<ArchiverConfig, 'archiverStoreMapSizeKb'
|
|
40
|
+
Pick<ArchiverConfig, 'archiverStoreMapSizeKb'> &
|
|
34
41
|
DataStoreConfig &
|
|
35
|
-
Required<Pick<DataStoreConfig, '
|
|
42
|
+
Required<Pick<DataStoreConfig, 'rollupAddress'>> &
|
|
36
43
|
EthereumClientConfig & {
|
|
37
44
|
snapshotsUrls?: string[];
|
|
38
45
|
minL1BlocksToTriggerReplace?: number;
|
|
@@ -43,7 +50,7 @@ type SnapshotSyncConfig = Pick<SharedNodeConfig, 'syncMode'> &
|
|
|
43
50
|
* Behaviour depends on syncing mode.
|
|
44
51
|
*/
|
|
45
52
|
export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) {
|
|
46
|
-
const { syncMode, snapshotsUrls, dataDirectory, l1ChainId, rollupVersion,
|
|
53
|
+
const { syncMode, snapshotsUrls, dataDirectory, l1ChainId, rollupVersion, rollupAddress } = config;
|
|
47
54
|
if (syncMode === 'full') {
|
|
48
55
|
log.debug('Snapshot sync is disabled. Running full sync.', { syncMode: syncMode });
|
|
49
56
|
return false;
|
|
@@ -59,19 +66,21 @@ export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) {
|
|
|
59
66
|
return false;
|
|
60
67
|
}
|
|
61
68
|
|
|
62
|
-
// Create an archiver store to check the current state (do this only once)
|
|
69
|
+
// Create an archiver store to check the current state (do this only once). This temporary store is only
|
|
70
|
+
// read for its sync point and never serves tagged-log queries, so the genesis block hash it carries is
|
|
71
|
+
// immaterial — pass the protocol constant.
|
|
63
72
|
log.verbose(`Creating temporary archiver data store`);
|
|
64
|
-
const archiverStore = await createArchiverStore(config);
|
|
73
|
+
const archiverStore = await createArchiverStore(config, GENESIS_BLOCK_HEADER_HASH);
|
|
65
74
|
let archiverL1BlockNumber: bigint | undefined;
|
|
66
75
|
let archiverL2BlockNumber: number | undefined;
|
|
67
76
|
try {
|
|
68
77
|
[archiverL1BlockNumber, archiverL2BlockNumber] = await Promise.all([
|
|
69
|
-
archiverStore
|
|
70
|
-
archiverStore.
|
|
78
|
+
getArchiverSynchPoint(archiverStore).then(s => s.blocksSynchedTo),
|
|
79
|
+
archiverStore.blocks.getLatestL2BlockNumber(),
|
|
71
80
|
] as const);
|
|
72
81
|
} finally {
|
|
73
82
|
log.verbose(`Closing temporary archiver data store`, { archiverL1BlockNumber, archiverL2BlockNumber });
|
|
74
|
-
await archiverStore.close();
|
|
83
|
+
await archiverStore.db.close();
|
|
75
84
|
}
|
|
76
85
|
|
|
77
86
|
const minL1BlocksToTriggerReplace = config.minL1BlocksToTriggerReplace ?? MIN_L1_BLOCKS_TO_TRIGGER_REPLACE;
|
|
@@ -100,7 +109,7 @@ export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) {
|
|
|
100
109
|
const indexMetadata: SnapshotsIndexMetadata = {
|
|
101
110
|
l1ChainId,
|
|
102
111
|
rollupVersion,
|
|
103
|
-
rollupAddress
|
|
112
|
+
rollupAddress,
|
|
104
113
|
};
|
|
105
114
|
|
|
106
115
|
// Fetch latest snapshot from each URL
|
|
@@ -188,7 +197,7 @@ export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) {
|
|
|
188
197
|
try {
|
|
189
198
|
await snapshotSync(snapshot, log, {
|
|
190
199
|
dataDirectory: config.dataDirectory!,
|
|
191
|
-
rollupAddress: config.
|
|
200
|
+
rollupAddress: config.rollupAddress,
|
|
192
201
|
fileStore,
|
|
193
202
|
});
|
|
194
203
|
log.info(`Snapshot synced to L1 block ${l1BlockNumber} L2 block ${l2BlockNumber}`, {
|
|
@@ -34,7 +34,7 @@ async function createSharedDeps(
|
|
|
34
34
|
|
|
35
35
|
// Note that we do NOT bind them to the rollup address, since we still need to
|
|
36
36
|
// monitor and cancel txs for previous rollups to free up our nonces.
|
|
37
|
-
const noRollupConfig = omit(config, '
|
|
37
|
+
const noRollupConfig = omit(config, 'rollupAddress');
|
|
38
38
|
const kvStore = await createStore(L1_TX_STORE_NAME, L1TxStore.SCHEMA_VERSION, noRollupConfig, logger.getBindings());
|
|
39
39
|
const store = new L1TxStore(kvStore, logger);
|
|
40
40
|
|