Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to alloy #1

Merged
merged 3 commits into from
Nov 26, 2024
Merged

Switch to alloy #1

merged 3 commits into from
Nov 26, 2024

Conversation

Akagi201
Copy link
Member

@Akagi201 Akagi201 commented Nov 26, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new CI workflow for automated Rust checks and builds, improving the development process.
  • Updates

    • Updated package version from 0.2.3 to 0.3.0.
    • Specified required Rust version as 1.82.0.
    • Replaced ethers dependency with alloy version 0.6.4.
    • Updated several dependencies to their latest versions for improved performance and security.
    • Excluded test-data from the package to streamline the build process.

These changes enhance the overall functionality and reliability of the application.

Copy link

coderabbitai bot commented Nov 26, 2024

Walkthrough

This pull request introduces a new GitHub Actions workflow for automating the Rust check and build process, triggered by specific branch and tag events. Additionally, it updates the Cargo.toml file for the calldata-compressor package, including version increments, new Rust version requirements, and dependency updates. The src/compressor.rs file is modified to change the import of the Bytes type from the ethers crate to the alloy crate, maintaining the existing functionality and structure of the code.

Changes

File Change Summary
.github/workflows/ci.yml New workflow added for Rust Check & Build, triggered on specific branches/tags, includes steps for setup, caching, and testing with Miri.
Cargo.toml Package version updated to 0.3.0, added rust-version as 1.82.0, introduced exclude field for test-data, and updated several dependencies and their versions.
src/compressor.rs Updated import statement for Bytes from ethers crate to alloy crate.

Poem

In the code where rabbits hop,
A workflow blooms, no need to stop.
Dependencies dance, versions align,
With alloy now, our bytes will shine.
From 0.2 to 0.3 we leap,
In Rust we trust, our code runs deep! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 914ba42 and 26bfb5a.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (3)
Cargo.toml (1)

24-24: Consider documenting migration steps

The switch from ethers to alloy is a breaking change that will require updates in downstream crates. Consider:

  1. Adding a CHANGELOG.md entry
  2. Documenting migration steps for users
  3. Adding examples of using the new alloy types

Would you like me to help create a migration guide?

.github/workflows/ci.yml (2)

54-55: Improve Miri testing setup

Split Miri setup and test steps for better error tracking and add a newline at the end of file.

      - name: Test with Miri
-       run: cargo +nightly miri setup && cargo +nightly miri test
+       run: |
+         cargo +nightly miri setup
+         cargo +nightly miri test
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 55-55: no new line character at the end of file

(new-line-at-end-of-file)


25-29: Consider adding migration-specific checks

Since this PR is part of switching from ethers to alloy, consider adding steps to verify the migration is complete.

Add these steps after the existing checks:

      - name: Verify no ethers dependencies
        run: |
          ! cargo tree | grep 'ethers'
          
      - name: Check consistent alloy usage
        run: |
          ! rg 'use ethers' || exit 1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1a816b4 and e7ad20d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • Cargo.toml (2 hunks)
  • src/compressor.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/compressor.rs
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[error] 55-55: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (4)
Cargo.toml (3)

3-3: Version bump to 0.3.0 is appropriate

The major version increment correctly reflects the breaking change of switching from ethers to alloy.


32-33: Dev-dependencies changes look good

  • Adding the derive feature to serde is appropriate for deriving serialization traits
  • Consistent version of serde_json across dependencies and dev-dependencies

24-24: Verify dependency versions for potential updates

Let's check for the latest stable versions of these dependencies:

Also applies to: 27-28

✅ Verification successful

Dependencies are using the latest stable versions

Based on the crates.io API results, all dependencies are using their latest stable versions:

  • alloy: 0.6.4 (current = 0.6.4)
  • serde_json: 1.0.133 (current = 1.0.133)
  • thiserror: 2.0.3 (current = 2.0.3)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check latest versions of dependencies
echo "Checking latest versions:"
for pkg in alloy serde_json thiserror; do
    echo -n "$pkg: "
    curl -s "https://crates.io/api/v1/crates/$pkg" | jq -r '.crate.max_stable_version'
done

Length of output: 554

.github/workflows/ci.yml (1)

38-40: Consider using stable Rust unless nightly features are required

The workflow uses nightly Rust toolchain. If nightly features aren't specifically needed, consider using stable for better reliability.

Cargo.toml Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
.github/workflows/ci.yml (3)

18-23: Consider adding RUST_BACKTRACE for better error reporting

Adding RUST_BACKTRACE=1 to the environment variables would help with debugging if any tests or builds fail in CI.

env:
  CARGO_INCREMENTAL: 0
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -C strip=debuginfo
+ RUST_BACKTRACE: 1

25-29: Add timeout to prevent hung builds

Long-running or stuck builds can block CI resources. Consider adding a timeout to the job.

jobs:
  check_and_build:
    name: Check and Build
    runs-on: ubuntu-latest
+   timeout-minutes: 30

57-57: Add newline at end of file

Add a newline character at the end of the file to follow POSIX standards.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 57-57: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e7ad20d and 914ba42.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[error] 57-57: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/ci.yml (1)

55-57: Review Miri's isolation disable flag for security implications

The -Zmiri-disable-isolation flag disables Miri's isolation mechanisms. This could potentially mask real issues in the code that would occur in production.

✅ Verification successful

Let me search for more context about unsafe code and Miri usage.


Miri isolation can be safely disabled - unsafe code is forbidden in this codebase

The codebase explicitly forbids unsafe code through the forbid lint rule in Cargo.toml: unsafe_code = "forbid". This means the compiler will reject any unsafe code blocks. Since there's no unsafe code that could be affected, disabling Miri's isolation won't mask any real issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any unsafe code blocks that might be affected by disabled isolation
rg -l 'unsafe' | xargs -I {} sh -c 'echo "=== {} ===" && ast-grep --pattern "unsafe { $$$ }" {}'

Length of output: 117


Script:

#!/bin/bash
# Look for any mentions of unsafe or Miri in source files and documentation
echo "=== Searching for unsafe keywords ==="
rg -i "unsafe" -A 3 -B 3

echo -e "\n=== Searching for Miri related content ==="
rg -i "miri" -A 3 -B 3

echo -e "\n=== Checking test files ==="
fd "test" -e rs

Length of output: 496

🧰 Tools
🪛 yamllint (1.35.1)

[error] 57-57: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/ci.yml Show resolved Hide resolved
@Akagi201 Akagi201 merged commit 9918836 into master Nov 26, 2024
2 checks passed
@Akagi201 Akagi201 deleted the feat/alloy branch November 26, 2024 07:11
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.

1 participant