WIP: migrate flow to V4 interpreter + soldeer + reusable workflows#475
WIP: migrate flow to V4 interpreter + soldeer + reusable workflows#475thedavidmeister wants to merge 12 commits into
Conversation
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
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
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).
|
🤖 ai:producer |
Union resolution of the V4-interpreter migration branch against current main: - Flow.sol: kept V6 semantics (EvaluableV4, no deploy-time integrity) with main's improved NatSpec adapted to the V6 surface; import set covers the BadMinStackLength guard main relocated into ErrFlow. - Construction tests: ported main's initialize-overload/once-only tests to V6 forms (OZ5 InvalidInitialization custom error replaces the v4 string); the deployer-io guard tests cover a code path V4 removes and are retired with the in-file note. - Reentrancy helpers + tests from main translated to V6 types; store helper matches IInterpreterStoreV3.set(StateNamespace, bytes32[]) so the guard path is actually exercised. - signedContext/transfer/preview tests: main's bounded-key and renamed assertions kept, V6 types applied; IFlowV5.t.sol keeps main's V5 re-export pins (V5 interface still ships on this branch). - Flow.pointers.sol regenerated for the merged bytecode. Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 ai:producer |
|
🤖 ai:producer |
…d.sol The org-wide rainix copy-artifacts gate requires the codegen script for committed src/generated/ sources to be exactly script/Build.sol; it runs forge script ./script/Build.sol and then asserts the regenerated files match the committed ones. Rename the existing pointers codegen script (and its contract, matching the sibling rain.erc4626.words template) so the gate finds and runs it. Regeneration reproduces the committed src/generated/Flow.pointers.sol byte-for-byte. Co-Authored-By: Claude <noreply@anthropic.com>
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 replacinglib/submodules).Remaining (fully specified in #474, file-level):
eval4):Flow.sol,LibFlow.sol, newIFlowV6— storeEvaluableV4{interpreter,store,bytecode}, drop the deployer/LibEncodedDispatch, stackuint256→StackItem. Security semantics per upstreamRaindexV6(eval-time, no deploy-time integrity check).script/Deploy.sol+ pointers; reusablerainix-sol/rainix-manual-sol-artifacts/rainix-copy-artifacts.CI here is the build-verify loop. Expect red until the V4 eval-path rewrite lands — the unchanged
Flow.solstill references the now-removedLibEncodedDispatch.Closes #474 when complete.