diff --git a/packages/erpc/Dockerfile b/packages/erpc/Dockerfile index e597696..640142d 100644 --- a/packages/erpc/Dockerfile +++ b/packages/erpc/Dockerfile @@ -9,7 +9,7 @@ RUN cd /tmp/dev && bun build --outfile ./erpc.js --minify --target node --extern # Final image #FROM erpc-dev AS final -FROM ghcr.io/erpc/erpc@sha256:c62bd25d011cb0cf354689685edcf81ef49480c532d7b980a1f4cf0be3bdd0ea AS final +FROM ghcr.io/erpc/erpc@sha256:c2e09378e5b7922428e8363c577fdf063aaf3d060e79ce44f8f9006c47bc80f6 AS final # Install curl, will be used for healthcheck RUN apt-get update && apt-get install -y curl diff --git a/packages/erpc/src/storage.ts b/packages/erpc/src/storage.ts index 729b917..e261664 100644 --- a/packages/erpc/src/storage.ts +++ b/packages/erpc/src/storage.ts @@ -26,10 +26,19 @@ const connectors = [ }, }, { - id: "memory-main", + id: "memory-unfinalized", driver: "memory", memory: { - maxItems: 65_536, + // max 4k items for unfinalized cache + maxItems: 4_096, + }, + }, + { + id: "memory-realtime", + driver: "memory", + memory: { + // Max 4k items for realtime cache + maxItems: 4_096, }, }, ] as const satisfies ConnectorConfig[]; @@ -50,17 +59,18 @@ const cachePolicies = [ }, // Cache not finalized data for 2sec in the memory { - connector: "memory-main", + connector: "memory-unfinalized", network: "*", method: "*", finality: DataFinalityStateUnfinalized, empty: CacheEmptyBehaviorIgnore, // 2sec in nanoseconds ttl: 2_000_000_000, + maxItemSize: "20kb", }, // Cache realtime data for 2sec on the memory on arbitrum { - connector: "memory-main", + connector: "memory-realtime", network: "evm:42161", method: "*", finality: DataFinalityStateRealtime, @@ -70,7 +80,7 @@ const cachePolicies = [ }, // Cache realtime data for 30sec on arbitrum sepolia { - connector: "memory-main", + connector: "memory-realtime", network: "evm:421614", method: "*", finality: DataFinalityStateRealtime,