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

refactor(zetacore)!: remove rosetta api #3130

Merged
merged 2 commits into from
Nov 8, 2024
Merged

refactor(zetacore)!: remove rosetta api #3130

merged 2 commits into from
Nov 8, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Nov 7, 2024

This functionality is unused.

Cosmos sdk v0.47.x still imports it though. It should be entirely removed in v0.50.x

Closes #3109

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced new commands for the zetacored CLI, including snapshots for managing local snapshots and testnet for local testnet configurations.
    • Added options like --grpc-addr, --grpc-insecure, and --height to various commands.
  • Bug Fixes

    • Removed Rosetta command functionality, simplifying the command structure and enhancing overall performance.
  • Documentation

    • Updated CLI documentation to reflect the removal of Rosetta commands and the addition of new commands and options.
  • Chores

    • Restructured dependency management, marking certain dependencies as indirect and adding new required packages for improved functionality.

Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request involve the removal of Rosetta API support from the application, including the elimination of related commands and dependencies. Specifically, the rosettaCmd import and associated command have been removed from the CLI setup, and the go.mod file has been updated to reflect the removal of direct dependencies on Rosetta. Additionally, documentation has been revised to remove references to the Rosetta command, while new commands and options have been introduced. The overall command structure has been simplified, focusing on core functionalities.

Changes

File Change Summary
cmd/zetacored/root.go Removed import for rosettaCmd and eliminated the command rootCmd.AddCommand(rosettaCmd.RosettaCommand(...)).
docs/cli/zetacored/cli.md Removed zetacored rosetta command; added commands zetacored snapshots, zetacored testnet, and new options like --grpc-addr, --grpc-insecure, --height.
go.mod Marked cosmossdk.io/tools/rosetta and github.com/coinbase/rosetta-sdk-go as indirect; added new dependencies and updated replace directives.
server/start.go Removed imports and code related to the Rosetta server, including configuration and error handling.
x/observer/keeper/events.go Added prettyPrintStruct function and updated EmitEventKeyGenBlockUpdated to use this new function.

Assessment against linked issues

Objective Addressed Explanation
Drop support for Rosetta API (#3109)

Possibly related PRs

Suggested labels

no-changelog

Suggested reviewers

  • fbac
  • kingpinXD
  • skosito
  • brewmaster012
  • swift1337
  • lumtis

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.

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.

@gartnera gartnera marked this pull request as ready for review November 8, 2024 02:37
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: 4

🧹 Outside diff range and nitpick comments (1)
server/start.go (1)

Line range hint 1-700: LGTM! Clean removal of Rosetta API.

The changes successfully remove Rosetta API support while maintaining the integrity of the server initialization flow. The code remains well-structured with clear separation of concerns between different server components (gRPC, JSON-RPC, API server, etc.).

Consider documenting the removal of Rosetta API support in the project's changelog or migration guide, as this could be a breaking change for any external systems relying on this functionality.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0e86494 and 0ca7514.

📒 Files selected for processing (5)
  • cmd/zetacored/root.go (0 hunks)
  • docs/cli/zetacored/cli.md (0 hunks)
  • go.mod (1 hunks)
  • server/start.go (1 hunks)
  • x/observer/keeper/events.go (2 hunks)
💤 Files with no reviewable changes (2)
  • cmd/zetacored/root.go
  • docs/cli/zetacored/cli.md
🧰 Additional context used
📓 Path-based instructions (2)
server/start.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/events.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (3)
go.mod (2)

Line range hint 513-519: LGTM: Well-maintained fork replacements.

The replace directives pointing to ZetaChain maintained forks is a good practice:

  • Ensures stability and control over critical dependencies
  • Allows for custom patches and fixes
  • Maintains compatibility with the project's requirements

Line range hint 447-451: Review new dependency versions and maintenance status.

The new dependencies added appear to be replacing removed functionality. However, we should verify their maintenance status and compatibility:

  • github.com/bnb-chain/tss-lib v1.5.0: Threshold Signature Scheme library
  • github.com/montanaflynn/stats v0.7.1: Statistics package
  • github.com/showa-93/go-mask v0.6.2: Data masking utility
  • github.com/tonkeeper/tongo v1.9.3: TON blockchain integration
  • github.com/zeta-chain/protocol-contracts-solana/go-idl: Solana contract integration
✅ Verification successful

Dependencies appear well-maintained with recent activity

Based on the verification results, all dependencies show healthy maintenance patterns:

  • All repositories are actively maintained (not archived) and show recent activity within the last 3 months
  • Notable observations:
    • bnb-chain/tss-lib: Latest release v2.0.2 (Jan 2024), active development with recent updates
    • montanaflynn/stats: Mature project (2.9k stars), stable v0.7.1 release
    • showa-93/go-mask: Recent release v0.6.2 (July 2024)
    • tonkeeper/tongo: Very active with updates as recent as Nov 8, 2024
    • zeta-chain/protocol-contracts-solana: Active development with RC release in Oct 2024
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check last commit dates and open issues for new dependencies
for repo in "bnb-chain/tss-lib" "montanaflynn/stats" "showa-93/go-mask" "tonkeeper/tongo" "zeta-chain/protocol-contracts-solana"; do
    echo "Checking $repo..."
    gh repo view "$repo" --json updatedAt,openIssues
done

Length of output: 6995


Script:

#!/bin/bash
# Let's try a different approach to check repository activity and maintenance status
for repo in "bnb-chain/tss-lib" "montanaflynn/stats" "showa-93/go-mask" "tonkeeper/tongo" "zeta-chain/protocol-contracts-solana"; do
    echo "=== Checking $repo ==="
    # Get last update date and basic stats
    gh repo view "$repo" --json updatedAt,pushedAt,stargazerCount,isArchived,hasIssuesEnabled
    
    # Get latest release info if available
    gh release list -R "$repo" -L 1
done

Length of output: 2748

server/start.go (1)

626-626: LGTM! Clear and helpful comment addition.

The added comment effectively explains the rationale for blocking the process in gRPC-only mode.

x/observer/keeper/events.go Show resolved Hide resolved
x/observer/keeper/events.go Show resolved Hide resolved
x/observer/keeper/events.go Show resolved Hide resolved
go.mod Show resolved Hide resolved
@lumtis lumtis added the no-changelog Skip changelog CI check label Nov 8, 2024
Copy link
Contributor

@swift1337 swift1337 left a comment

Choose a reason for hiding this comment

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

Let's also remove rosetta from contrib/* and localnet.

@gartnera gartnera requested a review from swift1337 November 8, 2024 16:13
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.19%. Comparing base (0e86494) to head (207973e).
Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3130      +/-   ##
===========================================
- Coverage    63.29%   63.19%   -0.11%     
===========================================
  Files          422      423       +1     
  Lines        29959    29887      -72     
===========================================
- Hits         18962    18886      -76     
- Misses       10157    10163       +6     
+ Partials       840      838       -2     

see 13 files with indirect coverage changes

@gartnera gartnera added this pull request to the merge queue Nov 8, 2024
Merged via the queue into develop with commit ea4e770 Nov 8, 2024
41 checks passed
@gartnera gartnera deleted the remove-rosetta branch November 8, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop support for Rosetta API
4 participants