Skip to content

fix: check tx result err in filter inbound events#3914

Merged
skosito merged 5 commits intodevelopfrom
filter-inbound-events-err
May 27, 2025
Merged

fix: check tx result err in filter inbound events#3914
skosito merged 5 commits intodevelopfrom
filter-inbound-events-err

Conversation

@skosito
Copy link
Member

@skosito skosito commented May 26, 2025

Description

https://github.com/zeta-chain/protocol-private/issues/242

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

  • Bug Fixes
    • Improved error handling when filtering inbound events by detecting and skipping failed transactions, ensuring only successful transactions are processed.

@skosito skosito requested a review from a team as a code owner May 26, 2025 12:51
@skosito skosito added the SOLANA_TESTS Run make start-solana-test label May 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 26, 2025

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

A precondition check for transaction errors has been added to the Solana inbound event filtering process. The function now immediately returns if the transaction result indicates an error, preventing further event parsing and processing for failed transactions.

Changes

File(s) Change Summary
zetaclient/chains/solana/observer/inbound.go Added an early return in FilterInboundEvents to detect and handle transaction errors before parsing.
changelog.md Documented the new transaction error check in the inbound event filtering process.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant FilterInboundEvents
    participant SolanaTxResult
    participant EventParser

    Caller->>FilterInboundEvents: Call with txResult, gatewayID, senderChainID, logger
    FilterInboundEvents->>SolanaTxResult: Check txResult.Meta.Err
    alt txResult.Meta.Err != nil
        FilterInboundEvents-->>Caller: Return error (transaction reverted)
    else txResult.Meta.Err == nil
        FilterInboundEvents->>EventParser: Parse events
        EventParser-->>FilterInboundEvents: Return parsed events
        FilterInboundEvents-->>Caller: Return events
    end
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.99%. Comparing base (225b109) to head (548b8de).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3914   +/-   ##
========================================
  Coverage    64.99%   64.99%           
========================================
  Files          470      470           
  Lines        34351    34354    +3     
========================================
+ Hits         22326    22329    +3     
  Misses       10993    10993           
  Partials      1032     1032           
Files with missing lines Coverage Δ
zetaclient/chains/solana/observer/inbound.go 34.96% <100.00%> (+1.39%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d0a1466 and f94d497.

📒 Files selected for processing (2)
  • changelog.md (1 hunks)
  • zetaclient/chains/solana/observer/inbound.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

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

  • zetaclient/chains/solana/observer/inbound.go
🪛 GitHub Check: codecov/patch
zetaclient/chains/solana/observer/inbound.go

[warning] 153-154: zetaclient/chains/solana/observer/inbound.go#L153-L154
Added lines #L153 - L154 were not covered by tests

🔇 Additional comments (1)
changelog.md (1)

54-54: LGTM!

The changelog entry is properly formatted and accurately describes the fix.

@swift1337 swift1337 self-requested a review May 27, 2025 11:32
@skosito skosito added this pull request to the merge queue May 27, 2025
@github-actions github-actions bot added the MERGE_FAILED Merge Queue CI failed label May 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 27, 2025
@skosito skosito enabled auto-merge May 27, 2025 17:14
@skosito skosito added this pull request to the merge queue May 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 27, 2025
@skosito skosito added this pull request to the merge queue May 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 27, 2025
@skosito skosito added this pull request to the merge queue May 27, 2025
@skosito
Copy link
Member Author

skosito commented May 27, 2025

i dont know why this keep getting kicked out of merge queue, trying again

Merged via the queue into develop with commit 7abfeb2 May 27, 2025
47 checks passed
@skosito skosito deleted the filter-inbound-events-err branch May 27, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MERGE_FAILED Merge Queue CI failed SOLANA_TESTS Run make start-solana-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants