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: remove unused method FilterSolanaInboundEvents #3440

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

ws4charlie
Copy link
Contributor

@ws4charlie ws4charlie commented Jan 30, 2025

Description

Remove unused FilterSolanaInboundEvents and the corresponding unit test purely for nil logger.

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • Refactor

    • Removed unused method FilterSolanaInboundEvents
    • Streamlined event filtering process for Solana inbound events
  • Cleanup

    • Removed associated test function for the deprecated method
    • Updated changelog to reflect recent project changes

Copy link
Contributor

coderabbitai bot commented Jan 30, 2025

📝 Walkthrough

Walkthrough

The pull request focuses on cleaning up and streamlining the Solana inbound event filtering mechanism in the ZetaChain project. The primary change involves removing the FilterSolanaInboundEvents function from both the implementation and test files, consolidating event filtering logic into a more unified approach. This modification represents a strategic code optimization aimed at reducing redundancy and improving maintainability.

Changes

File Change Summary
zetaclient/chains/solana/observer/inbound.go Removed FilterSolanaInboundEvents function, eliminating specialized Solana inbound event filtering
zetaclient/chains/solana/observer/inbound_test.go Deleted Test_FilterSolanaInboundEvents test function corresponding to the removed implementation
changelog.md Updated to reflect the removal of the unused method and associated changes

Possibly related PRs

Suggested Labels

no-changelog, zetaclient, chain:solana

Suggested Reviewers

  • kingpinXD
  • lumtis
  • skosito
  • fbac

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.

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.

@ws4charlie ws4charlie changed the title chore: remove unused FilterSolanaInboundEvents refactor: remove unused FilterSolanaInboundEvents Jan 30, 2025
@ws4charlie ws4charlie marked this pull request as ready for review January 30, 2025 17:49
@ws4charlie ws4charlie requested a review from a team as a code owner January 30, 2025 17:49
@ws4charlie ws4charlie added chain:solana SOLANA_TESTS Run make start-solana-test zetaclient Issues related to ZetaClient zetatool ZetaTool command line labels Jan 30, 2025
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

🔭 Outside diff range comments (1)
changelog.md (1)

Line range hint 26-35: Consider removing duplicate entries.

The following entries appear in both v26.0.0 and Unreleased sections:

This duplication could cause confusion about which version introduced these changes.

Keep these entries only in the v26.0.0 section since they were released in that version.

🧹 Nitpick comments (2)
changelog.md (2)

22-22: Maintain consistent indentation in changelog entries.

The entry * [3440](https://github.com/zeta-chain/node/pull/3440) - remove unused method 'FilterSolanaInboundEvents' has inconsistent indentation compared to other entries in the same section.

-* [3440](https://github.com/zeta-chain/node/pull/3440) - remove unused method `FilterSolanaInboundEvents`
+  * [3440](https://github.com/zeta-chain/node/pull/3440) - remove unused method `FilterSolanaInboundEvents`

Line range hint 37-43: Fix inconsistent version header formatting.

The version header has an extra "Unreleased" section that breaks the consistency of the changelog structure.

 ## v25.0.0
-
-## Unreleased
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 084100a and bde6ea7.

📒 Files selected for processing (3)
  • changelog.md (1 hunks)
  • zetaclient/chains/solana/observer/inbound.go (0 hunks)
  • zetaclient/chains/solana/observer/inbound_test.go (0 hunks)
💤 Files with no reviewable changes (2)
  • zetaclient/chains/solana/observer/inbound.go
  • zetaclient/chains/solana/observer/inbound_test.go
🔇 Additional comments (2)
changelog.md (2)

Line range hint 1-24: LGTM! Well-structured changelog section for unreleased changes.

The unreleased section follows the standard format with clear categorization of changes into Features, Refactor, and Fixes sections. Each entry includes a PR link and concise description.


Line range hint 1-1000: Verify version ordering in changelog.

The changelog shows version jumps (e.g., v26.0.0 to v24.0.0) and some versions appear out of order. This makes it difficult to track the chronological progression of changes.

Run this script to verify version ordering:

✅ Verification successful

Changelog version ordering is correct and follows semantic versioning

The changelog properly lists versions in descending order from v26.0.0 down to v16.0.0, following standard semantic versioning practices. The apparent version "jumps" are normal and represent major version increments. Each version is correctly positioned chronologically with newer versions appearing before older ones.

The script's error message was due to incorrect validation logic rather than any actual ordering issues in the changelog.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Extract and verify version numbers are in descending order

# Extract version numbers and check order
echo "Checking version order in changelog..."
versions=$(grep -E '^## v[0-9]+\.[0-9]+\.[0-9]+' changelog.md | cut -d' ' -f2)
echo "Found versions: $versions"

# Convert versions to comparable numbers and check if sorted
prev_ver=999999
for ver in $versions; do
    # Remove 'v' prefix and convert to comparable number
    num_ver=$(echo $ver | sed 's/v//' | awk -F. '{printf "%d%03d%03d", $1, $2, $3}')
    if [ $num_ver -gt $prev_ver ]; then
        echo "Version order issue: $ver appears after a lower version"
        exit 1
    fi
    prev_ver=$num_ver
done

Length of output: 921

@ws4charlie ws4charlie changed the title refactor: remove unused FilterSolanaInboundEvents refactor: remove unused method FilterSolanaInboundEvents Jan 30, 2025
@lumtis lumtis added this pull request to the merge queue Jan 30, 2025
Merged via the queue into develop with commit 782db2c Jan 30, 2025
59 of 63 checks passed
@lumtis lumtis deleted the remove-unused-func-FilterSolanaInboundEvents branch January 30, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chain:solana SOLANA_TESTS Run make start-solana-test zetaclient Issues related to ZetaClient zetatool ZetaTool command line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants