openchia / pool

OpenChia.io Pool
GNU Affero General Public License v3.0
24 stars 8 forks source link

Switch from a lower difficulty to a higher one sometimes results in PROOF_NOT_GOOD_ENOUGH #12

Open ghost opened 2 years ago

ghost commented 2 years ago

I sometimes (occasionally) see PROOF_NOT_GOOD_ENOUGH when pool switches the farmer to a higher difficulty of partials. If openchia hasn't changes the code related to verification of partials, then this is a generic problem with https://github.com/Chia-Network/pool-reference.

The screenshot below shows an example (it isn't one of my farmers, I currently don't have such a screenshot of my farmer):

Screenshot_20220217_150619

william-gr commented 2 years ago

What makes you think its a pool problem, and not a client indeed not sending a good proof?

william-gr commented 2 years ago

I mean, at the moment the difficulty changes, the pool will no longer accept partials with lower difficulty and I don't really see a way around that. Do you have any ideas?

ghost commented 2 years ago

I am not sure. It looks like a race condition between the pool and the farmer/harvester.

The solution would be to find, and fix the race condition, for example by introducing or extending the time interval during which the pool still accepts the lower difficulty despite having switched to the higher difficulty. An interval of just a few seconds should be enough to fix the issue. If the pool receives a partial corresponding to the outdated lower difficulty, then the number of points added to the farmer's point balance should correspond to the lower difficulty (in the screenshot: at 12:05:25 AM the pool would add 375 points to farmer's balance, despite the current difficulty being 446).

The probability of seeing a PROOF_NOT_GOOD_ENOUGH like this one is very low, and if it stays very low the bug does not need to be fixed. In other words, there is currently no need to start working on a fix for this issue.

ghost commented 2 years ago

A new occurrence of this issue:

https://openchia.io/en/explorer/farmer/a6bb9ca38acef6b0b192d9282ab2d0d8be58046abb015aed4befccf121366a66

Screenshot_20220223_033254