@aztec/kv-store 0.0.1-commit.5daedc8 → 0.0.1-commit.6201a7b05
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/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.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 +2 -1
- package/dest/indexeddb/multi_map.d.ts.map +1 -1
- package/dest/indexeddb/multi_map.js +16 -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/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 +48 -2
- 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 +25 -0
- 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.js +4 -2
- package/dest/lmdb/index.d.ts +3 -3
- package/dest/lmdb/index.d.ts.map +1 -1
- package/dest/lmdb/index.js +3 -3
- package/dest/lmdb/store.d.ts +3 -3
- 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 +7 -7
- package/dest/lmdb-v2/factory.d.ts.map +1 -1
- package/dest/lmdb-v2/factory.js +14 -10
- 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/multi_map.d.ts +2 -2
- package/dest/lmdb-v2/multi_map.d.ts.map +1 -1
- package/dest/lmdb-v2/multi_map.js +1 -2
- package/dest/lmdb-v2/read_transaction.js +21 -19
- 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 +3 -25
- 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/index.d.ts +7 -0
- package/dest/sqlite-opfs/index.d.ts.map +1 -0
- package/dest/sqlite-opfs/index.js +13 -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 +58 -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 +70 -0
- package/dest/sqlite-opfs/store.d.ts.map +1 -0
- package/dest/sqlite-opfs/store.js +242 -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 +194 -0
- package/dest/stores/l2_tips_store.d.ts +24 -9
- package/dest/stores/l2_tips_store.d.ts.map +1 -1
- package/dest/stores/l2_tips_store.js +61 -52
- package/dest/utils.d.ts +9 -6
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +51 -16
- package/package.json +21 -15
- 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 +15 -1
- package/src/indexeddb/singleton.ts +1 -1
- package/src/indexeddb/store.ts +13 -6
- package/src/interfaces/map_test_suite.ts +30 -2
- package/src/interfaces/multi_map_test_suite.ts +32 -0
- package/src/interfaces/utils.ts +1 -0
- package/src/lmdb/index.ts +9 -4
- package/src/lmdb/store.ts +13 -9
- package/src/lmdb-v2/array.ts +2 -2
- package/src/lmdb-v2/factory.ts +16 -12
- package/src/lmdb-v2/map.ts +2 -2
- package/src/lmdb-v2/multi_map.ts +2 -2
- package/src/lmdb-v2/read_transaction.ts +23 -23
- package/src/lmdb-v2/singleton.ts +2 -2
- package/src/lmdb-v2/store.ts +5 -31
- 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/index.ts +27 -0
- package/src/sqlite-opfs/map.ts +163 -0
- package/src/sqlite-opfs/messages.ts +28 -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 +248 -0
- package/src/sqlite-opfs/worker.ts +162 -0
- package/src/stores/l2_tips_store.ts +65 -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,194 @@
|
|
|
1
|
+
/// <reference lib="webworker" />
|
|
2
|
+
import sqlite3InitModule from '@sqlite.org/sqlite-wasm';
|
|
3
|
+
const SCHEMA_SQL = `
|
|
4
|
+
CREATE TABLE IF NOT EXISTS data (
|
|
5
|
+
slot TEXT NOT NULL PRIMARY KEY,
|
|
6
|
+
container TEXT NOT NULL,
|
|
7
|
+
key BLOB NOT NULL,
|
|
8
|
+
key_count INTEGER NOT NULL,
|
|
9
|
+
hash TEXT NOT NULL,
|
|
10
|
+
value BLOB
|
|
11
|
+
) WITHOUT ROWID;
|
|
12
|
+
|
|
13
|
+
CREATE INDEX IF NOT EXISTS idx_container_key ON data(container, key);
|
|
14
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_container_key_count ON data(container, key, key_count);
|
|
15
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_container_key_hash ON data(container, key, hash);
|
|
16
|
+
`;
|
|
17
|
+
const DEFAULT_SAH_POOL_DIRECTORY = '.aztec-kv';
|
|
18
|
+
const SAH_POOL_VFS_NAME = 'aztec-kv-opfs';
|
|
19
|
+
let sqlite3;
|
|
20
|
+
let pool;
|
|
21
|
+
let db;
|
|
22
|
+
let dbPath;
|
|
23
|
+
async function ensurePool(directory) {
|
|
24
|
+
sqlite3 ??= await sqlite3InitModule();
|
|
25
|
+
if (!pool) {
|
|
26
|
+
pool = await sqlite3.installOpfsSAHPoolVfs({
|
|
27
|
+
name: SAH_POOL_VFS_NAME,
|
|
28
|
+
directory,
|
|
29
|
+
initialCapacity: 8
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return pool;
|
|
33
|
+
}
|
|
34
|
+
async function handleInit(dbName, ephemeral, directory) {
|
|
35
|
+
sqlite3 ??= await sqlite3InitModule();
|
|
36
|
+
if (ephemeral) {
|
|
37
|
+
db = new sqlite3.oo1.DB(':memory:', 'c');
|
|
38
|
+
} else {
|
|
39
|
+
const p = await ensurePool(directory ?? DEFAULT_SAH_POOL_DIRECTORY);
|
|
40
|
+
dbPath = normalizeDbPath(dbName);
|
|
41
|
+
db = new p.OpfsSAHPoolDb(dbPath);
|
|
42
|
+
}
|
|
43
|
+
runSql(SCHEMA_SQL);
|
|
44
|
+
}
|
|
45
|
+
function handleClose() {
|
|
46
|
+
db?.close();
|
|
47
|
+
db = undefined;
|
|
48
|
+
dbPath = undefined;
|
|
49
|
+
}
|
|
50
|
+
async function handleExport() {
|
|
51
|
+
if (!db || !dbPath) {
|
|
52
|
+
throw new Error('SQLite worker: no database open to export');
|
|
53
|
+
}
|
|
54
|
+
if (!pool) {
|
|
55
|
+
throw new Error('SQLite worker: no SAH Pool available (ephemeral DBs cannot be exported)');
|
|
56
|
+
}
|
|
57
|
+
return await pool.exportFile(dbPath);
|
|
58
|
+
}
|
|
59
|
+
function handleDeleteDb(dbName) {
|
|
60
|
+
const path = normalizeDbPath(dbName);
|
|
61
|
+
if (db && dbPath === path) {
|
|
62
|
+
db.close();
|
|
63
|
+
db = undefined;
|
|
64
|
+
dbPath = undefined;
|
|
65
|
+
}
|
|
66
|
+
// Ephemeral :memory: DBs never back a file — skip installing a pool just to unlink
|
|
67
|
+
// nothing. installOpfsSAHPoolVfs acquires an exclusive lock on the OPFS SAH
|
|
68
|
+
// directory, and under heavy test churn that can contend with workers from
|
|
69
|
+
// previous tests whose OPFS handles Chromium hasn't yet released, hanging the RPC
|
|
70
|
+
// and then the whole test run.
|
|
71
|
+
if (!pool) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
pool.unlink(path);
|
|
76
|
+
} catch {
|
|
77
|
+
// File may not exist; ignore.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function requireDb() {
|
|
81
|
+
if (!db) {
|
|
82
|
+
throw new Error('SQLite worker: no database open');
|
|
83
|
+
}
|
|
84
|
+
return db;
|
|
85
|
+
}
|
|
86
|
+
function runSql(sql, bind) {
|
|
87
|
+
const conn = requireDb();
|
|
88
|
+
conn.exec({
|
|
89
|
+
sql,
|
|
90
|
+
bind
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
changes: conn.changes()
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function selectAll(sql, bind) {
|
|
97
|
+
const conn = requireDb();
|
|
98
|
+
const rows = [];
|
|
99
|
+
conn.exec({
|
|
100
|
+
sql,
|
|
101
|
+
bind,
|
|
102
|
+
rowMode: 'array',
|
|
103
|
+
resultRows: rows
|
|
104
|
+
});
|
|
105
|
+
return rows;
|
|
106
|
+
}
|
|
107
|
+
function normalizeDbPath(dbName) {
|
|
108
|
+
return dbName.startsWith('/') ? dbName : `/${dbName}`;
|
|
109
|
+
}
|
|
110
|
+
function respond(msg) {
|
|
111
|
+
self.postMessage(msg);
|
|
112
|
+
}
|
|
113
|
+
self.onmessage = async (ev)=>{
|
|
114
|
+
const req = ev.data;
|
|
115
|
+
try {
|
|
116
|
+
switch(req.type){
|
|
117
|
+
case 'init':
|
|
118
|
+
await handleInit(req.dbName, req.ephemeral, req.poolDirectory);
|
|
119
|
+
return respond({
|
|
120
|
+
type: 'ok',
|
|
121
|
+
id: req.id
|
|
122
|
+
});
|
|
123
|
+
case 'close':
|
|
124
|
+
handleClose();
|
|
125
|
+
return respond({
|
|
126
|
+
type: 'ok',
|
|
127
|
+
id: req.id
|
|
128
|
+
});
|
|
129
|
+
case 'deleteDb':
|
|
130
|
+
handleDeleteDb(req.dbName);
|
|
131
|
+
return respond({
|
|
132
|
+
type: 'ok',
|
|
133
|
+
id: req.id
|
|
134
|
+
});
|
|
135
|
+
case 'run':
|
|
136
|
+
{
|
|
137
|
+
const { changes } = runSql(req.sql, req.bind);
|
|
138
|
+
return respond({
|
|
139
|
+
type: 'ok',
|
|
140
|
+
id: req.id,
|
|
141
|
+
changes
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
case 'all':
|
|
145
|
+
{
|
|
146
|
+
const rows = selectAll(req.sql, req.bind);
|
|
147
|
+
return respond({
|
|
148
|
+
type: 'ok',
|
|
149
|
+
id: req.id,
|
|
150
|
+
rows
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
case 'export':
|
|
154
|
+
{
|
|
155
|
+
const bytes = await handleExport();
|
|
156
|
+
return respond({
|
|
157
|
+
type: 'ok',
|
|
158
|
+
id: req.id,
|
|
159
|
+
bytes
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
case 'begin':
|
|
163
|
+
runSql('BEGIN');
|
|
164
|
+
return respond({
|
|
165
|
+
type: 'ok',
|
|
166
|
+
id: req.id
|
|
167
|
+
});
|
|
168
|
+
case 'commit':
|
|
169
|
+
runSql('COMMIT');
|
|
170
|
+
return respond({
|
|
171
|
+
type: 'ok',
|
|
172
|
+
id: req.id
|
|
173
|
+
});
|
|
174
|
+
case 'rollback':
|
|
175
|
+
runSql('ROLLBACK');
|
|
176
|
+
return respond({
|
|
177
|
+
type: 'ok',
|
|
178
|
+
id: req.id
|
|
179
|
+
});
|
|
180
|
+
default:
|
|
181
|
+
{
|
|
182
|
+
const _exhaustive = req;
|
|
183
|
+
throw new Error(`Unknown request: ${JSON.stringify(_exhaustive)}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} catch (err) {
|
|
187
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
188
|
+
respond({
|
|
189
|
+
type: 'err',
|
|
190
|
+
id: req.id,
|
|
191
|
+
message
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
};
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { 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;
|
|
13
|
+
private readonly l2BlockNumberToCheckpointNumberStore;
|
|
14
|
+
private readonly l2CheckpointStore;
|
|
7
15
|
constructor(store: AztecAsyncKVStore, namespace: string);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDJfdGlwc19zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0b3Jlcy9sMl90aXBzX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNoRixPQUFPLEVBQUUsS0FBSyxVQUFVLEVBQUUsZUFBZSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDdkUsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFHL0QsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVoRTs7O0dBR0c7QUFDSCxxQkFBYSxhQUFjLFNBQVEsZUFBZTtJQU85QyxPQUFPLENBQUMsS0FBSztJQU5mLE9BQU8sQ0FBQyxRQUFRLENBQUMsV0FBVyxDQUF5QztJQUNyRSxPQUFPLENBQUMsUUFBUSxDQUFDLGtCQUFrQixDQUFxQztJQUN4RSxPQUFPLENBQUMsUUFBUSxDQUFDLG9DQUFvQyxDQUErQztJQUNwRyxPQUFPLENBQUMsUUFBUSxDQUFDLGlCQUFpQixDQUEwQztJQUU1RSxZQUNVLEtBQUssRUFBRSxpQkFBaUIsRUFDaEMsU0FBUyxFQUFFLE1BQU0sRUFTbEI7SUFFRCxTQUFTLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxVQUFVLEdBQUcsT0FBTyxDQUFDLFdBQVcsR0FBRyxTQUFTLENBQUMsQ0FFbEU7SUFFRCxTQUFTLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxVQUFVLEVBQUUsV0FBVyxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBRXpFO0lBRUQsU0FBUyxDQUFDLGtCQUFrQixDQUFDLFdBQVcsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUMsQ0FFbEY7SUFFRCxTQUFTLENBQUMsWUFBWSxDQUFDLFdBQVcsRUFBRSxXQUFXLEVBQUUsSUFBSSxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBRTVFO0lBRUQsVUFBZ0IsdUJBQXVCLENBQUMsV0FBVyxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBSS9FO0lBRUQsU0FBUyxDQUFDLDJCQUEyQixDQUFDLFdBQVcsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixHQUFHLFNBQVMsQ0FBQyxDQUVyRztJQUVELFNBQVMsQ0FBQywyQkFBMkIsQ0FBQyxXQUFXLEVBQUUsV0FBVyxFQUFFLGdCQUFnQixFQUFFLGdCQUFnQixHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFakg7SUFFRCxVQUFnQiw2QkFBNkIsQ0FBQyxXQUFXLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FJckY7SUFFRCxVQUFnQixhQUFhLENBQUMsZ0JBQWdCLEVBQUUsZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLG1CQUFtQixHQUFHLFNBQVMsQ0FBQyxDQU0xRztJQUVELFNBQVMsQ0FBQyxrQkFBa0IsQ0FBQyxVQUFVLEVBQUUsbUJBQW1CLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUUzRTtJQUVELFVBQWdCLHVCQUF1QixDQUFDLGdCQUFnQixFQUFFLGdCQUFnQixHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FJekY7SUFFRCxTQUFTLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxNQUFNLE9BQU8sQ0FBQyxDQUFDLENBQUMsR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBRTlEO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,KAAK,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;GAGG;AACH,qBAAa,aAAc,SAAQ,eAAe;IAO9C,OAAO,CAAC,KAAK;IANf,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyC;IACrE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqC;IACxE,OAAO,CAAC,QAAQ,CAAC,oCAAoC,CAA+C;IACpG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA0C;IAE5E,YACU,KAAK,EAAE,iBAAiB,EAChC,SAAS,EAAE,MAAM,EASlB;IAED,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAElE;IAED,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAED,SAAS,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAElF;IAED,SAAS,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;IAED,UAAgB,uBAAuB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/E;IAED,SAAS,CAAC,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAErG;IAED,SAAS,CAAC,2BAA2B,CAAC,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjH;IAED,UAAgB,6BAA6B,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrF;IAED,UAAgB,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAM1G;IAED,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;IAED,UAAgB,uBAAuB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzF;IAED,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE9D;CACF"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { L2TipsStoreBase } from '@aztec/stdlib/block';
|
|
2
|
+
import { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
3
|
+
/**
|
|
4
|
+
* Persistent implementation of L2 tips store backed by a KV store.
|
|
5
|
+
* Used by nodes that need to persist chain state across restarts.
|
|
6
|
+
*/ export class L2TipsKVStore extends L2TipsStoreBase {
|
|
7
|
+
store;
|
|
2
8
|
l2TipsStore;
|
|
3
9
|
l2BlockHashesStore;
|
|
10
|
+
l2BlockNumberToCheckpointNumberStore;
|
|
11
|
+
l2CheckpointStore;
|
|
4
12
|
constructor(store, namespace){
|
|
13
|
+
super(), this.store = store;
|
|
5
14
|
this.l2TipsStore = store.openMap([
|
|
6
15
|
namespace,
|
|
7
16
|
'l2_tips'
|
|
@@ -10,65 +19,65 @@
|
|
|
10
19
|
namespace,
|
|
11
20
|
'l2_block_hashes'
|
|
12
21
|
].join('_'));
|
|
22
|
+
this.l2BlockNumberToCheckpointNumberStore = store.openMap([
|
|
23
|
+
namespace,
|
|
24
|
+
'l2_block_number_to_checkpoint_number'
|
|
25
|
+
].join('_'));
|
|
26
|
+
this.l2CheckpointStore = store.openMap([
|
|
27
|
+
namespace,
|
|
28
|
+
'l2_checkpoint_store'
|
|
29
|
+
].join('_'));
|
|
30
|
+
}
|
|
31
|
+
getTip(tag) {
|
|
32
|
+
return this.l2TipsStore.getAsync(tag);
|
|
33
|
+
}
|
|
34
|
+
setTip(tag, blockNumber) {
|
|
35
|
+
return this.l2TipsStore.set(tag, blockNumber);
|
|
13
36
|
}
|
|
14
|
-
|
|
15
|
-
return this.l2BlockHashesStore.getAsync(
|
|
37
|
+
getStoredBlockHash(blockNumber) {
|
|
38
|
+
return this.l2BlockHashesStore.getAsync(blockNumber);
|
|
16
39
|
}
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
latest: await this.getL2Tip('latest'),
|
|
20
|
-
finalized: await this.getL2Tip('finalized'),
|
|
21
|
-
proven: await this.getL2Tip('proven')
|
|
22
|
-
};
|
|
40
|
+
setBlockHash(blockNumber, hash) {
|
|
41
|
+
return this.l2BlockHashesStore.set(blockNumber, hash);
|
|
23
42
|
}
|
|
24
|
-
async
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
hash: undefined
|
|
30
|
-
};
|
|
43
|
+
async deleteBlockHashesBefore(blockNumber) {
|
|
44
|
+
for await (const key of this.l2BlockHashesStore.keysAsync({
|
|
45
|
+
end: blockNumber
|
|
46
|
+
})){
|
|
47
|
+
await this.l2BlockHashesStore.delete(key);
|
|
31
48
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
}
|
|
50
|
+
getCheckpointNumberForBlock(blockNumber) {
|
|
51
|
+
return this.l2BlockNumberToCheckpointNumberStore.getAsync(blockNumber);
|
|
52
|
+
}
|
|
53
|
+
setCheckpointNumberForBlock(blockNumber, checkpointNumber) {
|
|
54
|
+
return this.l2BlockNumberToCheckpointNumberStore.set(blockNumber, checkpointNumber);
|
|
55
|
+
}
|
|
56
|
+
async deleteBlockToCheckpointBefore(blockNumber) {
|
|
57
|
+
for await (const key of this.l2BlockNumberToCheckpointNumberStore.keysAsync({
|
|
58
|
+
end: blockNumber
|
|
59
|
+
})){
|
|
60
|
+
await this.l2BlockNumberToCheckpointNumberStore.delete(key);
|
|
35
61
|
}
|
|
36
|
-
return {
|
|
37
|
-
number: blockNumber,
|
|
38
|
-
hash: blockHash
|
|
39
|
-
};
|
|
40
62
|
}
|
|
41
|
-
async
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const blocks = event.blocks.map((b)=>b.block);
|
|
46
|
-
for (const block of blocks){
|
|
47
|
-
await this.l2BlockHashesStore.set(block.number, (await block.hash()).toString());
|
|
48
|
-
}
|
|
49
|
-
await this.l2TipsStore.set('latest', blocks.at(-1).number);
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case 'chain-pruned':
|
|
53
|
-
await this.saveTag('latest', event.block);
|
|
54
|
-
break;
|
|
55
|
-
case 'chain-proven':
|
|
56
|
-
await this.saveTag('proven', event.block);
|
|
57
|
-
break;
|
|
58
|
-
case 'chain-finalized':
|
|
59
|
-
await this.saveTag('finalized', event.block);
|
|
60
|
-
for await (const key of this.l2BlockHashesStore.keysAsync({
|
|
61
|
-
end: event.block.number
|
|
62
|
-
})){
|
|
63
|
-
await this.l2BlockHashesStore.delete(key);
|
|
64
|
-
}
|
|
65
|
-
break;
|
|
63
|
+
async getCheckpoint(checkpointNumber) {
|
|
64
|
+
const buffer = await this.l2CheckpointStore.getAsync(checkpointNumber);
|
|
65
|
+
if (!buffer) {
|
|
66
|
+
return undefined;
|
|
66
67
|
}
|
|
68
|
+
return PublishedCheckpoint.fromBuffer(buffer);
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
saveCheckpointData(checkpoint) {
|
|
71
|
+
return this.l2CheckpointStore.set(checkpoint.checkpoint.number, checkpoint.toBuffer());
|
|
72
|
+
}
|
|
73
|
+
async deleteCheckpointsBefore(checkpointNumber) {
|
|
74
|
+
for await (const key of this.l2CheckpointStore.keysAsync({
|
|
75
|
+
end: checkpointNumber
|
|
76
|
+
})){
|
|
77
|
+
await this.l2CheckpointStore.delete(key);
|
|
72
78
|
}
|
|
73
79
|
}
|
|
80
|
+
runInTransaction(fn) {
|
|
81
|
+
return this.store.transactionAsync(fn);
|
|
82
|
+
}
|
|
74
83
|
}
|
package/dest/utils.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import type { AztecAsyncKVStore, AztecKVStore } from './interfaces/store.js';
|
|
4
4
|
/**
|
|
5
|
-
* Clears the store if the rollup address does not match the one stored in the database.
|
|
6
|
-
*
|
|
5
|
+
* Clears the store if the schema version or rollup address does not match the one stored in the database.
|
|
6
|
+
* Also clears if migrating from an older store format that didn't track schema version.
|
|
7
|
+
* This is to prevent data from being accidentally mixed up between different rollup instances or schema versions.
|
|
7
8
|
* @param store - The store to check
|
|
9
|
+
* @param targetSchemaVersion - The current schema version
|
|
8
10
|
* @param rollupAddress - The ETH address of the rollup contract
|
|
9
|
-
* @
|
|
11
|
+
* @param log - Optional logger
|
|
12
|
+
* @returns The store (cleared if necessary)
|
|
10
13
|
*/
|
|
11
|
-
export declare function
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
export declare function initStoreForRollupAndSchemaVersion<T extends AztecKVStore | AztecAsyncKVStore>(store: T, schemaVersion: number | undefined, rollupAddress: EthAddress | undefined, log?: Logger): Promise<T>;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFJcEQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsWUFBWSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHN0U7Ozs7Ozs7OztHQVNHO0FBQ0gsd0JBQXNCLGtDQUFrQyxDQUFDLENBQUMsU0FBUyxZQUFZLEdBQUcsaUJBQWlCLEVBQ2pHLEtBQUssRUFBRSxDQUFDLEVBQ1IsYUFBYSxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQ2pDLGFBQWEsRUFBRSxVQUFVLEdBQUcsU0FBUyxFQUNyQyxHQUFHLENBQUMsRUFBRSxNQUFNLEdBQ1gsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQXFDWiJ9
|
package/dest/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7E;;;;;;;;;GASG;AACH,wBAAsB,kCAAkC,CAAC,CAAC,SAAS,YAAY,GAAG,iBAAiB,EACjG,KAAK,EAAE,CAAC,EACR,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,aAAa,EAAE,UAAU,GAAG,SAAS,EACrC,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAqCZ"}
|
package/dest/utils.js
CHANGED
|
@@ -1,24 +1,59 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { DatabaseVersion } from '@aztec/stdlib/database-version/version';
|
|
1
3
|
import { isSyncStore } from './interfaces/utils.js';
|
|
2
4
|
/**
|
|
3
|
-
* Clears the store if the rollup address does not match the one stored in the database.
|
|
4
|
-
*
|
|
5
|
+
* Clears the store if the schema version or rollup address does not match the one stored in the database.
|
|
6
|
+
* Also clears if migrating from an older store format that didn't track schema version.
|
|
7
|
+
* This is to prevent data from being accidentally mixed up between different rollup instances or schema versions.
|
|
5
8
|
* @param store - The store to check
|
|
9
|
+
* @param targetSchemaVersion - The current schema version
|
|
6
10
|
* @param rollupAddress - The ETH address of the rollup contract
|
|
7
|
-
* @
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
* @param log - Optional logger
|
|
12
|
+
* @returns The store (cleared if necessary)
|
|
13
|
+
*/ export async function initStoreForRollupAndSchemaVersion(store, schemaVersion, rollupAddress, log) {
|
|
14
|
+
const targetSchemaVersion = schemaVersion ?? 0;
|
|
15
|
+
const targetRollupAddress = rollupAddress ?? EthAddress.ZERO;
|
|
16
|
+
const targetDatabaseVersion = new DatabaseVersion(targetSchemaVersion, targetRollupAddress);
|
|
17
|
+
// DB version: database schema version + rollup address combined)
|
|
18
|
+
const dbVersion = store.openSingleton('dbVersion');
|
|
19
|
+
const storedDatabaseVersion = isSyncStore(store) ? dbVersion.get() : await dbVersion.getAsync();
|
|
20
|
+
// Check if this is an old format store (has rollupAddress singleton but no dbVersion)
|
|
21
|
+
const oldRollupSingleton = store.openSingleton('rollupAddress');
|
|
22
|
+
const hasOldFormat = isSyncStore(store) ? !storedDatabaseVersion && !!oldRollupSingleton.get() : !storedDatabaseVersion && !!await oldRollupSingleton.getAsync();
|
|
23
|
+
if (hasOldFormat || doesStoreNeedToBeCleared(targetDatabaseVersion, storedDatabaseVersion, targetSchemaVersion, targetRollupAddress, log)) {
|
|
24
|
+
if (hasOldFormat) {
|
|
25
|
+
log?.warn('Detected old store format without dbVersion, clearing database');
|
|
26
|
+
}
|
|
20
27
|
await store.clear();
|
|
21
28
|
}
|
|
22
|
-
await
|
|
29
|
+
await dbVersion.set(targetDatabaseVersion.toBuffer().toString('utf-8'));
|
|
23
30
|
return store;
|
|
24
31
|
}
|
|
32
|
+
function doesStoreNeedToBeCleared(targetDatabaseVersion, storedDatabaseVersion, targetSchemaVersion, targetRollupAddress, log) {
|
|
33
|
+
if (storedDatabaseVersion) {
|
|
34
|
+
try {
|
|
35
|
+
const storedVersion = DatabaseVersion.fromBuffer(Buffer.from(storedDatabaseVersion, 'utf-8'));
|
|
36
|
+
const cmp = storedVersion.cmp(targetDatabaseVersion);
|
|
37
|
+
if (cmp === undefined) {
|
|
38
|
+
log?.warn('Rollup address changed, clearing database', {
|
|
39
|
+
stored: storedVersion.rollupAddress.toString(),
|
|
40
|
+
current: targetRollupAddress.toString()
|
|
41
|
+
});
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
if (cmp !== 0) {
|
|
45
|
+
log?.warn('Schema version changed, clearing database', {
|
|
46
|
+
stored: storedVersion.schemaVersion,
|
|
47
|
+
current: targetSchemaVersion
|
|
48
|
+
});
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
log?.warn('Failed to parse stored version, clearing database', {
|
|
53
|
+
err
|
|
54
|
+
});
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/kv-store",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.6201a7b05",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/interfaces/index.js",
|
|
7
|
+
"./interfaces": "./dest/interfaces/index.js",
|
|
7
8
|
"./lmdb": "./dest/lmdb/index.js",
|
|
8
9
|
"./lmdb-v2": "./dest/lmdb-v2/index.js",
|
|
9
10
|
"./indexeddb": "./dest/indexeddb/index.js",
|
|
10
|
-
"./
|
|
11
|
-
"./
|
|
11
|
+
"./sqlite-opfs": "./dest/sqlite-opfs/index.js",
|
|
12
|
+
"./stores": "./dest/stores/index.js"
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
14
|
-
"build": "yarn clean &&
|
|
15
|
-
"build:dev": "
|
|
15
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
16
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
16
17
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
17
18
|
"test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json",
|
|
18
|
-
"test:browser": "
|
|
19
|
+
"test:browser": "vitest run --config ./vitest.config.ts",
|
|
20
|
+
"bench:browser": "VITE_BENCH=1 vitest run --config ./vitest.config.ts src/bench",
|
|
19
21
|
"test": "yarn test:node",
|
|
20
22
|
"test:jest": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
21
23
|
},
|
|
@@ -24,10 +26,12 @@
|
|
|
24
26
|
"./package.local.json"
|
|
25
27
|
],
|
|
26
28
|
"dependencies": {
|
|
27
|
-
"@aztec/
|
|
28
|
-
"@aztec/
|
|
29
|
-
"@aztec/
|
|
30
|
-
"@aztec/
|
|
29
|
+
"@aztec/constants": "0.0.1-commit.6201a7b05",
|
|
30
|
+
"@aztec/ethereum": "0.0.1-commit.6201a7b05",
|
|
31
|
+
"@aztec/foundation": "0.0.1-commit.6201a7b05",
|
|
32
|
+
"@aztec/native": "0.0.1-commit.6201a7b05",
|
|
33
|
+
"@aztec/stdlib": "0.0.1-commit.6201a7b05",
|
|
34
|
+
"@sqlite.org/sqlite-wasm": "3.50.4-build1",
|
|
31
35
|
"idb": "^8.0.0",
|
|
32
36
|
"lmdb": "^3.2.0",
|
|
33
37
|
"msgpackr": "^1.11.2",
|
|
@@ -43,18 +47,20 @@
|
|
|
43
47
|
"@types/mocha-each": "^2.0.4",
|
|
44
48
|
"@types/node": "^22.15.17",
|
|
45
49
|
"@types/sinon": "^17.0.3",
|
|
46
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"@web/test-runner-playwright": "^0.11.0",
|
|
50
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
51
|
+
"@vitest/browser-playwright": "^4.0.0",
|
|
52
|
+
"buffer": "^6.0.3",
|
|
50
53
|
"chai": "^5.1.2",
|
|
51
54
|
"chai-as-promised": "^8.0.1",
|
|
52
55
|
"jest": "^30.0.0",
|
|
53
56
|
"mocha": "^10.8.2",
|
|
54
57
|
"mocha-each": "^2.0.1",
|
|
58
|
+
"playwright": "1.49.0",
|
|
55
59
|
"sinon": "^19.0.2",
|
|
56
60
|
"ts-node": "^10.9.1",
|
|
57
|
-
"typescript": "^5.3.3"
|
|
61
|
+
"typescript": "^5.3.3",
|
|
62
|
+
"util": "^0.12.5",
|
|
63
|
+
"vitest": "^4.0.0"
|
|
58
64
|
},
|
|
59
65
|
"files": [
|
|
60
66
|
"dest",
|