Skip to content

fix(genvm): download GenVM releases instead of building from source - #1712

Merged
MuncleUscles merged 1 commit into
v0.123-devfrom
fix/genvm-acquisition-v0123dev
Jul 23, 2026
Merged

fix(genvm): download GenVM releases instead of building from source#1712
MuncleUscles merged 1 commit into
v0.123-devfrom
fix/genvm-acquisition-v0123dev

Conversation

@MuncleUscles

Copy link
Copy Markdown
Member

Re-lands #1706, which was merged into #1697's branch after #1697 had already merged, so it never reached v0.123-dev. Identical change, cherry-picked cleanly onto the current base. v0.123-dev today still carries the bug described below.

Problem

third_party/genvm/version currently holds the literal string main. The pin router sends anything not matching a release tag down the nix path, so every build compiles GenVM from source against a floating ref — the build input moves on its own (it resolved to 02741163 when this was first investigated, 12f85fc0 later).

That nix build fails nondeterministically: a fixed-output-derivation mismatch on genvm-bz2-1.0.8 where specified: is constant but got: differs across jobs, because the sandbox is disabled and host state leaks in. Bumping the hash does not fix it.

02741163 is exactly the v0.6.0-rc0 tag, and that release ships a self-contained prebuilt bundle — Studio was compiling from source something that already exists as a download.

Change

Three explicit acquisition modes, precedence prebuilt > source > release:

Mode Selected by Use
prebuilt .e2e-genvm-prebuilt/ tree present E2E harness injection
source GENVM_SOURCE_MODE=source, or <branch>:<commit> in GENVM_REF GenVM developers (nix, opt-in)
release default Download a pinned genvm-manager release
  • Pin mainv0.6.0-rc0
  • Vendored genlayer-node's download_genvm.sh rather than writing a third implementation — keeps the tree-based split-layout probe (rc1 moved runners/ into a separate genvm-universal.tar.xz; the probe checks the tree, never the tag), chmod -R u+w for rc0's read-only data/, the post-install.py/genvm-post-install rename handling, and the pinned-runner assertion
  • New genvm-runner-pin stage collapses contract pins to a small normalized file, so the ~330MB GenVM layer no longer invalidates on every backend edit
  • Restored the GENVM_TAG/GENVM_REF mutual-exclusion guard
  • Removed GENVM_ARTIFACT_URL — half-wired, with a hardcoded amd64-only default that silently fetched the wrong architecture on arm64
  • Bare -dev branch pins now rejected with an actionable message instead of 404ing
  • .dockerignore: !docker/scripts/ is load-bearing — without it the new COPY fails and every build breaks in all three modes

GENVM_TAG's ENV is deliberately retained: dead at build time, but load-bearing at runtime as the precompile cache-key fallback.

Also: precompile moved out of the healthcheck window

Once the image built, a second failure surfaced — container jsonrpc is unhealthy at 208s. The genvm-manager bundle ships two executor lines (v0.2.17 legacy + v0.3.0-rc7) and the entrypoint precompiles every executor version in the manifest at startup; each cpython wasm compile is 15–20s. Two hard caps made it unfixable by raising retries: the CI healthcheck budget is ~210s (start_period: 30s + interval: 5s × retries: 36), and the compose step has timeout-minutes: 5.

Precompile now runs in its own step before compose up with a 30-minute budget, and the result is cached across runs keyed by GenVM binding + arch. It invokes the real entrypoint with true as the command, so the existing cache-marker logic is reused rather than duplicated.

Verification

Built locally on arm64. Release mode green; the image carries /genvm/version=v0.6.0-rc0, executors v0.2.17+v0.3.0-rc7, and the pinned runner 9b/8kjyda…tar — the tarball whose absence caused the original lint failure. Architecture resolved to arm64 correctly, where the old hardcoded URL would have fetched amd64.

Negative cases: explicit prebuilt with an unusable tree fails with an actionable message; auto-detect with an empty tree falls through to release; GENVM_TAG+GENVM_REF together fail; GENVM_TAG=v0.6-dev is rejected before any download.

On #1697's branch this took all four previously-failing jobs green — test 31m8s, Load Tests 15m56s, test-gasless 8m46s, db-integration-test 1m24s.

Source mode is untested — it is the known-broken nix path, now opt-in precisely so nobody hits it accidentally.

Pairs with genlayerlabs/genlayer-e2e#667.

Depends-On: genlayerlabs/genlayer-e2e@fix/studio-genvm-source-mode

…1706)

* fix(genvm): acquire GenVM by release download instead of nix build

Studio always built GenVM from source because the pin file held a
floating "main". That nix build fails nondeterministically on a
fixed-output derivation, so add explicit prebuilt/source/release modes
and default to downloading a pinned genvm-manager release.

* fix(ci): precompile GenVM before starting the stack

The genvm-manager bundle carries two executor lines, so precompiling both
on a cold cache overruns the healthcheck window and the container is
reported unhealthy. Precompile in a one-off container first and cache the
result across runs.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d62a1cf-3587-4910-bbf6-be2cfc24438f

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/genvm-acquisition-v0123dev

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

Comment @coderabbitai help to get the list of available commands.

@MuncleUscles

Copy link
Copy Markdown
Member Author

/run-e2e studio

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
77.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@MuncleUscles
MuncleUscles merged commit 85b8d00 into v0.123-dev Jul 23, 2026
25 of 26 checks passed
@MuncleUscles
MuncleUscles deleted the fix/genvm-acquisition-v0123dev branch July 23, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant