@aztec/kv-store 3.0.0-canary.a9708bd → 3.0.0-manual.20251030

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/config.d.ts CHANGED
@@ -2,7 +2,7 @@ import { type ConfigMappingsType } from '@aztec/foundation/config';
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  export type DataStoreConfig = {
4
4
  dataDirectory: string | undefined;
5
- dataStoreMapSizeKB: number;
5
+ dataStoreMapSizeKb: number;
6
6
  l1Contracts?: {
7
7
  rollupAddress: EthAddress;
8
8
  };
package/dest/config.js CHANGED
@@ -5,9 +5,9 @@ export const dataConfigMappings = {
5
5
  env: 'DATA_DIRECTORY',
6
6
  description: 'Optional dir to store data. If omitted will store in memory.'
7
7
  },
8
- dataStoreMapSizeKB: {
8
+ dataStoreMapSizeKb: {
9
9
  env: 'DATA_STORE_MAP_SIZE_KB',
10
- description: 'DB mapping size to be applied to all key/value stores',
10
+ description: 'The maximum possible size of a data store DB in KB. Can be overridden by component-specific options.',
11
11
  ...numberConfigHelper(128 * 1_024 * 1_024)
12
12
  },
13
13
  l1Contracts: {
@@ -7,7 +7,7 @@ export async function createStore(name, config, log = createLogger('kv-store'))
7
7
  if (typeof dataDirectory !== 'undefined') {
8
8
  dataDirectory = `${dataDirectory}/${name}`;
9
9
  }
10
- log.info(dataDirectory ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKB} KB` : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKB} KB`);
10
+ log.info(dataDirectory ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKb} KB` : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKb} KB`);
11
11
  const store = await AztecIndexedDBStore.open(createLogger('kv-store:indexeddb'), dataDirectory ?? '', false);
12
12
  if (config.l1Contracts?.rollupAddress) {
13
13
  return initStoreForRollup(store, config.l1Contracts.rollupAddress, log);
@@ -8,8 +8,8 @@ export function createStore(name, config, log = createLogger('kv-store')) {
8
8
  if (typeof dataDirectory !== 'undefined') {
9
9
  dataDirectory = join(dataDirectory, name);
10
10
  }
11
- log.info(dataDirectory ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKB} KB` : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKB} KB`);
12
- const store = AztecLmdbStore.open(dataDirectory, config.dataStoreMapSizeKB, false);
11
+ log.info(dataDirectory ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKb} KB` : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKb} KB`);
12
+ const store = AztecLmdbStore.open(dataDirectory, config.dataStoreMapSizeKb, false);
13
13
  if (config.l1Contracts?.rollupAddress) {
14
14
  return initStoreForRollup(store, config.l1Contracts.rollupAddress, log);
15
15
  }
@@ -21,12 +21,12 @@ export async function createStore(name, schemaVersion, config, log = createLogge
21
21
  schemaVersion,
22
22
  rollupAddress,
23
23
  dataDirectory: subDir,
24
- onOpen: (dbDirectory)=>AztecLMDBStoreV2.new(dbDirectory, config.dataStoreMapSizeKB, MAX_READERS, ()=>Promise.resolve(), log)
24
+ onOpen: (dbDirectory)=>AztecLMDBStoreV2.new(dbDirectory, config.dataStoreMapSizeKb, MAX_READERS, ()=>Promise.resolve(), log)
25
25
  });
26
- log.info(`Creating ${name} data store at directory ${subDir} with map size ${config.dataStoreMapSizeKB} KB (LMDB v2)`);
26
+ log.info(`Creating ${name} data store at directory ${subDir} with map size ${config.dataStoreMapSizeKb} KB (LMDB v2)`);
27
27
  [store] = await versionManager.open();
28
28
  } else {
29
- store = await openTmpStore(name, true, config.dataStoreMapSizeKB, MAX_READERS, log);
29
+ store = await openTmpStore(name, true, config.dataStoreMapSizeKb, MAX_READERS, log);
30
30
  }
31
31
  return store;
32
32
  }
@@ -44,7 +44,7 @@
44
44
  {
45
45
  const blocks = event.blocks.map((b)=>b.block);
46
46
  for (const block of blocks){
47
- await this.l2BlockHashesStore.set(block.number, (await block.header.hash()).toString());
47
+ await this.l2BlockHashesStore.set(block.number, (await block.hash()).toString());
48
48
  }
49
49
  await this.l2TipsStore.set('latest', blocks.at(-1).number);
50
50
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/kv-store",
3
- "version": "3.0.0-canary.a9708bd",
3
+ "version": "3.0.0-manual.20251030",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/interfaces/index.js",
@@ -24,10 +24,10 @@
24
24
  "./package.local.json"
25
25
  ],
26
26
  "dependencies": {
27
- "@aztec/ethereum": "3.0.0-canary.a9708bd",
28
- "@aztec/foundation": "3.0.0-canary.a9708bd",
29
- "@aztec/native": "3.0.0-canary.a9708bd",
30
- "@aztec/stdlib": "3.0.0-canary.a9708bd",
27
+ "@aztec/ethereum": "3.0.0-manual.20251030",
28
+ "@aztec/foundation": "3.0.0-manual.20251030",
29
+ "@aztec/native": "3.0.0-manual.20251030",
30
+ "@aztec/stdlib": "3.0.0-manual.20251030",
31
31
  "idb": "^8.0.0",
32
32
  "lmdb": "^3.2.0",
33
33
  "msgpackr": "^1.11.2",
package/src/config.ts CHANGED
@@ -4,7 +4,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
4
4
 
5
5
  export type DataStoreConfig = {
6
6
  dataDirectory: string | undefined;
7
- dataStoreMapSizeKB: number;
7
+ dataStoreMapSizeKb: number;
8
8
  l1Contracts?: { rollupAddress: EthAddress };
9
9
  };
10
10
 
@@ -13,9 +13,9 @@ export const dataConfigMappings: ConfigMappingsType<DataStoreConfig> = {
13
13
  env: 'DATA_DIRECTORY',
14
14
  description: 'Optional dir to store data. If omitted will store in memory.',
15
15
  },
16
- dataStoreMapSizeKB: {
16
+ dataStoreMapSizeKb: {
17
17
  env: 'DATA_STORE_MAP_SIZE_KB',
18
- description: 'DB mapping size to be applied to all key/value stores',
18
+ description: 'The maximum possible size of a data store DB in KB. Can be overridden by component-specific options.',
19
19
  ...numberConfigHelper(128 * 1_024 * 1_024), // Defaulted to 128 GB
20
20
  },
21
21
  l1Contracts: {
@@ -14,8 +14,8 @@ export async function createStore(name: string, config: DataStoreConfig, log: Lo
14
14
 
15
15
  log.info(
16
16
  dataDirectory
17
- ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKB} KB`
18
- : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKB} KB`,
17
+ ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKb} KB`
18
+ : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKb} KB`,
19
19
  );
20
20
  const store = await AztecIndexedDBStore.open(createLogger('kv-store:indexeddb'), dataDirectory ?? '', false);
21
21
  if (config.l1Contracts?.rollupAddress) {
package/src/lmdb/index.ts CHANGED
@@ -16,11 +16,11 @@ export function createStore(name: string, config: DataStoreConfig, log: Logger =
16
16
 
17
17
  log.info(
18
18
  dataDirectory
19
- ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKB} KB`
20
- : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKB} KB`,
19
+ ? `Creating ${name} data store at directory ${dataDirectory} with map size ${config.dataStoreMapSizeKb} KB`
20
+ : `Creating ${name} ephemeral data store with map size ${config.dataStoreMapSizeKb} KB`,
21
21
  );
22
22
 
23
- const store = AztecLmdbStore.open(dataDirectory, config.dataStoreMapSizeKB, false);
23
+ const store = AztecLmdbStore.open(dataDirectory, config.dataStoreMapSizeKb, false);
24
24
  if (config.l1Contracts?.rollupAddress) {
25
25
  return initStoreForRollup(store, config.l1Contracts.rollupAddress, log);
26
26
  }
@@ -33,15 +33,15 @@ export async function createStore(
33
33
  rollupAddress,
34
34
  dataDirectory: subDir,
35
35
  onOpen: dbDirectory =>
36
- AztecLMDBStoreV2.new(dbDirectory, config.dataStoreMapSizeKB, MAX_READERS, () => Promise.resolve(), log),
36
+ AztecLMDBStoreV2.new(dbDirectory, config.dataStoreMapSizeKb, MAX_READERS, () => Promise.resolve(), log),
37
37
  });
38
38
 
39
39
  log.info(
40
- `Creating ${name} data store at directory ${subDir} with map size ${config.dataStoreMapSizeKB} KB (LMDB v2)`,
40
+ `Creating ${name} data store at directory ${subDir} with map size ${config.dataStoreMapSizeKb} KB (LMDB v2)`,
41
41
  );
42
42
  [store] = await versionManager.open();
43
43
  } else {
44
- store = await openTmpStore(name, true, config.dataStoreMapSizeKB, MAX_READERS, log);
44
+ store = await openTmpStore(name, true, config.dataStoreMapSizeKb, MAX_READERS, log);
45
45
  }
46
46
 
47
47
  return store;
@@ -50,7 +50,7 @@ export class L2TipsKVStore implements L2BlockStreamEventHandler, L2BlockStreamLo
50
50
  case 'blocks-added': {
51
51
  const blocks = event.blocks.map(b => b.block);
52
52
  for (const block of blocks) {
53
- await this.l2BlockHashesStore.set(block.number, (await block.header.hash()).toString());
53
+ await this.l2BlockHashesStore.set(block.number, (await block.hash()).toString());
54
54
  }
55
55
  await this.l2TipsStore.set('latest', blocks.at(-1)!.number);
56
56
  break;