diff --git a/package.json b/package.json index 6ad6676a9e..ce04348a6b 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "sherif": "^0.8.4", "simple-git-hooks": "^2.8.1", "size-limit": "^11.1.2", - "typescript": "5.5.2", + "typescript": "5.6.2", "vitest": "^1.0.4" }, "trustedDependencies": ["c-kzg"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d8b21b6b00..1fb3d7e0f9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: version: 0.15.3 '@ark/attest': specifier: ^0.10.2 - version: 0.10.2(typescript@5.5.2) + version: 0.10.2(typescript@5.6.2) '@biomejs/biome': specifier: ^1.8.0 version: 1.8.0 @@ -28,7 +28,7 @@ importers: version: 5.0.0 '@pimlico/alto': specifier: 0.0.4 - version: 0.0.4(typescript@5.5.2) + version: 0.0.4(typescript@5.6.2) '@size-limit/preset-big-lib': specifier: ^11.1.2 version: 11.1.2(size-limit@11.1.2) @@ -58,10 +58,10 @@ importers: version: 10.4.1 knip: specifier: ^5.17.4 - version: 5.17.4(@types/node@20.14.0)(typescript@5.5.2) + version: 5.17.4(@types/node@20.14.0)(typescript@5.6.2) prool: specifier: ^0.0.16 - version: 0.0.16(@pimlico/alto@0.0.4(typescript@5.5.2)) + version: 0.0.16(@pimlico/alto@0.0.4(typescript@5.6.2)) publint: specifier: ^0.2.8 version: 0.2.8 @@ -75,8 +75,8 @@ importers: specifier: ^11.1.2 version: 11.1.2 typescript: - specifier: 5.5.2 - version: 5.5.2 + specifier: 5.6.2 + version: 5.6.2 vitest: specifier: ^1.0.4 version: 1.0.4(@types/node@20.14.0)(@vitest/ui@1.0.4)(terser@5.31.0) @@ -131,7 +131,7 @@ importers: version: 5.5.4 viem: specifier: file:../../src/ - version: link:../../src + version: file:src(typescript@5.5.4)(zod@3.22.4) environments/vite: dependencies: @@ -551,7 +551,7 @@ importers: version: link:../src vocs: specifier: 1.0.0-alpha.54 - version: 1.0.0-alpha.54(@types/node@20.14.0)(@types/react-dom@18.0.10)(@types/react@18.0.27)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(rollup@4.18.0)(terser@5.31.0)(typescript@5.5.4) + version: 1.0.0-alpha.54(@types/node@20.14.0)(@types/react-dom@18.0.10)(@types/react@18.0.27)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(rollup@4.18.0)(terser@5.31.0)(typescript@5.6.2) src: dependencies: @@ -572,7 +572,7 @@ importers: version: 1.4.0 abitype: specifier: 1.0.5 - version: 1.0.5(typescript@5.5.4)(zod@3.22.4) + version: 1.0.5(typescript@5.6.2)(zod@3.22.4) isows: specifier: 1.0.4 version: 1.0.4(ws@8.17.1) @@ -3107,7 +3107,6 @@ packages: bun@1.1.12: resolution: {integrity: sha512-NZzeZuZk7VwCs8VAXnXUHCPOlTS/IyHCscChtT1M1FLSwhBcVMsGVStYlXaaoqsinBKgp0CGJdhnJw2gR3NkDw==} - cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true @@ -6421,13 +6420,13 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + typescript@5.6.2: + resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} engines: {node: '>=14.17'} hasBin: true @@ -6642,6 +6641,14 @@ packages: typescript: optional: true + viem@2.21.3: + resolution: {integrity: sha512-WwOEsoiJ4v1zHf1OeKdtWth+chMyY/yZbHRLidhZEr0yFsOjTXkyfuvFp5ZykjRv9EtzDr2C6K/MU26CjMkSUw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + viem@file:src: resolution: {directory: src, type: directory} peerDependencies: @@ -6992,16 +6999,16 @@ snapshots: typescript: 5.3.3 validate-npm-package-name: 5.0.1 - '@ark/attest@0.10.2(typescript@5.5.2)': + '@ark/attest@0.10.2(typescript@5.6.2)': dependencies: '@ark/fs': 0.1.2 '@ark/util': 0.1.2 '@prettier/sync': 0.5.2(prettier@3.3.3) '@typescript/analyze-trace': 0.10.1 - '@typescript/vfs': 1.5.3(typescript@5.5.2) + '@typescript/vfs': 1.5.3(typescript@5.6.2) arktype: 2.0.0-beta.2 prettier: 3.3.3 - typescript: 5.5.2 + typescript: 5.6.2 transitivePeerDependencies: - supports-color @@ -8203,7 +8210,7 @@ snapshots: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - '@pimlico/alto@0.0.4(typescript@5.5.2)': + '@pimlico/alto@0.0.4(typescript@5.6.2)': dependencies: '@fastify/cors': 9.0.1 '@fastify/websocket': 10.0.1 @@ -8220,7 +8227,7 @@ snapshots: '@sentry/node': 7.118.0 '@types/node': 18.19.42 '@types/ws': 8.5.10 - abitype: 0.8.11(typescript@5.5.2)(zod@3.22.4) + abitype: 0.8.11(typescript@5.6.2)(zod@3.22.4) async-mutex: 0.4.1 dotenv: 16.4.5 fastify: 4.28.1 @@ -8229,7 +8236,7 @@ snapshots: pino-http: 8.6.1 pino-pretty: 10.3.1 prom-client: 14.2.0 - viem: 2.21.2(typescript@5.5.2)(zod@3.22.4) + viem: 2.21.3(typescript@5.6.2)(zod@3.22.4) yargs: 17.7.2 zod: 3.22.4 zod-validation-error: 1.5.0(zod@3.22.4) @@ -8796,10 +8803,10 @@ snapshots: dependencies: shiki: 1.12.0 - '@shikijs/twoslash@1.12.0(typescript@5.5.4)': + '@shikijs/twoslash@1.12.0(typescript@5.6.2)': dependencies: '@shikijs/core': 1.12.0 - twoslash: 0.2.9(typescript@5.5.4) + twoslash: 0.2.9(typescript@5.6.2) transitivePeerDependencies: - supports-color - typescript @@ -9092,10 +9099,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript/vfs@1.5.3(typescript@5.5.2)': + '@typescript/vfs@1.5.3(typescript@5.6.2)': dependencies: debug: 4.3.5 - typescript: 5.5.2 + typescript: 5.6.2 transitivePeerDependencies: - supports-color @@ -9657,9 +9664,9 @@ snapshots: '@xtuc/long@4.2.2': {} - abitype@0.8.11(typescript@5.5.2)(zod@3.22.4): + abitype@0.8.11(typescript@5.6.2)(zod@3.22.4): dependencies: - typescript: 5.5.2 + typescript: 5.6.2 optionalDependencies: zod: 3.22.4 @@ -9673,14 +9680,14 @@ snapshots: typescript: 5.4.5 zod: 3.22.4 - abitype@1.0.5(typescript@5.5.2)(zod@3.22.4): + abitype@1.0.5(typescript@5.5.4)(zod@3.22.4): optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.4 zod: 3.22.4 - abitype@1.0.5(typescript@5.5.4)(zod@3.22.4): + abitype@1.0.5(typescript@5.6.2)(zod@3.22.4): optionalDependencies: - typescript: 5.5.4 + typescript: 5.6.2 zod: 3.22.4 abort-controller@3.0.0: @@ -11532,7 +11539,7 @@ snapshots: kleur@4.1.5: {} - knip@5.17.4(@types/node@20.14.0)(typescript@5.5.2): + knip@5.17.4(@types/node@20.14.0)(typescript@5.6.2): dependencies: '@ericcornelissen/bash-parser': 0.5.2 '@nodelib/fs.walk': 2.0.0 @@ -11551,7 +11558,7 @@ snapshots: smol-toml: 1.1.4 strip-json-comments: 5.0.1 summary: 2.1.0 - typescript: 5.5.2 + typescript: 5.6.2 zod: 3.22.4 zod-validation-error: 3.3.0(zod@3.22.4) @@ -12801,7 +12808,7 @@ snapshots: dependencies: tdigest: 0.1.2 - prool@0.0.16(@pimlico/alto@0.0.4(typescript@5.5.2)): + prool@0.0.16(@pimlico/alto@0.0.4(typescript@5.6.2)): dependencies: change-case: 5.4.4 eventemitter3: 5.0.1 @@ -12810,7 +12817,7 @@ snapshots: http-proxy: 1.18.1 tar: 7.2.0 optionalDependencies: - '@pimlico/alto': 0.0.4(typescript@5.5.2) + '@pimlico/alto': 0.0.4(typescript@5.6.2) transitivePeerDependencies: - debug @@ -13826,11 +13833,11 @@ snapshots: twoslash-protocol@0.2.9: {} - twoslash@0.2.9(typescript@5.5.4): + twoslash@0.2.9(typescript@5.6.2): dependencies: '@typescript/vfs': 1.5.0 twoslash-protocol: 0.2.9 - typescript: 5.5.4 + typescript: 5.6.2 transitivePeerDependencies: - supports-color @@ -13880,10 +13887,10 @@ snapshots: typescript@5.4.5: {} - typescript@5.5.2: {} - typescript@5.5.4: {} + typescript@5.6.2: {} + ua-parser-js@1.0.38: {} ufo@1.5.3: {} @@ -14115,37 +14122,37 @@ snapshots: - utf-8-validate - zod - viem@2.21.2(typescript@5.5.2)(zod@3.22.4): + viem@2.21.2(typescript@5.5.4)(zod@3.22.4): dependencies: '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@scure/bip32': 1.4.0 '@scure/bip39': 1.4.0 - abitype: 1.0.5(typescript@5.5.2)(zod@3.22.4) + abitype: 1.0.5(typescript@5.5.4)(zod@3.22.4) isows: 1.0.4(ws@8.17.1) webauthn-p256: 0.0.5 ws: 8.17.1 optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.4 transitivePeerDependencies: - bufferutil - utf-8-validate - zod - viem@2.21.2(typescript@5.5.4)(zod@3.22.4): + viem@2.21.3(typescript@5.6.2)(zod@3.22.4): dependencies: '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@scure/bip32': 1.4.0 '@scure/bip39': 1.4.0 - abitype: 1.0.5(typescript@5.5.4)(zod@3.22.4) + abitype: 1.0.5(typescript@5.6.2)(zod@3.22.4) isows: 1.0.4(ws@8.17.1) webauthn-p256: 0.0.5 ws: 8.17.1 optionalDependencies: - typescript: 5.5.4 + typescript: 5.6.2 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -14169,6 +14176,24 @@ snapshots: - utf-8-validate - zod + viem@file:src(typescript@5.5.4)(zod@3.22.4): + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.4.0 + '@noble/hashes': 1.4.0 + '@scure/bip32': 1.4.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.5(typescript@5.5.4)(zod@3.22.4) + isows: 1.0.4(ws@8.17.1) + webauthn-p256: 0.0.5 + ws: 8.17.1 + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + vite-node@1.0.4(@types/node@20.14.0)(terser@5.31.0): dependencies: cac: 6.7.14 @@ -14270,7 +14295,7 @@ snapshots: vlq@0.2.3: {} - vocs@1.0.0-alpha.54(@types/node@20.14.0)(@types/react-dom@18.0.10)(@types/react@18.0.27)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(rollup@4.18.0)(terser@5.31.0)(typescript@5.5.4): + vocs@1.0.0-alpha.54(@types/node@20.14.0)(@types/react-dom@18.0.10)(@types/react@18.0.27)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(rollup@4.18.0)(terser@5.31.0)(typescript@5.6.2): dependencies: '@floating-ui/react': 0.26.16(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@hono/node-server': 1.11.2 @@ -14287,7 +14312,7 @@ snapshots: '@radix-ui/react-tabs': 1.0.4(@types/react-dom@18.0.10)(@types/react@18.0.27)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@shikijs/rehype': 1.12.0 '@shikijs/transformers': 1.12.0 - '@shikijs/twoslash': 1.12.0(typescript@5.5.4) + '@shikijs/twoslash': 1.12.0(typescript@5.6.2) '@vanilla-extract/css': 1.15.2 '@vanilla-extract/dynamic': 2.1.1 '@vanilla-extract/vite-plugin': 3.9.5(@types/node@20.14.0)(terser@5.31.0)(vite@5.3.5(@types/node@20.14.0)(terser@5.31.0)) @@ -14330,7 +14355,7 @@ snapshots: shiki: 1.12.0 tailwindcss: 3.4.3 toml: 3.0.0 - twoslash: 0.2.9(typescript@5.5.4) + twoslash: 0.2.9(typescript@5.6.2) ua-parser-js: 1.0.38 unified: 11.0.4 unist-util-visit: 5.0.0 diff --git a/src/utils/lru.ts b/src/utils/lru.ts index 193dc80d5c..bc52c0de47 100644 --- a/src/utils/lru.ts +++ b/src/utils/lru.ts @@ -14,7 +14,7 @@ export class LruMap extends Map { override get(key: string) { const value = super.get(key) - if (value !== undefined) { + if (super.has(key) && value !== undefined) { this.delete(key) super.set(key, value) } @@ -24,8 +24,10 @@ export class LruMap extends Map { override set(key: string, value: value) { super.set(key, value) - if (this.maxSize && this.size > this.maxSize) - this.delete(this.keys().next().value) + if (this.maxSize && this.size > this.maxSize) { + const firstKey = this.keys().next().value + if (firstKey) this.delete(firstKey) + } return this } } diff --git a/src/utils/rpc/ipc.ts b/src/utils/rpc/ipc.ts index 80fbfd9fe7..dbe5b8adf1 100644 --- a/src/utils/rpc/ipc.ts +++ b/src/utils/rpc/ipc.ts @@ -60,7 +60,10 @@ export async function getIpcRpcClient( let lastRemaining = Buffer.alloc(0) function onData(buffer: Buffer) { const [messages, remaining] = extractMessages( - Buffer.concat([lastRemaining, buffer]), + Buffer.concat([ + Uint8Array.from(lastRemaining), + Uint8Array.from(buffer), + ]), ) for (const message of messages) { const response = JSON.parse(Buffer.from(message).toString())