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

chore(katana): de-featurize base messaging #2506

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Oct 8, 2024

include the base messaging stuff as non-feature code. the starknet-messaging is still feature-gated.

Summary by CodeRabbit

  • New Features

    • Simplified command-line interface for node execution by removing messaging configuration.
    • Introduced TransactionMiner struct for enhanced transaction handling.
  • Bug Fixes

    • Resolved issues related to optional dependencies by making them mandatory.
  • Documentation

    • Added comments and documentation regarding feature flags and their usage.
  • Chores

    • Updated various package configurations to reflect the removal of the messaging feature.

Copy link

coderabbitai bot commented Oct 8, 2024

Walkthrough

Ohayo, sensei! The pull request introduces significant changes across several Cargo.toml files and source code files, primarily focusing on the removal of the messaging feature from the katana package and its dependencies. This includes updates to the NodeArgs struct, the SequencerConfig struct, and various modules, indicating a shift in the command-line interface and dependency management. The changes aim to simplify the feature set and streamline the codebase by eliminating the previously optional messaging dependencies.

Changes

File Path Change Summary
bin/katana/Cargo.toml Removed messaging from default features and features section.
bin/katana/src/cli/node.rs Removed messaging field from NodeArgs struct and commented out related logic in sequencer_config method.
crates/katana/core/Cargo.toml Removed optional = true from several dependencies and removed messaging feature entirely.
crates/katana/core/src/sequencer.rs Removed conditional compilation attribute for messaging field in SequencerConfig struct.
crates/katana/core/src/service/mod.rs Marked messaging module for removal and added TransactionMiner struct.
crates/katana/node/Cargo.toml Updated starknet-messaging feature to remove dependency on messaging.
crates/katana/rpc/rpc/Cargo.toml Modified katana-node dependency to remove features specification and ensured rstest is declared correctly.

Possibly related PRs

  • refactor(katana): separate node service task #2413: The changes in this PR involve the removal of the messaging feature and its associated logic, which directly relates to the modifications made in the main PR regarding the removal of the messaging feature from various files, including Cargo.toml and the NodeArgs struct.
  • chore: remove unused deps #2489: This PR also involves changes to Cargo.toml files, including the removal of dependencies related to the messaging feature, which aligns with the main PR's focus on eliminating the messaging feature across the codebase.

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

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: 0

🧹 Outside diff range and nitpick comments (2)
crates/katana/core/Cargo.toml (2)

36-36: Ohayo, sensei! LGTM with a small consideration.

The removal of optional = true for the alloy-related dependencies is in line with the de-featurization objective. This ensures that all necessary components for base messaging are always available.

However, it's worth noting that making these dependencies required might increase the package size and compilation time. If this becomes a concern, consider exploring strategies to optimize build times or package size in the future.

Also applies to: 38-42


Line range hint 52-52: Ohayo, sensei! LGTM: Messaging feature removed as planned.

The removal of the messaging feature is exactly what we expected to see for this de-featurization PR. This change integrates the base messaging components into the core package, simplifying the codebase structure.

Don't forget to update any relevant documentation that might reference the now-removed messaging feature to avoid confusion for other developers, sensei!

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3e51d5d and 2e69b30.

📒 Files selected for processing (7)
  • bin/katana/Cargo.toml (1 hunks)
  • bin/katana/src/cli/node.rs (0 hunks)
  • crates/katana/core/Cargo.toml (1 hunks)
  • crates/katana/core/src/sequencer.rs (0 hunks)
  • crates/katana/core/src/service/mod.rs (0 hunks)
  • crates/katana/node/Cargo.toml (1 hunks)
  • crates/katana/rpc/rpc/Cargo.toml (1 hunks)
💤 Files with no reviewable changes (3)
  • bin/katana/src/cli/node.rs
  • crates/katana/core/src/sequencer.rs
  • crates/katana/core/src/service/mod.rs
🧰 Additional context used
🔇 Additional comments (5)
crates/katana/node/Cargo.toml (1)

33-33: Ohayo, sensei! LGTM: Feature dependency removed as intended.

The removal of the "messaging" feature from the "starknet-messaging" feature dependencies aligns well with the PR objective of de-featurizing base messaging. This change suggests that the messaging functionality is now part of the core package rather than an optional feature.

To ensure this change doesn't cause unintended effects, please run the following script to check for any remaining references to the "messaging" feature:

bin/katana/Cargo.toml (1)

38-38: Ohayo, sensei! The messaging feature has been successfully de-featurized.

The changes in the features section align well with the PR objectives:

  1. The messaging feature has been removed from the default features list.
  2. The messaging feature itself has been completely removed.
  3. A new starknet-messaging feature has been introduced, which depends on katana-node/starknet-messaging.

These modifications effectively separate the core messaging functionality from feature-specific implementations, streamlining the codebase as intended.

However, to ensure consistency across the project, please verify:

  1. That all code depending on the previous messaging feature has been updated accordingly.
  2. That the new starknet-messaging feature is properly implemented and documented where necessary.

Let's run a quick check to ensure no lingering references to the old messaging feature remain:

Also applies to: 41-43

✅ Verification successful

Ohayo, sensei! All references to the old messaging feature have been successfully removed.

No lingering messaging references were found in the Rust files, and the Cargo.toml files properly reflect the new starknet-messaging feature.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old messaging feature

# Test: Search for "messaging" feature in Cargo.toml files
echo "Searching for 'messaging' feature in Cargo.toml files:"
rg --type toml 'messaging.*=.*\[' -g 'Cargo.toml'

# Test: Search for "messaging" feature in Rust files
echo "Searching for #[cfg(feature = \"messaging\")] in Rust files:"
rg '#\[cfg\(feature\s*=\s*"messaging"\)\]' -g '*.rs'

Length of output: 580

crates/katana/core/Cargo.toml (1)

18-18: Ohayo, sensei! LGTM: Dependencies are now required.

The removal of optional = true for async-trait, reqwest, serde, and serde_json aligns well with the objective of integrating base messaging components into the core package. This change ensures these essential dependencies are always available.

Also applies to: 26-28

crates/katana/rpc/rpc/Cargo.toml (2)

44-44: Ohayo again, sensei! The rstest dependency is looking sharp.

The modification to the rstest dependency line seems to be a simple reformatting. It's good to keep our Cargo.toml files consistent and tidy.


39-39: Ohayo, sensei! The katana-node dependency looks good now.

The removal of the "messaging" feature from the katana-node dependency aligns well with our mission to de-featurize base messaging. Nice work!

Let's make sure this change is consistent across our dojo. Run this script to check:

✅ Verification successful

Ohayo, sensei! It seems the previous check didn't yield any results. Let's double-check to ensure the "messaging" feature has been fully removed.


Ohayo, sensei! Let's ensure that the "messaging" feature has been thoroughly removed from the katana-node dependency.


Ohayo, sensei! It looks like the previous check didn't find the Cargo.toml file. Let's broaden our search to ensure the "messaging" feature is completely removed from all Cargo.toml files in the repository.


Ohayo, sensei! 🎉 The "messaging" feature has been successfully removed from the katana-node dependency across all Cargo.toml files. Everything looks great!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of "messaging" feature from katana-node dependencies

# Test: Search for any remaining "messaging" features in katana-node dependencies
rg --type toml 'katana-node.*features.*messaging' crates

Length of output: 58


Script:

#!/bin/bash
# Description: Confirm the complete removal of the "messaging" feature from katana-node dependencies

# Verify by checking the entire Cargo.toml for any mentions of "messaging" in features
ast-grep --lang toml --pattern $'katana-node { $$$ }' crates | grep 'messaging'

Length of output: 187


Script:

#!/bin/bash
# Description: Verify the complete removal of the "messaging" feature from katana-node dependencies

# Search for "messaging" feature specifically within katana-node in Cargo.toml files
rg -A2 '\[dependencies\.katana-node\]' crates/Cargo.toml | rg 'features\s*=\s*\[.*"messaging".*\]'

Length of output: 158


Script:

#!/bin/bash
# Description: Thoroughly verify the removal of the "messaging" feature from katana-node dependencies across all Cargo.toml files

# Search all Cargo.toml files for 'katana-node' dependencies with the 'messaging' feature
rg '\[dependencies\.katana-node\]' -A5 --type toml | rg 'messaging'

Length of output: 67

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.96%. Comparing base (3e51d5d) to head (2e69b30).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2506   +/-   ##
=======================================
  Coverage   68.95%   68.96%           
=======================================
  Files         376      376           
  Lines       48690    48689    -1     
=======================================
+ Hits        33576    33580    +4     
+ Misses      15114    15109    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kariy kariy merged commit 18bddac into main Oct 8, 2024
15 checks passed
@kariy kariy deleted the katana/remove-messaging-feature branch October 8, 2024 13: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.

1 participant