From 7eec6ba718bab33ed7c60bc0be9cd60e03f473e0 Mon Sep 17 00:00:00 2001 From: Sergey Timoshin Date: Sat, 11 Oct 2025 01:47:43 +0100 Subject: [PATCH] refactor: remove run mode flag in prover start --- cli/src/commands/test-validator/index.ts | 39 ------------- cli/src/utils/initTestEnv.ts | 12 ---- cli/src/utils/processProverServer.ts | 71 ------------------------ js/compressed-token/package.json | 8 ++- prover/server/Dockerfile | 2 +- prover/server/docker-compose.yml | 2 +- prover/server/main.go | 4 -- 7 files changed, 8 insertions(+), 130 deletions(-) diff --git a/cli/src/commands/test-validator/index.ts b/cli/src/commands/test-validator/index.ts index f23522a801..332fadf278 100644 --- a/cli/src/commands/test-validator/index.ts +++ b/cli/src/commands/test-validator/index.ts @@ -75,35 +75,6 @@ class SetupCommand extends Command { default: 3001, exclusive: ["skip-prover"], }), - "prover-run-mode": Flags.string({ - description: - "Specify the running mode for the prover (local-rpc, forester, forester-test, rpc, or full). Default: local-rpc", - options: [ - "local-rpc", - "rpc", - "forester", - "forester-test", - "full", - "full-test", - ] as const, - required: false, - exclusive: ["skip-prover"], - }), - circuit: Flags.string({ - description: "Specify individual circuits to enable.", - options: [ - "inclusion", - "non-inclusion", - "combined", - "append", - "update", - "append-test", - "update-test", - ], - multiple: true, - required: false, - exclusive: ["skip-prover"], - }), "limit-ledger-size": Flags.integer({ description: "Keep this amount of shreds in root slots.", required: false, @@ -226,16 +197,6 @@ class SetupCommand extends Command { proverPort: flags["prover-port"], prover: !flags["skip-prover"], skipSystemAccounts: flags["skip-system-accounts"], - proverRunMode: flags["prover-run-mode"] as - | "inclusion" - | "non-inclusion" - | "forester" - | "forester-test" - | "rpc" - | "full" - | "full-test" - | undefined, - circuits: flags["circuit"], geyserConfig: flags["geyser-config"], validatorArgs: flags["validator-args"], }); diff --git a/cli/src/utils/initTestEnv.ts b/cli/src/utils/initTestEnv.ts index cfb5138144..4367b23c5c 100644 --- a/cli/src/utils/initTestEnv.ts +++ b/cli/src/utils/initTestEnv.ts @@ -92,8 +92,6 @@ export async function initTestEnv({ checkPhotonVersion = true, photonDatabaseUrl, limitLedgerSize, - proverRunMode, - circuits, geyserConfig, validatorArgs, }: { @@ -108,16 +106,6 @@ export async function initTestEnv({ checkPhotonVersion?: boolean; photonDatabaseUrl?: string; limitLedgerSize?: number; - proverRunMode?: - | "local-rpc" - | "inclusion" - | "non-inclusion" - | "forester" - | "forester-test" - | "rpc" - | "full" - | "full-test"; - circuits?: string[]; validatorArgs?: string; geyserConfig?: string; }) { diff --git a/cli/src/utils/processProverServer.ts b/cli/src/utils/processProverServer.ts index 9b6852f8bd..fdb57b5ebb 100644 --- a/cli/src/utils/processProverServer.ts +++ b/cli/src/utils/processProverServer.ts @@ -7,7 +7,6 @@ import { waitForServers, } from "./process"; import { LIGHT_PROVER_PROCESS_NAME, BASE_PATH } from "./constants"; -import find from "find-process"; import { downloadProverBinary } from "./downloadProverBinary"; const KEYS_DIR = "proving-keys/"; @@ -17,76 +16,6 @@ export async function killProver() { await killProcess(LIGHT_PROVER_PROCESS_NAME); } -export async function isProverRunningWithFlags( - runMode?: string, - circuits?: string[], - proverPort?: number, - redisUrl?: string, -): Promise { - // Use find-process to get prover processes by name pattern - const proverProcesses = await find("name", "prover-"); - - const expectedArgs = []; - if (runMode) { - expectedArgs.push("--run-mode", runMode); - } - if (Array.isArray(circuits)) { - for (const c of circuits) { - expectedArgs.push("--circuit", c); - } - } - if (proverPort) { - expectedArgs.push("--prover-address", `0.0.0.0:${proverPort}`); - } - if (redisUrl) { - expectedArgs.push("--redis-url", redisUrl); - } - - let found = false; - for (const proc of proverProcesses) { - if ( - proc.cmd && - (proc.cmd.includes("prover-") || proc.name.startsWith("prover-")) - ) { - console.log("\n[Prover Process Detected]"); - console.log(` PID: ${proc.pid}`); - console.log(` Command: ${proc.cmd}`); - let matches = true; - for (const arg of expectedArgs) { - if (!proc.cmd.includes(arg)) { - matches = false; - break; - } - } - if (matches) { - found = true; - console.log( - "\x1b[32m✔ Prover is already running with the same configuration.\x1b[0m", - ); - console.log( - " To restart the prover, stop the process above or use the --force flag.\n", - ); - break; - } else { - const missing = proc.cmd - ? expectedArgs.filter((arg) => !proc.cmd!.includes(arg)) - : []; - if (missing.length > 0) { - console.log( - ` (Not a match for current request. Missing args: ${missing.join(", ")})`, - ); - } - } - } - } - if (!found) { - console.log( - "\x1b[33mNo running prover found with the requested configuration.\x1b[0m", - ); - } - return found; -} - /** * Ensures the prover binary exists, downloading it if necessary */ diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index cc39208a27..94cd809c3a 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -135,10 +135,14 @@ ] }, "build-ci": { - "dependsOn": ["@lightprotocol/stateless.js:build-ci"] + "dependsOn": [ + "@lightprotocol/stateless.js:build-ci" + ] }, "test-ci": { - "dependsOn": ["@lightprotocol/stateless.js:test-ci"] + "dependsOn": [ + "@lightprotocol/stateless.js:test-ci" + ] } } } diff --git a/prover/server/Dockerfile b/prover/server/Dockerfile index 12c8be79cb..1df2ce5a03 100644 --- a/prover/server/Dockerfile +++ b/prover/server/Dockerfile @@ -22,4 +22,4 @@ COPY --chown=nonroot:nonroot ./proving-keys/v2_* /proving-keys/ WORKDIR / ENTRYPOINT [ "light-prover" ] -CMD [ "start", "--run-mode", "rpc", "--keys-dir", "/proving-keys/" ] +CMD [ "start", "--preload-keys", "rpc", "--keys-dir", "/proving-keys/" ] diff --git a/prover/server/docker-compose.yml b/prover/server/docker-compose.yml index 04b8715dba..2c175642b6 100644 --- a/prover/server/docker-compose.yml +++ b/prover/server/docker-compose.yml @@ -15,7 +15,7 @@ services: - ./proving-keys:/proving-keys/:ro command: > start - --run-mode forester-test + --preload-keys forester-test --redis-url=redis://redis:6379 depends_on: - redis diff --git a/prover/server/main.go b/prover/server/main.go index 948718a7a9..77dd29fd26 100644 --- a/prover/server/main.go +++ b/prover/server/main.go @@ -571,10 +571,6 @@ func runCli() { Name: "circuit", Usage: "Specify the circuits to enable (inclusion, non-inclusion, combined, append, update, append-test, update-test, address-append, address-append-test)", }, - &cli.StringFlag{ - Name: "run-mode", - Usage: "Specify the running mode (rpc, forester, forester-test, full, or full-test)", - }, &cli.StringFlag{ Name: "preload-keys", Usage: "Preload keys: none (lazy load all), all (preload everything), or a run mode (rpc, forester, forester-test, full, full-test, local-rpc)",