First I want to congratulate you with your one year anniversary!
Second I appreciate it very much you are looking into the details of the issue.
I have also done some calculations I see that the differences become smaller as the total amount of submitted shares grows.
Please let me show you what I mean:
Hope this helps to find out was has been gone wrong if wrong at all.
Thank you & wish you a long and happy continuation of ABCPool!
That's a helpful table right there
I was keeping a similar table myself, coming to the same conclusions: the difference has now stopped growing.
First: The issue is solved. Rest assured, balances have always displayed the right amount of earnings. The inaccurate share count built up until now remains though, because the over-counted shares remain in our historical records. It would be too time-consuming to correct these. From now on the reported number of shares will grow in the same pace as balances again.
The issue is something that has been affecting the share count of all miners for a while now as it turns out. Thanks to your attentiveness (and let's not forget, a long code review sesion by Chlorine and me!) share accrual is now finally accurate again. It was most likely over-counting between 0.5-2.0%, judging from a DB analysis.
As mentioned before, balance accrual is done directly from the submitted shares. Stats calculation on the other hand, is a separate multi-stage process where the shares get tossed around and massaged into various useful bits of information. These help us manage the pool, and help you manage your miners.
[i had typed up a detailed report here, but it has some technical details that may be helpful to attackers, so I've yanked it. The gist is: one of the stats-stages had a subtle bug which became an issue once the pool grew.]
So, thanks again Mykel, now I hope you may finally start to enjoy the pool for a bit!
MC