Skip to content

Commit c02b41a

Browse files
committed
fix(warp): allow disabling state cache memoization for legacy checkpoint verification
1 parent 2610360 commit c02b41a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/domain/warp/RuntimeHostBoot.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type RuntimeHostConstructionOptions = {
5959
codec: CodecPort;
6060
trustCrypto?: TrustCryptoPort;
6161
seekCache?: SeekCachePort;
62-
stateCache?: WarpStateCachePort;
62+
stateCache?: WarpStateCachePort | null;
6363
audit?: boolean;
6464
blobStorage?: BlobStoragePort;
6565
patchBlobStorage?: BlobStoragePort;
@@ -90,7 +90,7 @@ export type RuntimeHostOpenOptions = {
9090
codec?: CodecPort;
9191
trustCrypto?: TrustCryptoPort;
9292
seekCache?: SeekCachePort;
93-
stateCache?: WarpStateCachePort;
93+
stateCache?: WarpStateCachePort | null;
9494
audit?: boolean;
9595
blobStorage?: BlobStoragePort;
9696
patchBlobStorage?: BlobStoragePort;
@@ -120,7 +120,7 @@ export class WarpOpenOptions {
120120
readonly codec?: CodecPort;
121121
readonly trustCrypto?: TrustCryptoPort;
122122
readonly seekCache?: SeekCachePort;
123-
readonly stateCache?: WarpStateCachePort;
123+
readonly stateCache?: WarpStateCachePort | null;
124124
readonly audit?: boolean;
125125
readonly blobStorage?: BlobStoragePort;
126126
readonly patchBlobStorage?: BlobStoragePort;
@@ -350,7 +350,7 @@ export async function resolveRuntimeHostConstructionOptions(
350350
let resolvedStateCache: WarpStateCachePort | undefined;
351351
if (stateCache !== undefined && stateCache !== null) {
352352
resolvedStateCache = stateCache;
353-
} else if (typeof persistence.createRuntimeStateCache === 'function') {
353+
} else if (stateCache !== null && typeof persistence.createRuntimeStateCache === 'function') {
354354
resolvedStateCache = await persistence.createRuntimeStateCache({
355355
graphName,
356356
codec: resolvedCodec,

test/integration/api/helpers/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export async function createTestRepo(label = 'api-test') {
4949
async function openGraph(graphName, writerId, opts = {}) {
5050
return WarpCore.open({
5151
blobStorage,
52+
stateCache: null,
5253
...opts,
5354
persistence,
5455
graphName,

0 commit comments

Comments
 (0)