@aztec/kv-store 0.0.1-commit.b655e406 → 0.0.1-commit.b9865e97
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/README.md +8 -1
- package/dest/bench/shared_map_bench.d.ts +19 -0
- package/dest/bench/shared_map_bench.d.ts.map +1 -0
- package/dest/bench/shared_map_bench.js +91 -0
- package/dest/indexeddb/array.d.ts +1 -1
- package/dest/indexeddb/array.d.ts.map +1 -1
- package/dest/indexeddb/array.js +21 -7
- package/dest/indexeddb/index.d.ts +3 -3
- package/dest/indexeddb/index.d.ts.map +1 -1
- package/dest/indexeddb/index.js +3 -6
- package/dest/indexeddb/map.d.ts +8 -2
- package/dest/indexeddb/map.d.ts.map +1 -1
- package/dest/indexeddb/map.js +23 -13
- package/dest/indexeddb/multi_map.d.ts +3 -1
- package/dest/indexeddb/multi_map.d.ts.map +1 -1
- package/dest/indexeddb/multi_map.js +30 -1
- package/dest/indexeddb/set.d.ts +1 -1
- package/dest/indexeddb/set.d.ts.map +1 -1
- package/dest/indexeddb/singleton.d.ts +1 -1
- package/dest/indexeddb/singleton.d.ts.map +1 -1
- package/dest/indexeddb/singleton.js +3 -1
- package/dest/indexeddb/store.d.ts +3 -3
- package/dest/indexeddb/store.d.ts.map +1 -1
- package/dest/indexeddb/store.js +6 -4
- package/dest/interfaces/array.d.ts +1 -1
- package/dest/interfaces/array_test_suite.d.ts +1 -1
- package/dest/interfaces/array_test_suite.d.ts.map +1 -1
- package/dest/interfaces/array_test_suite.js +33 -34
- package/dest/interfaces/common.d.ts +1 -1
- package/dest/interfaces/counter.d.ts +1 -1
- package/dest/interfaces/index.d.ts +2 -2
- package/dest/interfaces/index.d.ts.map +1 -1
- package/dest/interfaces/map.d.ts +1 -1
- package/dest/interfaces/map_test_suite.d.ts +1 -1
- package/dest/interfaces/map_test_suite.d.ts.map +1 -1
- package/dest/interfaces/map_test_suite.js +74 -29
- package/dest/interfaces/multi_map.d.ts +7 -1
- package/dest/interfaces/multi_map.d.ts.map +1 -1
- package/dest/interfaces/multi_map_test_suite.d.ts +1 -1
- package/dest/interfaces/multi_map_test_suite.d.ts.map +1 -1
- package/dest/interfaces/multi_map_test_suite.js +154 -36
- package/dest/interfaces/set.d.ts +1 -1
- package/dest/interfaces/set_test_suite.d.ts +1 -1
- package/dest/interfaces/set_test_suite.d.ts.map +1 -1
- package/dest/interfaces/set_test_suite.js +13 -14
- package/dest/interfaces/singleton.d.ts +1 -1
- package/dest/interfaces/singleton_test_suite.d.ts +1 -1
- package/dest/interfaces/singleton_test_suite.d.ts.map +1 -1
- package/dest/interfaces/singleton_test_suite.js +6 -7
- package/dest/interfaces/store.d.ts +1 -1
- package/dest/interfaces/utils.d.ts +2 -1
- package/dest/interfaces/utils.d.ts.map +1 -1
- package/dest/interfaces/utils.js +2 -1
- package/dest/lmdb/array.d.ts +1 -1
- package/dest/lmdb/array.d.ts.map +1 -1
- package/dest/lmdb/array.js +4 -2
- package/dest/lmdb/counter.d.ts +1 -1
- package/dest/lmdb/counter.d.ts.map +1 -1
- package/dest/lmdb/index.d.ts +3 -3
- package/dest/lmdb/index.d.ts.map +1 -1
- package/dest/lmdb/index.js +4 -4
- package/dest/lmdb/map.d.ts +1 -1
- package/dest/lmdb/map.d.ts.map +1 -1
- package/dest/lmdb/multi_map.d.ts +2 -1
- package/dest/lmdb/multi_map.d.ts.map +1 -1
- package/dest/lmdb/multi_map.js +15 -0
- package/dest/lmdb/set.d.ts +1 -1
- package/dest/lmdb/set.d.ts.map +1 -1
- package/dest/lmdb/singleton.d.ts +1 -1
- package/dest/lmdb/singleton.d.ts.map +1 -1
- package/dest/lmdb/store.d.ts +4 -5
- package/dest/lmdb/store.d.ts.map +1 -1
- package/dest/lmdb/store.js +13 -9
- package/dest/lmdb-v2/array.d.ts +2 -2
- package/dest/lmdb-v2/array.d.ts.map +1 -1
- package/dest/lmdb-v2/array.js +4 -3
- package/dest/lmdb-v2/factory.d.ts +32 -10
- package/dest/lmdb-v2/factory.d.ts.map +1 -1
- package/dest/lmdb-v2/factory.js +71 -16
- package/dest/lmdb-v2/index.d.ts +1 -1
- package/dest/lmdb-v2/map.d.ts +2 -2
- package/dest/lmdb-v2/map.d.ts.map +1 -1
- package/dest/lmdb-v2/map.js +1 -2
- package/dest/lmdb-v2/message.d.ts +1 -1
- package/dest/lmdb-v2/multi_map.d.ts +3 -2
- package/dest/lmdb-v2/multi_map.d.ts.map +1 -1
- package/dest/lmdb-v2/multi_map.js +11 -1
- package/dest/lmdb-v2/read_transaction.d.ts +1 -1
- package/dest/lmdb-v2/read_transaction.d.ts.map +1 -1
- package/dest/lmdb-v2/read_transaction.js +21 -19
- package/dest/lmdb-v2/set.d.ts +1 -1
- package/dest/lmdb-v2/set.d.ts.map +1 -1
- package/dest/lmdb-v2/singleton.d.ts +2 -2
- package/dest/lmdb-v2/singleton.d.ts.map +1 -1
- package/dest/lmdb-v2/singleton.js +1 -2
- package/dest/lmdb-v2/store.d.ts +4 -5
- package/dest/lmdb-v2/store.d.ts.map +1 -1
- package/dest/lmdb-v2/store.js +6 -28
- package/dest/lmdb-v2/tx-helpers.d.ts +6 -0
- package/dest/lmdb-v2/tx-helpers.d.ts.map +1 -0
- package/dest/lmdb-v2/tx-helpers.js +21 -0
- package/dest/lmdb-v2/utils.d.ts +1 -10
- package/dest/lmdb-v2/utils.d.ts.map +1 -1
- package/dest/lmdb-v2/utils.js +0 -94
- package/dest/lmdb-v2/write_transaction.d.ts +1 -1
- package/dest/lmdb-v2/write_transaction.d.ts.map +1 -1
- package/dest/lmdb-v2/write_transaction.js +9 -5
- package/dest/sqlite-opfs/array.d.ts +21 -0
- package/dest/sqlite-opfs/array.d.ts.map +1 -0
- package/dest/sqlite-opfs/array.js +128 -0
- package/dest/sqlite-opfs/errors.d.ts +27 -0
- package/dest/sqlite-opfs/errors.d.ts.map +1 -0
- package/dest/sqlite-opfs/errors.js +34 -0
- package/dest/sqlite-opfs/index.d.ts +16 -0
- package/dest/sqlite-opfs/index.d.ts.map +1 -0
- package/dest/sqlite-opfs/index.js +22 -0
- package/dest/sqlite-opfs/internal/ordered-binary-browser.d.ts +32 -0
- package/dest/sqlite-opfs/internal/ordered-binary-browser.d.ts.map +1 -0
- package/dest/sqlite-opfs/internal/ordered-binary-browser.js +448 -0
- package/dest/sqlite-opfs/map.d.ts +35 -0
- package/dest/sqlite-opfs/map.d.ts.map +1 -0
- package/dest/sqlite-opfs/map.js +163 -0
- package/dest/sqlite-opfs/messages.d.ts +66 -0
- package/dest/sqlite-opfs/messages.d.ts.map +1 -0
- package/dest/sqlite-opfs/messages.js +5 -0
- package/dest/sqlite-opfs/multi_map.d.ts +16 -0
- package/dest/sqlite-opfs/multi_map.d.ts.map +1 -0
- package/dest/sqlite-opfs/multi_map.js +67 -0
- package/dest/sqlite-opfs/set.d.ts +13 -0
- package/dest/sqlite-opfs/set.d.ts.map +1 -0
- package/dest/sqlite-opfs/set.js +19 -0
- package/dest/sqlite-opfs/singleton.d.ts +13 -0
- package/dest/sqlite-opfs/singleton.d.ts.map +1 -0
- package/dest/sqlite-opfs/singleton.js +48 -0
- package/dest/sqlite-opfs/store.d.ts +79 -0
- package/dest/sqlite-opfs/store.d.ts.map +1 -0
- package/dest/sqlite-opfs/store.js +281 -0
- package/dest/sqlite-opfs/worker.d.ts +2 -0
- package/dest/sqlite-opfs/worker.d.ts.map +1 -0
- package/dest/sqlite-opfs/worker.js +249 -0
- package/dest/stores/index.d.ts +1 -1
- package/dest/stores/l2_tips_store.d.ts +25 -10
- package/dest/stores/l2_tips_store.d.ts.map +1 -1
- package/dest/stores/l2_tips_store.js +62 -53
- package/dest/utils.d.ts +9 -6
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +51 -16
- package/package.json +33 -26
- package/src/bench/shared_map_bench.ts +111 -0
- package/src/indexeddb/array.ts +4 -4
- package/src/indexeddb/index.ts +9 -7
- package/src/indexeddb/map.ts +24 -11
- package/src/indexeddb/multi_map.ts +27 -1
- package/src/indexeddb/singleton.ts +1 -1
- package/src/indexeddb/store.ts +13 -6
- package/src/interfaces/array_test_suite.ts +33 -35
- package/src/interfaces/index.ts +1 -1
- package/src/interfaces/map_test_suite.ts +56 -30
- package/src/interfaces/multi_map.ts +7 -0
- package/src/interfaces/multi_map_test_suite.ts +167 -37
- package/src/interfaces/set_test_suite.ts +13 -15
- package/src/interfaces/singleton_test_suite.ts +6 -8
- package/src/interfaces/utils.ts +1 -0
- package/src/lmdb/index.ts +10 -5
- package/src/lmdb/multi_map.ts +16 -0
- package/src/lmdb/store.ts +13 -9
- package/src/lmdb-v2/array.ts +2 -2
- package/src/lmdb-v2/factory.ts +93 -19
- package/src/lmdb-v2/map.ts +2 -2
- package/src/lmdb-v2/multi_map.ts +10 -1
- package/src/lmdb-v2/read_transaction.ts +23 -23
- package/src/lmdb-v2/singleton.ts +2 -2
- package/src/lmdb-v2/store.ts +9 -33
- package/src/lmdb-v2/tx-helpers.ts +29 -0
- package/src/lmdb-v2/utils.ts +0 -118
- package/src/lmdb-v2/write_transaction.ts +9 -8
- package/src/sqlite-opfs/array.ts +124 -0
- package/src/sqlite-opfs/errors.ts +44 -0
- package/src/sqlite-opfs/index.ts +39 -0
- package/src/sqlite-opfs/internal/ordered-binary-browser.js +465 -0
- package/src/sqlite-opfs/map.ts +163 -0
- package/src/sqlite-opfs/messages.ts +39 -0
- package/src/sqlite-opfs/multi_map.ts +74 -0
- package/src/sqlite-opfs/set.ts +29 -0
- package/src/sqlite-opfs/singleton.ts +48 -0
- package/src/sqlite-opfs/store.ts +296 -0
- package/src/sqlite-opfs/worker.ts +231 -0
- package/src/stores/l2_tips_store.ts +66 -56
- package/src/utils.ts +79 -21
- package/dest/config.d.ts +0 -17
- package/dest/config.d.ts.map +0 -1
- package/dest/config.js +0 -26
- package/src/config.ts +0 -36
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { SerialQueue } from '@aztec/foundation/queue';
|
|
2
|
+
import { SQLiteOPFSAztecArray } from './array.js';
|
|
3
|
+
import { SqliteEncryptionError } from './errors.js';
|
|
4
|
+
import { SQLiteOPFSAztecMap } from './map.js';
|
|
5
|
+
import { SQLiteOPFSAztecMultiMap } from './multi_map.js';
|
|
6
|
+
import { SQLiteOPFSAztecSet } from './set.js';
|
|
7
|
+
import { SQLiteOPFSAztecSingleton } from './singleton.js';
|
|
8
|
+
/**
|
|
9
|
+
* Main-thread handle for a SQLite database persisted to OPFS via the `opfs-sahpool`
|
|
10
|
+
* VFS. Owns a dedicated Web Worker (the SAH Pool VFS requires Worker context) and
|
|
11
|
+
* routes every SQL op through it via typed postMessage RPC.
|
|
12
|
+
*
|
|
13
|
+
* Transaction ordering is guaranteed by a `SerialQueue` on the main thread combined
|
|
14
|
+
* with an `#inTx` flag: outside a `transactionAsync` block, each op acquires the
|
|
15
|
+
* queue for its own auto-commit; inside a block, the outer call holds the queue and
|
|
16
|
+
* nested ops bypass it to avoid deadlock.
|
|
17
|
+
*/ export class AztecSQLiteOPFSStore {
|
|
18
|
+
isEphemeral;
|
|
19
|
+
#worker;
|
|
20
|
+
#pending;
|
|
21
|
+
#txQueue;
|
|
22
|
+
#name;
|
|
23
|
+
#log;
|
|
24
|
+
#nextId;
|
|
25
|
+
#inTx;
|
|
26
|
+
#closed;
|
|
27
|
+
constructor(worker, name, log, isEphemeral){
|
|
28
|
+
this.isEphemeral = isEphemeral;
|
|
29
|
+
this.#pending = new Map();
|
|
30
|
+
this.#txQueue = new SerialQueue();
|
|
31
|
+
this.#nextId = 0;
|
|
32
|
+
this.#inTx = false;
|
|
33
|
+
this.#closed = false;
|
|
34
|
+
this.#worker = worker;
|
|
35
|
+
this.#name = name;
|
|
36
|
+
this.#log = log;
|
|
37
|
+
this.#worker.onmessage = (ev)=>{
|
|
38
|
+
const { id } = ev.data;
|
|
39
|
+
const handler = this.#pending.get(id);
|
|
40
|
+
if (!handler) {
|
|
41
|
+
this.#log.warn(`SQLite worker: no pending handler for id ${id}`);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.#pending.delete(id);
|
|
45
|
+
handler.resolve(ev.data);
|
|
46
|
+
};
|
|
47
|
+
this.#worker.onerror = (ev)=>{
|
|
48
|
+
this.#log.error(`SQLite worker crashed: ${ev.message}`);
|
|
49
|
+
this.#rejectPending(`SQLite worker crashed: ${ev.message}`);
|
|
50
|
+
};
|
|
51
|
+
this.#txQueue.start();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Opens (or creates) a SQLite database stored in the OPFS SAH Pool. When `ephemeral`
|
|
55
|
+
* is true the database lives only in memory and is lost when the worker terminates.
|
|
56
|
+
* Pass `poolDirectory` to place the SAH Pool in a non-default OPFS subdirectory —
|
|
57
|
+
* required when multiple stores coexist in the same tab, because the SAH Pool holds
|
|
58
|
+
* an exclusive lock on its directory.
|
|
59
|
+
*
|
|
60
|
+
* Pass `encryptionKey` (exactly 32 bytes) to enable at-rest encryption via sqlite3mc's
|
|
61
|
+
* ChaCha20 page cipher. The key buffer is **transferred** to the worker — its
|
|
62
|
+
* ArrayBuffer detaches on the caller side after `postMessage`. This is intentional:
|
|
63
|
+
* the API encodes a one-key-one-owner invariant. A caller that wants to use the same
|
|
64
|
+
* key for multiple stores must explicitly clone it per call (e.g.
|
|
65
|
+
* `new Uint8Array(savedKey)`), making the duplication a visible, deliberate decision
|
|
66
|
+
* rather than a silent structured-clone operation. The default path (one `.open()`,
|
|
67
|
+
* one consumption of the key) leaves zero key bytes on the main thread after the call.
|
|
68
|
+
*/ static async open(log, name, ephemeral = false, poolDirectory, encryptionKey) {
|
|
69
|
+
if (encryptionKey !== undefined && encryptionKey.length !== 32) {
|
|
70
|
+
throw new SqliteEncryptionError('invalid_key_length', `encryptionKey must be 32 bytes (got ${encryptionKey.length})`);
|
|
71
|
+
}
|
|
72
|
+
if (encryptionKey !== undefined && ephemeral) {
|
|
73
|
+
throw new SqliteEncryptionError('encryption_not_supported_for_ephemeral', 'encryptionKey is not supported for ephemeral (:memory:) stores');
|
|
74
|
+
}
|
|
75
|
+
const dbName = name && !ephemeral ? name : `tmp-${globalThis.crypto.getRandomValues(new Uint8Array(8)).join('')}`;
|
|
76
|
+
log.debug(`Opening SQLite-OPFS ${ephemeral ? 'ephemeral ' : ''}${encryptionKey ? 'encrypted ' : ''}database ${dbName}`);
|
|
77
|
+
const worker = new Worker(new URL('./worker.js', import.meta.url), {
|
|
78
|
+
type: 'module'
|
|
79
|
+
});
|
|
80
|
+
const store = new AztecSQLiteOPFSStore(worker, dbName, log, ephemeral);
|
|
81
|
+
// Transfer (not clone) the key buffer to the worker so we don't leave a
|
|
82
|
+
// second copy on the main thread. Caveat: this detaches the caller's
|
|
83
|
+
// encryptionKey.buffer — subsequent reads from the same Uint8Array are empty.
|
|
84
|
+
const transfer = encryptionKey ? [
|
|
85
|
+
encryptionKey.buffer
|
|
86
|
+
] : undefined;
|
|
87
|
+
try {
|
|
88
|
+
await store.#sendRequest({
|
|
89
|
+
type: 'init',
|
|
90
|
+
id: store.#allocId(),
|
|
91
|
+
dbName,
|
|
92
|
+
ephemeral,
|
|
93
|
+
poolDirectory,
|
|
94
|
+
encryptionKey
|
|
95
|
+
}, transfer);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
worker.terminate();
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
return store;
|
|
101
|
+
}
|
|
102
|
+
openMap(name) {
|
|
103
|
+
return new SQLiteOPFSAztecMap(this, name);
|
|
104
|
+
}
|
|
105
|
+
openSet(name) {
|
|
106
|
+
return new SQLiteOPFSAztecSet(this, name);
|
|
107
|
+
}
|
|
108
|
+
openMultiMap(name) {
|
|
109
|
+
return new SQLiteOPFSAztecMultiMap(this, name);
|
|
110
|
+
}
|
|
111
|
+
openCounter(_name) {
|
|
112
|
+
throw new Error('Method not implemented.');
|
|
113
|
+
}
|
|
114
|
+
openArray(name) {
|
|
115
|
+
return new SQLiteOPFSAztecArray(this, name);
|
|
116
|
+
}
|
|
117
|
+
openSingleton(name) {
|
|
118
|
+
return new SQLiteOPFSAztecSingleton(this, name);
|
|
119
|
+
}
|
|
120
|
+
transactionAsync(callback) {
|
|
121
|
+
// Nested calls join the outer transaction — SQLite does not support nested BEGIN,
|
|
122
|
+
// and re-acquiring the SerialQueue while the outer call holds it would deadlock.
|
|
123
|
+
// Errors in the nested callback propagate to the outer catch, which rolls back the
|
|
124
|
+
// whole thing (the standard "nested tx = savepoint-free join" semantic).
|
|
125
|
+
if (this.#inTx) {
|
|
126
|
+
return callback();
|
|
127
|
+
}
|
|
128
|
+
return this.#txQueue.put(async ()=>{
|
|
129
|
+
this.#inTx = true;
|
|
130
|
+
await this.#sendRequest({
|
|
131
|
+
type: 'begin',
|
|
132
|
+
id: this.#allocId()
|
|
133
|
+
});
|
|
134
|
+
try {
|
|
135
|
+
const result = await callback();
|
|
136
|
+
await this.#sendRequest({
|
|
137
|
+
type: 'commit',
|
|
138
|
+
id: this.#allocId()
|
|
139
|
+
});
|
|
140
|
+
return result;
|
|
141
|
+
} catch (err) {
|
|
142
|
+
await this.#sendRequest({
|
|
143
|
+
type: 'rollback',
|
|
144
|
+
id: this.#allocId()
|
|
145
|
+
}).catch((rollbackErr)=>this.#log.warn(`SQLite ROLLBACK failed: ${rollbackErr instanceof Error ? rollbackErr.message : rollbackErr}`));
|
|
146
|
+
throw err;
|
|
147
|
+
} finally{
|
|
148
|
+
this.#inTx = false;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
async clear() {
|
|
153
|
+
await this.runAsync('DELETE FROM data');
|
|
154
|
+
}
|
|
155
|
+
async delete() {
|
|
156
|
+
if (this.#closed) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.#closed = true;
|
|
160
|
+
await this.#txQueue.end();
|
|
161
|
+
await this.#sendRequest({
|
|
162
|
+
type: 'deleteDb',
|
|
163
|
+
id: this.#allocId(),
|
|
164
|
+
dbName: this.#name
|
|
165
|
+
}).catch((err)=>this.#log.warn(`SQLite deleteDb failed: ${err instanceof Error ? err.message : err}`));
|
|
166
|
+
this.#worker.terminate();
|
|
167
|
+
this.#rejectPending('SQLite store deleted');
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Placeholder — returns zeros to mirror the IndexedDB backend. SQLite exposes real
|
|
171
|
+
* numbers cheaply via `PRAGMA page_count` / `page_size` / `freelist_count` and
|
|
172
|
+
* `SELECT COUNT(*) FROM data`, which would populate `physicalFileSize`, `actualSize`,
|
|
173
|
+
* and `numItems` meaningfully (`mappingSize` stays 0 — it's an LMDB mmap concept).
|
|
174
|
+
* Upgrade when any caller actually consumes these values; all current consumers
|
|
175
|
+
* tolerate zeros.
|
|
176
|
+
*/ estimateSize() {
|
|
177
|
+
return Promise.resolve({
|
|
178
|
+
mappingSize: 0,
|
|
179
|
+
physicalFileSize: 0,
|
|
180
|
+
actualSize: 0,
|
|
181
|
+
numItems: 0
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
async close() {
|
|
185
|
+
if (this.#closed) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
this.#closed = true;
|
|
189
|
+
await this.#txQueue.end();
|
|
190
|
+
await this.#sendRequest({
|
|
191
|
+
type: 'close',
|
|
192
|
+
id: this.#allocId()
|
|
193
|
+
}).catch(()=>{});
|
|
194
|
+
this.#worker.terminate();
|
|
195
|
+
this.#rejectPending('SQLite store closed');
|
|
196
|
+
}
|
|
197
|
+
backupTo(_dstPath, _compact) {
|
|
198
|
+
throw new Error('Method not implemented.');
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Returns a raw SQLite image (bytes suitable for writing as a `.sqlite` file and
|
|
202
|
+
* opening in any SQLite tool). Works only for non-ephemeral DBs because the OPFS
|
|
203
|
+
* SAH Pool has to be initialized. Useful for inspection/debugging.
|
|
204
|
+
*/ async exportDb() {
|
|
205
|
+
const resp = await this.#sendRequest({
|
|
206
|
+
type: 'export',
|
|
207
|
+
id: this.#allocId()
|
|
208
|
+
});
|
|
209
|
+
if (!('bytes' in resp) || !resp.bytes) {
|
|
210
|
+
throw new Error('exportDb: worker returned no bytes');
|
|
211
|
+
}
|
|
212
|
+
return resp.bytes;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Runs a write statement (INSERT/UPDATE/DELETE/DDL). If called inside a
|
|
216
|
+
* `transactionAsync` block, bypasses the queue; otherwise acquires it so the
|
|
217
|
+
* op runs in its own auto-commit.
|
|
218
|
+
*/ runAsync(sql, bind) {
|
|
219
|
+
const send = ()=>this.#sendRequest({
|
|
220
|
+
type: 'run',
|
|
221
|
+
id: this.#allocId(),
|
|
222
|
+
sql,
|
|
223
|
+
bind
|
|
224
|
+
}).then((r)=>({
|
|
225
|
+
changes: 'changes' in r ? r.changes ?? 0 : 0
|
|
226
|
+
}));
|
|
227
|
+
return this.#inTx ? send() : this.#txQueue.put(send);
|
|
228
|
+
}
|
|
229
|
+
/** Runs a SELECT statement and returns rows in array row-mode. */ allAsync(sql, bind) {
|
|
230
|
+
const send = ()=>this.#sendRequest({
|
|
231
|
+
type: 'all',
|
|
232
|
+
id: this.#allocId(),
|
|
233
|
+
sql,
|
|
234
|
+
bind
|
|
235
|
+
}).then((r)=>'rows' in r ? r.rows ?? [] : []);
|
|
236
|
+
return this.#inTx ? send() : this.#txQueue.put(send);
|
|
237
|
+
}
|
|
238
|
+
#allocId() {
|
|
239
|
+
return ++this.#nextId;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Reject any in-flight requests with `reason`, so callers awaiting a response to a
|
|
243
|
+
* request sent to a now-terminated worker don't hang forever. Called from
|
|
244
|
+
* close()/delete() and from the worker.onerror handler.
|
|
245
|
+
*/ #rejectPending(reason) {
|
|
246
|
+
if (this.#pending.size === 0) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const err = new Error(reason);
|
|
250
|
+
for (const { reject } of this.#pending.values()){
|
|
251
|
+
reject(err);
|
|
252
|
+
}
|
|
253
|
+
this.#pending.clear();
|
|
254
|
+
}
|
|
255
|
+
#sendRequest(req, transfer) {
|
|
256
|
+
return new Promise((resolve, reject)=>{
|
|
257
|
+
this.#pending.set(req.id, {
|
|
258
|
+
resolve: (resp)=>{
|
|
259
|
+
if (resp.type === 'err') {
|
|
260
|
+
// Re-hydrate encryption-shaped errors as the typed class so consumers
|
|
261
|
+
// can pattern-match on `instanceof SqliteEncryptionError`. Plain
|
|
262
|
+
// errors stay plain — the wire protocol only tags encryption paths.
|
|
263
|
+
if (resp.encryptionCode !== undefined) {
|
|
264
|
+
reject(new SqliteEncryptionError(resp.encryptionCode, resp.message));
|
|
265
|
+
} else {
|
|
266
|
+
reject(new Error(resp.message));
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
resolve(resp);
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
reject
|
|
273
|
+
});
|
|
274
|
+
if (transfer && transfer.length > 0) {
|
|
275
|
+
this.#worker.postMessage(req, transfer);
|
|
276
|
+
} else {
|
|
277
|
+
this.#worker.postMessage(req);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/sqlite-opfs/worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/// <reference lib="webworker" />
|
|
2
|
+
import sqlite3InitModule from '@aztec/sqlite3mc-wasm';
|
|
3
|
+
import { SqliteEncryptionError, isDecryptFailureMessage } from './errors.js';
|
|
4
|
+
const SCHEMA_SQL = `
|
|
5
|
+
CREATE TABLE IF NOT EXISTS data (
|
|
6
|
+
slot TEXT NOT NULL PRIMARY KEY,
|
|
7
|
+
container TEXT NOT NULL,
|
|
8
|
+
key BLOB NOT NULL,
|
|
9
|
+
key_count INTEGER NOT NULL,
|
|
10
|
+
hash TEXT NOT NULL,
|
|
11
|
+
value BLOB
|
|
12
|
+
) WITHOUT ROWID;
|
|
13
|
+
|
|
14
|
+
CREATE INDEX IF NOT EXISTS idx_container_key ON data(container, key);
|
|
15
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_container_key_count ON data(container, key, key_count);
|
|
16
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_container_key_hash ON data(container, key, hash);
|
|
17
|
+
`;
|
|
18
|
+
const DEFAULT_SAH_POOL_DIRECTORY = '.aztec-kv';
|
|
19
|
+
const SAH_POOL_VFS_NAME = 'aztec-kv-opfs';
|
|
20
|
+
const MC_SAH_POOL_VFS_NAME = `multipleciphers-${SAH_POOL_VFS_NAME}`;
|
|
21
|
+
let sqlite3;
|
|
22
|
+
let pool;
|
|
23
|
+
let db;
|
|
24
|
+
let dbPath;
|
|
25
|
+
async function ensurePool(directory) {
|
|
26
|
+
sqlite3 ??= await sqlite3InitModule();
|
|
27
|
+
const s = sqlite3;
|
|
28
|
+
if (!pool) {
|
|
29
|
+
pool = await s.installOpfsSAHPoolVfs({
|
|
30
|
+
name: SAH_POOL_VFS_NAME,
|
|
31
|
+
directory,
|
|
32
|
+
initialCapacity: 8
|
|
33
|
+
});
|
|
34
|
+
// Register a sqlite3mc-wrapped VFS pointing at our SAH Pool VFS.
|
|
35
|
+
// Encrypted DBs must be opened through this wrapper so sqlite3mc can
|
|
36
|
+
// intercept file I/O; plain DBs continue using the SAH Pool VFS directly.
|
|
37
|
+
// The wrapper name is `multipleciphers-<underlying>`.
|
|
38
|
+
s.capi.sqlite3mc_vfs_create(SAH_POOL_VFS_NAME, 0);
|
|
39
|
+
}
|
|
40
|
+
return pool;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Applies sqlite3mc's ChaCha20 page cipher using a pre-derived 32-byte key.
|
|
44
|
+
* The PRAGMAs must run before any schema DDL so sqlite3mc can decrypt existing
|
|
45
|
+
* pages and encrypt new ones. Zeroes the caller-held key array after the PRAGMA
|
|
46
|
+
* completes to minimize residency of the raw key bytes outside sqlite3mc's heap.
|
|
47
|
+
*/ function applyEncryptionKey(conn, key) {
|
|
48
|
+
const hex = Array.from(key, (b)=>b.toString(16).padStart(2, '0')).join('');
|
|
49
|
+
conn.exec(`PRAGMA cipher = 'chacha20'`);
|
|
50
|
+
conn.exec(`PRAGMA key = "x'${hex}'"`);
|
|
51
|
+
key.fill(0);
|
|
52
|
+
}
|
|
53
|
+
async function handleInit(dbName, ephemeral, directory, encryptionKey) {
|
|
54
|
+
sqlite3 ??= await sqlite3InitModule();
|
|
55
|
+
const s = sqlite3;
|
|
56
|
+
if (encryptionKey !== undefined && ephemeral) {
|
|
57
|
+
throw new SqliteEncryptionError('encryption_not_supported_for_ephemeral', 'encryptionKey is not supported for ephemeral (:memory:) stores');
|
|
58
|
+
}
|
|
59
|
+
if (ephemeral) {
|
|
60
|
+
db = new s.oo1.DB(':memory:', 'c');
|
|
61
|
+
} else {
|
|
62
|
+
await ensurePool(directory ?? DEFAULT_SAH_POOL_DIRECTORY);
|
|
63
|
+
dbPath = normalizeDbPath(dbName);
|
|
64
|
+
if (encryptionKey !== undefined) {
|
|
65
|
+
db = new s.oo1.DB({
|
|
66
|
+
filename: dbPath,
|
|
67
|
+
flags: 'c',
|
|
68
|
+
vfs: MC_SAH_POOL_VFS_NAME
|
|
69
|
+
});
|
|
70
|
+
applyEncryptionKey(db, encryptionKey);
|
|
71
|
+
} else {
|
|
72
|
+
db = new pool.OpfsSAHPoolDb(dbPath);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
runSql(SCHEMA_SQL);
|
|
76
|
+
}
|
|
77
|
+
function handleClose() {
|
|
78
|
+
db?.close();
|
|
79
|
+
db = undefined;
|
|
80
|
+
dbPath = undefined;
|
|
81
|
+
}
|
|
82
|
+
async function handleExport() {
|
|
83
|
+
if (!db || !dbPath) {
|
|
84
|
+
throw new Error('SQLite worker: no database open to export');
|
|
85
|
+
}
|
|
86
|
+
if (!pool) {
|
|
87
|
+
throw new Error('SQLite worker: no SAH Pool available (ephemeral DBs cannot be exported)');
|
|
88
|
+
}
|
|
89
|
+
return await pool.exportFile(dbPath);
|
|
90
|
+
}
|
|
91
|
+
function handleDeleteDb(dbName) {
|
|
92
|
+
const path = normalizeDbPath(dbName);
|
|
93
|
+
if (db && dbPath === path) {
|
|
94
|
+
db.close();
|
|
95
|
+
db = undefined;
|
|
96
|
+
dbPath = undefined;
|
|
97
|
+
}
|
|
98
|
+
// Ephemeral :memory: DBs never back a file — skip installing a pool just to unlink
|
|
99
|
+
// nothing. installOpfsSAHPoolVfs acquires an exclusive lock on the OPFS SAH
|
|
100
|
+
// directory, and under heavy test churn that can contend with workers from
|
|
101
|
+
// previous tests whose OPFS handles Chromium hasn't yet released, hanging the RPC
|
|
102
|
+
// and then the whole test run.
|
|
103
|
+
if (!pool) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
pool.unlink(path);
|
|
108
|
+
} catch {
|
|
109
|
+
// File may not exist; ignore.
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function requireDb() {
|
|
113
|
+
if (!db) {
|
|
114
|
+
throw new Error('SQLite worker: no database open');
|
|
115
|
+
}
|
|
116
|
+
return db;
|
|
117
|
+
}
|
|
118
|
+
function runSql(sql, bind) {
|
|
119
|
+
const conn = requireDb();
|
|
120
|
+
conn.exec({
|
|
121
|
+
sql,
|
|
122
|
+
bind
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
changes: conn.changes()
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function selectAll(sql, bind) {
|
|
129
|
+
const conn = requireDb();
|
|
130
|
+
const rows = [];
|
|
131
|
+
conn.exec({
|
|
132
|
+
sql,
|
|
133
|
+
bind,
|
|
134
|
+
rowMode: 'array',
|
|
135
|
+
resultRows: rows
|
|
136
|
+
});
|
|
137
|
+
return rows;
|
|
138
|
+
}
|
|
139
|
+
function normalizeDbPath(dbName) {
|
|
140
|
+
return dbName.startsWith('/') ? dbName : `/${dbName}`;
|
|
141
|
+
}
|
|
142
|
+
function respond(msg) {
|
|
143
|
+
self.postMessage(msg);
|
|
144
|
+
}
|
|
145
|
+
self.onmessage = async (ev)=>{
|
|
146
|
+
const req = ev.data;
|
|
147
|
+
try {
|
|
148
|
+
switch(req.type){
|
|
149
|
+
case 'init':
|
|
150
|
+
await handleInit(req.dbName, req.ephemeral, req.poolDirectory, req.encryptionKey);
|
|
151
|
+
return respond({
|
|
152
|
+
type: 'ok',
|
|
153
|
+
id: req.id
|
|
154
|
+
});
|
|
155
|
+
case 'close':
|
|
156
|
+
handleClose();
|
|
157
|
+
return respond({
|
|
158
|
+
type: 'ok',
|
|
159
|
+
id: req.id
|
|
160
|
+
});
|
|
161
|
+
case 'deleteDb':
|
|
162
|
+
handleDeleteDb(req.dbName);
|
|
163
|
+
return respond({
|
|
164
|
+
type: 'ok',
|
|
165
|
+
id: req.id
|
|
166
|
+
});
|
|
167
|
+
case 'run':
|
|
168
|
+
{
|
|
169
|
+
const { changes } = runSql(req.sql, req.bind);
|
|
170
|
+
return respond({
|
|
171
|
+
type: 'ok',
|
|
172
|
+
id: req.id,
|
|
173
|
+
changes
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
case 'all':
|
|
177
|
+
{
|
|
178
|
+
const rows = selectAll(req.sql, req.bind);
|
|
179
|
+
return respond({
|
|
180
|
+
type: 'ok',
|
|
181
|
+
id: req.id,
|
|
182
|
+
rows
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
case 'export':
|
|
186
|
+
{
|
|
187
|
+
const bytes = await handleExport();
|
|
188
|
+
return respond({
|
|
189
|
+
type: 'ok',
|
|
190
|
+
id: req.id,
|
|
191
|
+
bytes
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
case 'begin':
|
|
195
|
+
runSql('BEGIN');
|
|
196
|
+
return respond({
|
|
197
|
+
type: 'ok',
|
|
198
|
+
id: req.id
|
|
199
|
+
});
|
|
200
|
+
case 'commit':
|
|
201
|
+
runSql('COMMIT');
|
|
202
|
+
return respond({
|
|
203
|
+
type: 'ok',
|
|
204
|
+
id: req.id
|
|
205
|
+
});
|
|
206
|
+
case 'rollback':
|
|
207
|
+
runSql('ROLLBACK');
|
|
208
|
+
return respond({
|
|
209
|
+
type: 'ok',
|
|
210
|
+
id: req.id
|
|
211
|
+
});
|
|
212
|
+
default:
|
|
213
|
+
{
|
|
214
|
+
const _exhaustive = req;
|
|
215
|
+
throw new Error(`Unknown request: ${JSON.stringify(_exhaustive)}`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
} catch (err) {
|
|
219
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
220
|
+
respond({
|
|
221
|
+
type: 'err',
|
|
222
|
+
id: req.id,
|
|
223
|
+
message,
|
|
224
|
+
encryptionCode: detectEncryptionCode(req, err, message)
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Maps a thrown error during request handling to a typed encryption code, so the
|
|
230
|
+
* main thread can re-hydrate it as a {@link SqliteEncryptionError}. Returns
|
|
231
|
+
* `undefined` for non-encryption errors (preserves the existing untyped path).
|
|
232
|
+
*
|
|
233
|
+
* Two sources:
|
|
234
|
+
* - The error was already a `SqliteEncryptionError` (pre-flight throws inside
|
|
235
|
+
* this worker — e.g. ephemeral + encryptionKey). Forward its code as-is.
|
|
236
|
+
* - The error came from SQLite/sqlite3mc with a known decrypt-failure message
|
|
237
|
+
* during an `init` request. Both "wrong key supplied" and "no key supplied
|
|
238
|
+
* to an encrypted DB" surface as SQLITE_NOTADB ("file is not a database") —
|
|
239
|
+
* we don't constrain on `req.encryptionKey` because the no-key-on-encrypted-DB
|
|
240
|
+
* case is exactly when the caller most needs the typed signal.
|
|
241
|
+
*/ function detectEncryptionCode(req, err, message) {
|
|
242
|
+
if (err instanceof SqliteEncryptionError) {
|
|
243
|
+
return err.code;
|
|
244
|
+
}
|
|
245
|
+
if (req.type === 'init' && isDecryptFailureMessage(message)) {
|
|
246
|
+
return 'decrypt_failed';
|
|
247
|
+
}
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
package/dest/stores/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './l2_tips_store.js';
|
|
2
2
|
export { L2TipsMemoryStore, type L2TipsStore } from '@aztec/stdlib/block';
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQztBQUVuQyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQyJ9
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { type BlockHash, type L2BlockTag, L2TipsStoreBase } from '@aztec/stdlib/block';
|
|
3
|
+
import { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
2
4
|
import type { AztecAsyncKVStore } from '../interfaces/store.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Persistent implementation of L2 tips store backed by a KV store.
|
|
7
|
+
* Used by nodes that need to persist chain state across restarts.
|
|
8
|
+
*/
|
|
9
|
+
export declare class L2TipsKVStore extends L2TipsStoreBase {
|
|
10
|
+
private store;
|
|
5
11
|
private readonly l2TipsStore;
|
|
6
12
|
private readonly l2BlockHashesStore;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
private readonly l2BlockNumberToCheckpointNumberStore;
|
|
14
|
+
private readonly l2CheckpointStore;
|
|
15
|
+
constructor(store: AztecAsyncKVStore, namespace: string, initialBlockHash: BlockHash);
|
|
16
|
+
protected getTip(tag: L2BlockTag): Promise<BlockNumber | undefined>;
|
|
17
|
+
protected setTip(tag: L2BlockTag, blockNumber: BlockNumber): Promise<void>;
|
|
18
|
+
protected getStoredBlockHash(blockNumber: BlockNumber): Promise<string | undefined>;
|
|
19
|
+
protected setBlockHash(blockNumber: BlockNumber, hash: string): Promise<void>;
|
|
20
|
+
protected deleteBlockHashesBefore(blockNumber: BlockNumber): Promise<void>;
|
|
21
|
+
protected getCheckpointNumberForBlock(blockNumber: BlockNumber): Promise<CheckpointNumber | undefined>;
|
|
22
|
+
protected setCheckpointNumberForBlock(blockNumber: BlockNumber, checkpointNumber: CheckpointNumber): Promise<void>;
|
|
23
|
+
protected deleteBlockToCheckpointBefore(blockNumber: BlockNumber): Promise<void>;
|
|
24
|
+
protected getCheckpoint(checkpointNumber: CheckpointNumber): Promise<PublishedCheckpoint | undefined>;
|
|
25
|
+
protected saveCheckpointData(checkpoint: PublishedCheckpoint): Promise<void>;
|
|
26
|
+
protected deleteCheckpointsBefore(checkpointNumber: CheckpointNumber): Promise<void>;
|
|
27
|
+
protected runInTransaction<T>(fn: () => Promise<T>): Promise<T>;
|
|
13
28
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDJfdGlwc19zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0b3Jlcy9sMl90aXBzX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNoRixPQUFPLEVBQUUsS0FBSyxTQUFTLEVBQUUsS0FBSyxVQUFVLEVBQU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QUFXLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FJL0U7SUFFRCxTQUFTLENBQUMsMkJBQTJCLENBQUMsV0FBVyxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsZ0JBQWdCLEdBQUcsU0FBUyxDQUFDLENBRXJHO0lBRUQsU0FBUyxDQUFDLDJCQUEyQixDQUFDLFdBQVcsRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUVqSDtJQUVELFVBQWdCLDZCQUE2QixDQUFDLFdBQVcsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUlyRjtJQUVELFVBQWdCLGFBQWEsQ0FBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsR0FBRyxPQUFPLENBQUMsbUJBQW1CLEdBQUcsU0FBUyxDQUFDLENBTTFHO0lBRUQsU0FBUyxDQUFDLGtCQUFrQixDQUFDLFVBQVUsRUFBRSxtQkFBbUIsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBRTNFO0lBRUQsVUFBZ0IsdUJBQXVCLENBQUMsZ0JBQWdCLEVBQUUsZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUl6RjtJQUVELFNBQVMsQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDLEVBQUUsRUFBRSxFQUFFLE1BQU0sT0FBTyxDQUFDLENBQUMsQ0FBQyxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FFOUQ7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"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