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(proto)!: separate client and server feature #118

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

lklimek
Copy link
Collaborator

@lklimek lklimek commented Dec 22, 2024

Issue being fixed or feature implemented

When building for WASM32 (eg. Javascript) targets, some tonic features, like channels, are not available.

We need to refactor this library a bit to allow building rs-tenderdash-abci without these features.

We do this by separating client and server-side code to client and server features .

New approach defines the following features for tenderdash-proto crate:

  • client - provides data types and methods used by ABCI clients (that is, Tenderdash or some test code for ABCI Applications)
  • server - default one - provides data types and methods used by ABCI Applications (eg. Dash Drive)

When built with --no-default-features, only data types are generated.

What was done?

  • Refactored features of tenderdash-proto
  • proto-compiler doesn't use features to define what will be built

How Has This Been Tested?

GHA + tested as part of dash platform wasm work (branch feat/wasm-dapi-sdk-client, rev 0a34d38106999a2a3da0b87f7b7403fb3e6d3f4d).

Breaking Changes

  • tenderdash-proto feature std is deprecated, and grpc is marked as internal; use server or client instead

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

Release Notes

  • Configuration Changes

    • Updated feature dependencies across multiple packages.
    • Refined gRPC support with separate server and client configurations.
  • Error Handling Improvements

    • Enhanced error management in ABCI library.
    • Explicit error type conversions added.
  • Module Management

    • Restructured module compilation based on feature flags.
    • Added support for granular gRPC server and client builds.
  • Dependency Updates

    • Modified default features for proto and ABCI packages.
    • Removed deprecated feature flags.

Copy link
Contributor

coderabbitai bot commented Dec 22, 2024

Walkthrough

The pull request introduces a comprehensive reorganization of gRPC-related features and dependencies across multiple packages in the Tenderdash project. The changes focus on separating gRPC server and client functionalities, updating feature flags, and modifying module compilation conditions. Key modifications include renaming gRPC-related enum variants, updating Cargo.toml configurations, and adjusting conditional compilation directives to provide more granular control over gRPC server and client components.

Changes

File Change Summary
abci/Cargo.toml - Removed grpc feature (deprecated)
- Updated default feature to remove grpc and include server
- Modified server feature to include tenderdash-proto/server
- Updated std feature to include tenderdash-proto/std instead of grpc
abci/src/lib.rs - Removed #[from] attribute for Decode and Encode error variants
- Added manual From trait implementations for EncodeError and DecodeError
abci/src/server/generic.rs - Removed lifetime parameter 'a from Server trait implementation
proto-compiler/Cargo.toml - Removed grpc, server, and client features
proto-compiler/src/constants.rs - Renamed Grpc enum variant to GrpcServer
- Added new GrpcClient enum variant
- Updated trait implementation from ToString to Display
proto-compiler/src/lib.rs - Updated proto_compile function to handle GrpcServer and GrpcClient modes
proto/Cargo.toml - Changed default feature from grpc to server
- Updated feature configurations for std, grpc, server, and client
- Modified tonic dependency to disable default features
proto/build.rs - Added conditional compilation for gRPC server and client features
proto/src/.gitignore - Added tenderdash_grpc_client/ to ignored entries
proto/src/lib.rs - Updated conditional compilation of modules
- Modified module re-exports based on feature flags
proto/src/time.rs - Added conditional compilation for format module
proto/src/error.rs - Updated conditional compilation directives from grpc to std
proto/src/prelude.rs - Updated conditional compilation for re-export of tonic crate from grpc to std
proto/src/protobuf.rs - Updated conditional compilation for fmt module imports from grpc to std
proto/src/serializers/from_str.rs - Updated conditional compilation for FromStr and Display trait imports from grpc to std
proto/src/serializers/part_set_header_total.rs - Updated conditional compilation for module from grpc to std
proto/src/serializers/time_duration.rs - Updated conditional compilation for Duration type imports from grpc to std
proto/src/serializers/timestamp.rs - Updated conditional compilation for fmt module imports from grpc to std
proto/tests/unit.rs - Updated conditional compilation attribute from grpc to std
proto-compiler/src/functions.rs - Updated generate_tenderdash_lib function to use mode directly instead of converting to string

Poem

🐰 Hop, hop, through gRPC's maze,
Refactoring features in clever ways,
Server, client, now distinct and clear,
Modules dance with modular cheer!
CodeRabbit's magic, feature-light! 🚀


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 82cc923 and a558c0a.

📒 Files selected for processing (2)
  • proto-compiler/src/constants.rs (1 hunks)
  • proto-compiler/src/functions.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: docs
  • GitHub Check: build (debian)
  • GitHub Check: tenderdash
  • GitHub Check: test-all
🔇 Additional comments (5)
proto-compiler/src/functions.rs (1)

314-314: LGTM! Performance improvement.

Good change. Using mode directly instead of mode.to_string() reduces an unnecessary allocation since GenerationMode now implements Display.

proto-compiler/src/constants.rs (4)

3-4: LGTM! Clean import addition.

The Display trait import is required and well-placed.


34-42: LGTM! Improved trait implementation.

Good improvement replacing ToString with Display. The string representations are clear and consistent with the module's purpose.


15-18: ⚠️ Potential issue

Breaking change: Renamed Grpc to GrpcServer and added GrpcClient.

This is a breaking change that aligns with the PR objective to separate client and server features. The documentation for GrpcClient clearly explains its purpose.

Run the following script to identify potential impacts:

✅ Verification successful

Breaking change verification successful: Grpc to GrpcServer/GrpcClient split

The breaking change has been properly implemented across all relevant files with no lingering references to the old variant. The separation aligns well with the PR objective.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of the old Grpc variant
# Test: Search for Grpc variant usage. Expect: No occurrences of the old variant.
rg "GenerationMode::Grpc" 

# Test: Search for new variant usages. Expect: Updated code using new variants.
rg -A 2 "GenerationMode::(GrpcServer|GrpcClient)"

Length of output: 2316


27-28: Verify module name changes in the codebase.

The module names are consistent with the enum changes, but we should verify their usage.

Run the following script to verify module name usage:

✅ Verification successful

Module name changes are consistent throughout the codebase

The module names tenderdash_grpc and tenderdash_grpc_client are properly declared, documented, and used consistently across the codebase. No conflicting usages found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of the old and new module names
# Test: Search for old module name. Expect: No occurrences of tenderdash_grpc.
rg "tenderdash_grpc[^_]"

# Test: Search for new module names. Expect: Updated code using new module names.
rg "(tenderdash_grpc_client|tenderdash_grpc)"

Length of output: 992


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

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.

@riongull
Copy link

riongull commented Jan 8, 2025

Can you tell us more about this PR? What is the overall purpose, etc?

@lklimek lklimek modified the milestones: 1.4, 1.3 Jan 8, 2025
@lklimek lklimek marked this pull request as ready for review January 9, 2025 00:08
@lklimek
Copy link
Collaborator Author

lklimek commented Jan 9, 2025

Can you tell us more about this PR? What is the overall purpose, etc?

First of all, this is internal library used by dash platform only.

For WASM, we only build client bindings, as we don't need server code (which doesn't work anyway). We also exclude some transport logic that is handled by separate library.

This PR just cleans up some Cargo features and logic around code generation, to make it easier to use only what's needed in WASM.

Copy link
Contributor

@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 (3)
abci/Cargo.toml (1)

38-39: Consider adding migration instructions for the deprecated feature.

While the deprecation of std in favor of grpc is clear, consider adding a comment with migration instructions or linking to documentation.

-# std is deprecated, use "grpc" instead
+# std is deprecated, use "grpc" instead.
+# Migration guide: https://github.com/dashpay/tenderdash/wiki/migrating-from-std-to-grpc
proto/Cargo.toml (2)

39-46: Enhance feature documentation and deprecation notices

The feature documentation could be improved:

  1. Add version numbers to deprecation notices
  2. Provide migration examples
  3. Make comment formatting consistent (periods)

Apply this diff to improve the documentation:

-# Enable standard library support; DEPRECATED - use `client` and/or `server` instead
+# Enable standard library support.
+# DEPRECATED since 0.x.x: Use `client` and/or `server` features instead.
+# Example: tenderdash-proto = { version = "0.x", features = ["client"] }
 std = ["client"]
-# Enable gRPC support using tonic; internal, consider using `server` or `client` instead
+# Enable gRPC support using tonic.
+# INTERNAL: Use `server` or `client` features instead.
 grpc = ["client", "dep:tonic", "tonic/codegen", "tonic/prost"]
-# Build gRPC server using tonic. Includes `client` feature.
+# Build gRPC server using tonic. Includes `client` feature
 server = ["client", "tonic/transport"]
-# Build minimal gRPC client using tonic, without transport
+# Build minimal gRPC client using tonic, without transport.
 client = ["tenderdash-proto-compiler/grpc", "prost/std", "grpc"]

37-46: Highlight the build.rs warning in the documentation

The warning about build.rs and feature changes is crucial. Consider making it more prominent to prevent issues:

Add this warning to:

  1. The README.md file
  2. The crate documentation
  3. The changelog for this breaking change

This will help users understand potential pitfalls when switching between features or upgrading versions.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 36999a4 and c434b67.

📒 Files selected for processing (11)
  • abci/Cargo.toml (1 hunks)
  • abci/src/lib.rs (1 hunks)
  • abci/src/server/generic.rs (1 hunks)
  • proto-compiler/Cargo.toml (0 hunks)
  • proto-compiler/src/constants.rs (2 hunks)
  • proto-compiler/src/lib.rs (1 hunks)
  • proto/Cargo.toml (2 hunks)
  • proto/build.rs (1 hunks)
  • proto/src/.gitignore (1 hunks)
  • proto/src/lib.rs (2 hunks)
  • proto/src/time.rs (1 hunks)
💤 Files with no reviewable changes (1)
  • proto-compiler/Cargo.toml
✅ Files skipped from review due to trivial changes (1)
  • proto/src/.gitignore
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test-all
🔇 Additional comments (17)
proto/build.rs (2)

16-19: LGTM! Clear documentation of build behavior.

The added comment effectively explains that building both server and client components is safe, even if they're not used in lib.rs.


20-25: Verify feature flag dependencies.

The conditional compilation directives correctly separate server and client builds. However, we should verify that all necessary dependencies are properly configured in Cargo.toml.

✅ Verification successful

Feature flag dependencies are correctly configured

The conditional compilation in build.rs is properly supported by the feature flag hierarchy in Cargo.toml:

  • Server feature includes client capabilities and transport
  • Client feature provides minimal gRPC client support
  • Tonic dependency is properly gated with appropriate features for each use case
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify feature flag configurations in Cargo.toml files
# Check for proper feature definitions and dependencies

# Search for feature definitions
echo "Checking feature definitions in Cargo.toml files:"
rg -A 5 '^\[features\]' 

# Search for feature usage in dependencies
echo "Checking feature usage in dependencies:"
rg -A 5 'features\s*=\s*\[' 

Length of output: 4592


Script:

#!/bin/bash
# Get the complete features section from proto/Cargo.toml
echo "Features section from proto/Cargo.toml:"
rg -A 20 '^\[features\]' proto/Cargo.toml

# Check if tonic is properly gated by features
echo -e "\nTonic dependency configuration:"
rg 'tonic.*=' proto/Cargo.toml

Length of output: 1283

abci/src/lib.rs (2)

42-44: LGTM! Improved error handling structure.

The removal of #[from] attributes in favor of explicit type specifications enhances clarity and control over error conversions.


53-65: Well-structured manual implementations for no_std compatibility.

The manual implementations of From traits for EncodeError and DecodeError are correctly implemented and documented. This change improves compatibility with no_std environments while maintaining clean error conversion paths.

proto/src/time.rs (2)

9-11: LGTM! Improved documentation clarity.

The added note about resolution differences between protobuf timestamp and milliseconds is helpful for developers.


3-5: Verify format module usage across features.

The conditional compilation ensures the format module is only included when necessary. However, we should verify that this doesn't break any existing functionality.

✅ Verification successful

Conditional compilation of format module is correctly implemented

The format module is properly isolated and only imported in the nostd context. No conflicts or breaking changes were found in server/client feature paths. The timestamp formatting functionality remains intact through specialized handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify format module usage
# Check if format module is used in server/client feature contexts

# Search for format module usage
echo "Checking format module usage:"
rg -p "use.*format" 

# Search for potential timestamp formatting calls
echo "Checking timestamp formatting calls:"
rg -p "format!.*time" 

Length of output: 593


Script:

#!/bin/bash
# Check format module contents and direct references
echo "Checking format module contents:"
rg -p "mod format|pub mod format"

echo "Checking direct format module references:"
rg -p "format::" --type rust

# Check feature-gated code blocks
echo "Checking feature-gated blocks:"
ast-grep --pattern 'cfg(feature = $_)'

Length of output: 344

abci/src/server/generic.rs (1)

Line range hint 99-106: LGTM! Simplified type constraints.

The removal of the unnecessary lifetime parameter 'a from the Server implementation for GenericServer is a good simplification. The implementation maintains all necessary trait bounds (Send + Sync + 'static) while reducing complexity.

proto-compiler/src/lib.rs (2)

127-138: LGTM! Clean separation of server configuration.

The GrpcServer configuration properly enables all required components (client, server, transport) while maintaining feature gates.


139-149: LGTM! Well-optimized client configuration for WASM.

The GrpcClient configuration correctly disables server and transport components while keeping client functionality, which aligns with WASM target requirements.

proto/src/lib.rs (3)

6-6: LGTM! Documentation style fix.

Allowing clippy::doc_lazy_continuation improves documentation readability without affecting functionality.


37-39: LGTM! Clean module organization.

The conditional compilation logic properly separates the modules based on features, with clear boundaries between server, client, and nostd implementations.

Also applies to: 42-49


51-58: LGTM! Well-structured re-exports.

The re-export logic maintains a clear precedence (server > client > nostd) while ensuring only one implementation is exposed.

proto-compiler/src/constants.rs (2)

16-19: LGTM! Clear enum variants.

The GenerationMode enum variants clearly represent their purposes with good documentation.


35-42: LGTM! Descriptive Display implementation.

The Display trait implementation provides clear and consistent string representations of the generation modes.

abci/Cargo.toml (1)

35-35: LGTM! Proper feature dependency.

Adding grpc to server feature ensures all required functionality is available.

proto/Cargo.toml (2)

55-55: LGTM: Optimized tonic dependency configuration

Good optimization! Disabling default features reduces the dependency footprint and aligns with making the crate more WASM-friendly.


37-37: Breaking change: Default feature changed to "server"

This change modifies the default behavior from including just gRPC support to including both client and server features. While this aligns with the PR objectives, it could impact existing users.

Let's verify the impact on existing dependencies:

Consider:

  1. Adding a migration guide in the README
  2. Documenting the new feature flags in the crate documentation
✅ Verification successful

Breaking change impact is minimal, documentation updates recommended

The change to default features appears safe as:

  • No dependencies found relying on default features
  • The abci package explicitly opts out of defaults with default-features = false

Still recommended:

  • Document the feature flag changes in CHANGELOG.md
  • Update crate documentation to explain the new feature structure
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for dependencies on tenderdash-proto without explicit feature selection
rg --type toml -A 5 'tenderdash-proto = .*(?!features)'

Length of output: 315


Script:

#!/bin/bash
# Find all Cargo.toml files that depend on tenderdash-proto
rg --type toml -l "tenderdash-proto"

# For each found file, show the dependency specification and surrounding context
rg --type toml -A 5 -B 2 'tenderdash-proto = .*'

Length of output: 651


Script:

#!/bin/bash
# Extract the tenderdash-proto dependency configuration from proto-compiler
rg --type toml -A 5 -B 2 'tenderdash-proto = .*' proto-compiler/Cargo.toml

Length of output: 76

Copy link
Contributor

@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 (2)
proto/src/error.rs (1)

3-6: LGTM! Consider updating module documentation

The change from grpc to std feature for error-related imports is semantically correct. Consider updating the module documentation to mention the feature flag requirements.

Add a note about feature requirements:

 //! This module defines the various errors that be raised during Protobuf
 //! conversions.
+//!
+//! When the `std` feature is enabled, this module uses types from the standard
+//! library. Otherwise, it uses types from the core library.
proto/Cargo.toml (1)

62-62: Consider pinning tonic version more strictly.

Since this is a breaking change that relies heavily on tonic's feature flags, consider using a more strict version requirement (e.g., =0.12.3) to prevent potential compatibility issues with minor version updates.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c434b67 and 82cc923.

📒 Files selected for processing (11)
  • abci/Cargo.toml (1 hunks)
  • proto/Cargo.toml (2 hunks)
  • proto/src/error.rs (1 hunks)
  • proto/src/lib.rs (2 hunks)
  • proto/src/prelude.rs (1 hunks)
  • proto/src/protobuf.rs (1 hunks)
  • proto/src/serializers/from_str.rs (1 hunks)
  • proto/src/serializers/part_set_header_total.rs (1 hunks)
  • proto/src/serializers/time_duration.rs (1 hunks)
  • proto/src/serializers/timestamp.rs (1 hunks)
  • proto/tests/unit.rs (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • proto/tests/unit.rs
  • proto/src/serializers/timestamp.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • abci/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test-all
  • GitHub Check: build (alpine)
🔇 Additional comments (8)
proto/src/prelude.rs (1)

14-14: LGTM! Verify tonic dependency configuration

The change from grpc to std feature for tonic re-export is semantically correct since tonic requires the standard library. This aligns with the PR objective to deprecate the grpc feature.

Let's verify the tonic dependency configuration:

✅ Verification successful

Verified: Tonic dependency and feature flags are properly configured

The change to #[cfg(feature = "std")] is correct and well-structured:

  • The std feature enables tonic through the client feature
  • This aligns with deprecating the grpc feature
  • The dependency hierarchy ensures proper feature resolution
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if tonic is properly configured in Cargo.toml
rg -l 'tonic.*=.*' | while read -r file; do
  echo "=== $file ==="
  rg 'tonic.*=.*' "$file"
done

Length of output: 408


Script:

#!/bin/bash
# Check feature definitions in Cargo.toml files
for file in proto/Cargo.toml proto-compiler/Cargo.toml; do
  echo "=== $file ==="
  rg '^\[features\]' -A 10 "$file"
done

Length of output: 908


Script:

#!/bin/bash
# Get complete feature definitions and tonic-related dependencies from proto/Cargo.toml
echo "=== Complete proto/Cargo.toml ==="
cat proto/Cargo.toml

Length of output: 2781

proto/src/serializers/time_duration.rs (1)

2-5: LGTM! Appropriate feature flag for Duration type

The change from grpc to std feature for Duration import is semantically correct, as it properly reflects the choice between std and core libraries.

proto/src/serializers/from_str.rs (1)

4-7: LGTM! Appropriate feature flag for trait imports

The change from grpc to std feature for FromStr and Display trait imports is semantically correct, as it properly reflects the choice between std and core libraries.

proto/Cargo.toml (1)

37-52: LGTM! Clear separation of features for better granularity.

The new feature structure effectively separates client and server capabilities, which is crucial for WASM support. The deprecation notices and feature dependencies are well-organized.

Let's verify the impact of these feature changes on dependent crates:

✅ Verification successful

Feature changes are safe to proceed

The verification shows that:

  • Dependencies are already using the new feature flags (server, std)
  • No external usage of the deprecated grpc feature was found
  • The only grpc feature reference is in the internal proto-compiler crate
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for direct dependencies on the deprecated 'grpc' feature
rg --type rust -A 3 'tenderdash-proto.*features.*=.*["'']grpc'

Length of output: 62


Script:

#!/bin/bash
# Find all Cargo.toml files and check for tenderdash-proto dependencies
fd Cargo.toml --type f --exec sh -c 'echo "=== {}:" && cat {} | grep -A 5 "tenderdash-proto"'

# Also search for any direct references to the features in rust files
rg --type rust -e 'tenderdash.proto.*features' -e '#\[cfg\(feature.*grpc'

Length of output: 1886

proto/src/lib.rs (2)

3-6: LGTM! Improved feature flag organization.

The change from grpc to std for no_std configuration is more semantically correct, and the added clippy allowance is appropriate for documentation.


37-58: Well-structured conditional compilation for module separation.

The module organization clearly separates client and server functionality while maintaining compatibility through re-exports. This is crucial for WASM support where server functionality is not needed.

Let's verify the module organization:

✅ Verification successful

Module separation is correctly implemented and verified.

The codebase maintains clean separation between server, client, and no_std implementations through feature flags, with no unexpected cross-dependencies. The organization supports WASM compatibility by properly isolating server functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any potential cross-dependencies between client and server modules
rg -A 3 'use (crate::)?(tenderdash_grpc|tenderdash_grpc_client)' --type rust

Length of output: 392


Script:

#!/bin/bash
# Check module definitions and their contents
echo "=== Checking module definitions ==="
fd -e rs -x head -n 20 {}

echo -e "\n=== Checking for any tonic/grpc related imports ==="
rg "use tonic|use grpc" --type rust

Length of output: 20579

proto/src/serializers/part_set_header_total.rs (1)

9-11: LGTM! Consistent feature flag usage for imports.

The change from grpc to std feature flag for conditional imports is consistent with the new feature organization.

proto/src/protobuf.rs (1)

6-8: LGTM! Consistent feature flag usage for imports.

The change from grpc to std feature flag for conditional imports aligns with the new feature organization.

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