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(zetaclient): drop outboundprocessor #3410

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

Conversation

swift1337
Copy link
Contributor

@swift1337 swift1337 commented Jan 24, 2025

Closes #3330

Summary by CodeRabbit

Release Notes

  • Refactor

    • Removed outboundprocessor package and related dependencies across multiple chain signers
    • Simplified outbound transaction processing logic
    • Consolidated outbound ID generation and tracking within the Signer struct
  • Changes

    • Removed outboundProcessor parameter from TryProcessOutbound methods
    • Updated outbound ID generation to use base.OutboundIDFromCCTX
    • Added MarkOutbound method to track active outbound transactions
    • Removed outboundprocessor initialization from various chain implementations

@swift1337 swift1337 self-assigned this Jan 24, 2025
@swift1337 swift1337 requested a review from a team as a code owner January 24, 2025 15:22
@swift1337 swift1337 added the no-changelog Skip changelog CI check label Jan 24, 2025
Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

📝 Walkthrough

Walkthrough

The pull request introduces a comprehensive refactoring of the outbound transaction processing mechanism across multiple components in the Zetachain client. The primary focus is on removing the outboundprocessor package and integrating its functionality directly into the Signer structs. This involves simplifying method signatures, removing external processor dependencies, and introducing a more integrated approach to tracking outbound transaction states.

Changes

File Change Summary
zetaclient/chains/base/observer.go Simplified logging messages by removing chain ID references
zetaclient/chains/base/signer.go Added activeOutbounds tracking, new methods for managing outbound states
zetaclient/chains/bitcoin/bitcoin.go, zetaclient/chains/evm/evm.go Removed outboundprocessor.Processor, updated New method signatures
Multiple signer files Removed outboundProc parameter, introduced base.OutboundIDFromCCTX()
zetaclient/outboundprocessor/outbound_processor.go Entire package deleted

Suggested labels

breaking:cli, refactor, LEGACY_TESTS

Suggested reviewers

  • lumtis
  • kingpinXD
  • fbac
  • skosito

Possibly related PRs

The changes represent a significant architectural refactoring that simplifies the outbound transaction processing workflow by consolidating responsibilities within the Signer components and removing the external processor dependency.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 12.22222% with 79 lines in your changes missing coverage. Please review.

Project coverage is 62.99%. Comparing base (3961c42) to head (1286b2d).

Files with missing lines Patch % Lines
zetaclient/chains/base/signer.go 2.17% 45 Missing ⚠️
zetaclient/orchestrator/orchestrator.go 0.00% 19 Missing ⚠️
zetaclient/chains/bitcoin/signer/signer.go 0.00% 4 Missing ⚠️
zetaclient/chains/solana/signer/signer.go 0.00% 4 Missing ⚠️
zetaclient/chains/base/observer.go 25.00% 3 Missing ⚠️
zetaclient/chains/bitcoin/bitcoin.go 33.33% 2 Missing ⚠️
zetaclient/chains/evm/evm.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3410      +/-   ##
===========================================
- Coverage    63.03%   62.99%   -0.04%     
===========================================
  Files          436      435       -1     
  Lines        30660    30665       +5     
===========================================
- Hits         19325    19318       -7     
- Misses       10525    10537      +12     
  Partials       810      810              
Files with missing lines Coverage Δ
zetaclient/chains/evm/signer/signer.go 41.56% <100.00%> (+0.53%) ⬆️
zetaclient/chains/ton/signer/signer.go 44.78% <100.00%> (-0.34%) ⬇️
zetaclient/chains/bitcoin/bitcoin.go 37.93% <33.33%> (-1.04%) ⬇️
zetaclient/chains/evm/evm.go 28.57% <33.33%> (-1.23%) ⬇️
zetaclient/chains/base/observer.go 77.01% <25.00%> (ø)
zetaclient/chains/bitcoin/signer/signer.go 15.14% <0.00%> (-0.17%) ⬇️
zetaclient/chains/solana/signer/signer.go 21.13% <0.00%> (-0.25%) ⬇️
zetaclient/orchestrator/orchestrator.go 22.88% <0.00%> (-0.38%) ⬇️
zetaclient/chains/base/signer.go 39.77% <2.17%> (-41.18%) ⬇️

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 (7)
zetaclient/chains/base/signer.go (2)

116-120: Clarify early-return logic in MarkOutbound.
When IsOutboundActive(outboundID) already matches the desired state, you silently return. This is concise but may benefit from a trace log if diagnosing unexpected inactivity.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 116-120: zetaclient/chains/base/signer.go#L116-L120
Added lines #L116 - L120 were not covered by tests


144-152: Record total active outbounds for analytics.
Removing the outbound from the map upon completion is correct. Ensure you have coverage or monitoring metrics for the time_taken field, so you can build performance dashboards around average outbound durations.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 144-152: zetaclient/chains/base/signer.go#L144-L152
Added lines #L144 - L152 were not covered by tests

zetaclient/chains/bitcoin/bitcoin.go (1)

147-147: Missing test coverage.
The static analysis indicates this line is untested. Consider adding a unit test scenario to ensure OutboundIDFromCCTX interacts correctly with subsequent processing logic.

Would you like me to propose a concise test to cover this line?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 147-147: zetaclient/chains/bitcoin/bitcoin.go#L147
Added line #L147 was not covered by tests

zetaclient/chains/solana/signer/signer.go (1)

123-123: Include a stack trace for debugging
Capturing a stack trace in case of panics would aid in troubleshooting deeper issues.

 defer func() {
     signer.MarkOutbound(outboundID, false)
-    if err := recover(); err != nil {
+    if r := recover(); r != nil {
+        debug.PrintStack()
         signer.Logger().Std.Error().Msgf("TryProcessOutbound: %s, caught panic error: %v", cctx.Index, r)
     }
 }()
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 123-123: zetaclient/chains/solana/signer/signer.go#L123
Added line #L123 was not covered by tests

zetaclient/chains/bitcoin/signer/signer.go (1)

288-288: Use stack traces for improved panic handling
Adding a debug stack trace would help in diagnosing issues when a panic occurs.

 defer func() {
     signer.MarkOutbound(outboundID, false)
-    if err := recover(); err != nil {
+    if r := recover(); r != nil {
+        debug.PrintStack()
         signer.Logger().Std.Error().Msgf("BTC TryProcessOutbound: %s, caught panic error: %v", cctx.Index, r)
     }
 }()
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 288-288: zetaclient/chains/bitcoin/signer/signer.go#L288
Added line #L288 was not covered by tests

zetaclient/chains/base/observer.go (1)

134-134: Retain chain ID context in logs for easier debugging
Removing the chain ID from the log messages streamlines output, but consider whether additional context might be lost. For troubleshooting, chain-specific logs can be crucial.

Also applies to: 138-138, 145-145, 148-148

zetaclient/chains/evm/signer/signer.go (1)

249-249: Add a stack trace for debugging panics
Emitting stack traces on recovery simplifies troubleshooting deeper panic causes.

 defer func() {
     signer.MarkOutbound(outboundID, false)
-    if r := recover(); r != nil {
+    if r := recover(); r != nil {
+        debug.PrintStack()
         signer.Logger().Std.Error().Msgf("TryProcessOutbound: %s, caught panic error: %v", cctx.Index, r)
     }
 }()
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3961c42 and 1286b2d.

📒 Files selected for processing (15)
  • zetaclient/chains/base/observer.go (1 hunks)
  • zetaclient/chains/base/signer.go (4 hunks)
  • zetaclient/chains/bitcoin/bitcoin.go (3 hunks)
  • zetaclient/chains/bitcoin/signer/signer.go (1 hunks)
  • zetaclient/chains/evm/evm.go (4 hunks)
  • zetaclient/chains/evm/signer/signer.go (1 hunks)
  • zetaclient/chains/evm/signer/signer_test.go (1 hunks)
  • zetaclient/chains/interfaces/interfaces.go (0 hunks)
  • zetaclient/chains/solana/signer/signer.go (1 hunks)
  • zetaclient/chains/ton/signer/signer.go (1 hunks)
  • zetaclient/chains/ton/signer/signer_test.go (1 hunks)
  • zetaclient/orchestrator/orchestrator.go (7 hunks)
  • zetaclient/outboundprocessor/outbound_processor.go (0 hunks)
  • zetaclient/outboundprocessor/outbound_processor_test.go (0 hunks)
  • zetaclient/testutils/mocks/chain_signer.go (0 hunks)
💤 Files with no reviewable changes (4)
  • zetaclient/outboundprocessor/outbound_processor_test.go
  • zetaclient/testutils/mocks/chain_signer.go
  • zetaclient/chains/interfaces/interfaces.go
  • zetaclient/outboundprocessor/outbound_processor.go
🧰 Additional context used
📓 Path-based instructions (11)
zetaclient/chains/evm/signer/signer_test.go (1)

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

zetaclient/chains/base/observer.go (1)

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

zetaclient/chains/evm/signer/signer.go (1)

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

zetaclient/chains/ton/signer/signer_test.go (1)

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

zetaclient/chains/ton/signer/signer.go (1)

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

zetaclient/chains/bitcoin/signer/signer.go (1)

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

zetaclient/chains/evm/evm.go (1)

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

zetaclient/orchestrator/orchestrator.go (1)

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

zetaclient/chains/bitcoin/bitcoin.go (1)

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

zetaclient/chains/base/signer.go (1)

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

zetaclient/chains/solana/signer/signer.go (1)

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

🪛 GitHub Check: codecov/patch
zetaclient/chains/base/observer.go

[warning] 138-138: zetaclient/chains/base/observer.go#L138
Added line #L138 was not covered by tests


[warning] 145-145: zetaclient/chains/base/observer.go#L145
Added line #L145 was not covered by tests


[warning] 148-148: zetaclient/chains/base/observer.go#L148
Added line #L148 was not covered by tests

zetaclient/chains/bitcoin/signer/signer.go

[warning] 283-285: zetaclient/chains/bitcoin/signer/signer.go#L283-L285
Added lines #L283 - L285 were not covered by tests


[warning] 288-288: zetaclient/chains/bitcoin/signer/signer.go#L288
Added line #L288 was not covered by tests

zetaclient/chains/evm/evm.go

[warning] 166-166: zetaclient/chains/evm/evm.go#L166
Added line #L166 was not covered by tests


[warning] 191-191: zetaclient/chains/evm/evm.go#L191
Added line #L191 was not covered by tests

zetaclient/orchestrator/orchestrator.go

[warning] 429-431: zetaclient/orchestrator/orchestrator.go#L429-L431
Added lines #L429 - L431 were not covered by tests


[warning] 436-442: zetaclient/orchestrator/orchestrator.go#L436-L442
Added lines #L436 - L442 were not covered by tests


[warning] 454-454: zetaclient/orchestrator/orchestrator.go#L454
Added line #L454 was not covered by tests


[warning] 482-483: zetaclient/orchestrator/orchestrator.go#L482-L483
Added lines #L482 - L483 were not covered by tests


[warning] 487-487: zetaclient/orchestrator/orchestrator.go#L487
Added line #L487 was not covered by tests


[warning] 514-515: zetaclient/orchestrator/orchestrator.go#L514-L515
Added lines #L514 - L515 were not covered by tests


[warning] 534-534: zetaclient/orchestrator/orchestrator.go#L534
Added line #L534 was not covered by tests


[warning] 544-545: zetaclient/orchestrator/orchestrator.go#L544-L545
Added lines #L544 - L545 were not covered by tests

zetaclient/chains/bitcoin/bitcoin.go

[warning] 147-147: zetaclient/chains/bitcoin/bitcoin.go#L147
Added line #L147 was not covered by tests


[warning] 176-176: zetaclient/chains/bitcoin/bitcoin.go#L176
Added line #L176 was not covered by tests

zetaclient/chains/base/signer.go

[warning] 116-120: zetaclient/chains/base/signer.go#L116-L120
Added lines #L116 - L120 were not covered by tests


[warning] 122-137: zetaclient/chains/base/signer.go#L122-L137
Added lines #L122 - L137 were not covered by tests


[warning] 139-142: zetaclient/chains/base/signer.go#L139-L142
Added lines #L139 - L142 were not covered by tests


[warning] 144-152: zetaclient/chains/base/signer.go#L144-L152
Added lines #L144 - L152 were not covered by tests


[warning] 155-160: zetaclient/chains/base/signer.go#L155-L160
Added lines #L155 - L160 were not covered by tests


[warning] 164-165: zetaclient/chains/base/signer.go#L164-L165
Added lines #L164 - L165 were not covered by tests


[warning] 169-171: zetaclient/chains/base/signer.go#L169-L171
Added lines #L169 - L171 were not covered by tests

zetaclient/chains/solana/signer/signer.go

[warning] 118-120: zetaclient/chains/solana/signer/signer.go#L118-L120
Added lines #L118 - L120 were not covered by tests


[warning] 123-123: zetaclient/chains/solana/signer/signer.go#L123
Added line #L123 was not covered by tests

🔇 Additional comments (28)
zetaclient/chains/evm/evm.go (3)

36-36: Removed processor parameter looks consistent.
By removing the proc *outboundprocessor.Processor parameter from the constructor, you simplify dependencies and ensure that outbound processing is handled solely by the signer. This declutters the interface and promotes a more cohesive design.


166-166: Add test coverage for outbound ID generation.
The new line using base.OutboundIDFromCCTX is untested according to coverage reports. Even though this function is relatively straightforward, consider adding a test to confirm correct IDs for various scenarios, such as edge cases involving different chain parameters.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 166-166: zetaclient/chains/evm/evm.go#L166
Added line #L166 was not covered by tests


191-191: Test IsOutboundActive usage.
Line 191 calls e.signer.IsOutboundActive to check for active outbounds. Ensure that there's a dedicated test verifying that calls to IsOutboundActive accurately reflect the updated state in different concurrency scenarios.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 191-191: zetaclient/chains/evm/evm.go#L191
Added line #L191 was not covered by tests

zetaclient/orchestrator/orchestrator.go (8)

429-431: Improve testing for observer type checks.
These lines ensure the observer is indeed a Solana observer. Please add tests to confirm that an error is correctly logged when the observer is of an unexpected type, ensuring robust defensive checks.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 429-431: zetaclient/orchestrator/orchestrator.go#L429-L431
Added lines #L429 - L431 were not covered by tests


436-442: Validate Solana signer in tests.
Here, the additional type check for a Solana signer helps prevent incorrect usage. Consider writing negative tests to confirm that an error is emitted when a signer is not of the correct type.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 436-442: zetaclient/orchestrator/orchestrator.go#L436-L442
Added lines #L436 - L442 were not covered by tests


454-454: Outbound ID creation for Solana.
Ensure base.OutboundIDFromCCTX(cctx) logic is covered by unit tests for the Solana flow, verifying that each portion of the ID (index, receiver chain ID, nonce) is correctly derived.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 454-454: zetaclient/orchestrator/orchestrator.go#L454
Added line #L454 was not covered by tests


482-483: Add test to verify active outbound skipping.
Skipping outbound processing when solSigner.IsOutboundActive(outboundID) is true is important to avoid re-processing. Implement a test confirming this logic is triggered correctly.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 482-483: zetaclient/orchestrator/orchestrator.go#L482-L483
Added lines #L482 - L483 were not covered by tests


487-487: Include coverage for concurrency edge cases in TryProcessOutbound.
Line 487 launches TryProcessOutbound asynchronously. Validate concurrency aspects by testing multiple simultaneous outbound attempts, ensuring no race conditions occur.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 487-487: zetaclient/orchestrator/orchestrator.go#L487
Added line #L487 was not covered by tests


514-515: Validate TON signer type checks.
As with the Solana code path, verifying that the signer is indeed a TON signer prevents misuse. Add a targeted test to confirm that an error is handled gracefully for invalid signers.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 514-515: zetaclient/orchestrator/orchestrator.go#L514-L515
Added lines #L514 - L515 were not covered by tests


534-534: Include test coverage for TON outbound ID generation.
Line 534 calls base.OutboundIDFromCCTX; you should validate correctness in the TON integration tests as well, guarding against unexpected parameter mismatches.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 534-534: zetaclient/orchestrator/orchestrator.go#L534
Added line #L534 was not covered by tests


544-545: Confirm correctness of IsOutboundActive for TON.
When tonSigner.IsOutboundActive(outboundID) returns true, the code correctly skips processing. A thorough test would confirm that re-processing never occurs prematurely.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 544-545: zetaclient/orchestrator/orchestrator.go#L544-L545
Added lines #L544 - L545 were not covered by tests

zetaclient/chains/base/signer.go (8)

4-4: Imports aligned with new functionalities.
The newly introduced imports (fmt, time, github.com/zeta-chain/node/x/crosschain/types) are cleanly integrated without extraneous overhead. Good job keeping them concise.

Also applies to: 6-6, 11-11


31-32: Add concurrency-based tests for activeOutbounds.
The activeOutbounds map is a straightforward approach to track active outbounds, but concurrency testing is crucial. Confirm that two concurrent calls updating the same outbound ID handle the mutex properly.

Also applies to: 51-51


114-114: Blank line changes.
No functional changes were made on line 114.


122-137: Highlight time of activation for debugging.
Logging the timestamp on activation is helpful for diagnosing outbound latencies. Consider adding a structured test verifying that the logger message matches the tracked time for newly activated outbounds.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 122-137: zetaclient/chains/base/signer.go#L122-L137
Added lines #L122 - L137 were not covered by tests


139-142: Ensure found check is tested.
These lines handle the scenario where the outbound isn't even tracked. A test verifying that calling MarkOutbound(..., false) on untracked IDs is safe would be valuable.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 139-142: zetaclient/chains/base/signer.go#L139-L142
Added lines #L139 - L142 were not covered by tests


155-160: Simple concurrency check for IsOutboundActive.
This method looks safe under a locked section. Consider a small concurrency test verifying no data race if multiple goroutines call IsOutboundActive simultaneously on the same or different IDs.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 155-160: zetaclient/chains/base/signer.go#L155-L160
Added lines #L155 - L160 were not covered by tests


163-167: Test malformed index values in OutboundID.
A quick negative test for unexpected or malformed indexes (like an empty string) ensures robust ID generation.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 164-165: zetaclient/chains/base/signer.go#L164-L165
Added lines #L164 - L165 were not covered by tests


169-172: Coverage for OutboundIDFromCCTX.
Although straightforward, add a test for cross-checking the correct combination of Index, ReceiverChainId, and TssNonce from cctx objects.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 169-171: zetaclient/chains/base/signer.go#L169-L171
Added lines #L169 - L171 were not covered by tests

zetaclient/chains/evm/signer/signer_test.go (1)

152-152: Use updated signature for TryProcessOutbound gracefully.
This invocation aligns with the newly updated method signature that no longer requires the outbound processor argument. Consider adding assertions to confirm that the function updates outbound state or produces expected signals.

zetaclient/chains/bitcoin/bitcoin.go (3)

14-14: New import usage is appropriate.
Introducing the base package appears necessary for OutboundIDFromCCTX.


26-26: Constructor simplified by removing the processor argument.
Eliminating the proc parameter helps reduce complexity and aligns with the new pattern of delegating outbound responsibilities to the signer.


176-176: Lack of coverage for IsOutboundActive check.
This branch is crucial for preventing concurrent or duplicate processing. Adding test coverage here helps ensure outbound concurrency control remains correct over time.

Please confirm if you want additional guidance on extending your tests to exercise this condition.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 176-176: zetaclient/chains/bitcoin/bitcoin.go#L176
Added line #L176 was not covered by tests

zetaclient/chains/ton/signer/signer_test.go (1)

75-75: nil chain observer argument in TryProcessOutbound.
Make sure passing nil for interfaces.ChainObserver is valid and won't cause downstream issues. If the observer is optional, confirm you have adequate test coverage for that scenario.

zetaclient/chains/ton/signer/signer.go (1)

81-83: Mark outbound as active within a proper deferred unmark.
This pattern clearly indicates when outbound processing begins and ends, improving concurrency safety. Ensure no race conditions occur if multiple goroutines invoke this logic concurrently.

zetaclient/chains/solana/signer/signer.go (1)

118-120: Add test coverage for new outbound tracking logic
These lines introduce important state changes (MarkOutbound(outboundID, true)), which appear untested according to the coverage report. Please add or expand unit tests to confirm that marking outbound as active functions correctly under normal conditions and error scenarios.

I can help create the necessary test cases or open a new issue for tracking if you’d like.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 118-120: zetaclient/chains/solana/signer/signer.go#L118-L120
Added lines #L118 - L120 were not covered by tests

zetaclient/chains/bitcoin/signer/signer.go (1)

283-285: Enhance test coverage for added outbound ID tracking
Similar to the Solana signer, these new lines for marking outbounds should be tested to ensure stability and correctness.

Happy to assist you in writing or enhancing the relevant tests to verify that outbounds are marked active accurately.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 283-285: zetaclient/chains/bitcoin/signer/signer.go#L283-L285
Added lines #L283 - L285 were not covered by tests

zetaclient/chains/evm/signer/signer.go (1)

244-246: Provide test coverage for outbound tracking logic
Lines 244 to 246 introduce a new outbound state transition. It’s best practice to confirm that tests encompass these changes to prevent regressions.

I can help prepare tests to validate that MarkOutbound(outboundID, true) behaves as expected in various scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move outboundprocessor logic to base signer
1 participant