Skip to content

feat: migrate raindex to soldeer for dependency management - #2586

Merged
thedavidmeister merged 28 commits into
mainfrom
2026-05-20-soldeer-migration
May 29, 2026
Merged

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

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented May 22, 2026

Copy link
Copy Markdown
Contributor

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

  • Chores

    • Switched to version-pinned packages and simplified remappings for reproducible builds.
    • Added dependencies/ to .gitignore and tightened filesystem permissions for local metadata.
    • Updated build/setup scripts and CI/workflows to the new package layout and streamlined install/build flow.
  • Tests

    • Updated all test imports to the pinned package layout; test logic and assertions remain unchanged.

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

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Migrates repo to Soldeer-managed dependencies: pins Solidity deps, adds remappings, updates foundry config, ignores dependencies/, replaces dotted/unversioned Solidity imports with versioned package paths across contracts and tests, updates scripts/CI to run forge soldeer install, and refactors Rust transaction/read helpers.

Changes

Soldeer Dependency Management Migration

Layer / File(s) Summary
Full migration sweep
foundry.toml, remappings.txt, .gitignore, script/*, pointers.sh, prep-base.sh, src/..., test/..., crates/*, .github/workflows/*, Cargo.toml, flake.nix
Pin Solidity deps under dependencies/, add Soldeer settings and remappings, ignore dependencies/, update imports in Solidity sources/tests to versioned packages, add execute_write_tx/WriteTransactionStatus and associated Rust refactors replacing Readable/WritableClient flows, and adjust CI/workflow checkout and prep steps.

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

  • hardyjosh
  • JuaniRios
  • 0xgleb

Poem

"🐰 I hopped through remaps, pinned each name with care,
Submodules loosened, dependencies sleep there.
Scripts, tests, and crates now fetch the same refrain,
New helpers hum and artifacts snugly lane.
Hooray — the repo blooms with versioned hair!"

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 3 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>
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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
prep-base.sh (1)

25-30: ⚡ Quick win

Add a test step in the setup flow.

Line 25 through Line 30 run install/build only; adding nix develop -c forge test would catch behavioral regressions early during setup validation.

As per coding guidelines, **/*.sol: For Solidity contracts, run nix develop -c forge test for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 11cc696 and 45cabb5.

⛔ Files ignored due to path filters (2)
  • flake.lock is excluded by !**/*.lock
  • 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
💤 Files with no reviewable changes (2)
  • remappings.txt
  • foundry.toml

thedavidmeister and others added 2 commits May 23, 2026 06:26
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
thedavidmeister and others added 10 commits May 27, 2026 18:32
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>
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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/common/src/transaction.rs (1)

138-171: ⚡ Quick win

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between 45cabb5 and 3f1078f.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • flake.lock is 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
  • .gitmodules
  • Cargo.toml
  • crates/cli/Cargo.toml
  • crates/cli/src/commands/order/calldata.rs
  • crates/cli/src/status.rs
  • crates/common/Cargo.toml
  • crates/common/build.rs
  • crates/common/src/add_order.rs
  • crates/common/src/deposit.rs
  • crates/common/src/dotrain_order.rs
  • crates/common/src/erc20.rs
  • crates/common/src/fuzz/impls.rs
  • crates/common/src/lib.rs
  • crates/common/src/raindex_client/orders.rs
  • crates/common/src/raindex_order_builder/mod.rs
  • crates/common/src/raindex_order_builder/order_operations.rs
  • crates/common/src/raindex_order_builder/state_management.rs
  • crates/common/src/rainlang.rs
  • crates/common/src/remove_order.rs
  • crates/common/src/replays.rs
  • crates/common/src/transaction.rs
  • crates/common/src/unit_tests.rs
  • crates/common/src/withdraw.rs
  • crates/common/src/write_tx.rs
  • crates/js_api/Cargo.toml
  • crates/quote/Cargo.toml
  • crates/quote/src/error.rs
  • crates/quote/src/order_quotes.rs
  • crates/test_fixtures/Cargo.toml
  • crates/test_fixtures/src/lib.rs
  • foundry.toml
  • lib/rain.deploy
  • lib/rain.interpreter
  • lib/rain.raindex.interface
  • lib/sushixswap-v2
  • prep-base.sh
  • src/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sol
  • src/interface/IRouteProcessor.sol
  • test/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.sol
  • test/util/concrete/MockRouteProcessor.sol
  • test/util/concrete/Refundoor.sol
  • test/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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/common/Cargo.toml (1)

78-84: getrandom 0.4 wasm_js dependency rationale checks out.

getrandom 0.4 uses the wasm_js feature for wasm32-unknown-unknown by wiring entropy through wasm-bindgen/js-sys to Crypto.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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f1078f and e25a17f.

⛔ Files ignored due to path filters (5)
  • Cargo.lock is excluded by !**/*.lock
  • src/generated/GenericPoolRaindexV6FlashBorrower.pointers.sol is excluded by !**/generated/**
  • src/generated/RaindexV6.pointers.sol is excluded by !**/generated/**
  • src/generated/RaindexV6SubParser.pointers.sol is excluded by !**/generated/**
  • src/generated/RouteProcessorRaindexV6ArbOrderTaker.pointers.sol is excluded by !**/generated/**
📒 Files selected for processing (15)
  • Cargo.toml
  • crates/common/Cargo.toml
  • crates/common/src/raindex_client/mod.rs
  • crates/common/src/raindex_order_builder/mod.rs
  • crates/common/src/unit_tests.rs
  • crates/js_api/src/raindex_order_builder/mod.rs
  • crates/js_api/src/registry.rs
  • crates/js_api/src/yaml/mod.rs
  • crates/quote/src/quote.rs
  • crates/quote/src/quote_debug.rs
  • test/concrete/raindex/RaindexV6.addOrder.mock.t.sol
  • test/concrete/raindex/RaindexV6.deposit.entask.t.sol
  • test/concrete/raindex/RaindexV6.entask.t.sol
  • test/concrete/raindex/RaindexV6.withdraw.entask.t.sol
  • test/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>
thedavidmeister and others added 8 commits May 29, 2026 16:20
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>
@thedavidmeister
thedavidmeister merged commit 262bd6c into main May 29, 2026
19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@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:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

SIZE=L

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