Skip to content

WIP: migrate flow to V4 interpreter + soldeer + reusable workflows#475

Draft
thedavidmeister wants to merge 9 commits into
mainfrom
2026-06-06-v4-soldeer-reusable
Draft

WIP: migrate flow to V4 interpreter + soldeer + reusable workflows#475
thedavidmeister wants to merge 9 commits into
mainfrom
2026-06-06-v4-soldeer-reusable

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Draft / WIP — tracks #474. Do not merge.

Starts flow's migration onto the current rain stack. Committed so far: the soldeer de-submodule groundwork (foundry.toml [dependencies] + remappings replacing lib/ submodules).

Remaining (fully specified in #474, file-level):

  • Interpreter V2 → V4 (eval4): Flow.sol, LibFlow.sol, new IFlowV6 — store EvaluableV4{interpreter,store,bytecode}, drop the deployer/LibEncodedDispatch, stack uint256StackItem. Security semantics per upstream RaindexV6 (eval-time, no deploy-time integrity check).
  • Deterministic script/Deploy.sol + pointers; reusable rainix-sol / rainix-manual-sol-artifacts / rainix-copy-artifacts.
  • Test rewrite (~10 files).

CI here is the build-verify loop. Expect red until the V4 eval-path rewrite lands — the unchanged Flow.sol still references the now-removed LibEncodedDispatch.

Closes #474 when complete.

First step of the flow V2->V4 + soldeer + reusables migration tracked in #474.
Replaces lib/ submodules with soldeer [dependencies] (OZ 4.9.6, forge-std,
rain-factory/interpreter-interface/math-fixedpoint/solmem) + remappings-only
mapping of the existing import roots. The eval-path V4 rewrite (Flow.sol/LibFlow/
IFlowV6) + tests follow per #474; CI on the draft PR is the build-verify loop.

Refs #474
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4828fcce-e543-45e9-895f-542bb9c8abcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-06-v4-soldeer-reusable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Flow.sol: EvaluableV2->EvaluableV4, eval2->eval4(EvalV4), drop deployer +
LibEncodedDispatch + io integrity check (eval-time validation per RaindexV6),
StackItem stack via assembly cast. New IFlowV6. LibFlow: store V2->V3, kvs
bytes32[]. Deprecated V2 interface imports across other flow interfaces
rewritten to their relocated deprecated/v1|v2 soldeer paths.

Build advancing past imports; remaining = transitive soldeer deps (rain-lib-hash
+ OZ 4.9.6/5.6.1 split where rain deps pull OZ5) + then test rewrite. Refs #474
Per 'track latest', flow targets OZ 5.6.1 (not 4.9.6) — aligns flow with the
rain deps that already pull OZ5. Requires flow's own OZ import paths + code to
move 4->5 (see #474). Adds rain-lib-hash/math-float/metadata/lib-typecast.
Refs #474
OZ 4->5 for flow: holders/ECDSA/ReentrancyGuard moved to the non-upgradeable
package (stateless, no __init); MulticallUpgradeable kept; @openzeppelin/contracts
bridge remap added. Clean soldeer reinstall (OZ 5.6.1 + rain-lib-hash/math-float).
Old flow interface EvaluableV2 imports repointed to deprecated/v1. src/ now builds;
remaining errors are all in test/ (the V4+OZ5 test rewrite). Refs #474
…reen

Rewrote the test harness to V4: InterpreterMockTest mocks eval4 (no deployer/
EncodedDispatch); FlowTest builds EvaluableV4{interpreter,store,bytecode} directly
with the evaluable bytecode derived from the expression so distinct flows hash
distinctly. Migrated all concrete tests: drop LibEncodedDispatch dispatch args,
uint256[]->StackItem[]/bytes32[] casts at flow()/stackToFlow() call sites, store
mocks IInterpreterStoreV2->V3, Context->ContextV2 event, OZ5 MessageHashUtils +
code.length (no Address.isContract). Multicall uses a sequential eval4 mock.
Dropped the obsolete deploy-time integrity-check construction tests (V4 validates
at eval time per RaindexV6). forge fmt applied. All suites pass locally. Refs #474
CI -> rainlanguage/rainix reusable rainix-sol (static/legal/test). Fix .gitignore
(dependencies/ + node_modules were not ignored due to a missing trailing newline)
and untrack the soldeer dependencies/ tree; add soldeer.lock + remappings.txt to
REUSE.toml. Local: slither 0 results, reuse 58/58 compliant, all tests pass.
Move the two-flow stack build + sequential eval4 mock into a helper to reduce
live locals in testFlowBasicMulticallFlows; nightly forge (no via-ir) hit stack
too deep on the inlined form.
…inistic Flow)

flow's deploy was vestigial (no Deploy.sol). Add deterministic Zoltu deploy of
the Flow implementation: script/Deploy.sol (DEPLOYMENT_SUITE=flow) +
BuildPointers.sol + committed src/generated/Flow.pointers.sol (idempotent).
foundry.toml gains rain-deploy/rain-sol-codegen, fs_permissions, rpc_endpoints +
etherscan. manual-sol-artifacts -> reusable rainix-manual-sol-artifacts;
git-clean -> reusable rainix-copy-artifacts. Flow deterministic address
0x502DcAb53948f43af1Fc3a63D14A47daC44C2992 (requires a deploy run to go live).
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.

Migrate flow to V4 interpreter (eval4) + soldeer + reusable workflows

1 participant