Move the deployed contracts' logic into BaseRainlang* abstracts (#552 step 1) - #575
Conversation
First step of the library / deploy split (#552). The five deployed contracts' logic moves into src/abstract/BaseRainlang{Parser,Store, Interpreter,ExpressionDeployer,}.sol and src/concrete/* become thin bindings of the generated tables and Zoltu addresses over them, which is the shape the .deploy repo consumes from the package. PARSE_META_BUILD_DEPTH is a source constant on BaseRainlangParser rather than a value re-read from the generated file it parameterises. test/concrete/Test*.sol are the bases built from current source with no generated tables, placed at fixed test addresses by test/lib/deploy/LibTestInterpreterDeploy.sol. RainlangExpressionDeployerDeploymentTest types I_* as the bases and gets one hook, deployRainlang(), defaulting to the test concretes, so the op, integrity, eval and parse tests run against current source; the concrete-specific tests keep exercising the real concretes and pins. Parser, store and interpreter bytecode are unchanged. RainlangExpressionDeployer is 15 bytes longer (the parser() and integrityFunctionPointers() hooks are internal calls the legacy optimizer does not inline), so its candidate address moves and Rainlang, which embeds it, moves with it. The live 0.1.9 deployments are untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QyCCzi9WZPhuXcU1hwr2bq
|
Warning Review limit reachedNext included review available in 49 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (8)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (23)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change extracts shared Rainlang behavior into abstract base contracts. Concrete contracts now bind generated tables and deployed addresses. Test fixtures add runtime-bound implementations and fixed-address deployment support. ChangesRainlang base architecture
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established in the current change. Sequence Diagram(s)sequenceDiagram
participant Caller
participant RainlangExpressionDeployer
participant RainlangParser
participant LibIntegrityCheck
Caller->>RainlangExpressionDeployer: parse2(data)
RainlangExpressionDeployer->>RainlangParser: unsafeParse(data)
RainlangParser-->>RainlangExpressionDeployer: bytecode and constants
RainlangExpressionDeployer->>LibIntegrityCheck: integrityCheck2(serialized bytecode)
LibIntegrityCheck-->>RainlangExpressionDeployer: integrity result
RainlangExpressionDeployer-->>Caller: serialized bytecode
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
script/CopyArtifacts.sol output: the devdoc in the Rainlang, expression deployer and interpreter artifacts follows the moved NatSpec. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QyCCzi9WZPhuXcU1hwr2bq
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QyCCzi9WZPhuXcU1hwr2bq
|
@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:
|
First step of the library / deploy split (#552, rainix#296): the logic of the five deployed contracts moves into
src/abstract/BaseRainlang{Parser,Store,Interpreter,ExpressionDeployer,}.sol, andsrc/concrete/*become thin bindings of the generated tables and Zoltu addresses over them. This is the shape the.deployrepo needs from therainlangpackage: it will carry only the thin concretes plus the pins.BaseRainlangInterpreterbindsopcodeFunctionPointers();BaseRainlangParserbindsparseMeta()/operandHandlerFunctionPointers()/literalParserFunctionPointers()(nowviewso a binding may read storage);BaseRainlangExpressionDeployerbindsparser()/integrityFunctionPointers()/describedByMetaV1();BaseRainlangStoreandBaseRainlangbind nothing beyondIRainlang.PARSE_META_BUILD_DEPTHis a source constant onBaseRainlangParserrather than a value re-read from the generated file it parameterises.test/concrete/Test*.solare the bases built from current source with no generated tables: the parser builds its parse meta fromLibAllStandardOps.authoringMetaV2()at construction, the pointer tables are read fromLibAllStandardOpsat runtime.test/lib/deploy/LibTestInterpreterDeploy.solplaces them at fixed test addresses.RainlangExpressionDeployerDeploymentTesttypesI_*as the bases and gets one hook,deployRainlang(), defaulting to the test concretes. The op / integrity / eval / parse tests now run against current source rather than the etched candidate record; the concrete-specific tests (*.pointers,*.meta,deployCheck,extrospect,Rainlang.t,LibInterpreterDeploy.t,Build.t, the deploy chain test) still exercise the real concretes and pins, and the deploy repo'sOpTestwill override the hook withetchRainlang.RainlangExpressionDeployeris 15 bytes longer (theparser()/integrityFunctionPointers()hooks are internal calls the legacy optimizer does not inline), so its candidate address moves0xb90c299a…→0x146Fecd8…, andRainlang, which embeds it, moves with it. The live 0.1.9 deployments are untouched; the next release needs theexpression-deployerandrainlangsuites deployed before its cut, which is the documented flow.QA
ARBITRUM_RPC_URL, the same set that fails locally onmain.RainlangExpressionDeployer.meta.t.solnow asserts againstnew RainlangExpressionDeployer()becauseI_DEPLOYERis the source-built test concrete, which is the discriminating case for the hook: with the old binding it read the generated hash back from itself.RainlangParser.pointers,RainlangInterpreter.pointersandRainlangExpressionDeployer.pointerspin generated tables ==LibAllStandardOps-built tables for the concretes, and every op test now takes theLibAllStandardOpspath directly through the test concretes.script/Build.solrun to a fixed point;src/generated/candidate/{RainlangParser,RainlangStore,RainlangInterpreter}.solbyte-identical tomain, the two moved records regenerated by the script.Base*, thin concretes, test harness independent of pins). The deploy repo, the slim and consumer migration follow.🤖 Generated with Claude Code
https://claude.ai/code/session_01QyCCzi9WZPhuXcU1hwr2bq
Summary by CodeRabbit
Refactor
Tests