dominant-strategies / go-quai

Official Go Implementation of the Quai Network
GNU General Public License v3.0
2.37k stars 459 forks source link

[Core] ProcessingState should potentially only return true for Zones #1759

Open Djadih opened 3 months ago

Djadih commented 3 months ago

At least in LibP2P, every time we care about ProcessingState(), we also have to check that location.Context == common.ZONE_CTX, which seems redundant.

It would be better and more intuitive if ProcessingState only returned true for Zone anyway, since that is the only context for which there is state.

This would reduce code reuse and also prevent bugs from developers forgetting to double check context. However this is a very far-reaching change, the implications of which may be unknown.

mibuono commented 3 months ago

We need to be very sure before we do this.