NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
6 stars 3 forks source link

Standardize subscription error handling #183

Closed Hyodar closed 1 month ago

Hyodar commented 1 month ago

Now that all our subscriptions are made through a SafeEthClient, the only situations in which there is a subscription error are either when the client is being closed or the context is ended - both cases mean deliberately exiting (and in our case program exit). So, we can just standardize unsubbing and (if receiver) closing the channel whenever there is an error. Ideally none of these steps would be necessary and are functionally changing anything if we assume the unsubbing has already happened and the channel can be closed automatically on GC, but if there ever is some extra reason at least we're not leaking anything.