Bug: Tampered message when a node disconnect and rejoin
This doesn't happen all the time but we disconnect and rejoin multiple times then we will encounter this error
cc @nann-cheng , I'm debugging this
Cause of bug:
You set
exchangeComplete: make(chan struct{}, 1),
While, e.exchangeComplete <- struct{}{} is signaled in ecdh message listener, thus, after the second time this signal is invoked, without WaitForExchangeComplete consuming it, it will block the message receiver forever, thus preventing old nodes from receiving correct symmetric key.
my bad. thanks for help debugging this
fix in https://github.com/fystack/mpcium/pull/95