@aztec/pxe 5.0.1 → 5.1.0-nightly.20260717
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.
|
@@ -11,4 +11,4 @@ export declare function openBrowserStore(name: string, schemaVersion: number, co
|
|
|
11
11
|
rollupAddress: EthAddress;
|
|
12
12
|
dataStoreMapSizeKb?: number;
|
|
13
13
|
}, log?: Logger): Promise<AztecSQLiteOPFSStore>;
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBQ2xFLE9BQU8sRUFDTCxvQkFBb0IsRUFJckIsTUFBTSw2QkFBNkIsQ0FBQztBQUlyQzs7OztHQUlHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUNwQyxJQUFJLEVBQUUsTUFBTSxFQUNaLGFBQWEsRUFBRSxNQUFNLEVBQ3JCLE1BQU0sRUFBRTtJQUFFLFNBQVMsRUFBRSxNQUFNLENBQUM7SUFBQyxhQUFhLEVBQUUsVUFBVSxDQUFDO0lBQUMsa0JBQWtCLENBQUMsRUFBRSxNQUFNLENBQUE7Q0FBRSxFQUNyRixHQUFHLEdBQUUsTUFBaUMsR0FDckMsT0FBTyxDQUFDLG9CQUFvQixDQUFDLENBZ0MvQiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/client/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/client/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EACL,oBAAoB,EAIrB,MAAM,6BAA6B,CAAC;AAIrC;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,UAAU,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,EACrF,GAAG,GAAE,MAAiC,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAgC/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
-
import { AztecSQLiteOPFSStore, storePoolDirectory } from '@aztec/kv-store/sqlite-opfs';
|
|
2
|
+
import { AztecSQLiteOPFSStore, SqliteCorruptionError, deleteStore, storePoolDirectory } from '@aztec/kv-store/sqlite-opfs';
|
|
3
3
|
import { assertStoreIdentity, effectiveStoreName } from '../../storage/store_identity.js';
|
|
4
4
|
/**
|
|
5
5
|
* Opens the persistent browser (sqlite-opfs) store selected by `name` and identity `(config.l1ChainId,
|
|
@@ -16,7 +16,21 @@ import { assertStoreIdentity, effectiveStoreName } from '../../storage/store_ide
|
|
|
16
16
|
storeName,
|
|
17
17
|
dataStoreMapSizeKb: config.dataStoreMapSizeKb
|
|
18
18
|
});
|
|
19
|
-
const
|
|
19
|
+
const openStore = ()=>AztecSQLiteOPFSStore.open(createLogger('kv-store:sqlite-opfs'), storeName, false, storePoolDirectory(storeName));
|
|
20
|
+
let store;
|
|
21
|
+
try {
|
|
22
|
+
store = await openStore();
|
|
23
|
+
} catch (err) {
|
|
24
|
+
if (!(err instanceof SqliteCorruptionError)) {
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
// A corrupt image is unrecoverable — no retry against the same bytes helps. Wipe the store's OPFS directory
|
|
28
|
+
// (safe: the failed open left no SAH-pool lock behind) and reopen a fresh, empty one, so the browser self-heals
|
|
29
|
+
// into a normal first-run rather than dead-ending on "database disk image is malformed" every load.
|
|
30
|
+
log.warn(`${storeName} store is corrupt (${err.message}); wiping and reopening fresh`);
|
|
31
|
+
await deleteStore(storeName);
|
|
32
|
+
store = await openStore();
|
|
33
|
+
}
|
|
20
34
|
try {
|
|
21
35
|
await assertStoreIdentity(store, storeName, identity);
|
|
22
36
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.1.0-nightly.20260717",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"typedocOptions": {
|
|
6
6
|
"entryPoints": [
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@aztec/bb-prover": "5.0.
|
|
75
|
-
"@aztec/bb.js": "5.0.
|
|
76
|
-
"@aztec/builder": "5.0.
|
|
77
|
-
"@aztec/constants": "5.0.
|
|
78
|
-
"@aztec/ethereum": "5.0.
|
|
79
|
-
"@aztec/foundation": "5.0.
|
|
80
|
-
"@aztec/key-store": "5.0.
|
|
81
|
-
"@aztec/kv-store": "5.0.
|
|
82
|
-
"@aztec/noir-protocol-circuits-types": "5.0.
|
|
83
|
-
"@aztec/noir-types": "5.0.
|
|
84
|
-
"@aztec/protocol-contracts": "5.0.
|
|
85
|
-
"@aztec/simulator": "5.0.
|
|
86
|
-
"@aztec/standard-contracts": "5.0.
|
|
87
|
-
"@aztec/stdlib": "5.0.
|
|
74
|
+
"@aztec/bb-prover": "5.1.0-nightly.20260717",
|
|
75
|
+
"@aztec/bb.js": "5.1.0-nightly.20260717",
|
|
76
|
+
"@aztec/builder": "5.1.0-nightly.20260717",
|
|
77
|
+
"@aztec/constants": "5.1.0-nightly.20260717",
|
|
78
|
+
"@aztec/ethereum": "5.1.0-nightly.20260717",
|
|
79
|
+
"@aztec/foundation": "5.1.0-nightly.20260717",
|
|
80
|
+
"@aztec/key-store": "5.1.0-nightly.20260717",
|
|
81
|
+
"@aztec/kv-store": "5.1.0-nightly.20260717",
|
|
82
|
+
"@aztec/noir-protocol-circuits-types": "5.1.0-nightly.20260717",
|
|
83
|
+
"@aztec/noir-types": "5.1.0-nightly.20260717",
|
|
84
|
+
"@aztec/protocol-contracts": "5.1.0-nightly.20260717",
|
|
85
|
+
"@aztec/simulator": "5.1.0-nightly.20260717",
|
|
86
|
+
"@aztec/standard-contracts": "5.1.0-nightly.20260717",
|
|
87
|
+
"@aztec/stdlib": "5.1.0-nightly.20260717",
|
|
88
88
|
"koa": "^2.16.1",
|
|
89
89
|
"koa-router": "^13.1.1",
|
|
90
90
|
"lodash.omit": "^4.5.0",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@aztec/noir-test-contracts.js": "5.0.
|
|
97
|
-
"@aztec/world-state": "5.0.
|
|
96
|
+
"@aztec/noir-test-contracts.js": "5.1.0-nightly.20260717",
|
|
97
|
+
"@aztec/world-state": "5.1.0-nightly.20260717",
|
|
98
98
|
"@jest/globals": "^30.0.0",
|
|
99
99
|
"@types/jest": "^30.0.0",
|
|
100
100
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
AztecSQLiteOPFSStore,
|
|
5
|
+
SqliteCorruptionError,
|
|
6
|
+
deleteStore,
|
|
7
|
+
storePoolDirectory,
|
|
8
|
+
} from '@aztec/kv-store/sqlite-opfs';
|
|
4
9
|
|
|
5
10
|
import { assertStoreIdentity, effectiveStoreName } from '../../storage/store_identity.js';
|
|
6
11
|
|
|
@@ -21,12 +26,23 @@ export async function openBrowserStore(
|
|
|
21
26
|
storeName,
|
|
22
27
|
dataStoreMapSizeKb: config.dataStoreMapSizeKb,
|
|
23
28
|
});
|
|
24
|
-
const
|
|
25
|
-
createLogger('kv-store:sqlite-opfs'),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const openStore = () =>
|
|
30
|
+
AztecSQLiteOPFSStore.open(createLogger('kv-store:sqlite-opfs'), storeName, false, storePoolDirectory(storeName));
|
|
31
|
+
|
|
32
|
+
let store: AztecSQLiteOPFSStore;
|
|
33
|
+
try {
|
|
34
|
+
store = await openStore();
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (!(err instanceof SqliteCorruptionError)) {
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
// A corrupt image is unrecoverable — no retry against the same bytes helps. Wipe the store's OPFS directory
|
|
40
|
+
// (safe: the failed open left no SAH-pool lock behind) and reopen a fresh, empty one, so the browser self-heals
|
|
41
|
+
// into a normal first-run rather than dead-ending on "database disk image is malformed" every load.
|
|
42
|
+
log.warn(`${storeName} store is corrupt (${err.message}); wiping and reopening fresh`);
|
|
43
|
+
await deleteStore(storeName);
|
|
44
|
+
store = await openStore();
|
|
45
|
+
}
|
|
30
46
|
try {
|
|
31
47
|
await assertStoreIdentity(store, storeName, identity);
|
|
32
48
|
} catch (err) {
|