feat: migrate raindex to soldeer for dependency management - #2586
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>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughMigrates repo to Soldeer-managed dependencies: pins Solidity deps, adds remappings, updates foundry config, ignores ChangesSoldeer Dependency Management Migration
Sequence Diagram(s)(Skipped — repository-wide migration; no focused multi-component sequential flow to visualize.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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>
Replace ReadableClient/ReadContractParameters/WriteContractParameters with alloy Provider eth_call (TransactionRequest + provider.call + abi_decode_returns) and the alloy write path, across common, cli/status, and quote. Removes the last alloy-ethers-typecast usage.
Move the rainlang-family deps onto crates.io: rainlang-eval 0.1.2 (its forking executor now comes from the published rain-forker crate, replacing foundry-evm), bindings 0.1.15 / dispair 0.1.10 / parser 0.1.3. This eliminates the foundry-evm git dependency (15 unpublishable crates) and resolves the FullyQualifiedNamespace / AbiDecodedErrorType duplicate-crate conflicts, since eval and raindex now share a single crates.io rainlang_bindings. Also: rain-metaboard-subgraph 0.1.3 get_metabytes_by_subject takes &Bytes (was &BigInt); fork_eval/fork_parse moved to the ForkEvalExt extension trait; GH_COMMIT_SHA derived via build.rs for local builds; getrandom 0.4 wasm_js feature for the wasm build. Workspace alloy bumps to 1.8.3. Compiles native + wasm. The only remaining git dep is rainlang_test_fixtures (publish=false). Builds on the in-progress soldeer migration on this branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
eval 0.1.2 pulls wasm-bindgen-utils 0.1.2 (fixes the wasm build); rain-math-float 0.1.6 moves onto revm 36, so the whole graph shares a single revm instead of linking revm 25 and 36 together. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The orderbook (RaindexV6) reads token decimals via the TOFU singleton and its ensureDeployed() requires the deployed codehash to equal the libs TOFU_DECIMALS_EXPECTED_CODE_HASH. test_fixtures was set_code-ing raindexs own compile of TOFUTokenDecimals.sol, whose metadata hash differs, so every deposit/take reverted with TOFUTokenDecimalsNotDeployed. Deploy the canonical creation code from LibTOFUTokenDecimals instead, read its runtime, and place that at the deterministic singleton address. Fixes the ~32 take_orders e2e/single tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The SERIALIZED_STATE snapshot lost its base64 padding and was stale after the flate2 bump; restore the correct gzip bytes so the URL_SAFE decode round-trips. Update the bad-fork-URL assertion to expect rain-forker's ExecutorError (connection/setup failures), replacing the old foundry forker's Eyre variant. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The lib/ submodules (sushixswap-v2, rain.interpreter, rain.raindex.interface, rain.deploy) are fully replaced by Soldeer dependencies under dependencies/, resolved via remappings.txt. Drop the submodules, the now-empty .gitmodules, the stale Cargo workspace exclude, the prep-base.sh submodule init, and flip CI checkout submodules flags to false. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
After the alloy bump the unreachable-RPC error surfaces as reqwest's "error sending request" rather than the old multi-provider fallback "all providers failed to handle the request" phrasing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…026-05-20-soldeer-migration
A failing fork RPC now surfaces rain-forker's "Executor error: HTTP error 400 ..." instead of the old foundry forker's "could not instantiate forked environment" phrasing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/common/src/transaction.rs (1)
138-171: ⚡ Quick winConsider extracting the URL-parsing and provider-creation pattern.
All three
read_*helper functions duplicate the same URL parsing and provider setup logic. Extracting a shared helper would reduce repetition and simplify future maintenance.♻️ Proposed refactor to reduce duplication
Add a private helper function:
async fn with_read_provider<F, T, Fut>( rpcs: &[String], f: F, ) -> Result<T, TransactionArgsError> where F: FnOnce(impl Provider) -> Fut, Fut: std::future::Future<Output = Result<T, TransportError>>, { let urls = rpcs .iter() .map(|s| s.parse::<Url>()) .collect::<Result<Vec<_>, _>>()?; let provider = mk_read_provider(&urls)?; Ok(f(provider).await?) }Then simplify each helper:
pub async fn read_chain_id(rpcs: &[String]) -> Result<u64, TransactionArgsError> { - let urls = rpcs - .iter() - .map(|s| s.parse::<Url>()) - .collect::<Result<Vec<_>, _>>()?; - let provider = mk_read_provider(&urls)?; - Ok(provider.get_chain_id().await?) + with_read_provider(rpcs, |p| p.get_chain_id()).await } pub async fn read_block_number(rpcs: &[String]) -> Result<u64, TransactionArgsError> { - let urls = rpcs - .iter() - .map(|s| s.parse::<Url>()) - .collect::<Result<Vec<_>, _>>()?; - let provider = mk_read_provider(&urls)?; - Ok(provider.get_block_number().await?) + with_read_provider(rpcs, |p| p.get_block_number()).await }(A similar pattern would apply to
read_call, though its closure body is slightly more complex.)🤖 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 `@crates/common/src/transaction.rs` around lines 138 - 171, Extract the repeated URL parsing + provider creation into a private helper (e.g., with_read_provider) and refactor read_chain_id, read_block_number, and read_call to call it; the helper should take rpcs: &[String], parse into Vec<Url> (same logic currently in each function), call mk_read_provider(&urls) to get the provider, then run a closure that performs provider.get_chain_id(), provider.get_block_number(), or the call logic for read_call and return/propagate the Result/TransportError mapped to TransactionArgsError — this removes duplication while keeping existing behaviors of read_chain_id, read_block_number, read_call and the use of mk_read_provider and ABI encode/decode flows.
🤖 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 `@crates/common/src/transaction.rs`:
- Around line 138-171: Extract the repeated URL parsing + provider creation into
a private helper (e.g., with_read_provider) and refactor read_chain_id,
read_block_number, and read_call to call it; the helper should take rpcs:
&[String], parse into Vec<Url> (same logic currently in each function), call
mk_read_provider(&urls) to get the provider, then run a closure that performs
provider.get_chain_id(), provider.get_block_number(), or the call logic for
read_call and return/propagate the Result/TransportError mapped to
TransactionArgsError — this removes duplication while keeping existing behaviors
of read_chain_id, read_block_number, read_call and the use of mk_read_provider
and ABI encode/decode flows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 208da09d-6a99-4cc2-9873-619f29263023
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockflake.lockis excluded by!**/*.lock
📒 Files selected for processing (56)
.github/workflows/copilot-setup-steps.yml.github/workflows/deploy-subgraph.yaml.github/workflows/git-clean.yaml.github/workflows/manual-rs-release.yml.github/workflows/manual-sol-artifacts.yaml.github/workflows/rainix.yaml.github/workflows/test-subgraph.yml.github/workflows/test-ui-components.yaml.github/workflows/test-webapp.yaml.github/workflows/vercel-docs-preview.yaml.github/workflows/vercel-docs-prod.yaml.github/workflows/vercel-preview.yaml.github/workflows/vercel-prod.yaml.gitignore.gitmodulesCargo.tomlcrates/cli/Cargo.tomlcrates/cli/src/commands/order/calldata.rscrates/cli/src/status.rscrates/common/Cargo.tomlcrates/common/build.rscrates/common/src/add_order.rscrates/common/src/deposit.rscrates/common/src/dotrain_order.rscrates/common/src/erc20.rscrates/common/src/fuzz/impls.rscrates/common/src/lib.rscrates/common/src/raindex_client/orders.rscrates/common/src/raindex_order_builder/mod.rscrates/common/src/raindex_order_builder/order_operations.rscrates/common/src/raindex_order_builder/state_management.rscrates/common/src/rainlang.rscrates/common/src/remove_order.rscrates/common/src/replays.rscrates/common/src/transaction.rscrates/common/src/unit_tests.rscrates/common/src/withdraw.rscrates/common/src/write_tx.rscrates/js_api/Cargo.tomlcrates/quote/Cargo.tomlcrates/quote/src/error.rscrates/quote/src/order_quotes.rscrates/test_fixtures/Cargo.tomlcrates/test_fixtures/src/lib.rsfoundry.tomllib/rain.deploylib/rain.interpreterlib/rain.raindex.interfacelib/sushixswap-v2prep-base.shsrc/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.solsrc/interface/IRouteProcessor.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.soltest/util/concrete/MockRouteProcessor.soltest/util/concrete/Refundoor.soltest/util/concrete/TOFUTokenDecimalsArtifact.sol
💤 Files with no reviewable changes (10)
- lib/rain.deploy
- lib/sushixswap-v2
- lib/rain.raindex.interface
- .gitmodules
- crates/common/src/erc20.rs
- crates/quote/src/error.rs
- lib/rain.interpreter
- crates/quote/Cargo.toml
- prep-base.sh
- crates/common/src/raindex_order_builder/mod.rs
✅ Files skipped from review due to trivial changes (6)
- .gitignore
- crates/common/src/lib.rs
- crates/common/src/raindex_order_builder/state_management.rs
- test/util/concrete/TOFUTokenDecimalsArtifact.sol
- test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.sol
- src/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sol
🚧 Files skipped from review as they are similar to previous changes (1)
- test/util/concrete/MockRouteProcessor.sol
- bump rain-math-float 0.1.6 -> 0.1.7 (boxed FloatError::DecimalFloat) - common: add getrandom_v04 (wasm_js) so the standalone wasm-pack build works; box erc20::Error in RaindexError / RaindexOrderBuilderError to clear clippy::result_large_err; drop an unused import - js_api: box RaindexOrderBuilderError in the wasm wrapper; allow dead_code on the wasm-only #[wasm_bindgen_test] modules; drop a needless mut - quote: drop unused test imports - regenerate src/generated/*.pointers.sol for the optimizer_runs=800 bytecode (fixes testRuntimeCode* / testExpectedCodeHash*) - forge fmt 5 test files Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/common/Cargo.toml (1)
78-84: getrandom 0.4 wasm_js dependency rationale checks out.
getrandom0.4 uses thewasm_jsfeature forwasm32-unknown-unknownby wiring entropy throughwasm-bindgen/js-systoCrypto.getRandomValues(with the usual wasm_js caveat: it adds extra deps and is generally discouraged for libraries, but is appropriate for wasm-pack browser tests).🤖 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 `@crates/common/Cargo.toml` around lines 78 - 84, The getrandom 0.4 entry must explicitly enable the wasm_js feature for wasm tests: keep the getrandom_v04 dependency block with package = "getrandom", version = "0.4" and ensure the features array contains "wasm_js" (i.e., getrandom_v04 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }); do not remove or alter the wasm_js feature and retain the explanatory comment above the block so wasm-pack browser tests build correctly.
🤖 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 `@crates/common/Cargo.toml`:
- Around line 78-84: The getrandom 0.4 entry must explicitly enable the wasm_js
feature for wasm tests: keep the getrandom_v04 dependency block with package =
"getrandom", version = "0.4" and ensure the features array contains "wasm_js"
(i.e., getrandom_v04 = { package = "getrandom", version = "0.4", features =
["wasm_js"] }); do not remove or alter the wasm_js feature and retain the
explanatory comment above the block so wasm-pack browser tests build correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c17e96d4-262b-49e8-b905-5da195d818b2
⛔ Files ignored due to path filters (5)
Cargo.lockis excluded by!**/*.locksrc/generated/GenericPoolRaindexV6FlashBorrower.pointers.solis excluded by!**/generated/**src/generated/RaindexV6.pointers.solis excluded by!**/generated/**src/generated/RaindexV6SubParser.pointers.solis excluded by!**/generated/**src/generated/RouteProcessorRaindexV6ArbOrderTaker.pointers.solis excluded by!**/generated/**
📒 Files selected for processing (15)
Cargo.tomlcrates/common/Cargo.tomlcrates/common/src/raindex_client/mod.rscrates/common/src/raindex_order_builder/mod.rscrates/common/src/unit_tests.rscrates/js_api/src/raindex_order_builder/mod.rscrates/js_api/src/registry.rscrates/js_api/src/yaml/mod.rscrates/quote/src/quote.rscrates/quote/src/quote_debug.rstest/concrete/raindex/RaindexV6.addOrder.mock.t.soltest/concrete/raindex/RaindexV6.deposit.entask.t.soltest/concrete/raindex/RaindexV6.entask.t.soltest/concrete/raindex/RaindexV6.withdraw.entask.t.soltest/concrete/raindex/RaindexV6.withdraw.t.sol
💤 Files with no reviewable changes (1)
- crates/common/src/unit_tests.rs
✅ Files skipped from review due to trivial changes (6)
- crates/js_api/src/yaml/mod.rs
- crates/js_api/src/registry.rs
- test/concrete/raindex/RaindexV6.withdraw.t.sol
- test/concrete/raindex/RaindexV6.deposit.entask.t.sol
- crates/quote/src/quote.rs
- test/concrete/raindex/RaindexV6.addOrder.mock.t.sol
🚧 Files skipped from review as they are similar to previous changes (3)
- test/concrete/raindex/RaindexV6.withdraw.entask.t.sol
- test/concrete/raindex/RaindexV6.entask.t.sol
- Cargo.toml
No git submodules remain, so the checkout `submodules: false` is just the default and `fetch-depth: 0` (full history) is no longer needed. Removing both lets checkout do a default shallow clone — faster CI. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rainix dropped its trivial sol/rs task wrappers, so the CI matrix's rainix-sol-test/static/legal and rainix-rs-artifacts were "command not found". Define them in the flake (forge test / slither + forge fmt / reuse lint / cargo build --release) using rainix's sol+rs build inputs, and add them to the devShell. Also declare remappings.txt and soldeer.lock in REUSE.toml (and drop the removed .gitmodules) so `reuse lint` (sol-legal) passes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the locally-defined sol/rs task wrappers with rainix's reusable workflows: - solidity job -> rainix-sol.yaml (static + legal + test). raindex's fork tests read foundry.toml rpc_endpoints, so repoint those at rainix's *_RPC_URL env names and map our CI_DEPLOY_* secrets onto rainix's RPC_URL_*_FORK inputs. - copy-artifacts job -> rainix-copy-artifacts.yaml asserts the committed generated artifacts stay fresh, replacing the in-line pointers.sh regen. Commit the generated subparser meta (un-gitignore meta/) alongside the already-committed pointers; this lets the reusables build/test without a prelude (a test reads meta/RaindexV6SubParser.rain.meta). Keep rust/wasm/js on raindex's own devshell matrix (they need sqlite3 and forge-build artifacts the slim rainix rs reusables don't provide); inline rs-artifacts as `cargo build --release`. Drop the flake task wrappers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Match rainlang's CI layout: separate thin workflow files that each call a rainix reusable with `secrets: inherit`, instead of bundling them as jobs in rainix.yaml. - rainix-sol.yaml -> rainix-sol.yaml reusable (static + legal + test) - copy-artifacts.yaml -> rainix-copy-artifacts.yaml reusable rainix.yaml now only carries the rust/wasm/js matrix that needs raindex's own devshell (sqlite3 + forge artifacts). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- flake.nix: raindex-ui-components-prelude pulled nixpkgs' wasm-bindgen-cli (0.2.117), shadowing rainix's 0.2.122 on the devshell PATH; the rain crates force the wasm-bindgen crate to 0.2.122, so the npm raindex package's wasm-bindgen step failed with a schema mismatch (webapp + ui-components builds). Drop the redundant pkgs.wasm-bindgen-cli; rainix.rust-build-inputs already provides the matching 0.2.122. - test-subgraph.yml: drop the obsolete `cd lib/rain.interpreter/.../ rain.math.float && rainix-sol-prelude` step (that nested submodule is gone; subgraph-build does its own forge build via soldeer). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- REUSE.toml: declare meta/**/ (committed binary subparser .rain.meta artifacts have no inline SPDX) so reuse lint (sol-legal) passes. - subgraph networks.json + subgraph.yaml: optimizer_runs=800 moved RaindexV6's deterministic Zoltu address to 0xa560e58C...; point the subgraph configs at it (matches the regenerated pointers / deploy lib). testProdDeploy* still fork live networks and check on-chain code at the new address, so they require deploying the new bytecode (manual-sol-artifacts). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rainix dropped the trivial rainix-sol-prelude / rainix-rs-prelude wrappers, which the deploy workflow still invoked. Since the meta and pointer artifacts are now committed (and copy-artifacts.yaml enforces their freshness), no codegen prelude is needed: the deploy and standard-tests just soldeer-install + forge-build against the committed artifacts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Match rainlang: the deploy workflow is now a thin workflow_dispatch wrapper over rainlanguage/rainix's rainix-manual-sol-artifacts.yaml with secrets: inherit. The reusable maps RPC_URL_*_FORK secrets to the ARBITRUM_RPC_URL/BASE_RPC_URL/... names foundry.toml resolves, fixing the "environment variable ARBITRUM_RPC_URL not found" deploy failure, and deploys from committed artifacts with no codegen prelude. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- buildPackage.js: refresh the wasm-bindgen string-replace anchors for
0.2.122. node now loads `wasmBytes` via a `${__dirname}` template, web
emits `export { initSync, __wbg_init as default };` on one line, and
initSync prefers `{ module }`. The stale anchors silently no-opped, so
the wasm was never inlined (js-bindings ENOENT) nor initialized (webapp
`__wbindgen_export2` undefined).
- builder.test.ts: the U256 parser (ruint) now says "invalid digit: t"
rather than "digit 29 is out of range for base 10".
- ui-components: 0.2.122 generates `[Symbol.dispose]` on wasm classes, so
the DotrainRegistry mock must include it.
- test-subgraph.yml: run `forge soldeer install` before subgraph-build;
without it the migrated `dependencies/` dir is empty and forge build
cannot resolve imports.
- LibRaindexDeploy.sol + subgraph/networks.json: update RAINDEX_START_BLOCK_*
and subgraph startBlocks to the redeployed RaindexV6 blocks (arbitrum
467989192, base 46645657, flare 61847874, polygon 87623401).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The subgraph reads out/DecimalFloat.sol/DecimalFloat.json, but raindex only imports LibDecimalFloat (not the concrete contract), so after the submodule->soldeer migration forge no longer emits that ABI (the rain.math.float submodule build that used to produce it was dropped from test-subgraph.yml). Importing the concrete contract in script/ forces forge to compile it, restoring the ABI the subgraph build consumes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment: S/M/L PR Classification Guidelines:This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed. Small (S)Characteristics:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|
|
Tip For best results, initiate chat on the files or code changes. SIZE=L |
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