Skip to content

fix(genvm): restore legacy v0.2 contract compatibility - #1762

Merged
MuncleUscles merged 1 commit into
v0.123-devfrom
fix/v0.123-legacy-executor-routing
Sep 17, 2026
Merged

MuncleUscles merged 1 commit into
v0.123-devfrom
fix/v0.123-legacy-executor-routing

Conversation

@MuncleUscles

Copy link
Copy Markdown
Member

Delivery context

Target: v0.123-dev. This is an urgent, independently releasable compatibility fix for the Studio Next / Studio Dev preview deployment. It does not promote the standing stable-release gate #1670 and has no cross-repository dependency.

Landing cut: this PR only, head 7c0bc132dbee0ee0731ebb2a872519303f2d6847 over v0.123-dev@9d414f99ee69b2de414a3014dea49e62f20382de. The named fee-bucket work in #1750 / genvm-manager#31 is deliberately excluded: it is a separate protocol change and is not needed for this fix. Keep this cut frozen during E2E.

What

  • Infer the retained v0.2 executor line from a text contract's first-line version comment for ordinary deployment and schema extraction, without requiring sim_config.
  • Apply the same selection at the Node deployment entry point so gen_call and fee-estimate simulations agree with consensus.
  • Persist the selector on deployment and preserve explicitly pinned / stored executor selections, including address-based schema extraction.
  • Use the matching legacy code slot for temporary schema state, code retrieval, accepted/finalized deployment bootstrap and administrative code upgrades.
  • Add unit and full-RPC integration regressions; require actual execution success in the integration deployment/write helpers, not just terminal transaction status.

Why

Studio's default major-0 selection chooses the current v0.3 executor, but retained v0.2 contracts use a different runner format. Their unchanged, stable runner hashes therefore fail before contract execution.

Routing alone is insufficient: v0.2 stores CODE at root offset 1 and LOCKED_SLOTS at 2, whereas v0.3 stores CODE at 2. Putting schema code into the modern slot makes the legacy executor interpret the code-length prefix as a lock-list count. Code reads and finalized bootstrap also need to use the legacy layout.

Testing done

  • Prescribed backend unit suite: 1,617 passed (existing test_rpc_endpoint_manager.py exclusion; one existing websockets deprecation warning).
  • Pinned Ruff 0.15.22 across the backend and Black 24.4.2 checks: passed.
  • Commit hooks for all changed files: passed.
  • Repository-wide pre-commit run --all-files in an isolated checkout: all general/backend hooks passed; frontend ESLint/Prettier could not start because frontend dependencies are not installed in that scratch checkout. No frontend files changed.
  • Official pinned GenVM release runtime: unchanged legacy ERC20 schema failed before routing fix and passed with v0.2.17; current v0.3 schema still passed.
  • Real GenVM lifecycle: legacy deployment without an override, snapshot serialization, stored code extraction, schema, read, write, read — all passed. Also repeated from the empty-selector snapshot used by simulated deployment, with standard SDK calldata.
  • These native-runtime checks use an isolated in-memory host and deterministic synchronous execution; they are not full RPC/DB/consensus E2E.
  • Added full-RPC regressions in tests/integration/test_deploy_reroute_to.py; full E2E is the remaining landing gate.

Decisions made

  • Preserve the existing GenVM release pin and installed runner hashes; no GenVM rebuild or SDK migration is required.
  • Reuse the canonical v0.2 line selector already written by the migration for pre-existing contracts.
  • Honor explicit overrides; do not infer compatibility from imports, runner hashes or later comments.
  • Do not enable unsafe GenVM debug mode or change public debug-RPC access.
  • Keep storage reads narrow in SQL instead of fetching an entire contract state.
  • No database migration or contract-state rewrite. Rollback is a code revert, but reverting reintroduces the legacy failures.

Checks

  • Tested this code locally
  • Reviewed the complete diff and new files
  • Descriptive conventional-commit title
  • Full E2E green on the frozen cut
  • No separate issue opened; this addresses the reported Studio preview compatibility incident.

Reviewing tips

The first-line selector is in backend/node/genvm/executor_selection.py. Review it together with the ABI-specific code-slot handling and the accepted-state registration regression, since a routing-only fix still fails.

User-facing release notes

Restores schema extraction and ordinary deployment of unchanged legacy v0.2 contracts on Studio preview, and retains the correct executor/storage layout for later reads and writes.

Select the retained v0.2 executor from the first-line source version for ordinary deployments, schema extraction and fee-estimate simulations. Persist the selection and honor existing explicit pins.

Use the matching legacy code-storage slot when extracting schemas/code, bootstrapping finalized state and upgrading code; the modern slot aliases the legacy lock list.

Validated with 1617 backend unit tests, pinned Ruff/Black checks, and the official GenVM runtime: unchanged legacy deployment, persisted snapshot, schema, read, write and read. Current v0.3 schema remains valid. Full RPC/consensus integration is left to E2E.
@coderabbitai

coderabbitai Bot commented Sep 11, 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: Advanced

Run ID: 600aec65-e614-47dd-94eb-a52ead837c5e

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

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 MuncleUscles self-assigned this Sep 11, 2026

Copy link
Copy Markdown
Member Author

/run-e2e v0.6 all

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

Copy link
Copy Markdown
Member Author

/merge

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The merge request cannot proceed. Check reviews, required CI and the selected landing cut. Related changes may require action by their owners; internal details are available to the team.

2 similar comments
@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The merge request cannot proceed. Check reviews, required CI and the selected landing cut. Related changes may require action by their owners; internal details are available to the team.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The merge request cannot proceed. Check reviews, required CI and the selected landing cut. Related changes may require action by their owners; internal details are available to the team.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

Automatic landing has stopped. Earlier merges are not undone. Inspect the current E2E checks, resolve the blocker, then request /merge again.

Copy link
Copy Markdown
Member Author

/run-e2e v0.6 all

Resuming the authorized compatibility release to Studio Next/Dev only. Frozen landing cut: #1762 alone, head 7c0bc132dbee0ee0731ebb2a872519303f2d6847 over v0.123-dev@9d414f99ee69b2de414a3014dea49e62f20382de; no cross-repository Depends-On changes. Request full component AND stack coverage, with no Studio-only stack selector. The prior successful refresh was rejected by the landing gate because it selected only the Studio stack. No conflicting E2E run is active. Existing required CI is green; the reviewed diff and local worktree are unchanged. Merge and preview-only release follow a valid green snapshot. Stable production/staging and unrelated PRs are excluded.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

Copy link
Copy Markdown
Member Author

The new E2E plan resolved the current release branch more freshly than the initial PR metadata: #1750 has already landed, so the tested base is 0737a52de4be3db0ea33336d99f68b5e3e14ce40, not the historical base in this PR description. The only open PR in the cut remains #1762 at 7c0bc132dbee0ee0731ebb2a872519303f2d6847.

Run 35199189091 tests candidate a3f83c83219b68161b72aeb257518025697fdb54 (tree 7150e217a417af59fd1d1852f5f9573edad4ae9e) with scope=all, stack=all, default profile, track v0.6. This includes the already-merged named-fee baseline and its GenVM rc5 pin. No additional open PRs are being added. Preview-only deployment remains the release boundary.

Copy link
Copy Markdown
Member Author

/merge

Authorized landing of the frozen single-PR cut after full E2E success: https://github.com/genlayerlabs/genlayer-e2e/actions/runs/35199189091 (v0.6, scope=all, stack=all; 174 passed, 0 failed; 107/107 features covered).

Head: 7c0bc132dbee0ee0731ebb2a872519303f2d6847. Tested target: v0.123-dev at 0737a52de4be3db0ea33336d99f68b5e3e14ce40. Candidate: a3f83c83219b68161b72aeb257518025697fdb54, tree 7150e217a417af59fd1d1852f5f9573edad4ae9e. Only #1762 is in this cut; no additional open PRs. Combined-candidate backend unit suite: 1,631 passed.

After landing, release the next unused v0.123 preview version to Studio Next/Dev only. No stable production or staging promotion.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command.

@MuncleUscles
MuncleUscles merged commit a0300c3 into v0.123-dev Sep 17, 2026
21 checks passed
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