diff --git a/yarn-project/p2p/src/testbench/worker_client_manager.ts b/yarn-project/p2p/src/testbench/worker_client_manager.ts index d6f3b250fa96..f3f1b3b1648a 100644 --- a/yarn-project/p2p/src/testbench/worker_client_manager.ts +++ b/yarn-project/p2p/src/testbench/worker_client_manager.ts @@ -81,13 +81,16 @@ class WorkerClientManager { * Note: We send the raw peerIdPrivateKey string instead of SecretValue * because SecretValue.toJSON() returns '[Redacted]', losing the value. * The worker must re-wrap it in SecretValue. + * We also omit priceBumpPercentage since it's a bigint and can't be + * serialized over IPC (which uses JSON under the hood). */ private createClientConfig( clientIndex: number, port: number, otherNodes: string[], - ): Omit & { peerIdPrivateKey: string } & Partial { - return { + ): Omit & { peerIdPrivateKey: string } & Partial { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { priceBumpPercentage: _, ...config } = { ...getP2PDefaultConfig(), p2pEnabled: true, peerIdPrivateKey: this.peerIdPrivateKeys[clientIndex], @@ -96,7 +99,10 @@ class WorkerClientManager { p2pPort: port, bootstrapNodes: [...otherNodes], ...this.p2pConfig, - } as Omit & { peerIdPrivateKey: string } & Partial; + } as Record; + return config as Omit & { + peerIdPrivateKey: string; + } & Partial; } /** @@ -104,7 +110,9 @@ class WorkerClientManager { * Config uses raw string for peerIdPrivateKey (not SecretValue) for IPC serialization. */ private spawnWorkerProcess( - config: Omit & { peerIdPrivateKey: string } & Partial, + config: Omit & { + peerIdPrivateKey: string; + } & Partial, clientIndex: number, ): [ChildProcess, Promise] { const useCompiled = existsSync(workerJsPath);