From 257010f6a4f92e9ce18f41810b6eaa082a96ff80 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 3 Apr 2014 14:37:55 -0600 Subject: [PATCH] Added low share diff tolerance. --- README.md | 51 ++++++++++++++++-------------- libs/poolWorker.js | 2 +- pool_configs/litecoin_example.json | 16 ++++++---- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index cfb8e7c..fbafa84 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,34 @@ Description of options: "enabled": true, //Set this to false and a pool will not be created from this config file "coin": "litecoin.json", //Reference to coin config file in 'coins' directory + "address": "mi4iBXbBsydtcc5yFmsff2zCFVX4XG7qJc", //Address to where block rewards are given + + "blockRefreshInterval": 1000, //How often to poll RPC daemons for new blocks, in milliseconds + + /* How many milliseconds should have passed before new block transactions will trigger a new + job broadcast. */ + "txRefreshInterval": 20000, + + /* Some miner software is bugged and will consider the pool offline if it doesn't receive + anything for around a minute, so every time we broadcast jobs, set a timeout to rebroadcast + in this many seconds unless we find a new job. Set to zero or remove to disable this. */ + "jobRebroadcastTimeout": 55, + + //instanceId: 37, //Recommend not using this because a crypto-random one will be generated + + /* Some attackers will create thousands of workers that use up all available socket connections, + usually the workers are zombies and don't submit shares after connecting. This feature + detects those and disconnects them. */ + "connectionTimeout": 600, //Remove workers that haven't been in contact for this many seconds + + /* Sometimes you want the block hashes even for shares that aren't block candidates. */ + "emitInvalidBlockHashes": false, + + /* We use proper maximum algorithm difficulties found in the coin daemon source code. Most + miners/pools that deal with scrypt use a guesstimated one that is about 5.86% off from the + actual one. So here we can set a tolerable threshold for if a share is slightly too low + due to mining apps using incorrect max diffs and this pool using correct max diffs. */ + "shareVariancePercent": 10, /* This determines what to do with submitted shares (and stratum worker authentication). You have two options: @@ -249,29 +277,6 @@ Description of options: } }, - "address": "mi4iBXbBsydtcc5yFmsff2zCFVX4XG7qJc", //Address to where block rewards are given - - "blockRefreshInterval": 1000, //How often to poll RPC daemons for new blocks, in milliseconds - - /* How many milliseconds should have passed before new block transactions will trigger a new - job broadcast. */ - "txRefreshInterval": 20000, - - /* Some miner software is bugged and will consider the pool offline if it doesn't receive - anything for around a minute, so every time we broadcast jobs, set a timeout to rebroadcast - in this many seconds unless we find a new job. Set to zero or remove to disable this. */ - "jobRebroadcastTimeout": 55, - - //instanceId: 37, //Recommend not using this because a crypto-random one will be generated - - /* Some attackers will create thousands of workers that use up all available socket connections, - usually the workers are zombies and don't submit shares after connecting. This feature - detects those and disconnects them. */ - "connectionTimeout": 600, //Remove workers that haven't been in contact for this many seconds - - /* Sometimes you want the block hashes even for shares that aren't block candidates. */ - "emitInvalidBlockHashes": false, - /* If a worker is submitting a high threshold of invalid shares we can temporarily ban them to reduce system/network load. Also useful to fight against flooding attacks. */ "banning": { diff --git a/libs/poolWorker.js b/libs/poolWorker.js index 97d2283..d288375 100644 --- a/libs/poolWorker.js +++ b/libs/poolWorker.js @@ -126,7 +126,7 @@ module.exports = function(logger){ if (isValidShare) - logger.debug(logSystem, logComponent, logSubCat, 'Share accepted at ' + data.difficulty + ' with diff ' + data.shareDiff + ' by ' + data.worker + ' [' + data.ip + ']' ); + logger.debug(logSystem, logComponent, logSubCat, 'Share accepted at diff ' + data.difficulty + ' with diff ' + data.shareDiff + ' by ' + data.worker + ' [' + data.ip + ']' ); else if (!isValidShare) logger.debug(logSystem, logComponent, logSubCat, 'Share rejected: ' + shareData); diff --git a/pool_configs/litecoin_example.json b/pool_configs/litecoin_example.json index 044a1e9..e11b945 100644 --- a/pool_configs/litecoin_example.json +++ b/pool_configs/litecoin_example.json @@ -2,6 +2,14 @@ "enabled": false, "coin": "litecoin.json", + "address": "n4jSe18kZMCdGcZqaYprShXW6EH1wivUK1", + "blockRefreshInterval": 1000, + "txRefreshInterval": 20000, + "jobRebroadcastTimeout": 55, + "connectionTimeout": 600, + "emitInvalidBlockHashes": false, + "shareVariancePercent": 15, + "shareProcessing": { "internal": { "enabled": true, @@ -35,12 +43,6 @@ } }, - "address": "n4jSe18kZMCdGcZqaYprShXW6EH1wivUK1", - "blockRefreshInterval": 1000, - "txRefreshInterval": 20000, - "jobRebroadcastTimeout": 55, - "connectionTimeout": 600, - "banning": { "enabled": true, "time": 600, @@ -61,7 +63,7 @@ } }, "3032": { - "diff": 16 + "diff": 8 }, "3256": { "diff": 256