Repository navigation
fix(genvm): keep salted children of v0.2 parents at the address their SDK returns - #1827
Conversation
… 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.
|
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 Summary: ✅ CompletedThis 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. |
|
/run-e2e all |
|
E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally. |
|
/merge-train |
|
The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command. |
kp2pml30
left a comment
There was a problem hiding this comment.
LGTM, sorry, I forgot about v0.2 when I removed the legacy formula completely
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
create2field and returnskeccak(0x01 ‖ parent ‖ salt ‖ chain id)[:20]fromgl.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_campaignand theCampaignICshard 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
predictGhostAddresshost hook.Implementation and validation
legacy_salted_child_addressrestores 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_locallyuses it only for salted children of a v0.2 emitter (uses_legacy_storageof 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.Tests:
re:^v0\.2\.andv0.2.xpins, collision on the legacy address, unsalted children unchanged, row fallback, deploy fallback; CREATE2 still asserted for unpinned, v0.3 and v0.4 emitters.tests/unitpasses locally (1882 passed, 7 skipped).test_legacy_factory_reaches_its_salted_child_at_the_address_it_storeddeploys 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:
re:pin other than the canonicalre:^v0\.2\.is not treated as v0.2, same as the existing storage-slot rule.predictGhostAddressfor 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.