Closed emlautarom1 closed 1 month ago
The current SafeEthClient is prone to race conditions:
SafeEthClient
https://github.com/NethermindEth/near-sffl/blob/4dabcd9eca5a1b3df98957913b93d26914b20c9c/core/safeclient/client.go#L303-L313
It's possible for two threads to run CLose simultaneously while c.close == false. Then, both threads will close the c.closeC channel triggering a panic due to double-closing.
CLose
c.close == false
close
c.closeC
The current
SafeEthClient
is prone to race conditions:https://github.com/NethermindEth/near-sffl/blob/4dabcd9eca5a1b3df98957913b93d26914b20c9c/core/safeclient/client.go#L303-L313
It's possible for two threads to run
CLose
simultaneously whilec.close == false
. Then, both threads willclose
thec.closeC
channel triggering a panic due to double-closing.