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

feat: remove starknet-messaging feature #3005

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Feb 10, 2025

starknet-messaging feature was added as an initial work to explore appchains on katana.
Now that appchains are unlocked, this feature is by default included in Katana.

Summary by CodeRabbit

  • Refactor
    • Removed the legacy Starknet messaging support to streamline the messaging functionality.
  • Documentation
    • Updated command-line instructions for starting messaging. Users should now launch messaging with the simplified command syntax (e.g., using "katana --messaging …") without legacy feature flags.

@glihm glihm marked this pull request as ready for review February 10, 2025 22:39
Copy link

coderabbitai bot commented Feb 10, 2025

Ohayo, sensei! Here’s the breakdown of the changes:

Walkthrough

This pull request removes the starknet-messaging feature from multiple package configurations in the Katana project. The changes update several Cargo.toml files to eliminate feature flags, modify dependency settings (e.g., making starknet-crypto required), and simplify the messaging module by removing conditional logic related to Starknet messaging. Additionally, the messaging contracts’ README has been revised to update the command instructions.

Changes

Files Changes Summary
bin/katana/Cargo.toml, crates/katana/cli/Cargo.toml, crates/katana/node/Cargo.toml Removed the starknet-messaging feature from the [features] sections.
crates/katana/core/Cargo.toml Modified the starknet-crypto dependency to be required (removed optional = true) and deleted the [features] section for starknet-messaging.
crates/katana/contracts/messaging/README.md Updated the command instructions by removing development mode context and the starknet-messaging feature flag.
crates/katana/core/src/service/messaging/{mod.rs, service.rs} Removed conditional compilation and Starknet-specific messaging logic; the module now always includes the Starknet messaging code in a simplified form.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant MessagingService
    participant EthHandler as "Ethereum Handler"
    Client->>MessagingService: Send message
    MessagingService->>EthHandler: Process Ethereum message
    EthHandler-->>MessagingService: Return acknowledgement
    MessagingService-->>Client: Relay acknowledgement
Loading

Possibly related PRs

Suggested reviewers

  • kariy

🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

🧹 Nitpick comments (1)
crates/katana/core/src/service/messaging/mod.rs (1)

167-171: Consider adding debug logs for initialization, sensei!

While the error handling is good, adding debug logs during initialization could help with troubleshooting.

 match StarknetMessaging::new(config).await {
     Ok(m_sn) => {
         info!(target: LOG_TARGET, "Messaging enabled [Starknet].");
+        debug!(target: LOG_TARGET, ?config, "Starknet messaging initialized with config");
         Ok(MessengerMode::Starknet(m_sn))
     }
     Err(e) => {
         error!(target: LOG_TARGET, error = %e, "Starknet messenger init.");
+        debug!(target: LOG_TARGET, ?config, "Failed to initialize Starknet messaging with config");
         Err(Error::InitError)
     }
 }

Also applies to: 187-196

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f744a0 and 6ca31ef.

📒 Files selected for processing (7)
  • bin/katana/Cargo.toml (0 hunks)
  • crates/katana/cli/Cargo.toml (0 hunks)
  • crates/katana/contracts/messaging/README.md (1 hunks)
  • crates/katana/core/Cargo.toml (1 hunks)
  • crates/katana/core/src/service/messaging/mod.rs (1 hunks)
  • crates/katana/core/src/service/messaging/service.rs (0 hunks)
  • crates/katana/node/Cargo.toml (0 hunks)
💤 Files with no reviewable changes (4)
  • crates/katana/cli/Cargo.toml
  • crates/katana/core/src/service/messaging/service.rs
  • bin/katana/Cargo.toml
  • crates/katana/node/Cargo.toml
✅ Files skipped from review due to trivial changes (1)
  • crates/katana/contracts/messaging/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: fmt
🔇 Additional comments (4)
crates/katana/core/src/service/messaging/mod.rs (2)

20-21: Ohayo! Documentation update looks good, sensei!

The updated documentation accurately reflects that Starknet messaging is now a built-in feature rather than optional.


36-37: Verify module dependencies after feature flag removal

The removal of feature flags means these modules are now always included. Let's verify there are no missing dependencies.

Also applies to: 57-57, 60-61

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Check for any remaining feature flags related to starknet messaging
rg -l '#\[cfg\(feature\s*=\s*"starknet-messaging"\)\]' .

# Check for any potential circular dependencies
cargo tree -e features katana-core

Length of output: 191


Ohayo, sensei! We verified that there are no remaining feature-flag usages for "starknet-messaging" (the regex search returned no hits). However, our circular dependency check with cargo tree -e features katana-core didn't run because the cargo command wasn’t available in our sandbox. Could you please run that check manually in your local environment to confirm no circular dependencies exist?

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

41-41: Ohayo! Dependency update looks good, sensei!

The starknet-crypto dependency is now correctly set as a required workspace dependency, which aligns with Starknet messaging being a built-in feature.


1-62: Verify dependency versions across workspace

Let's ensure all related crates have consistent dependency versions after the feature removal.

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Check for any inconsistent starknet-related dependency versions across workspace
cargo tree -e features | grep -i starknet

# Verify no orphaned dependencies
cargo tree --no-dev-dependencies -d

Length of output: 273


Ohayo, sensei! It looks like the automated dependency checks couldn’t run since the cargo command wasn’t available in the current environment. That means we can’t automatically verify the dependency version consistency across the workspace. I’d recommend manually running the cargo commands locally to check for any inconsistent dependency versions or orphaned dependencies. Thanks for your hard work on this, sensei!

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.00%. Comparing base (9f744a0) to head (6ca31ef).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3005      +/-   ##
==========================================
+ Coverage   56.99%   57.00%   +0.01%     
==========================================
  Files         431      431              
  Lines       57151    57151              
==========================================
+ Hits        32572    32580       +8     
+ Misses      24579    24571       -8     

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

@glihm glihm merged commit d3a4f2d into main Feb 10, 2025
16 checks passed
@glihm glihm deleted the katana/rm-starknet-messaging-feat branch February 10, 2025 23: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.

2 participants