Skip to content

Fix foundry version and bring back RainEvalResults - #341

Merged
0xgleb merged 6 commits into
mainfrom
fix/deps-versions
Jun 30, 2025
Merged

Fix foundry version and bring back RainEvalResults#341
0xgleb merged 6 commits into
mainfrom
fix/deps-versions

Conversation

@0xgleb

@0xgleb 0xgleb commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

Motivation

Tauri build requires a different foundry version and the return of RainEvalResults

Solution

Fix foundry version and bring back the type

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

  • New Features
    • Introduced the ability to aggregate and export multiple evaluation results into a tabular format with clear column names and row values.
    • Added serialization support for aggregated evaluation results, enabling easier data handling and sharing.
  • Tests
    • Added tests to verify correct generation of tabular data from evaluation traces.
  • Chores
    • Updated dependency references to newer versions for improved stability and compatibility.

@coderabbitai

coderabbitai Bot commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update dependency commit hashes for foundry-evm and foundry-evm-core in Cargo.toml. Additionally, new data structures and methods are added to crates/eval/src/trace.rs to aggregate multiple RainEvalResult instances into a serializable, tabular format, including helper functions and a test.

Changes

File(s) Change Summary
Cargo.toml Updated foundry-evm and foundry-evm-core dependency commit hashes to a newer revision.
crates/eval/src/trace.rs Added structs and methods for aggregating and serializing RainEvalResult data into tables; added helper function and test.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant RainEvalResults
    participant RainEvalResult
    participant RainSourceTrace

    Caller->>RainEvalResults: into_flattened_table()
    RainEvalResults->>RainEvalResult: iterate over results
    RainEvalResult->>RainSourceTrace: access traces
    RainSourceTrace->>RainEvalResults: flattened_trace_path_names(traces)
    RainEvalResults->>Caller: RainEvalResultsTable (column_names, rows)
Loading

Suggested reviewers

  • hardyjosh

📜 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 62405c4 and 5c97396.

📒 Files selected for processing (1)
  • crates/eval/src/trace.rs (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
crates/eval/src/trace.rs (1)
Learnt from: 0xgleb
PR: rainlanguage/rain.interpreter#334
File: crates/eval/src/trace.rs:120-125
Timestamp: 2025-06-17T17:41:22.817Z
Learning: In crates/eval/src/trace.rs, the TryFrom<RawCallResult> implementation for RainEvalResult intentionally returns empty vectors for stack and writes fields. This restores old functionality that was removed in an update but is needed by downstream code (rain.orderbook).
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • 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 (4)
crates/eval/src/trace.rs (4)

6-7: LGTM! Import additions are appropriate.

The serde imports are necessary for serialization support, and the Deref import is already used elsewhere in the file.


205-214: Well-structured serializable table representation.

The struct is properly annotated with serde attributes and includes appropriate WASM support with conditional compilation. The camelCase renaming follows common JSON conventions.


216-225: Clean wrapper implementation.

The RainEvalResults struct and its From implementation provide a clean abstraction for handling collections of evaluation results.


227-255: Good fix for empty results handling.

The method now properly handles the empty results case that was flagged in previous reviews. The flattening logic correctly extracts hierarchical trace data into a tabular format.

✨ 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.

@0xgleb 0xgleb changed the title fix foundry version Fix foundry version and bring back RainEvalResults Jun 23, 2025
@0xgleb
0xgleb marked this pull request as ready for review June 23, 2025 15:55
@0xgleb 0xgleb linked an issue Jun 23, 2025 that may be closed by this pull request

@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 5e09c37 and 26c8e25.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • crates/eval/src/trace.rs (3 hunks)
🔇 Additional comments (4)
Cargo.toml (1)

14-15: Verify the foundry dependency update for compatibility and breaking changes.

The commit hash update should be verified to ensure it's valid and doesn't introduce breaking changes that could affect the existing codebase.

#!/bin/bash
# Description: Verify the foundry commit hash and check for potential breaking changes

# Check if the new commit hash exists in the foundry repository
curl -s "https://api.github.com/repos/foundry-rs/foundry/commits/ed86c645f037f1cc4e5c1583f074a7b2142c4f66" | jq -r '.sha // "Commit not found"'

# Get commit information and recent changes
curl -s "https://api.github.com/repos/foundry-rs/foundry/commits/ed86c645f037f1cc4e5c1583f074a7b2142c4f66" | jq -r '.commit.message, .commit.author.date'

# Check for recent releases or tags that might indicate breaking changes
curl -s "https://api.github.com/repos/foundry-rs/foundry/releases/latest" | jq -r '.tag_name, .published_at'
crates/eval/src/trace.rs (3)

6-7: LGTM - Appropriate imports added.

The serde imports and std::ops::Deref are correctly added to support the new serialization functionality and deref operations.


205-214: LGTM - Well-structured serializable table.

The RainEvalResultsTable struct is properly designed with:

  • Appropriate serialization attributes
  • WASM support with proper type annotations
  • Clear field naming following camelCase convention

216-225: LGTM - Clean wrapper implementation.

The RainEvalResults struct and its From implementation provide a clean wrapper around a vector of results with straightforward conversion logic.

Comment thread crates/eval/src/trace.rs
Comment thread crates/eval/src/trace.rs
Comment thread crates/eval/src/trace.rs
@0xgleb 0xgleb self-assigned this Jun 25, 2025
@0xgleb
0xgleb requested review from findolor and hardyjosh June 25, 2025 09:27
@0xgleb 0xgleb mentioned this pull request Jun 25, 2025
4 tasks
@0xgleb
0xgleb merged commit 1fc0c5f into main Jun 30, 2025
@0xgleb
0xgleb deleted the fix/deps-versions branch June 30, 2025 09:48
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.

Fix Tauri build issues in the interpreter

3 participants