feat: migrate raindex to soldeer for dependency management#2586
feat: migrate raindex to soldeer for dependency management#2586thedavidmeister wants to merge 7 commits into
Conversation
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>
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 18 minutes and 53 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (25)
📝 WalkthroughWalkthroughMigrate repo to Soldeer: add dependency remappings and pins, ignore ChangesSoldeer Dependency Management Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
soldeer.lockis excluded by!**/*.lock
📒 Files selected for processing (145)
.gitignorefoundry.tomlremappings.txtscript/BuildAuthoringMeta.solscript/BuildPointers.solscript/Deploy.solscript/DiagOrder.solsrc/abstract/RaindexV6ArbCommon.solsrc/abstract/RaindexV6ArbOrderTaker.solsrc/abstract/RaindexV6ArbTaskGated.solsrc/abstract/RaindexV6FlashBorrower.solsrc/abstract/RaindexV6FlashLender.solsrc/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.solsrc/concrete/parser/RaindexV6SubParser.solsrc/concrete/raindex/RaindexV6.solsrc/lib/LibGenericPoolExchange.solsrc/lib/LibOrder.solsrc/lib/LibRaindex.solsrc/lib/LibRaindexArb.solsrc/lib/LibRaindexSubParser.soltest/abstract/RaindexV6ArbOrderTaker.context.t.soltest/abstract/RaindexV6ArbOrderTaker.ierc165.t.soltest/abstract/RaindexV6ArbOrderTaker.noOrders.t.soltest/abstract/RaindexV6ArbOrderTaker.onTakeOrders2.t.soltest/abstract/RaindexV6ArbOrderTaker.onTakeOrders2Direct.t.soltest/abstract/RaindexV6ArbOrderTaker.reentrancy.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashPassMatch.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashPassZero.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashWrongTask.t.soltest/abstract/RaindexV6ArbTaskGated.construct.t.soltest/abstract/RaindexV6ArbTaskGated.iTaskHashNonzero.t.soltest/abstract/RaindexV6ArbTaskGated.iTaskHashZero.t.soltest/abstract/RaindexV6FlashBorrower.badInitiator.t.soltest/abstract/RaindexV6FlashBorrower.badLenderApproval.t.soltest/abstract/RaindexV6FlashBorrower.flashLoanFailed.t.soltest/abstract/RaindexV6FlashBorrower.ierc165.t.soltest/abstract/RaindexV6FlashBorrower.lenderValidation.t.soltest/abstract/RaindexV6FlashBorrower.mixedDecimals.t.soltest/abstract/RaindexV6FlashBorrower.noOrders.t.soltest/abstract/RaindexV6FlashBorrower.realTokenTransfers.t.soltest/abstract/RaindexV6FlashBorrower.reentrancy.t.soltest/abstract/RaindexV6FlashLender.griefRecipient.t.soltest/abstract/RaindexV6FlashLender.ierc165.t.soltest/abstract/RaindexV6FlashLender.maxFlashLoan.t.soltest/abstract/RaindexV6FlashLender.mockSuccess.t.soltest/abstract/RaindexV6FlashLender.reentrant.t.soltest/abstract/RaindexV6FlashLender.transfers.t.soltest/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.approvalRevoked.t.soltest/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.exchangeRevert.t.soltest/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.sender.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.approvalRevoked.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.ethForwarded.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.exchangeRevert.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.sender.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.nonStandardDecimals.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2Direct.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sender.t.soltest/concrete/parser/RaindexV6SubParser.describedByMeta.t.soltest/concrete/parser/RaindexV6SubParser.ierc165.t.soltest/concrete/parser/RaindexV6SubParser.pointers.t.soltest/concrete/parser/RaindexV6SubParser.signedContext.t.soltest/concrete/parser/RaindexV6SubParser.signers.t.soltest/concrete/raindex/RaindexV6.addOrder.entask.t.soltest/concrete/raindex/RaindexV6.addOrder.mock.t.soltest/concrete/raindex/RaindexV6.addOrder.nonce.t.soltest/concrete/raindex/RaindexV6.addOrder.owner.t.soltest/concrete/raindex/RaindexV6.addOrder.t.soltest/concrete/raindex/RaindexV6.clear.badStack.t.soltest/concrete/raindex/RaindexV6.clear.context.t.soltest/concrete/raindex/RaindexV6.clear.handleIO.revert.t.soltest/concrete/raindex/RaindexV6.clear.mock.t.soltest/concrete/raindex/RaindexV6.clear.sameOwner.t.soltest/concrete/raindex/RaindexV6.clear.sameToken.t.soltest/concrete/raindex/RaindexV6.clear.zeroAmount.t.soltest/concrete/raindex/RaindexV6.deposit.entask.t.soltest/concrete/raindex/RaindexV6.deposit.t.soltest/concrete/raindex/RaindexV6.entask.t.soltest/concrete/raindex/RaindexV6.quote.sameToken.t.soltest/concrete/raindex/RaindexV6.quote.t.soltest/concrete/raindex/RaindexV6.removeOrder.entask.t.soltest/concrete/raindex/RaindexV6.removeOrder.mock.t.soltest/concrete/raindex/RaindexV6.removeOrder.owner.t.soltest/concrete/raindex/RaindexV6.takeOrder.badStack.t.soltest/concrete/raindex/RaindexV6.takeOrder.exceedsMaxRatio.t.soltest/concrete/raindex/RaindexV6.takeOrder.handleIO.revert.t.soltest/concrete/raindex/RaindexV6.takeOrder.maximumInput.t.soltest/concrete/raindex/RaindexV6.takeOrder.maximumOutput.t.soltest/concrete/raindex/RaindexV6.takeOrder.minimumIO.t.soltest/concrete/raindex/RaindexV6.takeOrder.noop.t.soltest/concrete/raindex/RaindexV6.takeOrder.precision.t.soltest/concrete/raindex/RaindexV6.takeOrder.sameToken.t.soltest/concrete/raindex/RaindexV6.takeOrder.tokenMismatch.t.soltest/concrete/raindex/RaindexV6.vaultBalance.t.soltest/concrete/raindex/RaindexV6.withdraw.entask.t.soltest/concrete/raindex/RaindexV6.withdraw.t.soltest/lib/LibOrder.t.soltest/lib/LibRaindexArb.finalizeArbNativeGas.t.soltest/lib/LibRaindexArb.finalizeArbOutputTokenProfit.t.soltest/lib/LibRaindexArb.finalizeArbTaskContext.t.soltest/lib/LibRaindexArb.finalizeArbTokenTransfers.t.soltest/lib/deploy/LibRaindexDeploy.t.soltest/lib/deploy/LibRaindexDeployIsStartBlockArbitrum.t.soltest/lib/deploy/LibRaindexDeployIsStartBlockBase.t.soltest/lib/deploy/LibRaindexDeployIsStartBlockFlare.t.soltest/lib/deploy/LibRaindexDeployIsStartBlockPolygon.t.soltest/lib/deploy/LibRaindexDeployNetworksJsonAddresses.t.soltest/lib/deploy/LibRaindexDeployNetworksJsonStartBlockArbitrum.t.soltest/lib/deploy/LibRaindexDeployNetworksJsonStartBlockBase.t.soltest/lib/deploy/LibRaindexDeployNetworksJsonStartBlockFlare.t.soltest/lib/deploy/LibRaindexDeployNetworksJsonStartBlockPolygon.t.soltest/lib/deploy/LibRaindexDeployProd.t.soltest/lib/deploy/LibRaindexDeployStartBlockArbitrum.t.soltest/lib/deploy/LibRaindexDeployStartBlockBase.t.soltest/lib/deploy/LibRaindexDeployStartBlockFlare.t.soltest/lib/deploy/LibRaindexDeployStartBlockPolygon.t.soltest/lib/deploy/LibRaindexDeploySubgraphYamlAddress.t.soltest/lib/deploy/LibRouteProcessor4CreationCode.t.soltest/util/abstract/ArbTest.soltest/util/abstract/IRaindexV6Stub.soltest/util/abstract/MockRaindexBase.soltest/util/abstract/RaindexV6ExternalMockTest.soltest/util/abstract/RaindexV6ExternalRealTest.soltest/util/abstract/RaindexV6SelfTest.soltest/util/abstract/RaindexV6SubParserContextTest.soltest/util/concrete/AllowanceCheckingExchange.soltest/util/concrete/ChildRaindexV6ArbTaskGated.soltest/util/concrete/FlashLendingMockRaindex.soltest/util/concrete/MaliciousLender.soltest/util/concrete/MaliciousRaindex.soltest/util/concrete/MockExchange.soltest/util/concrete/MockRouteProcessor.soltest/util/concrete/MockToken.soltest/util/concrete/RealisticFlashLendingMockRaindex.soltest/util/concrete/RealisticOrderTakerMockRaindex.soltest/util/concrete/Reenteroor.soltest/util/concrete/ReentrantExchange.soltest/util/concrete/ReentrantMockRaindex.soltest/util/concrete/RevertingExchange.soltest/util/lib/LibEtchRaindex.soltest/util/lib/LibTestAddOrder.soltest/util/lib/LibTestArb.soltest/util/lib/LibTestFlashBorrowerArb.soltest/util/lib/LibTestTakeOrder.sol
- 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>
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>
The old rainix rev pinned in flake.lock predated soldeer support and its `rainix-sol-prelude` task ran `forge install`, which modern foundry treats as soldeer-aware and chokes on raindex's `dependencies/` directory pathspec. Bumps the rainix input to current HEAD (only exposes `rainix-sol-artifacts` and `rainix-rs-static`), and replaces the legacy `rainix-sol-prelude` / `rainix-rs-prelude` invocations in pointers.sh and prep-base.sh with explicit `forge soldeer install + forge build`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
prep-base.sh (1)
25-30: ⚡ Quick winAdd a test step in the setup flow.
Line 25 through Line 30 run install/build only; adding
nix develop -c forge testwould catch behavioral regressions early during setup validation.As per coding guidelines,
**/*.sol: For Solidity contracts, runnix develop -c forge testfor testing.🤖 Prompt for 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. In `@prep-base.sh` around lines 25 - 30, The setup script runs installation and build steps but omits running Forge tests; add a test step by invoking the Forge test command (nix develop -c forge test) in the flow—insert a call to "nix develop -c forge test" (e.g., after "nix develop -c forge build" and/or after the second "nix develop -i \"${keep[@]}\" -c forge build") so Solidity contract tests (/**/*.sol) are executed during setup and catch regressions early.
🤖 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.
Nitpick comments:
In `@prep-base.sh`:
- Around line 25-30: The setup script runs installation and build steps but
omits running Forge tests; add a test step by invoking the Forge test command
(nix develop -c forge test) in the flow—insert a call to "nix develop -c forge
test" (e.g., after "nix develop -c forge build" and/or after the second "nix
develop -i \"${keep[@]}\" -c forge build") so Solidity contract tests
(/**/*.sol) are executed during setup and catch regressions early.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8c74d903-f1d6-4802-b667-afcbb2c27b4e
⛔ Files ignored due to path filters (2)
flake.lockis excluded by!**/*.locksoldeer.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
foundry.tomlpointers.shprep-base.shremappings.txttest/concrete/raindex/RaindexV6.clear.mock.t.sol
💤 Files with no reviewable changes (2)
- remappings.txt
- foundry.toml
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
lib/submodules (rain.interpreter,rain.deploy,rain.raindex.interface) with Soldeer registry deps.rain-interpreter-interface-0.1.0/src/,raindex-interface-0.1.1/src/,rainlang-0.1.2/src/, etc.).sushixswap-v2stays a submodule (not on the Soldeer registry).5.6.1for raindex source, with4.8.3side-by-side forrain-math-fixedpoint-0.1.0's transitive use.forge buildis green end-to-end (429 files).Still pending (follow-up work in this PR or separate)
lib/rain.interpreter,lib/rain.deploy,lib/rain.raindex.interfacesubmodules +.gitmodulescleanup.prep-base.sh/pointers.shto drop submodule prelude steps.Cargo.tomlpath-deps that point intolib/rain.interpreter/....fs_permissionspaths infoundry.tomlthat still reference./lib/rain.interpreter/....rainixprovides soldeer-aware shells)..soldeerignorefor raindex itself.Test plan
forge buildgreen locally (verified).forge testpasses.Summary by CodeRabbit
Chores
Tests