@aztec/kv-store 0.0.0-test.1 → 0.0.1-commit.b655e406
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 +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +5 -3
- package/dest/indexeddb/array.d.ts +2 -1
- package/dest/indexeddb/array.d.ts.map +1 -1
- package/dest/indexeddb/array.js +3 -0
- package/dest/indexeddb/index.js +1 -1
- package/dest/indexeddb/map.d.ts +11 -5
- package/dest/indexeddb/map.d.ts.map +1 -1
- package/dest/indexeddb/map.js +38 -60
- package/dest/indexeddb/multi_map.d.ts +12 -0
- package/dest/indexeddb/multi_map.d.ts.map +1 -0
- package/dest/indexeddb/multi_map.js +78 -0
- package/dest/indexeddb/singleton.d.ts +2 -1
- package/dest/indexeddb/singleton.d.ts.map +1 -1
- package/dest/indexeddb/singleton.js +3 -1
- package/dest/indexeddb/store.d.ts +12 -13
- package/dest/indexeddb/store.d.ts.map +1 -1
- package/dest/indexeddb/store.js +45 -42
- package/dest/interfaces/array.d.ts +4 -3
- package/dest/interfaces/array.d.ts.map +1 -1
- package/dest/interfaces/array.js +1 -3
- package/dest/interfaces/common.d.ts +10 -8
- package/dest/interfaces/common.d.ts.map +1 -1
- package/dest/interfaces/common.js +8 -3
- package/dest/interfaces/index.d.ts +3 -1
- package/dest/interfaces/index.d.ts.map +1 -1
- package/dest/interfaces/index.js +2 -0
- package/dest/interfaces/map.d.ts +20 -48
- package/dest/interfaces/map.d.ts.map +1 -1
- package/dest/interfaces/map.js +1 -1
- package/dest/interfaces/map_test_suite.d.ts.map +1 -1
- package/dest/interfaces/map_test_suite.js +135 -70
- package/dest/interfaces/multi_map.d.ts +35 -0
- package/dest/interfaces/multi_map.d.ts.map +1 -0
- package/dest/interfaces/multi_map.js +3 -0
- package/dest/interfaces/multi_map_test_suite.d.ts +3 -0
- package/dest/interfaces/multi_map_test_suite.d.ts.map +1 -0
- package/dest/interfaces/multi_map_test_suite.js +245 -0
- package/dest/interfaces/store.d.ts +17 -42
- package/dest/interfaces/store.d.ts.map +1 -1
- package/dest/interfaces/utils.d.ts +1 -0
- package/dest/interfaces/utils.d.ts.map +1 -1
- package/dest/interfaces/utils.js +2 -1
- package/dest/lmdb/array.d.ts +2 -1
- package/dest/lmdb/array.d.ts.map +1 -1
- package/dest/lmdb/index.js +2 -2
- package/dest/lmdb/map.d.ts +10 -22
- package/dest/lmdb/map.d.ts.map +1 -1
- package/dest/lmdb/map.js +15 -81
- package/dest/lmdb/multi_map.d.ts +12 -0
- package/dest/lmdb/multi_map.d.ts.map +1 -0
- package/dest/lmdb/multi_map.js +29 -0
- package/dest/lmdb/store.d.ts +7 -22
- package/dest/lmdb/store.d.ts.map +1 -1
- package/dest/lmdb/store.js +11 -31
- package/dest/lmdb-v2/array.d.ts +2 -1
- package/dest/lmdb-v2/array.d.ts.map +1 -1
- package/dest/lmdb-v2/array.js +1 -0
- package/dest/lmdb-v2/factory.d.ts +1 -1
- package/dest/lmdb-v2/factory.d.ts.map +1 -1
- package/dest/lmdb-v2/factory.js +16 -6
- package/dest/lmdb-v2/map.d.ts +10 -43
- package/dest/lmdb-v2/map.d.ts.map +1 -1
- package/dest/lmdb-v2/map.js +17 -103
- package/dest/lmdb-v2/message.d.ts +23 -4
- package/dest/lmdb-v2/message.d.ts.map +1 -1
- package/dest/lmdb-v2/message.js +6 -4
- package/dest/lmdb-v2/multi_map.d.ts +51 -0
- package/dest/lmdb-v2/multi_map.d.ts.map +1 -0
- package/dest/lmdb-v2/multi_map.js +113 -0
- package/dest/lmdb-v2/read_transaction.d.ts +2 -0
- package/dest/lmdb-v2/read_transaction.d.ts.map +1 -1
- package/dest/lmdb-v2/read_transaction.js +34 -0
- package/dest/lmdb-v2/set.d.ts +15 -0
- package/dest/lmdb-v2/set.d.ts.map +1 -0
- package/dest/lmdb-v2/set.js +23 -0
- package/dest/lmdb-v2/singleton.d.ts.map +1 -1
- package/dest/lmdb-v2/singleton.js +1 -0
- package/dest/lmdb-v2/store.d.ts +9 -8
- package/dest/lmdb-v2/store.d.ts.map +1 -1
- package/dest/lmdb-v2/store.js +19 -7
- package/dest/lmdb-v2/utils.d.ts +2 -4
- package/dest/lmdb-v2/utils.d.ts.map +1 -1
- package/dest/lmdb-v2/write_transaction.d.ts +2 -4
- package/dest/lmdb-v2/write_transaction.d.ts.map +1 -1
- package/dest/stores/index.d.ts +1 -0
- package/dest/stores/index.d.ts.map +1 -1
- package/dest/stores/index.js +1 -0
- package/dest/stores/l2_tips_store.d.ts +2 -1
- package/dest/stores/l2_tips_store.d.ts.map +1 -1
- package/dest/stores/l2_tips_store.js +18 -9
- package/package.json +18 -14
- package/src/config.ts +6 -4
- package/src/indexeddb/array.ts +5 -1
- package/src/indexeddb/index.ts +2 -2
- package/src/indexeddb/map.ts +35 -53
- package/src/indexeddb/multi_map.ts +79 -0
- package/src/indexeddb/singleton.ts +4 -1
- package/src/indexeddb/store.ts +66 -56
- package/src/interfaces/array.ts +5 -3
- package/src/interfaces/common.ts +20 -9
- package/src/interfaces/index.ts +3 -1
- package/src/interfaces/map.ts +19 -53
- package/src/interfaces/map_test_suite.ts +73 -44
- package/src/interfaces/multi_map.ts +38 -0
- package/src/interfaces/multi_map_test_suite.ts +242 -0
- package/src/interfaces/store.ts +18 -53
- package/src/interfaces/utils.ts +1 -0
- package/src/lmdb/array.ts +2 -1
- package/src/lmdb/index.ts +3 -3
- package/src/lmdb/map.ts +23 -94
- package/src/lmdb/multi_map.ts +35 -0
- package/src/lmdb/store.ts +23 -47
- package/src/lmdb-v2/array.ts +7 -2
- package/src/lmdb-v2/factory.ts +17 -10
- package/src/lmdb-v2/map.ts +29 -126
- package/src/lmdb-v2/message.ts +23 -0
- package/src/lmdb-v2/multi_map.ts +141 -0
- package/src/lmdb-v2/read_transaction.ts +40 -0
- package/src/lmdb-v2/set.ts +33 -0
- package/src/lmdb-v2/singleton.ts +5 -1
- package/src/lmdb-v2/store.ts +22 -14
- package/src/lmdb-v2/write_transaction.ts +2 -2
- package/src/stores/index.ts +2 -0
- package/src/stores/l2_tips_store.ts +18 -9
- package/dest/interfaces/store_test_suite.d.ts +0 -3
- package/dest/interfaces/store_test_suite.d.ts.map +0 -1
- package/dest/interfaces/store_test_suite.js +0 -37
- package/src/interfaces/store_test_suite.ts +0 -56
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
|
-
|
|
5
|
+
dataStoreMapSizeKb: number;
|
|
6
6
|
l1Contracts?: {
|
|
7
7
|
rollupAddress: EthAddress;
|
|
8
8
|
};
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,eAAe,CAgBlE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD"}
|
package/dest/config.js
CHANGED
|
@@ -5,14 +5,16 @@ 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
|
-
|
|
8
|
+
dataStoreMapSizeKb: {
|
|
9
9
|
env: 'DATA_STORE_MAP_SIZE_KB',
|
|
10
|
-
description: '
|
|
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: {
|
|
14
14
|
description: 'The deployed L1 contract addresses',
|
|
15
|
-
nested:
|
|
15
|
+
nested: {
|
|
16
|
+
rollupAddress: l1ContractAddressesMapping.rollupAddress
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
2
|
import type { AztecAsyncArray } from '../interfaces/array.js';
|
|
3
|
+
import type { Value } from '../interfaces/common.js';
|
|
3
4
|
import type { AztecIDBSchema } from './store.js';
|
|
4
5
|
/**
|
|
5
6
|
* A persistent array backed by IndexedDB.
|
|
6
7
|
*/
|
|
7
|
-
export declare class IndexedDBAztecArray<T> implements AztecAsyncArray<T> {
|
|
8
|
+
export declare class IndexedDBAztecArray<T extends Value> implements AztecAsyncArray<T> {
|
|
8
9
|
#private;
|
|
9
10
|
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, name: string);
|
|
10
11
|
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/indexeddb/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/indexeddb/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,KAAK,CAAE,YAAW,eAAe,CAAC,CAAC,CAAC;;gBAMjE,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM;IAM9D,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,IAAI,EAAE,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAEvE;IAEK,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ9B,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBnC,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAa7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAW9C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAsB7C,YAAY,IAAI,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAQlD,WAAW,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAM9C,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC;CAOnD"}
|
package/dest/indexeddb/array.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hash } from 'ohash';
|
|
1
2
|
/**
|
|
2
3
|
* A persistent array backed by IndexedDB.
|
|
3
4
|
*/ export class IndexedDBAztecArray {
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
for (const val of vals){
|
|
31
32
|
await this.db.put({
|
|
32
33
|
value: val,
|
|
34
|
+
hash: hash(val),
|
|
33
35
|
container: this.#container,
|
|
34
36
|
key: this.#name,
|
|
35
37
|
keyCount: length + 1,
|
|
@@ -67,6 +69,7 @@
|
|
|
67
69
|
}
|
|
68
70
|
await this.db.put({
|
|
69
71
|
value: val,
|
|
72
|
+
hash: hash(val),
|
|
70
73
|
container: this.#container,
|
|
71
74
|
key: this.#name,
|
|
72
75
|
keyCount: index + 1,
|
package/dest/indexeddb/index.js
CHANGED
|
@@ -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.
|
|
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);
|
package/dest/indexeddb/map.d.ts
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
-
import type { Key, Range } from '../interfaces/common.js';
|
|
3
|
-
import type {
|
|
2
|
+
import type { Key, Range, Value } from '../interfaces/common.js';
|
|
3
|
+
import type { AztecAsyncMap } from '../interfaces/map.js';
|
|
4
4
|
import type { AztecIDBSchema } from './store.js';
|
|
5
5
|
/**
|
|
6
6
|
* A map backed by IndexedDB.
|
|
7
7
|
*/
|
|
8
|
-
export declare class IndexedDBAztecMap<K extends Key, V> implements
|
|
8
|
+
export declare class IndexedDBAztecMap<K extends Key, V extends Value> implements AztecAsyncMap<K, V> {
|
|
9
9
|
#private;
|
|
10
10
|
protected name: string;
|
|
11
|
+
protected container: string;
|
|
11
12
|
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, mapName: string);
|
|
12
13
|
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
13
14
|
get db(): IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'>;
|
|
14
15
|
getAsync(key: K): Promise<V | undefined>;
|
|
15
|
-
getValuesAsync(key: K): AsyncIterableIterator<V>;
|
|
16
16
|
hasAsync(key: K): Promise<boolean>;
|
|
17
|
+
sizeAsync(): Promise<number>;
|
|
17
18
|
set(key: K, val: V): Promise<void>;
|
|
19
|
+
setMany(entries: {
|
|
20
|
+
key: K;
|
|
21
|
+
value: V;
|
|
22
|
+
}[]): Promise<void>;
|
|
18
23
|
swap(_key: K, _fn: (val: V | undefined) => V): Promise<void>;
|
|
19
24
|
setIfNotExists(key: K, val: V): Promise<boolean>;
|
|
20
25
|
delete(key: K): Promise<void>;
|
|
21
|
-
deleteValue(key: K, val: V): Promise<void>;
|
|
22
26
|
entriesAsync(range?: Range<K>): AsyncIterableIterator<[K, V]>;
|
|
23
27
|
valuesAsync(range?: Range<K>): AsyncIterableIterator<V>;
|
|
24
28
|
keysAsync(range?: Range<K>): AsyncIterableIterator<K>;
|
|
29
|
+
protected normalizeKey(key: K): string;
|
|
30
|
+
protected slot(key: K, index?: number): string;
|
|
25
31
|
}
|
|
26
32
|
//# sourceMappingURL=map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/indexeddb/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/indexeddb/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,KAAK,CAAE,YAAW,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;;IAC3F,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;gBAKhB,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM;IAMjE,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,IAAI,EAAE,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC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1,14 @@
|
|
|
1
|
+
import { hash } from 'ohash';
|
|
1
2
|
/**
|
|
2
3
|
* A map backed by IndexedDB.
|
|
3
4
|
*/ export class IndexedDBAztecMap {
|
|
4
5
|
name;
|
|
5
|
-
|
|
6
|
+
container;
|
|
6
7
|
#_db;
|
|
7
8
|
#rootDB;
|
|
8
9
|
constructor(rootDB, mapName){
|
|
9
10
|
this.name = mapName;
|
|
10
|
-
this
|
|
11
|
+
this.container = `map:${mapName}`;
|
|
11
12
|
this.#rootDB = rootDB;
|
|
12
13
|
}
|
|
13
14
|
set db(db) {
|
|
@@ -17,44 +18,39 @@
|
|
|
17
18
|
return this.#_db ? this.#_db : this.#rootDB.transaction('data', 'readwrite').store;
|
|
18
19
|
}
|
|
19
20
|
async getAsync(key) {
|
|
20
|
-
const data = await this.db.get(this
|
|
21
|
+
const data = await this.db.get(this.slot(key));
|
|
21
22
|
return data?.value;
|
|
22
23
|
}
|
|
23
|
-
async *getValuesAsync(key) {
|
|
24
|
-
const index = this.db.index('keyCount');
|
|
25
|
-
const rangeQuery = IDBKeyRange.bound([
|
|
26
|
-
this.#container,
|
|
27
|
-
this.#normalizeKey(key),
|
|
28
|
-
0
|
|
29
|
-
], [
|
|
30
|
-
this.#container,
|
|
31
|
-
this.#normalizeKey(key),
|
|
32
|
-
Number.MAX_SAFE_INTEGER
|
|
33
|
-
], false, false);
|
|
34
|
-
for await (const cursor of index.iterate(rangeQuery)){
|
|
35
|
-
yield cursor.value.value;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
24
|
async hasAsync(key) {
|
|
39
25
|
const result = await this.getAsync(key) !== undefined;
|
|
40
26
|
return result;
|
|
41
27
|
}
|
|
42
|
-
async
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
this
|
|
28
|
+
async sizeAsync() {
|
|
29
|
+
const index = this.db.index('key');
|
|
30
|
+
const rangeQuery = IDBKeyRange.bound([
|
|
31
|
+
this.container,
|
|
32
|
+
''
|
|
46
33
|
], [
|
|
47
|
-
this
|
|
48
|
-
|
|
49
|
-
])
|
|
34
|
+
this.container,
|
|
35
|
+
'\uffff'
|
|
36
|
+
]);
|
|
37
|
+
return await index.count(rangeQuery);
|
|
38
|
+
}
|
|
39
|
+
async set(key, val) {
|
|
50
40
|
await this.db.put({
|
|
51
41
|
value: val,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
hash: hash(val),
|
|
43
|
+
container: this.container,
|
|
44
|
+
key: this.normalizeKey(key),
|
|
45
|
+
keyCount: 1,
|
|
46
|
+
slot: this.slot(key)
|
|
56
47
|
});
|
|
57
48
|
}
|
|
49
|
+
async setMany(entries) {
|
|
50
|
+
for (const { key, value } of entries){
|
|
51
|
+
await this.set(key, value);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
58
54
|
swap(_key, _fn) {
|
|
59
55
|
throw new Error('Not implemented');
|
|
60
56
|
}
|
|
@@ -66,34 +62,16 @@
|
|
|
66
62
|
return false;
|
|
67
63
|
}
|
|
68
64
|
async delete(key) {
|
|
69
|
-
await this.db.delete(this
|
|
70
|
-
}
|
|
71
|
-
async deleteValue(key, val) {
|
|
72
|
-
const index = this.db.index('keyCount');
|
|
73
|
-
const rangeQuery = IDBKeyRange.bound([
|
|
74
|
-
this.#container,
|
|
75
|
-
this.#normalizeKey(key),
|
|
76
|
-
0
|
|
77
|
-
], [
|
|
78
|
-
this.#container,
|
|
79
|
-
this.#normalizeKey(key),
|
|
80
|
-
Number.MAX_SAFE_INTEGER
|
|
81
|
-
], false, false);
|
|
82
|
-
for await (const cursor of index.iterate(rangeQuery)){
|
|
83
|
-
if (JSON.stringify(cursor.value.value) === JSON.stringify(val)) {
|
|
84
|
-
await cursor.delete();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
65
|
+
await this.db.delete(this.slot(key));
|
|
88
66
|
}
|
|
89
67
|
async *entriesAsync(range = {}) {
|
|
90
68
|
const index = this.db.index('key');
|
|
91
69
|
const rangeQuery = IDBKeyRange.bound([
|
|
92
|
-
this
|
|
93
|
-
range.start
|
|
70
|
+
this.container,
|
|
71
|
+
range.start ? this.normalizeKey(range.start) : ''
|
|
94
72
|
], [
|
|
95
|
-
this
|
|
96
|
-
range.end
|
|
73
|
+
this.container,
|
|
74
|
+
range.end ? this.normalizeKey(range.end) : '\uffff'
|
|
97
75
|
], !!range.reverse, !range.reverse);
|
|
98
76
|
let count = 0;
|
|
99
77
|
for await (const cursor of index.iterate(rangeQuery, range.reverse ? 'prev' : 'next')){
|
|
@@ -101,7 +79,7 @@
|
|
|
101
79
|
return;
|
|
102
80
|
}
|
|
103
81
|
yield [
|
|
104
|
-
cursor.value.key,
|
|
82
|
+
this.#denormalizeKey(cursor.value.key),
|
|
105
83
|
cursor.value.value
|
|
106
84
|
];
|
|
107
85
|
count++;
|
|
@@ -114,20 +92,20 @@
|
|
|
114
92
|
}
|
|
115
93
|
async *keysAsync(range = {}) {
|
|
116
94
|
for await (const [key, _] of this.entriesAsync(range)){
|
|
117
|
-
yield
|
|
95
|
+
yield key;
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
98
|
#denormalizeKey(key) {
|
|
121
|
-
const denormalizedKey = key.split(',').map((part)=>
|
|
122
|
-
return denormalizedKey.length > 1 ? denormalizedKey :
|
|
99
|
+
const denormalizedKey = key.split(',').map((part)=>part.startsWith('n_') ? Number(part.slice(2)) : part);
|
|
100
|
+
return denormalizedKey.length > 1 ? denormalizedKey : denormalizedKey[0];
|
|
123
101
|
}
|
|
124
|
-
|
|
102
|
+
normalizeKey(key) {
|
|
125
103
|
const arrayKey = Array.isArray(key) ? key : [
|
|
126
104
|
key
|
|
127
105
|
];
|
|
128
|
-
return arrayKey.join(',');
|
|
106
|
+
return arrayKey.map((element)=>typeof element === 'number' ? `n_${element}` : element).join(',');
|
|
129
107
|
}
|
|
130
|
-
|
|
131
|
-
return `map:${this.name}:slot:${this
|
|
108
|
+
slot(key, index = 0) {
|
|
109
|
+
return `map:${this.name}:slot:${this.normalizeKey(key)}:${index}`;
|
|
132
110
|
}
|
|
133
111
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Key, Value } from '../interfaces/common.js';
|
|
2
|
+
import type { AztecAsyncMultiMap } from '../interfaces/multi_map.js';
|
|
3
|
+
import { IndexedDBAztecMap } from './map.js';
|
|
4
|
+
/**
|
|
5
|
+
* A multi map backed by IndexedDB.
|
|
6
|
+
*/
|
|
7
|
+
export declare class IndexedDBAztecMultiMap<K extends Key, V extends Value> extends IndexedDBAztecMap<K, V> implements AztecAsyncMultiMap<K, V> {
|
|
8
|
+
set(key: K, val: V): Promise<void>;
|
|
9
|
+
getValuesAsync(key: K): AsyncIterableIterator<V>;
|
|
10
|
+
deleteValue(key: K, val: V): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=multi_map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi_map.d.ts","sourceRoot":"","sources":["../../src/indexeddb/multi_map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;GAEG;AACH,qBAAa,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,KAAK,CAChE,SAAQ,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAC9B,YAAW,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC;IAEpB,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC1C,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC;IAcjD,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAejD"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { hash } from 'ohash';
|
|
2
|
+
import { IndexedDBAztecMap } from './map.js';
|
|
3
|
+
/**
|
|
4
|
+
* A multi map backed by IndexedDB.
|
|
5
|
+
*/ export class IndexedDBAztecMultiMap extends IndexedDBAztecMap {
|
|
6
|
+
async set(key, val) {
|
|
7
|
+
// Inserting repeated values is a no-op
|
|
8
|
+
const exists = !!await this.db.index('hash').get(IDBKeyRange.bound([
|
|
9
|
+
this.container,
|
|
10
|
+
this.normalizeKey(key),
|
|
11
|
+
hash(val)
|
|
12
|
+
], [
|
|
13
|
+
this.container,
|
|
14
|
+
this.normalizeKey(key),
|
|
15
|
+
hash(val)
|
|
16
|
+
]));
|
|
17
|
+
if (exists) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Get the maximum keyCount for the given key
|
|
21
|
+
// In order to support sparse multimaps, we cannot rely
|
|
22
|
+
// on just counting the number of entries for the key, since we would repeat slots
|
|
23
|
+
// if we delete an entry
|
|
24
|
+
// set -> container:key:0 (keyCount = 1)
|
|
25
|
+
// set -> container:key:1 (keyCount = 2)
|
|
26
|
+
// delete -> container:key:0 (keyCount = 1)
|
|
27
|
+
// set -> container:key:1 <--- already exists!
|
|
28
|
+
// Instead, we iterate in reverse order to get the last inserted entry
|
|
29
|
+
const index = this.db.index('keyCount');
|
|
30
|
+
const rangeQuery = IDBKeyRange.upperBound([
|
|
31
|
+
this.container,
|
|
32
|
+
this.normalizeKey(key),
|
|
33
|
+
Number.MAX_SAFE_INTEGER
|
|
34
|
+
]);
|
|
35
|
+
const maxEntry = (await index.iterate(rangeQuery, 'prevunique').next()).value;
|
|
36
|
+
const count = maxEntry?.value?.keyCount ?? 0;
|
|
37
|
+
await this.db.put({
|
|
38
|
+
value: val,
|
|
39
|
+
hash: hash(val),
|
|
40
|
+
container: this.container,
|
|
41
|
+
key: this.normalizeKey(key),
|
|
42
|
+
keyCount: count + 1,
|
|
43
|
+
slot: this.slot(key, count)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async *getValuesAsync(key) {
|
|
47
|
+
// Iterate over the whole range of keyCount for the given key
|
|
48
|
+
const index = this.db.index('keyCount');
|
|
49
|
+
const rangeQuery = IDBKeyRange.bound([
|
|
50
|
+
this.container,
|
|
51
|
+
this.normalizeKey(key),
|
|
52
|
+
0
|
|
53
|
+
], [
|
|
54
|
+
this.container,
|
|
55
|
+
this.normalizeKey(key),
|
|
56
|
+
Number.MAX_SAFE_INTEGER
|
|
57
|
+
], false, false);
|
|
58
|
+
for await (const cursor of index.iterate(rangeQuery)){
|
|
59
|
+
yield cursor.value.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async deleteValue(key, val) {
|
|
63
|
+
// Since we know the value, we can hash it and directly query the "hash" index
|
|
64
|
+
// to avoid having to iterate over all the values
|
|
65
|
+
const fullKey = await this.db.index('hash').getKey(IDBKeyRange.bound([
|
|
66
|
+
this.container,
|
|
67
|
+
this.normalizeKey(key),
|
|
68
|
+
hash(val)
|
|
69
|
+
], [
|
|
70
|
+
this.container,
|
|
71
|
+
this.normalizeKey(key),
|
|
72
|
+
hash(val)
|
|
73
|
+
]));
|
|
74
|
+
if (fullKey) {
|
|
75
|
+
await this.db.delete(fullKey);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IDBPDatabase, IDBPObjectStore } from 'idb';
|
|
2
|
+
import type { Value } from '../interfaces/common.js';
|
|
2
3
|
import type { AztecAsyncSingleton } from '../interfaces/singleton.js';
|
|
3
4
|
import type { AztecIDBSchema } from './store.js';
|
|
4
5
|
/**
|
|
5
6
|
* Stores a single value in IndexedDB.
|
|
6
7
|
*/
|
|
7
|
-
export declare class IndexedDBAztecSingleton<T> implements AztecAsyncSingleton<T> {
|
|
8
|
+
export declare class IndexedDBAztecSingleton<T extends Value> implements AztecAsyncSingleton<T> {
|
|
8
9
|
#private;
|
|
9
10
|
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, name: string);
|
|
10
11
|
set db(db: IDBPObjectStore<AztecIDBSchema, ['data'], 'data', 'readwrite'> | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/indexeddb/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/indexeddb/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,uBAAuB,CAAC,CAAC,SAAS,KAAK,CAAE,YAAW,mBAAmB,CAAC,CAAC,CAAC;;gBAMzE,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM;IAM9D,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EAEpF;IAED,IAAI,EAAE,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAEvE;IAEK,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKlC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAY7B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CAIjC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hash } from 'ohash';
|
|
1
2
|
/**
|
|
2
3
|
* Stores a single value in IndexedDB.
|
|
3
4
|
*/ export class IndexedDBAztecSingleton {
|
|
@@ -26,7 +27,8 @@
|
|
|
26
27
|
slot: this.#slot,
|
|
27
28
|
key: this.#slot,
|
|
28
29
|
keyCount: 1,
|
|
29
|
-
value: val
|
|
30
|
+
value: val,
|
|
31
|
+
hash: hash(val)
|
|
30
32
|
});
|
|
31
33
|
return result !== undefined;
|
|
32
34
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { type DBSchema, type IDBPDatabase } from 'idb';
|
|
3
3
|
import type { AztecAsyncArray } from '../interfaces/array.js';
|
|
4
|
-
import type { Key, StoreSize } from '../interfaces/common.js';
|
|
4
|
+
import type { Key, StoreSize, Value } from '../interfaces/common.js';
|
|
5
5
|
import type { AztecAsyncCounter } from '../interfaces/counter.js';
|
|
6
|
-
import type { AztecAsyncMap
|
|
6
|
+
import type { AztecAsyncMap } from '../interfaces/map.js';
|
|
7
|
+
import type { AztecAsyncMultiMap } from '../interfaces/multi_map.js';
|
|
7
8
|
import type { AztecAsyncSet } from '../interfaces/set.js';
|
|
8
9
|
import type { AztecAsyncSingleton } from '../interfaces/singleton.js';
|
|
9
10
|
import type { AztecAsyncKVStore } from '../interfaces/store.js';
|
|
10
|
-
export type StoredData<V> = {
|
|
11
|
+
export type StoredData<V extends Value> = {
|
|
11
12
|
value: V;
|
|
12
13
|
container: string;
|
|
13
14
|
key: string;
|
|
14
15
|
keyCount: number;
|
|
15
16
|
slot: string;
|
|
17
|
+
hash: string;
|
|
16
18
|
};
|
|
17
19
|
export interface AztecIDBSchema extends DBSchema {
|
|
18
20
|
data: {
|
|
@@ -22,6 +24,7 @@ export interface AztecIDBSchema extends DBSchema {
|
|
|
22
24
|
container: string;
|
|
23
25
|
key: string;
|
|
24
26
|
keyCount: number;
|
|
27
|
+
hash: string;
|
|
25
28
|
};
|
|
26
29
|
};
|
|
27
30
|
}
|
|
@@ -31,7 +34,7 @@ export interface AztecIDBSchema extends DBSchema {
|
|
|
31
34
|
export declare class AztecIndexedDBStore implements AztecAsyncKVStore {
|
|
32
35
|
#private;
|
|
33
36
|
readonly isEphemeral: boolean;
|
|
34
|
-
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, isEphemeral: boolean,
|
|
37
|
+
constructor(rootDB: IDBPDatabase<AztecIDBSchema>, isEphemeral: boolean, name: string);
|
|
35
38
|
/**
|
|
36
39
|
* Creates a new AztecKVStore backed by IndexedDB. The path to the database is optional. If not provided,
|
|
37
40
|
* the database will be stored in a temporary location and be deleted when the process exists.
|
|
@@ -43,17 +46,12 @@ export declare class AztecIndexedDBStore implements AztecAsyncKVStore {
|
|
|
43
46
|
* @returns The store
|
|
44
47
|
*/
|
|
45
48
|
static open(log: Logger, name?: string, ephemeral?: boolean): Promise<AztecIndexedDBStore>;
|
|
46
|
-
/**
|
|
47
|
-
* Forks the current DB into a new DB by backing it up to a temporary location and opening a new indexedb.
|
|
48
|
-
* @returns A new AztecIndexedDBStore.
|
|
49
|
-
*/
|
|
50
|
-
fork(): Promise<AztecAsyncKVStore>;
|
|
51
49
|
/**
|
|
52
50
|
* Creates a new AztecMap in the store.
|
|
53
51
|
* @param name - Name of the map
|
|
54
52
|
* @returns A new AztecMap
|
|
55
53
|
*/
|
|
56
|
-
openMap<K extends Key, V>(name: string): AztecAsyncMap<K, V>;
|
|
54
|
+
openMap<K extends Key, V extends Value>(name: string): AztecAsyncMap<K, V>;
|
|
57
55
|
/**
|
|
58
56
|
* Creates a new AztecSet in the store.
|
|
59
57
|
* @param name - Name of the set
|
|
@@ -65,20 +63,20 @@ export declare class AztecIndexedDBStore implements AztecAsyncKVStore {
|
|
|
65
63
|
* @param name - Name of the map
|
|
66
64
|
* @returns A new AztecMultiMap
|
|
67
65
|
*/
|
|
68
|
-
openMultiMap<K extends Key, V>(name: string): AztecAsyncMultiMap<K, V>;
|
|
66
|
+
openMultiMap<K extends Key, V extends Value>(name: string): AztecAsyncMultiMap<K, V>;
|
|
69
67
|
openCounter<K extends Key>(_name: string): AztecAsyncCounter<K>;
|
|
70
68
|
/**
|
|
71
69
|
* Creates a new AztecArray in the store.
|
|
72
70
|
* @param name - Name of the array
|
|
73
71
|
* @returns A new AztecArray
|
|
74
72
|
*/
|
|
75
|
-
openArray<T>(name: string): AztecAsyncArray<T>;
|
|
73
|
+
openArray<T extends Value>(name: string): AztecAsyncArray<T>;
|
|
76
74
|
/**
|
|
77
75
|
* Creates a new AztecSingleton in the store.
|
|
78
76
|
* @param name - Name of the singleton
|
|
79
77
|
* @returns A new AztecSingleton
|
|
80
78
|
*/
|
|
81
|
-
openSingleton<T>(name: string): AztecAsyncSingleton<T>;
|
|
79
|
+
openSingleton<T extends Value>(name: string): AztecAsyncSingleton<T>;
|
|
82
80
|
/**
|
|
83
81
|
* Runs a callback in a transaction.
|
|
84
82
|
* @param callback - Function to execute in a transaction
|
|
@@ -93,5 +91,6 @@ export declare class AztecIndexedDBStore implements AztecAsyncKVStore {
|
|
|
93
91
|
delete(): Promise<void>;
|
|
94
92
|
estimateSize(): Promise<StoreSize>;
|
|
95
93
|
close(): Promise<void>;
|
|
94
|
+
backupTo(_dstPath: string, _compact?: boolean): Promise<void>;
|
|
96
95
|
}
|
|
97
96
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/indexeddb/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/indexeddb/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EAAE,KAAK,QAAQ,E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