Repository navigation
fix(localnet): run current Studio (v0.123) with genlayer init/up - #434
danieljrc888 wants to merge 1 commit into
Conversation
The bundled compose still described the pre-v0.80 Studio topology, so the CLI defaulted to localnet v0.65.0 and any newer version failed in sequence: missing simulator-hardhat image, migration ignoring DB_URL, partial GenVM web override (missing extra_tld), jsonrpc requiring REDIS_URL with no redis/consensus-worker, healthcheck shorter than the ~95 s GenVM precompile, and chain id 61999 instead of 61127. - compose: add redis and consensus-worker, drop hardhat, pass DB* variables to the migration, share a genvm_cache volume, raise the jsonrpc start_period to 300 s. - .env.example: GENLAYER_CHAIN_ID=61127 to match the SDK localnet chain. - setupLocalhostAccess: mount the web override on the worker too (it executes contracts) and write the full GenVM web schema, since the backend replaces the image's file instead of merging it. - localnetCompatibleVersion: v0.123.0 (default and minimum). - isLocalnetRunning: expect consensus-worker instead of the removed webrequest container. Validated with a cold start (down -v) of Studio v0.123.0-rc.10: all services healthy, a v0.3 contract deploy reached FINALIZED and its read returned the stored value. Unit tests: 842 passed.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3af2d186c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,4 +1,4 @@ | |||
| export const localnetCompatibleVersion = "v0.65.0"; | |||
| export const localnetCompatibleVersion = "v0.123.0"; | |||
There was a problem hiding this comment.
Default to a published Studio image tag
For a fresh installation, plain genlayer init now selects v0.123.0, but the commit's validation notes explicitly state that those stable images have not been published and only v0.123.0-rc.10 is usable. src/commands/general/index.ts uses this constant as the option default, and InitAction.execute() writes it directly to LOCALNETVERSION, which selects the service image tags in docker-compose.yml. Consequently, the default initialization fails to pull its images after already resetting the user's existing localnet. Use the published release-candidate tag as the default (separating the minimum-version constant if necessary), or publish the stable images before changing the default.
Useful? React with 👍 / 👎.
Problem and outcome
genlayer init/genlayer upcannot run any Studio release from v0.80 onward. The bundleddocker-compose.ymlstill describes the older topology, and the default--localnet-versionis pinned tov0.65.0.Against Studio v0.123.0-rc.10, which is the release this CLI line ships with, startup fails at six points in sequence:
yeagerai/simulator-hardhat:v0.123.0-rc.10fails withmanifest unknown. The newest hardhat tag is v0.79.1.connection to server at "localhost" ... port 5432 failed, because the image readsDBUSER/DBHOST/... and ignoresDB_URL.Failed to start module ... missing field extra_tld. The backend replaces the image's GenVM web config instead of merging it, so the CLI's partial override breaks it.FATAL: REDIS_URL environment variable is required. The compose has no redis and no consensus-worker.upthen reportsdependency failed to start ... unhealthy.InvalidChainId, because the chain id is 61999 while the SDKlocalnetuses 61127.With this PR,
genlayer init/upstart a working v0.123 localnet.Non-goals:
initand overlaps here only onlocalnetCompatibleVersion.Implementation and validation
docker-compose.yml:redisandconsensus-worker, using the same image tag as the other services;hardhat;DB*variables to the migration;genvm_cachevolume so the worker can reuse the precompile;start_periodto 300 s..env.example: addsGENLAYER_CHAIN_ID=61127.setupLocalhostAccess:consensus-workertoo, since contracts execute there;/genvm/config/genvm-module-web.yaml. This ties the override to the GenVM schema; having Studio merge the override would remove that coupling (genlayer-studio#1761).localnetCompatibleVersionis nowv0.123.0, as both the default and the minimum. The version compare ignores prereleases, so--localnet-version v0.123.0-rc.10is accepted. Until Studiov0.123.0stable images are published, a plaingenlayer initcannot pull them; use--localnet-version v0.123.0-rc.10.GENLAYER_REQUIRED_CONTAINERSnow expectsgenlayer-consensus-workerinstead of the removedgenlayer-webrequest. Before this change,isLocalnetRunning()always returned false.Validation:
down -v) of Studio v0.123.0-rc.10 with these files, repeated three times. All containers were healthy, the frontend returned 200 andpingreturned OK. A v0.3 Storage contract deploy reached FINALIZED (MAJORITY_AGREE) andget_storagereturned the stored value. These runs used a separate compose project with remapped host ports; the file changes are otherwise identical.npx vitest run: 77 files, 842 tests passed. Two new tests cover the worker override and the complete web config.npm run buildpasses.docker compose configvalidates.Not covered:
sim_createRandomValidatorsduringinitwith a real LLM key. The smoke used manually created validators.Related: transactions on this localnet also need fees; see #421 and the fee-default PR.
Rollback: revert this commit. That restores the v0.65.0 default.