-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cherry pick changes from #1 and #7 #27
Conversation
WalkthroughWalkthroughThe changes involve significant modifications to the handling of streams and message processing within the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Communication
participant PartyCoordinator
participant TssServer
Client->>Communication: Send Message
Communication->>PartyCoordinator: Process Message
PartyCoordinator->>Communication: Reset Stream
Communication->>Communication: Wait for Channel (10s)
alt Timeout
Communication->>Client: Log Warning
else Success
Communication->>PartyCoordinator: Forward Message
end
TssServer->>PartyCoordinator: Key Sign Request
PartyCoordinator->>TssServer: Release Streams
TssServer->>PartyCoordinator: Remove Peer Group
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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, codebase verification and nitpick comments (1)
p2p/communication.go (1)
180-189
: Enhanced error handling and resource management in message processing.The modifications in the
readFromStream
method, specifically the use ofstream.Reset()
at line 180 and the introduction of a timeout mechanism at lines 184-189, are well-thought-out improvements. These changes enhance the robustness and reliability of the communication process by ensuring resources are not wasted and the system remains responsive.Consider adding more detailed logging at each step of the new timeout mechanism to aid in debugging and ensure that any issues can be traced more effectively.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- p2p/communication.go (1 hunks)
- p2p/party_coordinator.go (6 hunks)
- tss/keysign.go (1 hunks)
Additional comments not posted (2)
tss/keysign.go (1)
222-223
: Proper placement of peer group cleanup.The addition of
t.partyCoordinator.RemovePeerGroup(msgID)
at line 223 is correctly placed within thedefer
block to ensure cleanup is handled after stream releases. This change aligns with the PR's objectives to enhance resource management.Please verify that the removal of peer groups does not interfere with ongoing operations that might still need access to these groups. This can be done by reviewing all usages of peer groups across the application to ensure there are no unintended side effects.
p2p/party_coordinator.go (1)
75-75
: Stream management improvements and method renaming.The changes to use
stream.Reset()
in various methods (lines 75, 98, 134) and the renaming ofremovePeerGroup
toRemovePeerGroup
(line 185) are well-implemented. These modifications enhance the robustness of stream management and improve the code's readability and maintainability by adhering to Go's naming conventions.Ensure that the new stream handling logic is consistently applied across all relevant parts of the application to maintain uniformity and prevent any potential issues related to stream management.
Also applies to: 98-98, 134-134, 185-185
Cherry pick some missing
_ = stream.Close()
from #1.From #7:
_ = stream.Close()
to_ = stream.Reset()
removePeerGroup
public and calling it during other cleanup logicSummary by CodeRabbit
New Features
Bug Fixes
Refactor