shutter-network / rolling-shutter

Rolling Shutter is an MEV protection system to be plugged into rollups.
https://twitter.com/project_shutter/
26 stars 7 forks source link

Don't close channels as receivers #470

Closed jannikluhn closed 1 day ago

jannikluhn commented 2 days ago

In many places in the code, a receiver creates a channel, passes it to the sender, and closes it on shutdown. This sometimes results in panics due to sends on a closed channel, because the receiver oftentimes cannot guarantee that the sender has stopped sending. In general, only the sender should close channels, and only if necessary in order to notify the receiver that no more elements are coming. To fix this, we just remove the close statements as they are not needed.

Closes #464. With this commit, I was unable to reproduce the error.