Skip to content

Conversation

@kevinssgh
Copy link
Contributor

  • Modified unit test
  • Modified error handling for 3 communication components: p2p comms, signature notifier, party coordinator

@kevinssgh kevinssgh requested a review from brewmaster012 March 17, 2023 16:59
n, ok := s.notifiers[msg.ID]
if !ok {
logger.Debug().Msgf("notifier for message id(%s) not exist", msg.ID)
_ = stream.Close()
Copy link
Collaborator

@brewmaster012 brewmaster012 Mar 17, 2023

Choose a reason for hiding this comment

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

if stream was not closed here, then will it be eventually closed? @kevinssgh

Copy link
Contributor Author

@kevinssgh kevinssgh Mar 17, 2023

Choose a reason for hiding this comment

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

Yes only once all the goroutines have finished here:
https://github.com/brewmaster012/go-tss/blob/8f5e91b0ad5b8cd29caa05408edfcf44cd97dfff/tss/keysign.go#L282

The streams from the 3 components get released in the defer line here:
https://github.com/brewmaster012/go-tss/blob/8f5e91b0ad5b8cd29caa05408edfcf44cd97dfff/tss/keysign.go#L214

I believe the issue was with these streams being open unnecessarily for too long.

Copy link
Collaborator

@brewmaster012 brewmaster012 Mar 17, 2023

Choose a reason for hiding this comment

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

hmm.. any idea as to why we have "deadlock" if the streams get eventually released?
is it because once stream is exhausted, the "release" functions get deadlocked somehow because no progress can be made otherwhere? @kevinssgh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not certain that it is exactly a deadlock. It seems like the P2P layer is blocking certain protocols while the streams are open for too long. Even though they are released eventually the lower level blocks the communication protocol.

@brewmaster012
Copy link
Collaborator

Also what is the purpose of the "UNKNOWN" streams? Why are they not immediately closed?
In my test 5tx/block 10% random fail rate, the number of UNKNOWN streams could get dangerously high to ~500
@kevinssgh

@brewmaster012 brewmaster012 self-requested a review March 17, 2023 20:54
Copy link
Collaborator

@brewmaster012 brewmaster012 left a comment

Choose a reason for hiding this comment

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

can't break it anymore!

@kevinssgh
Copy link
Contributor Author

The purpose of those UNKNOWN streams is mainly for incoming connections that aren't associated with a party or message id. I noticed that there was a bug where they weren't deleted from the stream map, that was something else I fixed as well but not sure if it had a direct impact.

@kevinssgh kevinssgh merged commit fb3ceba into master May 11, 2023
gartnera added a commit that referenced this pull request Sep 7, 2024
gartnera added a commit that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants