Skip to content

fix(genvm): keep salted children of v0.2 parents at the address their SDK returns - #1827

Merged
danieljrc888 merged 3 commits into
v0.123-devfrom
fix/genvm-legacy-salted-child-address
Nov 16, 2026
Merged

danieljrc888 merged 3 commits into
v0.123-devfrom
fix/genvm-legacy-salted-child-address

Conversation

@danieljrc888

Copy link
Copy Markdown
Contributor

Problem and outcome

#1821 places every salted child deployment at the GhostFactory CREATE2 address, on every executor line. Contracts on the retained v0.2 line cannot follow that change: their SDK is content-addressed and immutable, ignores the create2 field and returns keccak(0x01 ‖ parent ‖ salt ‖ chain id)[:20] from gl.deploy_contract(salt_nonce=...). A v0.2 factory therefore stores an address where Studio never deploys the child.

This is what Rally does: CampaignFactory.create_campaign and the CampaignIC shard deploys store the returned address. It works on production (v0.121.25) and on rc.12, and would break on the first rc cut after #1821.

With this change, a salted child whose emitting contract runs on the v0.2 line is placed at the address its SDK returns. Every other line keeps CREATE2, so v0.4 behaviour is unchanged.

Non-goals: no change for v0.3 (disabled on the studio network by #1825), no change to unsalted placement, no change to the predictGhostAddress host hook.

Implementation and validation

  • legacy_salted_child_address restores the formula removed in feat(genvm): Place salted children at the GhostFactory CREATE2 address #1821 (same bytes as v0.121.25 and rc.12).
  • _author_message_phase_locally uses it only for salted children of a v0.2 emitter (uses_legacy_storage of the emitter's pin). The pin is read from the context snapshot, then from the contract row (snapshots saved before pins existed carry none, which covers transactions accepted on v0.121 and finalized after the upgrade), then from the deployment's own selection for a row that is not pinned yet.
  • Collision checks and the factory nonce count are unchanged.
  • No settlement network runs v0.2, so this cannot make Studio and mainnet disagree on an address.

Tests:

  • Unit: legacy placement for re:^v0\.2\. and v0.2.x pins, collision on the legacy address, unsalted children unchanged, row fallback, deploy fallback; CREATE2 still asserted for unpinned, v0.3 and v0.4 emitters. tests/unit passes locally (1882 passed, 7 skipped).
  • Integration: test_legacy_factory_reaches_its_salted_child_at_the_address_it_stored deploys a v0.2 factory that spawns a salted child and reads the child at the stored address. Not run locally; it relies on CI.

Known limits:

  • A debug-mode re: pin other than the canonical re:^v0\.2\. is not treated as v0.2, same as the existing storage-slot rule.
  • A v0.4 contract that asks predictGhostAddress for a v0.2 parent's child gets the CREATE2 address, not the legacy one.

Risk and rollback: the change only affects salted children of v0.2 emitters, which are broken without it. Reverting restores #1821 behaviour.

… SDK returns

#1821 placed every salted child at the GhostFactory CREATE2 address. The
v0.2 SDK is immutable, ignores the host's create2 parameters and returns
keccak(0x01 || parent || salt || chain id)[:20] to the contract, so a v0.2
factory (Rally's CampaignFactory and CampaignIC) stored an address where
Studio no longer deployed anything.

A salted child whose emitter runs on the retained v0.2 line is placed at
that address again, as on v0.121 and rc.12. Every other line keeps CREATE2.
The emitter's line comes from the snapshot pin, then the contract row (for
snapshots saved before pins existed), then the deployment's own selection.
@danieljrc888 danieljrc888 self-assigned this Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 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

  • 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: 9939daef-edc3-4a16-a648-3127c404fbdb

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

@danieljrc888
danieljrc888 marked this pull request as ready for review November 16, 2026 06:09
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T06:36:25.553011Z 5f5facf New commits
🔒 Security Review ✅ Completed 2026-11-16T06:12:44.895513Z 6958378 Draft marked ready
ℹ️ 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.

@danieljrc888

Copy link
Copy Markdown
Contributor Author

/run-e2e 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.

@danieljrc888

Copy link
Copy Markdown
Contributor Author

/merge-train

@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.

@kp2pml30 kp2pml30 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, sorry, I forgot about v0.2 when I removed the legacy formula completely

@danieljrc888
danieljrc888 merged commit 0c66767 into v0.123-dev Nov 16, 2026
29 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.

2 participants