Skip to content

binmaskflag - #329

Merged
thedavidmeister merged 46 commits into
mainfrom
2025-05-28-rainix
Jun 1, 2025
Merged

thedavidmeister merged 46 commits into
mainfrom
2025-05-28-rainix

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented May 28, 2025 •

Copy link
Copy Markdown
Contributor

Motivation

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies with no impact on user-facing features.
    • Improved CI workflows by enhancing caching and installation steps for more efficient and reliable builds.
    • Removed an unused submodule to streamline the project structure.
    • Refined test suites for better error handling, clearer structure, and centralized parsing invocation without affecting functionality.
    • Added environment variable support for RPC URLs to improve test configuration flexibility.

@coderabbitai

coderabbitai Bot commented May 28, 2025 •

Copy link
Copy Markdown
Contributor

"""

Walkthrough

The subproject commit references for lib/sol.lib.binmaskflag, lib/rain.metadata, lib/rain.lib.memkv, lib/rain.string, and lib/rain.interpreter.interface have been updated to new commits. The submodule linkage for lib/rain.intorastring was removed. GitHub Actions workflows .github/workflows/git-clean.yaml, .github/workflows/manual-sol-artifacts.yaml, and .github/workflows/rainix.yaml were modified to replace previous Nix setup and caching steps with new Nix installation and caching actions. Additionally, two bitwise operation Solidity files had minor conditional expression refactorings. Multiple test helper functions were added or modified to use external calls instead of internal calls, and one test helper function in LibParseLiteralSubParseable.parseSubParseable.t.sol was updated to add error handling and change visibility. No other code or functionality changes are included.

Changes

File(s) Change Summary
lib/sol.lib.binmaskflag Updated submodule commit reference
lib/rain.metadata Updated submodule commit reference
lib/rain.lib.memkv Updated submodule commit reference
lib/rain.string Updated submodule commit reference
lib/rain.interpreter.interface Updated submodule commit reference
lib/rain.intorastring, .gitmodules Removed submodule linkage
.github/workflows/git-clean.yaml Replaced Nix setup and caching steps with new Nix install and cache actions
.github/workflows/manual-sol-artifacts.yaml Replaced Nix setup and caching steps with new Nix install and cache actions
.github/workflows/rainix.yaml Replaced Nix setup and caching steps with new Nix install and cache actions
src/lib/op/bitwise/LibOpShiftBitsLeftNP.sol Refactored conditional check in integrity function to combine conditions
src/lib/op/bitwise/LibOpShiftBitsRightNP.sol Refactored conditional check in integrity function to combine conditions
test/src/lib/parse/literal/LibParseLiteralSubParseable.parseSubParseable.t.sol Modified checkParseSubParseable to add error parameter and change visibility; added overload for backward compatibility
test/src/lib/parse/LibParseState.pushSubParser.t.sol Added external helper function and updated test to call it externally
test/src/lib/parse/LibSubParse.subParserExtern.t.sol Added external wrapper function and updated test to call it externally
test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimalFloat.t.sol Added external wrapper function and updated test to call it externally
test/src/lib/parse/literal/LibParseLiteralString.parseString.t.sol Added external wrapper function and updated test to call it externally
test/src/lib/op/logic/LibOpConditionsNP.t.sol Corrected commented-out import path (no functional change)
foundry.toml Changed remapping path for rain.intorastring to new location
test/src/lib/parse/LibParse.unexpectedRHS.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.unexpectedRightParen.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol Added external wrapper function; updated tests to call it externally
test/src/lib/parse/LibParseOperand.parseOperand.t.sol Changed function visibility to public; updated calls to use external call
test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol Changed contract inheritance; updated parsing calls to use external calls
test/src/lib/parse/LibParse.operandM1M1.t.sol Updated parsing calls to use external calls
test/src/lib/parse/LibParse.operandSingleFull.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.unclosedLeftParen.t.sol Added external view wrapper for parse; updated tests to call it externally; added new test for nested unclosed left paren
test/src/lib/parse/LibParse.unexpectedLHS.t.sol Added external view wrapper for parse; updated tests to call it externally; adjusted revert position in one test
test/src/lib/op/00/LibOpStackNP.t.sol Added external pure wrapper for integrity; updated test to call it externally
test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol Added external pure wrapper for integrity; updated tests to call it externally
test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol Added external pure wrapper for integrity; updated tests to call it externally
test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol Added external pure wrapper for integrity; updated tests to call it externally
test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol Added external pure wrapper for integrity; updated tests to call it externally
test/src/lib/op/call/LibOpCall.t.sol Added external pure wrapper for integrity; updated tests to call it externally
test/src/lib/parse/LibParse.comments.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.empty.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.missingFinalSemi.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.nOutput.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.namedLHS.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/parse/LibParse.operandDisallowed.t.sol Added external view wrapper for parse; updated tests to call it externally
test/src/lib/op/00/LibOpConstant.t.sol Added external pure wrapper for integrity; updated test to call it externally
test/src/lib/op/00/LibOpContextNP.t.sol Refactored tests to separate setup and revert expectation; added external view helper functions
test/src/lib/op/logic/LibOpEnsure.t.sol Refactored test to separate revert expectation from test logic; added external view helper
test/abstract/ParseTest.sol Added new abstract test contract with external parse function

Sequence Diagram(s)

No sequence diagram is generated as the changes involve submodule updates, workflow configuration modifications, minor conditional refactorings, and test helper function signature and invocation changes without affecting control flow or introducing new features.

Possibly related PRs

  • bump int #319: Also updates the subproject commit reference for lib/rain.interpreter.interface.
  • bump int #323: Similarly updates the subproject commit reference for lib/rain.interpreter.interface.
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e974d4e and 5a3d358.

📒 Files selected for processing (1)
  • crates/eval/src/fork.rs (8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: git-clean
🔇 Additional comments (4)
crates/eval/src/fork.rs (4)

233-233: Simplified error handling looks good.

The change from Err(ForkCallError::Failed(raw)) to Err(raw.into()) simplifies the error handling by leveraging the From/Into trait implementation, which is more idiomatic Rust.


278-278: Consistent error handling improvement.

Same improvement as line 233 - using raw.into() provides cleaner and more consistent error handling.


375-375: Good simplification of block number assignment.

Removing the unnecessary mapping step makes the code more direct and readable while maintaining the same functionality.


395-396: Environment variable imports look correct.

The addition of environment variable imports aligns with the transition from hardcoded URLs to configurable environment variables in the tests.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40fa504 and a2af96e.

📒 Files selected for processing (1)
  • lib/rain.metadata (1 hunks)

Comment thread lib/rain.metadata

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6634821 and 23035eb.

📒 Files selected for processing (3)
  • .github/workflows/git-clean.yaml (1 hunks)
  • .github/workflows/manual-sol-artifacts.yaml (1 hunks)
  • .github/workflows/rainix.yaml (1 hunks)
🔇 Additional comments (3)
.github/workflows/manual-sol-artifacts.yaml (1)

41-56: Consistent Nix installation and caching steps are correctly applied.
The workflow now uses nixbuild/nix-quick-install-action@v30 for Nix setup and nix-community/cache-nix-action@v6 for store caching with appropriate keys and garbage collection settings, aligning with best practices.

.github/workflows/rainix.yaml (1)

34-49: Nix quick install and caching integration looks good.
The new nixbuild/nix-quick-install-action@v30 and nix-community/cache-nix-action@v6 steps are correctly configured, preserving derivations and improving CI performance.

.github/workflows/git-clean.yaml (1)

13-28: Nix installer and cache steps updated correctly.
Swapping in nixbuild/nix-quick-install-action@v30 and nix-community/cache-nix-action@v6 ensures reliable environment setup and efficient caching.

Comment thread .github/workflows/manual-sol-artifacts.yaml
Comment thread .github/workflows/rainix.yaml
Comment thread .github/workflows/git-clean.yaml

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23035eb and 4df6d5d.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .gitmodules (0 hunks)
  • lib/rain.interpreter.interface (1 hunks)
  • lib/rain.intorastring (0 hunks)
  • lib/rain.lib.memkv (1 hunks)
  • src/lib/op/bitwise/LibOpShiftBitsLeftNP.sol (1 hunks)
  • src/lib/op/bitwise/LibOpShiftBitsRightNP.sol (1 hunks)
💤 Files with no reviewable changes (2)
  • .gitmodules
  • lib/rain.intorastring
🔇 Additional comments (3)
lib/rain.lib.memkv (1)

1-1:

Details

❓ Verification inconclusive

Verify the submodule commit reference and ensure compatibility.

The submodule commit reference update follows the correct Git format. However, please ensure that:

  1. The new commit hash is valid and contains the expected changes
  2. The updated submodule is compatible with the current codebase
  3. All tests pass with the new submodule version

Please run the following script to verify the commit exists and gather information about the changes:


🏁 Script executed:

#!/bin/bash
# Description: Verify the submodule commit and check for potential compatibility issues

# Check if the submodule commit exists and get basic info
cd lib/rain.lib.memkv
git show --oneline --name-only 16ec7bd8eeb9e206053bac11f7abe7e431a14bac

# Check the commit message for context
git log --oneline -1 16ec7bd8eeb9e206053bac11f7abe7e431a14bac

# Check if there are any breaking changes indicated in recent commits
git log --oneline 5a335e5150d9f869dbe2b7e863e4a3a63be244e1..16ec7bd8eeb9e206053bac11f7abe7e431a14bac

Length of output: 269


Ensure submodule commit is available and compatible

The referenced commit 16ec7bd8eeb9e206053bac11f7abe7e431a14bac could not be fetched from the rain.lib.memkv submodule. Please:

  • Confirm that this commit has been pushed to the submodule’s remote repository
  • Synchronize and update the submodule locally:
    git submodule sync lib/rain.lib.memkv
    git submodule update --init --recursive lib/rain.lib.memkv
  • Once the ref is present, verify its changes (git show, git log) and run your full test suite to ensure compatibility with the parent project
lib/rain.interpreter.interface (1)

1-1: Approve subproject commit reference update.

The submodule pointer for lib/rain.interpreter.interface has been bumped to 9be3759…. This aligns with the other subproject updates in this PR.

src/lib/op/bitwise/LibOpShiftBitsRightNP.sol (1)

21-21: LGTM! Clean conditional expression refactoring.

The refactoring successfully combines the two validation checks into a single, more readable expression while maintaining the same logic and error handling behavior.

Comment thread src/lib/op/bitwise/LibOpShiftBitsLeftNP.sol

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3021eb8 and cbae5eb.

📒 Files selected for processing (9)
  • test/src/lib/parse/LibParse.unexpectedRHS.t.sol (3 hunks)
  • test/src/lib/parse/LibParse.unexpectedRightParen.t.sol (3 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol (4 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol (1 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol (4 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol (3 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol (2 hunks)
  • test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol (2 hunks)
  • test/src/lib/parse/LibParseOperand.parseOperand.t.sol (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: git-clean
🔇 Additional comments (18)
test/src/lib/parse/LibParseOperand.parseOperand.t.sol (2)

22-24: Good refactoring to enable external test calls.

Changing the visibility from internal to public allows the function to be called externally via this., which is essential for proper revert testing with vm.expectRevert().


257-257: Excellent improvement to test methodology.

Converting these calls to use this.checkParsingOperandFromData() ensures proper external call context for revert testing. This change allows vm.expectRevert() to correctly capture and verify the expected exceptions.

Also applies to: 263-263, 269-269

test/src/lib/parse/LibParse.unexpectedRHS.t.sol (2)

25-27: Well-implemented external wrapper for parsing tests.

The parseExternal function correctly wraps the internal parsing logic and uses the appropriate view modifier. This enables external call testing while maintaining the same interface.


59-59: Proper external call usage for revert testing.

Using this.parseExternal() ensures that vm.expectRevert() can properly intercept and verify the expected exceptions during parsing.

Also applies to: 69-69

test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol (2)

11-13: Clean external wrapper implementation.

The wrapper function correctly delegates to LibParseOperand.handleOperandSingleFull with the appropriate pure modifier and matching return type.


34-34: Proper external call pattern for error testing.

Converting to external calls via this.handleOperandSingleFullExternal() ensures that revert conditions are properly tested and error messages are correctly propagated.

Also applies to: 41-41

test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol (2)

11-13: Consistent external wrapper implementation.

The wrapper function follows the established pattern and correctly delegates to the library function with appropriate modifiers.


18-18: Comprehensive external call conversion for revert testing.

All tests that expect revert conditions have been properly converted to use external calls. This ensures reliable testing of error conditions and proper error propagation. Note that line 72 correctly continues to use the direct library call since it's testing success cases, not revert conditions.

Also applies to: 27-27, 34-34, 47-47, 59-59

test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol (2)

11-13: LGTM! Proper external wrapper implementation for revert testing.

The external wrapper function correctly delegates to the internal library function, enabling proper revert testing with vm.expectRevert(). This is a standard pattern in Foundry/Forge testing.


36-36: Correct usage of external wrapper for revert testing.

The test functions that expect reverts now properly use this.handleOperandM1M1External() instead of direct library calls. This ensures that vm.expectRevert() can correctly catch the reverts from the external call context. Success path tests appropriately continue using direct calls.

Also applies to: 59-59, 66-66

test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol (2)

9-11: LGTM! Proper external wrapper implementation.

The external wrapper correctly delegates to LibParseOperand.handleOperandDisallowed and maintains the same function signature, enabling proper revert testing.


20-20: Correct application of external wrapper for revert testing.

The test function that expects a revert now properly uses the external wrapper via this.handleOperandDisallowedExternal(), which will allow vm.expectRevert() to function correctly.

test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol (2)

11-13: LGTM! Consistent external wrapper implementation.

The external wrapper properly delegates to LibParseOperand.handleOperand8M1M1 while maintaining the correct function signature for revert testing.


18-18: Proper application of external wrapper across all revert test cases.

All test functions that expect reverts now correctly use this.handleOperand8M1M1External() instead of direct library calls. This ensures consistent and reliable revert testing behavior across all error conditions (no values, overflow values, and too many values).

Also applies to: 36-36, 60-60, 88-88, 95-95

test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol (1)

18-18: Correct usage of external wrapper for all revert test cases.

All test functions expecting reverts now properly use this.handleOperandSingleFullNoDefaultExternal(), ensuring reliable revert testing for no values, overflow values, and multiple values scenarios.

Also applies to: 36-36, 43-43

test/src/lib/parse/LibParse.unexpectedRightParen.t.sol (3)

18-24: LGTM: Well-implemented external wrapper for testing.

The external wrapper function is correctly implemented and serves a clear purpose for testing revert conditions. Using external calls instead of internal calls provides better isolation and more accurate simulation of how the parser would be called in production.


37-37: Improved test reliability through external calls.

Good change! Using external calls instead of internal calls for testing revert conditions provides better error handling semantics and more accurately simulates how the parser would be used in production.


52-52: Consistent improvement across test functions.

Excellent consistency in applying the external call pattern across both test functions. This maintains uniform testing methodology while improving error handling verification.

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

♻️ Duplicate comments (1)
test/src/lib/parse/LibParse.empty.t.sol (1)

19-21: Same duplication and inconsistency issues as other files.

The implementation is correct but suffers from the same issues identified in other test files: code duplication and selective usage.

This has the same duplication issue as the other test files. Please consolidate into a base contract as suggested in the review of LibParse.operandDisallowed.t.sol.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4af4086 and 0bf62a2.

📒 Files selected for processing (13)
  • test/src/lib/op/00/LibOpStackNP.t.sol (2 hunks)
  • test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol (3 hunks)
  • test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol (3 hunks)
  • test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol (3 hunks)
  • test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol (3 hunks)
  • test/src/lib/op/call/LibOpCall.t.sol (3 hunks)
  • test/src/lib/parse/LibParse.comments.t.sol (2 hunks)
  • test/src/lib/parse/LibParse.empty.t.sol (2 hunks)
  • test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol (9 hunks)
  • test/src/lib/parse/LibParse.missingFinalSemi.t.sol (1 hunks)
  • test/src/lib/parse/LibParse.nOutput.t.sol (3 hunks)
  • test/src/lib/parse/LibParse.namedLHS.t.sol (4 hunks)
  • test/src/lib/parse/LibParse.operandDisallowed.t.sol (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: git-clean
🔇 Additional comments (22)
test/src/lib/op/00/LibOpStackNP.t.sol (2)

32-38: LGTM: Clean external wrapper implementation.

The integrityExternal function correctly wraps the internal LibOpStackNP.integrity call with appropriate visibility and signature matching. This follows a consistent pattern across the test suite for standardizing how integrity checks are tested.


76-76: Consistent test update for external call pattern.

The test correctly uses the new external wrapper instead of the direct internal call, maintaining the same test logic while enabling different revert handling behavior.

test/src/lib/op/call/LibOpCall.t.sol (2)

26-28: LGTM: Consistent external wrapper pattern.

The implementation follows the same clean pattern established in other test files, correctly wrapping LibOpCall.integrity with proper external visibility.


54-54: Tests correctly updated for external call pattern.

Both test functions properly use the new external wrapper, maintaining consistent testing methodology across the suite.

Also applies to: 78-78

test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol (2)

23-29: LGTM: Maintains consistent external wrapper pattern.

The integrityExternal function follows the established pattern with correct external pure visibility and proper forwarding to LibOpShiftBitsLeftNP.integrity.


59-59: Tests properly updated for external wrapper usage.

Both integrity test functions correctly use the external wrapper, ensuring consistent revert handling behavior across the test suite.

Also applies to: 69-69

test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol (2)

13-19: LGTM: Completes the systematic external wrapper pattern.

The implementation maintains the consistent standard established across the test suite, with proper external pure visibility and correct parameter forwarding.


52-52: Tests consistently updated for external wrapper pattern.

Both test functions properly use the external wrapper, completing the systematic refactoring of integrity test methodology across the operation libraries.

Comment thread test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol
Comment thread test/src/lib/parse/LibParse.operandDisallowed.t.sol Outdated
Comment thread test/src/lib/parse/LibParse.missingFinalSemi.t.sol Outdated
Comment thread test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol Outdated

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

♻️ Duplicate comments (1)
test/src/lib/parse/LibParse.operandSingleFull.t.sol (1)

63-63: Strategic use of external calls for revert testing.

The selective refactoring to use this.parseExternal(...) only for functions that expect reverts is a good pattern. External calls are necessary for proper revert testing in Foundry, while internal calls remain efficient for successful test cases.

Note: The past review comment about a missing return statement in parseExternal is outdated - the current implementation in ParseTest (line 17) correctly returns the parse result.

Also applies to: 209-209, 217-217, 225-225, 233-233

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5aa2f and 751be79.

📒 Files selected for processing (3)
  • test/abstract/ParseTest.sol (1 hunks)
  • test/src/lib/parse/LibParse.empty.t.sol (3 hunks)
  • test/src/lib/parse/LibParse.operandSingleFull.t.sol (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: git-clean
🔇 Additional comments (2)
test/abstract/ParseTest.sol (1)

1-19: Well-designed test abstraction.

This new abstract contract provides a clean centralization of parsing logic for test files. The implementation correctly wraps the parsing operation and returns the expected tuple of bytecode and constants.

test/src/lib/parse/LibParse.operandSingleFull.t.sol (1)

4-4: Appropriate inheritance change.

The change to inherit from ParseTest aligns with the new abstraction pattern and provides access to the centralized parseExternal function.

Comment thread test/src/lib/parse/LibParse.empty.t.sol
Comment thread test/src/lib/parse/LibParse.empty.t.sol

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

♻️ Duplicate comments (1)
test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol (1)

205-206: Addressing past review concern: Usage pattern is actually consistent by design.

Contrary to the previous review comment flagging inconsistency, the usage pattern in this file is actually consistent and intentional:

  • this.parseExternal() is used for tests that expect reverts (proper error bubbling)
  • Direct LibMetaFixture.newState(...).parse() calls are used for view tests that don't expect reverts

This selective application based on test type is a sensible design choice rather than an inconsistency.

Also applies to: 215-217, 226-227, 236-238, 296-296, 305-305, 314-314, 323-323

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 751be79 and 719ed4f.

📒 Files selected for processing (10)
  • crates/env/src/lib.rs (1 hunks)
  • crates/eval/src/fork.rs (4 hunks)
  • test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol (10 hunks)
  • test/src/lib/parse/LibParse.missingFinalSemi.t.sol (2 hunks)
  • test/src/lib/parse/LibParse.nOutput.t.sol (4 hunks)
  • test/src/lib/parse/LibParse.namedLHS.t.sol (5 hunks)
  • test/src/lib/parse/LibParse.operandDisallowed.t.sol (3 hunks)
  • test/src/lib/parse/LibParse.unclosedLeftParen.t.sol (1 hunks)
  • test/src/lib/parse/LibParse.unexpectedLHS.t.sol (5 hunks)
  • test/src/lib/parse/LibParse.unexpectedRHS.t.sol (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: git-clean
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
🔇 Additional comments (22)
test/src/lib/parse/LibParse.nOutput.t.sol (3)

4-4: LGTM! Clean refactoring to centralized test infrastructure.

The import change from Test to ParseTest is part of a well-coordinated refactoring effort to centralize parsing test functionality.


15-15: LGTM! Inheritance change improves test structure.

The contract now inherits from ParseTest instead of Test, which provides centralized parsing functionality and reduces code duplication across test files.


45-45: LGTM! Consistent external call pattern for revert testing.

The refactoring to use this.parseExternal() instead of direct parsing calls provides several benefits:

  • Cleaner error bubbling with vm.expectRevert()
  • Consistent test invocation pattern across all parsing tests
  • Centralized parsing logic in the ParseTest abstract contract

The test expectations and logic remain unchanged, preserving the original test coverage.

Also applies to: 52-52, 85-85

test/src/lib/parse/LibParse.unexpectedRHS.t.sol (3)

4-4: LGTM! Consistent with refactoring pattern.

The import change to ParseTest aligns with the centralized test infrastructure refactoring seen across multiple parsing test files.


21-21: LGTM! Improved test inheritance structure.

The inheritance change to ParseTest provides access to centralized parsing functionality and maintains consistency with other parsing test contracts.


54-54: LGTM! External parsing calls improve test reliability.

The switch to this.parseExternal() ensures proper error handling and revert testing while maintaining the same test logic and expectations.

Also applies to: 64-64

test/src/lib/parse/LibParse.operandDisallowed.t.sol (3)

4-4: LGTM! Addresses previous duplication concerns.

The import change to ParseTest successfully resolves the code duplication issues mentioned in previous review comments by centralizing parsing functionality.


11-11: LGTM! Effective solution to duplication problem.

The inheritance change to ParseTest eliminates the need for duplicate parseExternal functions across multiple test contracts, as noted in previous reviews.


17-17: LGTM! Consistent external call pattern.

All test methods now use the centralized this.parseExternal() approach, which provides uniform error handling and eliminates the code duplication previously identified in reviews.

Also applies to: 25-25, 34-34, 43-43

test/src/lib/parse/LibParse.missingFinalSemi.t.sol (3)

4-4: LGTM! Completes the refactoring effort.

The import change to ParseTest finalizes the consistent refactoring pattern across all parsing test files.


14-14: LGTM! Consistent inheritance structure.

The contract now inherits from ParseTest, maintaining consistency with the broader refactoring effort that successfully addressed previous code duplication issues.


20-20: LGTM! Comprehensive external call adoption.

All test methods consistently use this.parseExternal(), completing the refactoring effort that:

  • Eliminates code duplication across test files
  • Provides uniform error handling for revert testing
  • Centralizes parsing logic in the ParseTest abstract contract
  • Maintains all original test expectations and coverage

This refactoring successfully addresses the duplication concerns noted in previous reviews.

Also applies to: 26-26, 32-32, 38-38, 44-44

test/src/lib/parse/LibParse.namedLHS.t.sol (2)

4-4: LGTM! Clean inheritance refactor.

The update to inherit from ParseTest instead of Test aligns with the standardization effort across parsing test contracts.

Also applies to: 21-21


97-97: Consistent external call pattern for revert tests.

The selective use of this.parseExternal() for tests that expect reverts is appropriate, as external calls enable proper error bubbling in test scenarios. The view functions that don't expect reverts continue to use direct parsing calls, which is a sensible design choice.

Also applies to: 107-107, 171-171

test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol (1)

4-4: LGTM! Consistent with parsing test refactor pattern.

The inheritance change from Test to ParseTest and the selective use of external parsing calls follows the established pattern across parsing test contracts.

Also applies to: 16-16

test/src/lib/parse/LibParse.unclosedLeftParen.t.sol (3)

4-4: LGTM! Consistent refactor to ParseTest inheritance.

The change to inherit from ParseTest instead of Test follows the established pattern for parsing test contracts.

Also applies to: 12-12


18-18: Excellent consistency - all tests use external calls.

Since all tests in this contract expect reverts, they all consistently use this.parseExternal() for proper error bubbling. This demonstrates the pattern being applied correctly across the entire file.

Also applies to: 24-24, 31-31, 39-39, 45-45


42-46: New test case for unclosed parentheses scenario.

The new testParseUnclosedLeftParenNested4() function adds coverage for a specific nesting scenario with unclosed left parentheses. The test logic and error expectation appear correct.

test/src/lib/parse/LibParse.unexpectedLHS.t.sol (3)

24-24: LGTM: External call refactoring is consistent.

The refactoring from direct internal parsing calls to external calls via this.parseExternal(...) is implemented consistently across all test methods. This aligns with the systematic refactoring described in the AI summary.

Also applies to: 27-27, 30-30, 36-36, 39-39, 42-42, 49-49, 52-52, 55-55, 67-67, 79-79, 102-102


51-51:

Details

❓ Verification inconclusive

Verify the test expectation change is correct.

The expected revert position changed from 2 to 3 for input "a __:;". This suggests a change in parser behavior where the unexpected character is now detected at the second underscore (position 3) instead of the first underscore after the space (position 2).

For input "a __:;":

  • Position 0: 'a'
  • Position 1: ' ' (space)
  • Position 2: '_' (first underscore)
  • Position 3: '_' (second underscore)

Please verify this change is intentional and aligns with the updated parser logic.


🏁 Script executed:

#!/bin/bash
# Description: Check for related parser behavior changes or documentation
# Expected: Find evidence that parser behavior changed for underscore handling

# Search for recent changes to underscore parsing logic
rg -A 5 -B 5 "underscore.*tail|UnexpectedLHSChar" --type sol

# Look for parser state or logic changes related to LHS parsing
ast-grep --pattern 'function $$$LHS$$$($_) {
  $$$
}'

Length of output: 146


Unable to confirm parser offset change for underscores

Our searches didn’t reveal any updates to the UnexpectedLHSChar logic or underscore handling in the parser code. Please manually verify that the new revert position (3) for input "a __:;" is intentional and that no related code or documentation needs adjustment. Consider:

  • Locating the definition and selector use of UnexpectedLHSChar in the codebase
  • Reviewing the parser’s LHS‐handling implementation around underscores
  • Updating any comments or docs to reflect the new diagnostic position

4-4:

Details

✅ Verification successful

Verify the ParseTest base class implementation.

The refactoring changes the inheritance from Test to ParseTest and updates the import accordingly. This appears to be part of a systematic refactoring mentioned in the AI summary to centralize parsing logic.

Also applies to: 18-18


🏁 Script executed:

#!/bin/bash
# Description: Verify that ParseTest properly extends Test and provides parseExternal method
# Expected: ParseTest should inherit from Test and implement parseExternal method

# Search for ParseTest definition
ast-grep --pattern 'abstract contract ParseTest'

# Search for parseExternal method definition  
ast-grep --pattern 'function parseExternal($_) $$$'

Length of output: 104


🏁 Script executed:

#!/bin/bash
# Searching for the ParseTest contract definition
rg --ignore-case "abstract contract ParseTest" -n .
rg --ignore-case "contract ParseTest" -n .

# Searching for the parseExternal method implementation
rg --ignore-case "function parseExternal" -n .

Length of output: 533


ParseTest inheritance and parseExternal implementation verified
The ParseTest contract in test/abstract/ParseTest.sol correctly extends Test (line 9) and provides the external parseExternal(string memory) method (line 16). No changes are required for the import or inheritance.

crates/eval/src/fork.rs (1)

398-399: Import of CI_FORK_POLYGON_RPC_URL looks good
The new environment variable is correctly imported alongside the other CI constants and matches its usage in the tests.

Comment thread crates/env/src/lib.rs
Comment thread crates/eval/src/fork.rs Outdated

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

♻️ Duplicate comments (1)
crates/env/src/lib.rs (1)

4-6: Previous review suggestion is now outdated

Note that the previous review comment suggesting inconsistency between &str and Lazy<String> types is no longer applicable, as all URL constants now consistently use Lazy<String>.

Also applies to: 26-32, 34-40

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0bbf171 and 0597932.

📒 Files selected for processing (1)
  • crates/env/src/lib.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: git-clean
🔇 Additional comments (2)
crates/env/src/lib.rs (2)

26-32: LGTM! Polygon RPC URL constant added correctly

The new CI_FORK_POLYGON_RPC_URL constant follows the established pattern with proper error handling and type consistency.


34-40: LGTM! BSC RPC URL constant added correctly

The new CI_FORK_BSC_RPC_URL constant follows the established pattern with proper error handling and type consistency.

Comment thread crates/env/src/lib.rs

@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

♻️ Duplicate comments (2)
.github/workflows/rainix.yaml (1)

34-49: Nix setup and caching configuration looks good.

The update to nixbuild/nix-quick-install-action@v30 and nix-community/cache-nix-action@v6 provides better caching with garbage collection controls. The configuration appropriately handles cache keys and restoration prefixes.

Note: The previous suggestion to extract Nix setup steps into a reusable component for maintainability still applies if this pattern is used across multiple workflows.

crates/env/src/lib.rs (1)

30-39: New fork URL constants follow consistent pattern.

The new CI_FORK_POLYGON_RPC_URL and CI_FORK_BSC_RPC_URL constants properly follow the established pattern with error messages and lazy initialization.

Note: The previous suggestion about simplifying these URL constants to const declarations using env!() directly (avoiding Lazy<String> and .to_string() runtime overhead) still applies if the consuming code can work with &str instead of owned String values.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 981bf82 and 357f6fd.

📒 Files selected for processing (3)
  • .github/workflows/rainix.yaml (2 hunks)
  • crates/env/src/lib.rs (2 hunks)
  • crates/eval/src/fork.rs (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: git-clean
🔇 Additional comments (3)
crates/eval/src/fork.rs (1)

398-400: LGTM! Environment variable imports properly added.

The import of CI_FORK_BSC_RPC_URL and CI_FORK_POLYGON_RPC_URL from rain_interpreter_env correctly supports the transition from hardcoded URLs to environment-driven configuration.

.github/workflows/rainix.yaml (1)

64-64: Environment variable correctly added for fork testing.

The addition of CI_FORK_POLYGON_RPC_URL environment variable aligns with the code changes in crates/eval/src/fork.rs that now use environment variables instead of hardcoded URLs.

crates/env/src/lib.rs (1)

4-10: Consistent error message pattern now applied.

Good improvement! The CI_DEPLOY_SEPOLIA_RPC_URL now includes a descriptive error message when the environment variable is missing, matching the pattern used by other constants.

Comment thread crates/eval/src/fork.rs
@thedavidmeister
thedavidmeister merged commit 7786ab2 into main Jun 1, 2025
This was referenced Feb 28, 2026
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.

2 participants