Skip to content

Split rain.factory into library (rain.factory) + deploy (rain.factory.deploy) #46

Description

@thedavidmeister

Practise run for the org-wide deploy-repo / library-repo split: every repo is strictly one or the other, never both. rain.factory is a clean, simple candidate — one deployed contract, so the deploy half is a single suite (vs st0x.deploy's 13).

Why it needs splitting

rain.factory is currently both:

  • Library — autopublishes rain-factory to Soldeer (rainix-autopublish, next-version lifecycle, currently 0.1.6); consumers import its interfaces.
  • Deploy — carries frozen per-tag deploy-pin snapshots (src/generated/0_1_3|0_1_4|0_1_5/CloneFactory.pointers.sol) for a deployed CloneFactory, with script/Deploy.sol + BuildPointers.sol.

The two lifecycles are mutually exclusive (see rainlanguage/rainix#280): the next-version bump on every merge desyncs [package].version from the frozen DEPLOY_TAG, the same class of permanently-red drift that motivated the split.

The cut is clean

Verified: the interfaces import nothing concrete (self-contained surface); the concrete CloneFactory imports the interfaces (one-way dep); LibCloneFactoryDeploy imports from src/generated/<tag>/ (a deploy-pin lib). So:

rain.factory — keeps the name, stays a LIBRARY (autopublish)

  • src/interface/ICloneableV2.sol, ICloneableFactoryV3.sol, ICloneableFactoryV2.sol
  • src/interface/deprecated/**
  • Keeps package-release.yaml (autopublish) + rainix-sol.yaml. Drops manual-sol-artifacts.yaml.
  • Interface consumers are unaffected — this is why the library keeps the name.

rain.factory.deploy — NEW, a DEPLOY repo (rainix-tag-release)

  • src/concrete/CloneFactory.sol (imports the interfaces → depends on rain-factory via Soldeer)
  • src/lib/LibCloneFactoryDeploy.sol (the deployed address + codehash pins)
  • src/generated/<tag>/CloneFactory.pointers.sol (frozen snapshots)
  • script/Deploy.sol + script/BuildPointers.sol
  • All current tests (all are concrete/lib): LibCloneFactoryDeploy*.t.sol, CloneFactoryCloneDeterministic.t.sol, TestCloneable*.sol
  • package-release.yamlrainix-tag-release (tag-triggered sol-v*, single deploy-suites entry), plus rainix-sol.yaml + manual-sol-artifacts.yaml.
  • Publishes rain-factory-deploy to Soldeer.

Consumer migration

Interface imports (rain-factory/src/interface/**) stay pointed at rain-factory — no change. Only deploy-pin consumers move: anyone importing rain-factory/src/lib/LibCloneFactoryDeploy.sol (the CLONE_FACTORY_DEPLOYED_CODEHASH pin) repoints to rain-factory-deploy. Known: S01-Issuer/st0x.deploy. A full org grep for LibCloneFactoryDeploy gates this phase.

Sequencing

  1. Prereqfeat(ci): rainix-tag-release — tag-triggered deploy-repo release rainix#280 (rainix-tag-release) merges; the Ankr fork-RPC key is restored (the deploy repo's verify gate needs fork tests).
  2. Create rain.factory.deploy with the deploy half + rain-factory Soldeer dep + tag-release CI.
  3. First release of rain.factory.deploy (sol-v0.1.x) so its deploy pins are published — needs (1).
  4. Slim rain.factory to interfaces-only (PR).
  5. Migrate consumers off the deploy pin, once (3) has published.

Steps 2 and 4 are authorable now (CI referencing rainix-tag-release@main goes live when #280 lands); 3 and 5 wait on the prereqs.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions