nodejs-pool icon indicating copy to clipboard operation
nodejs-pool copied to clipboard

PPLNS does not payout full block reward when pool is new (under N*diff shares)

Open plavirudar opened this issue 7 years ago • 2 comments

When the pool has under N*blockDiff shares total, the PPLNS payout system only pays out totalShares/(N*blockDiff) of the block reward, instead of the entire block reward.

This is an issue for a pool that finds blocks before N*diff shares are submitted to the pool, and will result in incorrect calculation of payouts.

From what I can see, blockManager.js does the following: 1: Start from share at the block that was found, load every single share and iterate back across blockchain

2: Payout shareDiff / N*blockDiff proportion of the rewardTotal

let amountToPay = Math.floor((shareData.shares / blockDiff*global.config.pplns.shareMulti)) * rewardTotal);

3: Iterate through the whole blockchain of shares until reward is completely distributed, after the reward is distributed any further shares will not have payments.

In this case, if there are less than N*blockDiff total shares, the payout will not be 100% and will be proportionately lower.

I propose that in such cases, the payout should be multiplied to ensure 100% of it goes through.

plavirudar avatar Mar 02 '18 21:03 plavirudar

Compare blockManager from github.com/ArqTras I make a bit different way to deploy coins and can’t merge it in to snippa repo. Second block, with higher effort should solve your problem

ArqTras avatar Mar 05 '18 18:03 ArqTras

@ArqTras Second block will not solve the problem if the sum of the first 3 blocks is still below 200% block diff of the 3rd block. Until cumulative effort hits 200% of block diff, the shares will remain underpaid.

plavirudar avatar Mar 05 '18 21:03 plavirudar