Upstream change
rainlanguage/rain.deploy#242 removes DeployCandidate.sourceCreationCode and
makes checkCandidatesAnchoredToSource resolve the candidate's own
snapshot.artifactPath through vm.getCode instead. The source operand now
comes from the compiler rather than from the declaration.
The removed field was one a consumer filled in. Pointing it at the same
generated constant as the record made the one check that catches a snapshot of
the wrong contract compare a value with itself — green for any candidate at all,
in CI and on the irreversible RainDeployBroadcast.run() path alike. That is
rainlanguage/rain.factory.deploy#34, which #242 closes.
This is a BREAKING change and this repo's declaration must be edited before the
pin can move.
What this repo has to change
Current pin: "rain-deploy" = "0.1.7" (foundry.toml:66) — the oldest pin of
any consumer, so this repo has the largest jump.
1. src/abstract/ExtrospectDeploySuites.sol
One candidate, extrospect:
- Line 56 — delete
sourceCreationCode: type(Extrospect).creationCode, and
the trailing comma on the snapshot: DeploySuite({...}) entry above it. The
DeployCandidate({...}) literal is left with its single snapshot field.
- Line 6 — delete
import {Extrospect} from "../concrete/Extrospect.sol";.
It becomes unused: line 56 is its only use in this file. The remaining
Extrospect spellings are the aliased import from
../generated/candidate/Extrospect.sol (line 10) and doc prose, neither of
which needs the type.
artifactPath at line 53 is "src/concrete/Extrospect.sol:Extrospect". Checked
against the tree: that file exists and declares contract Extrospect, so it
resolves and needs no correction.
2. test/src/abstract/ExtrospectDeploySuites.t.sol — one test becomes unspellable
testExtrospectArtifactPathIsTheCandidateContract (lines 30-36) currently
asserts exactly the property #242 moves into the package:
assertEq(
keccak256(vm.getCode(candidate.snapshot.artifactPath)),
keccak256(candidate.sourceCreationCode),
"artifact path does not compile to the candidate's source creation code"
);
Its right-hand operand is the field being removed, so the test cannot compile
after the bump. It is not merely redundant — once the anchor itself reads
vm.getCode(artifactPath), restating it here against the same call would compare
a value with itself, which is the exact shape #242 exists to eliminate. Delete it
rather than rewrite it, and note in its place that the package now enforces it.
The two sibling tests in the same file,
testExtrospectSuiteKeyIsTheDispatchedSuite and
testExtrospectCandidateHasNoDependencies, are untouched and still cover the
other two unconstrained fields.
The doc comment at lines 25-29 names sourceCreationCode and goes with it.
3. script/Build.sol
- Line 82 —
contracts[i].candidate.sourceCreationCode, becomes
vm.getCode(contracts[i].candidate.snapshot.artifactPath),, so
regenerateSnapshots writes from the same origin the anchor reads back.
- Line 18 — the
GeneratedContract doc comment says "Snapshots are written
from its sourceCreationCode and snapshot.dependencies"; that field will no
longer exist.
test/script/Build.t.sol:116 splits artifactPath on ":" to check the
generated contract name. That keeps working — src/concrete/Extrospect.sol:Extrospect
splits to two components — but it is worth re-reading alongside the change, since
the path it reads is now load-bearing rather than cosmetic.
4. Version pin, when there is one to move to
Seven files spell the versioned remapping prefix rain-deploy-0.1.7/ and each has
to be rewritten together with foundry.toml and soldeer.lock:
src/abstract/RainDeploySuitesBase.sol (the re-export shim holding the one
local spelling of the package path, which the generated libs reach through a
relative import and so cannot be skipped)
script/Build.sol, script/Deploy.sol
test/script/Build.t.sol, test/src/abstract/ExtrospectDeployChain.t.sol,
test/src/abstract/ExtrospectDeploySnapshot.t.sol,
test/src/concrete/Extrospect.constants.t.sol
The version to bump to does not exist yet
rainlanguage/rain.deploy#242 is open, unmerged and unreleased. There is no
published rain-deploy version carrying this change, so this issue deliberately
names none. The bump target has to be filled in once #242 merges and a Soldeer
release is cut; until then this issue is the record of what the edit will be,
not a request to make it.
Not affected in this repo
Migration item 3 of #242 — "any consumer wrapper marked pure must become
view" — needs no edit here. This repo inherits RainDeployVerifySnapshot
without redeclaring testSnapshotMatchesSource or wrapping
checkCandidatesAnchoredToSource, so the mutability change lands entirely
inside the package.
Migration item 4 — no foundry.toml change is required, because vm.getCode
does not go through fs_permissions.
Upstream change
rainlanguage/rain.deploy#242 removes
DeployCandidate.sourceCreationCodeandmakes
checkCandidatesAnchoredToSourceresolve the candidate's ownsnapshot.artifactPaththroughvm.getCodeinstead. The source operand nowcomes from the compiler rather than from the declaration.
The removed field was one a consumer filled in. Pointing it at the same
generated constant as the record made the one check that catches a snapshot of
the wrong contract compare a value with itself — green for any candidate at all,
in CI and on the irreversible
RainDeployBroadcast.run()path alike. That israinlanguage/rain.factory.deploy#34, which #242 closes.
This is a BREAKING change and this repo's declaration must be edited before the
pin can move.
What this repo has to change
Current pin:
"rain-deploy" = "0.1.7"(foundry.toml:66) — the oldest pin ofany consumer, so this repo has the largest jump.
1.
src/abstract/ExtrospectDeploySuites.solOne candidate,
extrospect:sourceCreationCode: type(Extrospect).creationCode, andthe trailing comma on the
snapshot: DeploySuite({...})entry above it. TheDeployCandidate({...})literal is left with its singlesnapshotfield.import {Extrospect} from "../concrete/Extrospect.sol";.It becomes unused: line 56 is its only use in this file. The remaining
Extrospectspellings are the aliased import from../generated/candidate/Extrospect.sol(line 10) and doc prose, neither ofwhich needs the type.
artifactPathat line 53 is"src/concrete/Extrospect.sol:Extrospect". Checkedagainst the tree: that file exists and declares
contract Extrospect, so itresolves and needs no correction.
2.
test/src/abstract/ExtrospectDeploySuites.t.sol— one test becomes unspellabletestExtrospectArtifactPathIsTheCandidateContract(lines 30-36) currentlyasserts exactly the property #242 moves into the package:
Its right-hand operand is the field being removed, so the test cannot compile
after the bump. It is not merely redundant — once the anchor itself reads
vm.getCode(artifactPath), restating it here against the same call would comparea value with itself, which is the exact shape #242 exists to eliminate. Delete it
rather than rewrite it, and note in its place that the package now enforces it.
The two sibling tests in the same file,
testExtrospectSuiteKeyIsTheDispatchedSuiteandtestExtrospectCandidateHasNoDependencies, are untouched and still cover theother two unconstrained fields.
The doc comment at lines 25-29 names
sourceCreationCodeand goes with it.3.
script/Build.solcontracts[i].candidate.sourceCreationCode,becomesvm.getCode(contracts[i].candidate.snapshot.artifactPath),, soregenerateSnapshotswrites from the same origin the anchor reads back.GeneratedContractdoc comment says "Snapshots are writtenfrom its
sourceCreationCodeandsnapshot.dependencies"; that field will nolonger exist.
test/script/Build.t.sol:116splitsartifactPathon":"to check thegenerated contract name. That keeps working —
src/concrete/Extrospect.sol:Extrospectsplits to two components — but it is worth re-reading alongside the change, since
the path it reads is now load-bearing rather than cosmetic.
4. Version pin, when there is one to move to
Seven files spell the versioned remapping prefix
rain-deploy-0.1.7/and each hasto be rewritten together with
foundry.tomlandsoldeer.lock:src/abstract/RainDeploySuitesBase.sol(the re-export shim holding the onelocal spelling of the package path, which the generated libs reach through a
relative import and so cannot be skipped)
script/Build.sol,script/Deploy.soltest/script/Build.t.sol,test/src/abstract/ExtrospectDeployChain.t.sol,test/src/abstract/ExtrospectDeploySnapshot.t.sol,test/src/concrete/Extrospect.constants.t.solThe version to bump to does not exist yet
rainlanguage/rain.deploy#242 is open, unmerged and unreleased. There is no
published
rain-deployversion carrying this change, so this issue deliberatelynames none. The bump target has to be filled in once #242 merges and a Soldeer
release is cut; until then this issue is the record of what the edit will be,
not a request to make it.
Not affected in this repo
Migration item 3 of #242 — "any consumer wrapper marked
puremust becomeview" — needs no edit here. This repo inheritsRainDeployVerifySnapshotwithout redeclaring
testSnapshotMatchesSourceor wrappingcheckCandidatesAnchoredToSource, so the mutability change lands entirelyinside the package.
Migration item 4 — no
foundry.tomlchange is required, becausevm.getCodedoes not go through
fs_permissions.