node-open-mining-portal
node-open-mining-portal copied to clipboard
Add MPOS SSO DB Compatibility
@HashUnlimited @zone117x merge?
There’s a problem with MPOS always taking the diff from pool_workers and using it for hashrate calculations. Seb is out of the game already so we need to take care.
This PR just sticks with the current behaviour in regards to the diff. Lets work through it step by step. This would fix the SSO Support. and then we can fix MPOS's hashrate calcs in another PR
So what issue do you see in SSO? Maybe I don’t get it
Edit: for my understanding you would update the shared db on worker diff change. That’d be good for single pools on pushpoold but on setups like ours just letting MPOS handle the frontend it would basically result in altered dashboard values?
MPOS Supports SSO for accounts and workers correct? This was a new feature developed before myself with stratum-mining and @zone117x with nomp added support for it.
So the problem lies here:
MPOS set to SSO on workers will add all the workers to the SSO db but expect shares in the normal DB. So NOMP will either submit shares to the wrong db or look for workers in the wrong db.
Another one is accounts. If NOMP is set to auto create workers it'll look in the db specified in the config which wont be the SSO db for the reasons specified above. So it'll think the user doesnt exist and wont create the account.
Check the Comments on the commit. I've described the changes there
Exactly. So for SSO to function correctly, the way is to set up the MPOS config for shared but leave out the workers table. That’s tbd by user. Was playing with the topic just yesterday, Seb isn’t totally aware. Going to update the wiki and a PR removing the workers example. Clean up and remove the code as well.
It also means disabling the autoCreateWorkers option of NOMP
So what is the approach? I still don’t get it. Do you simply want workers getting copied across the pools?
I guess we both are just thinking from different sides, you might want to find a solution so MPOS is handling the worker updates when configured as SSO and I am thinking from the MPOS side
Okay lets step through it. What's the issue with MPOS?
I am not 100% sure about the dashboard but the admin panel and statistics are checking the worker table for update. In general, sharing workers across pools is a bad idea at all:
- Updating a worker on one pool will disconnect miners on any other pool where it's used
- Statistics per worker aren't useful when the worker is shared
Is there on the other side any useful aspect in sharing workers nowadays?
The idea behind it when it was developed was that someone could use the same worker on various different pools. a common concept was that people used the
Updating a worker on one pool shouldn't disconnect a worker on any other pool. Also you're correct re: statistics per worker. With SSO we should use the central DB for verifying the workers, while inputting the difficulty and statistics info into the coin DB.
Sorry, I have been busy recently.... how about we create a dev_dev branch and check the things through?
sure thats fine by me
After long long time working on main net, we finally found some time to test this on a test pool :-) As expected, the result is not how I (personally) would prefer to run my pool cluster, but on the other hand side there's no negative impact if handled correctly. A few lines of documentation would be nice, what are your thoughts @zone117x ? I'd say give it a go.
Doesn't this need some checks for the new mposMode configuration property so existing setups aren't broken? Looks good if we get those checks and a bit of documentation for the new configuration.
Existing installations would need to add the shared_database
to their config. Actually good practise would be to fall back to the standard database if this doesn't exist in the file. The example config should be updated as well, @ahmedbodi could you maybe tweak a little more?
[edit:] We might also keep in mind, that MPOS allows the configuration of the shared DB per table, it would probably be a good idea to go with that flexibility as well so it's up to the user if he wants to work with shared accounts only or workers as well.
I'll try and find some time to get this done
It doesn't work :(