node-open-mining-portal icon indicating copy to clipboard operation
node-open-mining-portal copied to clipboard

Add MPOS SSO DB Compatibility

Open ahmedbodi opened this issue 6 years ago • 20 comments

ahmedbodi avatar Jun 24 '18 00:06 ahmedbodi

@HashUnlimited @zone117x merge?

ahmedbodi avatar Jul 10 '18 22:07 ahmedbodi

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.

HashUnlimited avatar Jul 10 '18 23:07 HashUnlimited

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

ahmedbodi avatar Jul 10 '18 23:07 ahmedbodi

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?

HashUnlimited avatar Jul 10 '18 23:07 HashUnlimited

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.

ahmedbodi avatar Jul 10 '18 23:07 ahmedbodi

Check the Comments on the commit. I've described the changes there

ahmedbodi avatar Jul 10 '18 23:07 ahmedbodi

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.

HashUnlimited avatar Jul 10 '18 23:07 HashUnlimited

It also means disabling the autoCreateWorkers option of NOMP

ahmedbodi avatar Jul 10 '18 23:07 ahmedbodi

So what is the approach? I still don’t get it. Do you simply want workers getting copied across the pools?

HashUnlimited avatar Jul 10 '18 23:07 HashUnlimited

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

HashUnlimited avatar Jul 10 '18 23:07 HashUnlimited

Okay lets step through it. What's the issue with MPOS?

ahmedbodi avatar Jul 11 '18 20:07 ahmedbodi

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?

HashUnlimited avatar Jul 12 '18 07:07 HashUnlimited

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 .1 worker on every pool they were using. One of the other main reasons for this is "multipools" many of which are based on MPOS. The only exceptions i know of are YIIMP based ones which seem extremely popular. and Multipool.us and IPOMiner which are based on an ancient software called simplecoin which they updated themselves. The way they work is having the central db contain the workers and then just working round robin between the stratum instances based on the profitability.

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.

ahmedbodi avatar Jul 12 '18 14:07 ahmedbodi

Sorry, I have been busy recently.... how about we create a dev_dev branch and check the things through?

HashUnlimited avatar Jul 19 '18 10:07 HashUnlimited

sure thats fine by me

ahmedbodi avatar Jul 22 '18 19:07 ahmedbodi

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.

HashUnlimited avatar Sep 10 '18 07:09 HashUnlimited

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.

zone117x avatar Sep 10 '18 19:09 zone117x

Existing installations would need to add the shared_databaseto 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.

HashUnlimited avatar Sep 11 '18 05:09 HashUnlimited

I'll try and find some time to get this done

ahmedbodi avatar Sep 12 '18 18:09 ahmedbodi

It doesn't work :(

le2Ks avatar May 28 '21 01:05 le2Ks