jtoomim / p2pool

Peer-to-peer Bitcoin mining pool
https://github.com/jtoomim/p2pool/
GNU General Public License v3.0
37 stars 45 forks source link

Displaying low-power miners #55

Open Mezantrop74 opened 3 years ago

Mezantrop74 commented 3 years ago

Hello. How to implement the display of the work of low-power miners? For example, if a miner has a capacity of only 100 megahashes, it connects and does the work, but the pool itself does not see it and does not display statistics on it. How to make it display statistics?

mansilladev commented 2 years ago

Hi @Mezantrop74. Know this is an old issue, but its in the vein of something that I've been pondering around low-hash miners and variable difficulty. But I digress..

So, back to your question -- all miners and stats are reflected in the graphs, despite their hashrate (even if its super low). For example, on the Hyperdonkey P2Pool LTC/Doge merge mining node, the graphs and stats JSON shows all miners, even those with the lowest hashrates:

Perhaps you're looking at some type of third-party web interface that might be filtering those out.. but as far as p2pool node, the data is there for all miners.

jtoomim commented 2 years ago

tl;dr: The stratum difficulty (pseudoshare difficulty) for your miner is probably too high. if you wait a while (an hour or so?), a low-hashrate miner will eventually get a reasonable difficulty, and will show up in stats. You can also accelerate this process by using the +diff setting to manually set difficulty to something reasonable. For a LTC miner with 100 MH/s, a difficulty around 1k to 10k might work. You use the +diff setting by appending it to your stratum username, e.g. YOURPAYOUTADDRESS.WORKERNAME+3000. Low settings will use more bandwidth and CPU power while giving higher accuracy on the node stats graphs.

Context: There's an issue with share difficulty assignment. The node has very little idea of what difficulty to assign to each miner, and if the node guesses too low, it can overwhelm the node with shares to process and can saturate the CPU (which makes the node hang for all miners), so when miners first connect the node assigns a difficulty that is based on the total p2pool network hashrate. Difficulty is adjusted on occasion to target a certain stratum share rate (3 seconds per share per worker by default), but only when the worker returns a share. The code really ought to be rewritten so that difficulty is changed every n seconds even if no shares are returned, but I didn't do this because I was lazy.