p2pool/networks.pyUnlike p2pool/bitcoin/networks.py some of the values here may be subjective and not clearly defined.
I will add my own personal comments to each setting. Please feel free to add your own or discuss opposing viewpoints.
For reference here is the section of the code for litecoin:
litecoin=math.Object(
PARENT=networks.nets['litecoin'],
SHARE_PERIOD=15, # seconds
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
TARGET_LOOKBEHIND=200, # shares
SPREAD=3, # blocks
IDENTIFIER='e037d5b8c6923410'.decode('hex'),
PREFIX='7208c1a53ef629b0'.decode('hex'),
P2P_PORT=9338,
MIN_TARGET=0,
MAX_TARGET=2**256//2**20 - 1,
PERSIST=True,
WORKER_PORT=9327,
BOOTSTRAP_ADDRS='forre.st vps.forre.st liteco.in 95.211.21.103 37.229.117.57 66.228.48.21 180.169.60.179 112.84.181.102 74.214.62.115 209.141.46.154 78.27.191.182 66.187.70.88 88.190.223.96 78.47.242.59 158.182.39.43 180.177.114.80 216.230.232.35 94.231.56.87 62.38.194.17 82.67.167.12 183.129.157.220 71.19.240.182 216.177.81.88 109.106.0.130 113.10.168.210 218.22.102.12 85.69.35.7:54396 201.52.162.167 95.66.173.110:8331 109.65.171.93 95.243.237.90 208.68.17.67 87.103.197.163 101.1.25.211 144.76.17.34 209.99.52.72 198.23.245.250 46.151.21.226 66.43.209.193 59.127.188.231 178.194.42.169 85.10.35.90 110.175.53.212 98.232.129.196 116.228.192.46 94.251.42.75 195.216.115.94 24.49.138.81 61.158.7.36 213.168.187.27 37.59.10.166 72.44.88.49 98.221.44.200 178.19.104.251 87.198.219.221 85.237.59.130:9310 218.16.251.86 151.236.11.119 94.23.215.27 60.190.203.228 176.31.208.222 46.163.105.201 198.84.186.74 199.175.50.102 188.142.102.15 202.191.108.46 125.65.108.19 15.185.107.232 108.161.131.248 188.116.33.39 78.142.148.62 69.42.217.130 213.110.14.23 185.10.51.18 74.71.113.207 77.89.41.253 69.171.153.219 58.210.42.10 174.107.165.198 50.53.105.6 116.213.73.50 83.150.90.211 210.28.136.11 86.58.41.122 70.63.34.88 78.155.217.76 68.193.128.182 198.199.73.40 193.6.148.18 188.177.188.189 83.109.6.82 204.10.105.113 64.91.214.180 46.4.74.44 98.234.11.149 71.189.207.226'.split(' '),
ANNOUNCE_CHANNEL='#p2pool-ltc',
VERSION_CHECK=lambda v: True,
VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.8.5.1!' if v < 80501 else None,
),
For now here are some of my notes (work in progress):
SHARE_PERIODSHARE_PERIOD sets a target time for how often to provide a share. It will regulating the difficulty to try to hit that target time taking into account the setting in TARGET_LOOKBEHIND.
A lower number will have the effect of a lower share difficulty but also result in a larger share chain depending on the value in CHAIN_LENGTH. It may also cause additional orphans in the p2pool share chain as too low a difficulty will mean multiple miners will find shares at the same time. Not necessarily a bad thing as your all working on finding the same block but the winning finder will get the credit for the share.
CommentI have seen people say a good rule of thumb is setting this to 1/5 of the altcoin block period. Too high a number will provide a higher diff share favoring higher hash rate miners. Too low a number increases resources (traffic, memory, storage) and orphans from competing miners finding the same shares. I believe setting this to 10 for most altcoins with block times of between 0.5 - 2 minutes is a good compromise.
CHAIN_LENGTHCHAIN_LENGTH is the number of shares p2pool keeps before discarding them. It needs to be larger than or equal to REAL_CHAIN_LENGTH (it is normally equal to). One reason it increase this would be to show more data in the recent blocks found list.
Example: 24*60*60//10 = 1 day of shares. 7*24*60*60//10 = 7 days of shares. [
verification needed]
REAL_CHAIN_LENGTHREAL_CHAIN_LENGTH sets the total number of previously found shares to include in the payout when a block is found. A longer chain provides a larger amount of time to find a share (get paid for work).
It also contributes to how long you need mine to reach your "full" payout amount.
Comment24*60*60//10 is calculated as follows:
(24*60*60)/10 = 8,640 shares are paid when a block is found.
Take the value in SHARE_PERIOD and multiply by the number of shares to find how many seconds a share is valid for.
For example:
8,640 shares will be paid with a share expected to be found every 10 seconds
8,640 * 10 = 86,400 seconds
86,400 / 60 = 1,440 minutes
1,440 / 60 = 24 hours
24 / 24 = 1 days
I have tried various REAL_CHAIN_LENGTH settings but have settled on 24*60*60//10 for the following reasons:
Allows a 24 hours period of time for finding of a share and for those shares to be valid based on having a share period of 10 seconds.
- Allows smaller miners time to find a share within 24 hours
- Amount of time to full payout increased but so does the time you continue to receive payment after you stop mining
- Takes longer to ramp up to your full payout amount but you continue to get paid for about the same amount of time after you stop mining. With a CHAIN_LENGTH setting of 24*60*60//10 I would say most miners reach their full payout between 6-8 hours and continue to receive a payout for about the same amount of time after they stop mining (depending on their hashrate and the setting in spread).
TARGET_LOOKBEHINDDetermines the number of shares counted for difficulty regulation.
Used to determine share difficulty based on the hash rate of p2pool (not individual nodes).
CommentSome people set this really low but I recommend it be kept at 200 as it will modify the share diff based on the previous 200 shares rather quickly. I think they believe it will take TARGET_LOOKBEHIND*SHARE_PERIOD='time it takes to adjust' but I feel it actually uses the last 200 shares and adjust based on the average. Setting too low a number does not give it a large enough number of shares to determine the proper value and adjust smoothly.With large miners coming and going the difficulty adjustment takes too long with 200 shares on smaller p2pool networks. On larger p2pool networks this is not noticeable but I have resulted to setting this to 20 to accommodate large miners coming and going.
SPREADSPREAD determines how many blocks (max) to pay if a miner finds at lease one share.
Does not go beyond the CHAIN_LENGTH/REAL_CHAIN_LENGTH setting.
Comment600/[block time]=x
x*3=spread
bitcoin SPREAD=3 block every 600 seconds Baseline
litecoin SPREAD=12 block every 150 seconds 600/150=4 4x3=12
bbqcoin SPREAD=30 block every 60 seconds 600/60=10 10x3=30
casinocoin SPREAD=60 block every 30 seconds 600/30=20 20x3=60
digitalcoin SPREAD=90 block every 20 seconds 600/20=30 30x3=90 (old spec)
digitalcoin SPREAD=45 block every 40 seconds 600/40=15 15x3=45 (new spec)
worldcoin SPREAD=120 block every 15 seconds 600/15=40 40x3=120 (old spec)
worldcoin SPREAD=60 block every 30 seconds 600/30=20 20x3=60 (new spec)
anoncoin SPREAD=10 block every 205 seconds 600/205=2.926829268292683 2.926829268292683x3=8.780487804878049
globalcoin SPREAD=45 block every 40 seconds 600/40=15 15x3=45
dogecoin SPREAD=30 block every 60 seconds 600/60=10 10x3=30
potcoin SPREAD=45 block every 40 seconds 600/40=15 15x3=45
craftcoin SPREAD=6 block every 300 seconds 600/300=2 2x3=6 (old spec)
craftcoin SPREAD=30 block every 60 seconds 600/60=10 10x3=30 (new spec)
nyancoin SPREAD=30 block every 60 seconds 600/60=10 10x3=30
It is not a hard limit # of blocks, it is the # times the average work required to solve a block. In other words, for a SPREAD=3 if the average time to block is 8 hours, then your shares will fall off the payout after 24 hours. So, if p2pool happens to get lucky and solve 10 blocks in that 24 hour period, your share will be paid for all 10 blocks.
--------------------
To generate unique values for IDENTIFIER and PREFIX create a random string of 19 numbers and convert to Hex.
I use the windows Programmer Calculator to do the conversion (View menu).
Example:
5486237465184378845 = 4C2307E841C11FDD
....more to come!