Skip to content

fix(localnet): run current Studio (v0.123) with genlayer init/up - #434

Open
danieljrc888 wants to merge 1 commit into
v0.40-devfrom
fix/localnet-compose-v0123
Open

danieljrc888 wants to merge 1 commit into
v0.40-devfrom
fix/localnet-compose-v0123

Conversation

@danieljrc888

Copy link
Copy Markdown

Problem and outcome

genlayer init / genlayer up cannot run any Studio release from v0.80 onward. The bundled docker-compose.yml still describes the older topology, and the default --localnet-version is pinned to v0.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:

  1. Pulling yeagerai/simulator-hardhat:v0.123.0-rc.10 fails with manifest unknown. The newest hardhat tag is v0.79.1.
  2. The migration exits with connection to server at "localhost" ... port 5432 failed, because the image reads DBUSER/DBHOST/... and ignores DB_URL.
  3. jsonrpc fails with 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.
  4. jsonrpc fails with FATAL: REDIS_URL environment variable is required. The compose has no redis and no consensus-worker.
  5. On a cold start, GenVM precompile takes about 95 s, which exceeds the jsonrpc healthcheck window. up then reports dependency failed to start ... unhealthy.
  6. Deploys fail with InvalidChainId, because the chain id is 61999 while the SDK localnet uses 61127.

With this PR, genlayer init / up start a working v0.123 localnet.

Non-goals:

Implementation and validation

  • docker-compose.yml:
    • adds redis and consensus-worker, using the same image tag as the other services;
    • removes hardhat;
    • passes the DB* variables to the migration;
    • shares a genvm_cache volume so the worker can reuse the precompile;
    • raises the jsonrpc start_period to 300 s.
  • .env.example: adds GENLAYER_CHAIN_ID=61127.
  • setupLocalhostAccess:
    • mounts the localhost web override on consensus-worker too, since contracts execute there;
    • writes the full GenVM web schema. The fields match the rc.10 image's /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).
  • localnetCompatibleVersion is now v0.123.0, as both the default and the minimum. The version compare ignores prereleases, so --localnet-version v0.123.0-rc.10 is accepted. Until Studio v0.123.0 stable images are published, a plain genlayer init cannot pull them; use --localnet-version v0.123.0-rc.10.
  • GENLAYER_REQUIRED_CONTAINERS now expects genlayer-consensus-worker instead of the removed genlayer-webrequest. Before this change, isLocalnetRunning() always returned false.
  • Docs and README examples now point at v0.123.0.

Validation:

  • Cold start (down -v) of Studio v0.123.0-rc.10 with these files, repeated three times. All containers were healthy, the frontend returned 200 and ping returned OK. A v0.3 Storage contract deploy reached FINALIZED (MAJORITY_AGREE) and get_storage returned 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 build passes.
  • docker compose config validates.

Not covered:

  • sim_createRandomValidators during init with a real LLM key. The smoke used manually created validators.
  • Localhost web access from contracts through the new override. Startup with the override works.

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.

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.
@danieljrc888 danieljrc888 self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a944386d-9406-4962-af94-ccf9fe50293c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T16:49:15.077074Z d3af2d1 PR opened
🔒 Security Review ✅ Completed 2026-11-03T16:51:20.859715Z d3af2d1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant