3d20e9c5123baee58091ab3d6a8f014aad7c68c7
Before, sends into the event buffer were not performed under mutex lock, meaning that the channel could be closed while a send is in progress, causing a panic. A relay flooding events while a Close was in progress could trigger a panic. Also, a slow consumer in addition to a flooding relay would cause the buffered pipe to grow unboundedly, which could cause memory to run out. Both of these were resolved by removing the buffered pipe altogether, sending directly into the events channel, and sending under mutex. The tradeoff we accept is that to secure the code against remote vulnerabilities and ensure no messages are dropped, the consumer must drain the subscription channels to prevent backpressure and deadlocks.
Prism - A Nostr Messaging Framework built on Honeybee
Languages
Go
99.5%
Shell
0.5%