Skip to content

feat: migrate raindex to soldeer for dependency management#2586

Open
thedavidmeister wants to merge 4 commits into
mainfrom
2026-05-20-soldeer-migration
Open

feat: migrate raindex to soldeer for dependency management#2586
thedavidmeister wants to merge 4 commits into
mainfrom
2026-05-20-soldeer-migration

Conversation

@thedavidmeister
Copy link
Copy Markdown
Contributor

@thedavidmeister thedavidmeister commented May 22, 2026

Summary

  • Replaces lib/ submodules (rain.interpreter, rain.deploy, rain.raindex.interface) with Soldeer registry deps.
  • Rewrites 146 source files to versioned soldeer import paths (rain-interpreter-interface-0.1.0/src/, raindex-interface-0.1.1/src/, rainlang-0.1.2/src/, etc.).
  • sushixswap-v2 stays a submodule (not on the Soldeer registry).
  • OpenZeppelin pinned at 5.6.1 for raindex source, with 4.8.3 side-by-side for rain-math-fixedpoint-0.1.0's transitive use.
  • forge build is green end-to-end (429 files).

Still pending (follow-up work in this PR or separate)

  • Remove obsolete lib/rain.interpreter, lib/rain.deploy, lib/rain.raindex.interface submodules + .gitmodules cleanup.
  • Update prep-base.sh / pointers.sh to drop submodule prelude steps.
  • Update Cargo.toml path-deps that point into lib/rain.interpreter/....
  • Update fs_permissions paths in foundry.toml that still reference ./lib/rain.interpreter/....
  • CI workflow review (the migration assumes rainix provides soldeer-aware shells).
  • Add a project .soldeerignore for raindex itself.

Test plan

  • forge build green locally (verified).
  • forge test passes.
  • CI green.
  • Smoke-test a deploy script run.

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated dependency management system to use version-pinned packages with explicit versioning for OpenZeppelin Contracts (v5.6.1), Forge Standard Library (v1.16.1), and multiple Rain ecosystem libraries, improving build reproducibility and maintainability.
    • Expanded filesystem permissions configuration for interpreter metadata and deployment artifacts.

Review Change Stack

Replaces lib/ submodules (rain.interpreter, rain.deploy,
rain.raindex.interface) with soldeer registry deps. Rewrites 146 source
files' imports to versioned soldeer paths (rain-interpreter-interface-0.1.0/
src/, raindex-interface-0.1.1/src/, rainlang-0.1.2/src/, etc.).

sushixswap-v2 remains a submodule (not on the Soldeer registry).

OpenZeppelin pinned at 5.6.1 for raindex source plus 4.8.3 side-by-side
for rain-math-fixedpoint-0.1.0's transitive dep.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this May 22, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Warning

Rate limit exceeded

@thedavidmeister has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 55 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9d7e1531-470b-48c5-9023-8f2bf08012b0

📥 Commits

Reviewing files that changed from the base of the PR and between 11cc696 and 06cc55a.

⛔ Files ignored due to path filters (1)
  • soldeer.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • foundry.toml
  • pointers.sh
  • prep-base.sh
  • remappings.txt
  • test/concrete/raindex/RaindexV6.clear.mock.t.sol
📝 Walkthrough

Walkthrough

This PR migrates the RAIndex repository from git submodules to Soldeer package management. It updates foundry.toml with dependency pins and Soldeer configuration, creates remappings.txt with explicit package-to-version mappings, and updates ~350 files to use versioned Soldeer package import paths instead of unversioned module paths and dotted namespaces.

Changes

Soldeer Dependency Management Migration

Layer / File(s) Summary
Dependency Configuration
.gitignore, foundry.toml, remappings.txt
.gitignore adds dependencies/ directory. foundry.toml extends libs to include dependencies, adds [dependencies] section pinning forge-std, @openzeppelin-contracts-5.6.1, and versioned rain-* packages, adds [soldeer] section with recursive_deps = false, updates fs_permissions for generated paths, and replaces long remappings array with shorter custom set. remappings.txt adds explicit mappings for named dependencies to versioned dependencies/<package>/<version>/ paths.
Source Code Imports
script/*, src/abstract/*, src/concrete/*, src/lib/*
~100 files update import paths from unversioned/dotted module paths to Soldeer versioned package paths: forge-std/Test.solforge-std-1.16.1/src/Test.sol, openzeppelin-contracts/*@openzeppelin-contracts-5.6.1/*, rain.raindex.interface/*raindex-interface-0.1.1/src/interface/*, rain.* libraries → rain-*-0.x.y/src/* paths. No contract logic is changed.
Test File Imports
test/abstract/*, test/concrete/*, test/lib/*, test/util/*
~250 test files and test utilities update import paths following the same versioning pattern as source files. One functional change in test/concrete/raindex/RaindexV6.clear.mock.t.sol line 792: Math.Rounding.Floor changed to Math.Rounding.Down in bobIORatio18 upper-bound calculation. All other changes are import path updates; test logic remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The changes are homogeneous and repetitive: nearly every modification is a mechanical import path update following a consistent pattern. The configuration changes in foundry.toml, remappings.txt, and .gitignore are straightforward. The single functional change (Math.Rounding enum value) is easily verified. High volume (~350 files) but low complexity per file.

Possibly related issues

  • Soldeer migration across the Rain ecosystem: This PR implements the dependency management transition described in related issues for rain.deploy, rain.math.binary, rain.solmem, and other Rain packages, consolidating the ecosystem migration from git submodules to Soldeer.
  • Replace git submodules with Soldeer for Solidity dependencies #2578: Previous Soldeer migration work in the same repository that establishes the pattern this PR follows.

Suggested reviewers

  • hardyjosh
  • 0xgleb
  • JuaniRios
  • findolor

Poem

🐰 From submodules tangled, we hop to Soldeer's light,
Versioned packages organized, remappings right.
Three-fifty files united in import's simple dance,
One rounding tweak to seal the compatibility glance.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-20-soldeer-migration

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@foundry.toml`:
- Around line 34-38: The fs_permissions entries in foundry.toml still list
obsolete rain interpreter artifact paths (e.g.
"./lib/rain.interpreter/meta/RainterpreterExpressionDeployerNPE2.rain.meta",
"./lib/rain.interpreter/deployments/latest/RainterpreterParserNPE2",
"./lib/rain.interpreter/deployments/latest/RainterpreterStoreNPE2",
"./lib/rain.interpreter/deployments/latest/RainterpreterNPE2",
"./lib/rain.interpreter/deployments/latest/RainterpreterExpressionDeployerNPE2")
that don't exist in this checkout; either remove these stale whitelist entries
or replace each with the actual Soldeer-generated artifact paths that exist in
this repo (or the correct lib/ paths for the current rain interpreter artifacts)
so Foundry file reads will succeed. Ensure you update/remove every reference to
the Rainterpreter*NPE2 entries in the fs_permissions array in foundry.toml.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf43e1c0-9b09-4c9a-a480-dd30e634ccd0

📥 Commits

Reviewing files that changed from the base of the PR and between 29b7822 and 11cc696.

⛔ Files ignored due to path filters (1)
  • soldeer.lock is excluded by !**/*.lock
📒 Files selected for processing (145)
  • .gitignore
  • foundry.toml
  • remappings.txt
  • script/BuildAuthoringMeta.sol
  • script/BuildPointers.sol
  • script/Deploy.sol
  • script/DiagOrder.sol
  • src/abstract/RaindexV6ArbCommon.sol
  • src/abstract/RaindexV6ArbOrderTaker.sol
  • src/abstract/RaindexV6ArbTaskGated.sol
  • src/abstract/RaindexV6FlashBorrower.sol
  • src/abstract/RaindexV6FlashLender.sol
  • src/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sol
  • src/concrete/parser/RaindexV6SubParser.sol
  • src/concrete/raindex/RaindexV6.sol
  • src/lib/LibGenericPoolExchange.sol
  • src/lib/LibOrder.sol
  • src/lib/LibRaindex.sol
  • src/lib/LibRaindexArb.sol
  • src/lib/LibRaindexSubParser.sol
  • test/abstract/RaindexV6ArbOrderTaker.context.t.sol
  • test/abstract/RaindexV6ArbOrderTaker.ierc165.t.sol
  • test/abstract/RaindexV6ArbOrderTaker.noOrders.t.sol
  • test/abstract/RaindexV6ArbOrderTaker.onTakeOrders2.t.sol
  • test/abstract/RaindexV6ArbOrderTaker.onTakeOrders2Direct.t.sol
  • test/abstract/RaindexV6ArbOrderTaker.reentrancy.t.sol
  • test/abstract/RaindexV6ArbTaskGated.checkTaskHashPassMatch.t.sol
  • test/abstract/RaindexV6ArbTaskGated.checkTaskHashPassZero.t.sol
  • test/abstract/RaindexV6ArbTaskGated.checkTaskHashWrongTask.t.sol
  • test/abstract/RaindexV6ArbTaskGated.construct.t.sol
  • test/abstract/RaindexV6ArbTaskGated.iTaskHashNonzero.t.sol
  • test/abstract/RaindexV6ArbTaskGated.iTaskHashZero.t.sol
  • test/abstract/RaindexV6FlashBorrower.badInitiator.t.sol
  • test/abstract/RaindexV6FlashBorrower.badLenderApproval.t.sol
  • test/abstract/RaindexV6FlashBorrower.flashLoanFailed.t.sol
  • test/abstract/RaindexV6FlashBorrower.ierc165.t.sol
  • test/abstract/RaindexV6FlashBorrower.lenderValidation.t.sol
  • test/abstract/RaindexV6FlashBorrower.mixedDecimals.t.sol
  • test/abstract/RaindexV6FlashBorrower.noOrders.t.sol
  • test/abstract/RaindexV6FlashBorrower.realTokenTransfers.t.sol
  • test/abstract/RaindexV6FlashBorrower.reentrancy.t.sol
  • test/abstract/RaindexV6FlashLender.griefRecipient.t.sol
  • test/abstract/RaindexV6FlashLender.ierc165.t.sol
  • test/abstract/RaindexV6FlashLender.maxFlashLoan.t.sol
  • test/abstract/RaindexV6FlashLender.mockSuccess.t.sol
  • test/abstract/RaindexV6FlashLender.reentrant.t.sol
  • test/abstract/RaindexV6FlashLender.transfers.t.sol
  • test/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.approvalRevoked.t.sol
  • test/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.exchangeRevert.t.sol
  • test/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.sender.t.sol
  • test/concrete/arb/GenericPoolRaindexV6FlashBorrower.approvalRevoked.t.sol
  • test/concrete/arb/GenericPoolRaindexV6FlashBorrower.ethForwarded.t.sol
  • test/concrete/arb/GenericPoolRaindexV6FlashBorrower.exchangeRevert.t.sol
  • test/concrete/arb/GenericPoolRaindexV6FlashBorrower.sender.t.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.nonStandardDecimals.t.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2.t.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2Direct.t.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sender.t.sol
  • test/concrete/parser/RaindexV6SubParser.describedByMeta.t.sol
  • test/concrete/parser/RaindexV6SubParser.ierc165.t.sol
  • test/concrete/parser/RaindexV6SubParser.pointers.t.sol
  • test/concrete/parser/RaindexV6SubParser.signedContext.t.sol
  • test/concrete/parser/RaindexV6SubParser.signers.t.sol
  • test/concrete/raindex/RaindexV6.addOrder.entask.t.sol
  • test/concrete/raindex/RaindexV6.addOrder.mock.t.sol
  • test/concrete/raindex/RaindexV6.addOrder.nonce.t.sol
  • test/concrete/raindex/RaindexV6.addOrder.owner.t.sol
  • test/concrete/raindex/RaindexV6.addOrder.t.sol
  • test/concrete/raindex/RaindexV6.clear.badStack.t.sol
  • test/concrete/raindex/RaindexV6.clear.context.t.sol
  • test/concrete/raindex/RaindexV6.clear.handleIO.revert.t.sol
  • test/concrete/raindex/RaindexV6.clear.mock.t.sol
  • test/concrete/raindex/RaindexV6.clear.sameOwner.t.sol
  • test/concrete/raindex/RaindexV6.clear.sameToken.t.sol
  • test/concrete/raindex/RaindexV6.clear.zeroAmount.t.sol
  • test/concrete/raindex/RaindexV6.deposit.entask.t.sol
  • test/concrete/raindex/RaindexV6.deposit.t.sol
  • test/concrete/raindex/RaindexV6.entask.t.sol
  • test/concrete/raindex/RaindexV6.quote.sameToken.t.sol
  • test/concrete/raindex/RaindexV6.quote.t.sol
  • test/concrete/raindex/RaindexV6.removeOrder.entask.t.sol
  • test/concrete/raindex/RaindexV6.removeOrder.mock.t.sol
  • test/concrete/raindex/RaindexV6.removeOrder.owner.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.badStack.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.exceedsMaxRatio.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.handleIO.revert.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.maximumInput.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.maximumOutput.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.minimumIO.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.noop.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.precision.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.sameToken.t.sol
  • test/concrete/raindex/RaindexV6.takeOrder.tokenMismatch.t.sol
  • test/concrete/raindex/RaindexV6.vaultBalance.t.sol
  • test/concrete/raindex/RaindexV6.withdraw.entask.t.sol
  • test/concrete/raindex/RaindexV6.withdraw.t.sol
  • test/lib/LibOrder.t.sol
  • test/lib/LibRaindexArb.finalizeArbNativeGas.t.sol
  • test/lib/LibRaindexArb.finalizeArbOutputTokenProfit.t.sol
  • test/lib/LibRaindexArb.finalizeArbTaskContext.t.sol
  • test/lib/LibRaindexArb.finalizeArbTokenTransfers.t.sol
  • test/lib/deploy/LibRaindexDeploy.t.sol
  • test/lib/deploy/LibRaindexDeployIsStartBlockArbitrum.t.sol
  • test/lib/deploy/LibRaindexDeployIsStartBlockBase.t.sol
  • test/lib/deploy/LibRaindexDeployIsStartBlockFlare.t.sol
  • test/lib/deploy/LibRaindexDeployIsStartBlockPolygon.t.sol
  • test/lib/deploy/LibRaindexDeployNetworksJsonAddresses.t.sol
  • test/lib/deploy/LibRaindexDeployNetworksJsonStartBlockArbitrum.t.sol
  • test/lib/deploy/LibRaindexDeployNetworksJsonStartBlockBase.t.sol
  • test/lib/deploy/LibRaindexDeployNetworksJsonStartBlockFlare.t.sol
  • test/lib/deploy/LibRaindexDeployNetworksJsonStartBlockPolygon.t.sol
  • test/lib/deploy/LibRaindexDeployProd.t.sol
  • test/lib/deploy/LibRaindexDeployStartBlockArbitrum.t.sol
  • test/lib/deploy/LibRaindexDeployStartBlockBase.t.sol
  • test/lib/deploy/LibRaindexDeployStartBlockFlare.t.sol
  • test/lib/deploy/LibRaindexDeployStartBlockPolygon.t.sol
  • test/lib/deploy/LibRaindexDeploySubgraphYamlAddress.t.sol
  • test/lib/deploy/LibRouteProcessor4CreationCode.t.sol
  • test/util/abstract/ArbTest.sol
  • test/util/abstract/IRaindexV6Stub.sol
  • test/util/abstract/MockRaindexBase.sol
  • test/util/abstract/RaindexV6ExternalMockTest.sol
  • test/util/abstract/RaindexV6ExternalRealTest.sol
  • test/util/abstract/RaindexV6SelfTest.sol
  • test/util/abstract/RaindexV6SubParserContextTest.sol
  • test/util/concrete/AllowanceCheckingExchange.sol
  • test/util/concrete/ChildRaindexV6ArbTaskGated.sol
  • test/util/concrete/FlashLendingMockRaindex.sol
  • test/util/concrete/MaliciousLender.sol
  • test/util/concrete/MaliciousRaindex.sol
  • test/util/concrete/MockExchange.sol
  • test/util/concrete/MockRouteProcessor.sol
  • test/util/concrete/MockToken.sol
  • test/util/concrete/RealisticFlashLendingMockRaindex.sol
  • test/util/concrete/RealisticOrderTakerMockRaindex.sol
  • test/util/concrete/Reenteroor.sol
  • test/util/concrete/ReentrantExchange.sol
  • test/util/concrete/ReentrantMockRaindex.sol
  • test/util/concrete/RevertingExchange.sol
  • test/util/lib/LibEtchRaindex.sol
  • test/util/lib/LibTestAddOrder.sol
  • test/util/lib/LibTestArb.sol
  • test/util/lib/LibTestFlashBorrowerArb.sol
  • test/util/lib/LibTestTakeOrder.sol

Comment thread foundry.toml Outdated
- Replace `forge install` with `git submodule update --init --recursive`
  plus an explicit `forge soldeer install`.
- Drop the `rainix-sol-prelude` runs inside each lib/rain.* submodule;
  Solidity resolves via published soldeer artifacts. Keep
  `rainix-rs-prelude` / `rainlang-prelude` since the Cargo workspace
  still consumes the submodules' Rust crates as path-deps.
- Remove fs_permissions entries pointing at the rain.interpreter
  submodule's meta / deployments dirs — no raindex source references
  these paths after the soldeer migration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
thedavidmeister and others added 2 commits May 22, 2026 10:51
The single test usage of `fixedPointDiv` was a one-liner that resolves to
`Math.mulDiv(a, 1e18, b, Math.Rounding.Floor)`. Inlining it lets us drop
both `rain-math-fixedpoint-0.1.0` and the `@openzeppelin-contracts-4.8.3`
side-by-side install it pulled in.

This unblocks `forge soldeer install` in CI, which was failing because
the lockfile only retained one OZ version while foundry.toml referenced
both.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The pointers.sh script ran rainix-sol-prelude inside each rain.*
submodule, which invokes forge install — which now tries to git submodule
update a dependencies/ pathspec that does not exist in raindex.

The submodule preludes were generating pointer constants embedded in
the libs Solidity, but those constants now ship inside the published
soldeer artifacts. raindex only needs to soldeer-install + run its own
preludes + execute BuildPointers.sol.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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