Author

Topic: pool.yrral.net P2Pool backed mining pool ALPHA (Read 3187 times)

legendary
Activity: 1904
Merit: 1002
Here are the difficulty weighted share records for the 3 solved blocks this payout period.

Block Unix Timestamp: 1372321882 Total Payout: 0.11698405
Address                                                 shares  payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        219840  0.11688292
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ      190.217 0.00010113

Block Unix Timestamp: 1372496818 Total Payout: 0.09565966
Address                                                 shares  payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        127459  0.09322465
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ       3329.2  0.00243501

Block Unix Timestamp: 1372604666 Total Payout: 0.05891375
Address                                                 shares   payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        61423.7  0.05702005
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ      2039.95  0.0018937

Total confirmed payouts:
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        0.26712762
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ      0.00442984 + 0.00000042 = 0.00443026
Total                                                    0.27155788


Transaction ID: 2232dc36bad0c64c23f9b5ac48ad4fe692f4138ef565cfd90a8a4cc11bef017b

The pool has been down since noon EST on Saturday and will remain so for at least the rest of this week.
legendary
Activity: 1904
Merit: 1002
Sorry, no payout today.  P2Pool only found one block since the last payout, and it still needs another 33 confirms before it is spendable.  There will definitely be a payout Monday.  Thank you for your patience.  Hopefully p2pool will gain a larger share of mining with the new changes coming (longer share times which makes p2pool work better with some ASICs) and we can get back to solving more blocks.
legendary
Activity: 1904
Merit: 1002
That's okay since I don't plan to use 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ anymore and haven't for more than a week (that amount due is probably just from PPLNS carryover or whatever). I'll just use 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ from now on.

Sure, I'll make a note to add what I owe you in with the next payout to 1yrraL... I should have thought to just roll it in this time but I forgot you mentioned controlling both of those addresses.
full member
Activity: 121
Merit: 100
That's okay since I don't plan to use 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ anymore and haven't for more than a week (that amount due is probably just from PPLNS carryover or whatever). I'll just use 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ from now on.
legendary
Activity: 1904
Merit: 1002
Payout TxID: 23819c6456687172fb3f8f72cf0b99c0d01de06b77e4beb3183d48360923598a

I had to drop the payout to 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ since it is below the dust limit (If I include it most nodes won't forward my transaction and most miners won't include it).  If you send enough hashpower my way to earn more than the dust limit I will include the 0.00000042 BTC owed in your next payout.
legendary
Activity: 1904
Merit: 1002
I will send out the Monday payout soon after the latest block matures.  It is not yet spendable.  Details below.

Block Unix Timestamp: 1372020686 Total Payout: 0.15397766
Address                                                       shares       payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        358324      0.15169291
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ    0.999985   0.00000042
13WSYzi1h9S14oN7E8DGbGLk7vHoXC2x3W 174.207     0.00007375
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ         5221.76   0.00221058
legendary
Activity: 1904
Merit: 1002
You're welcome. Smiley One last thing—I haven't received anything on the 1yrraL address yet (the blockchain only shows a single .01 BTC transaction that I sent to myself for testing purposes), just the .12807 mBTC on 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ. Was this supposed to have been sent out already, or is it scheduled for the next payout cycle?

Next cycle.... unfortunately p2pool hasn't found a block yet Sad.  Terrible luck.  You can verify here: http://p2pool.info/
full member
Activity: 121
Merit: 100
You're welcome. Smiley One last thing—I haven't received anything on the 1yrraL address yet (the blockchain only shows a single .01 BTC transaction that I sent to myself for testing purposes), just the .12807 mBTC on 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ. Was this supposed to have been sent out already, or is it scheduled for the next payout cycle?
legendary
Activity: 1904
Merit: 1002
I'm going to say the timestamps sound about right. So it looks like I started mining only just before that last block was hit—for the four previous blocks I was on p2pool and already got paid for those. I didn't realize that.

So based on that, the payout listed for 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ sounds like it's probably reasonable.

Good.  At least you didn't completely miss out on that luck streak.  The time to find a block is up to 39 hours, but we should get at least one block before payout time on Monday.  Thank your for helping me test and giving me reason to triple check my calculations.
full member
Activity: 121
Merit: 100
I'm going to say the timestamps sound about right. So it looks like I started mining only just before that last block was hit—for the four previous blocks I was on p2pool and already got paid for those. I didn't realize that.

So based on that, the payout listed for 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ sounds like it's probably reasonable.
legendary
Activity: 1904
Merit: 1002
Hmm, I'm actually 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ—I received exactly .00012807 BTC on this address.
And indeed, I was mining during the entire last several days, as far as I know.

Edit: I just checked, and it turns out I very briefly mined using 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ at the beginning. This was for a very short period (no more than a few hours or so), then I switched to the address I mentioned above for the remainder of the time.

The first share I see from you is timestamped Tue, 18 Jun 2013 00:24:04 GMT (to the 1Q address, the first share from 1yrraL was Tue, 18 Jun 2013 01:23:08 GMT)
The 5th block was found 2013-06-18 00:55:45 and the others were found on the 17th, according to https://blockchain.info/address/1B1kSM3KfcP9BvGDC1G3cxZAV9LbxovpQi

As for shares since then, here is why I am expecting if a block were paid out now:
Total Payout: 0.155
Address                                                        shares       payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr         202136      0.15096917
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ    0.999985    0.00000075
13WSYzi1h9S14oN7E8DGbGLk7vHoXC2x3W  174.207     0.00013011
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ          5221.76    0.00389997

Is that more in line with your expectations?  Do you disagree with either the timing of your mining or the blocks (I don't see anywhere where it specifies it is using UTC, but it appears so).
full member
Activity: 121
Merit: 100
Okay, it turns out I was mining with two different addresses. .00012807 was received via 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ—I was mining with this address for a very short period at the very beginning (no more than a few hours). Then I switched to 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ and used that one for the remainder of the entire period.

So I got the payment via 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ, but not for 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ.

Hmm, I'm actually 1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ—I received exactly .00012807 BTC on this address.
And indeed, I was mining during the entire last several days, as far as I know.

Edit: I just checked, and it turns out I very briefly mined using 1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ at the beginning. This was for a very short period (no more than a few hours or so), then I switched to the address I mentioned above for the remainder of the time.
legendary
Activity: 1904
Merit: 1002
Unfortunately, my payout was more than 250 times less than expected. Mining directly on p2pool, I was getting about .005–.008 BTC per block. Here, the total payout for those five blocks was .00012807. Maybe I'm missing something?

1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ 8.04828  0.00012807

If this is you, you only got credit for part of the last block.

You can see the timestamps on the blocks here: http://blockexplorer.com/address/1B1kSM3KfcP9BvGDC1G3cxZAV9LbxovpQi

If you were indeed mining during all 5, I may have a timezone issue.  Let me know and I'll check.  If there is an issue, I will credit you what you are due.
full member
Activity: 121
Merit: 100
Unfortunately, my payout was more than 250 times less than expected. Mining directly on p2pool, I was getting about .005–.008 BTC per block. Here, the total payout for those five blocks was .00012807. Maybe I'm missing something?
legendary
Activity: 1904
Merit: 1002
No new blocks, payout made as above:
https://blockchain.info/tx/cc4ea45a7c05129c29b87bb8a2fbc71c558652f4da1ce015c3eb9569d5b3e9cd

Next payout will be Monday at noon EST.
legendary
Activity: 1904
Merit: 1002
Here are the difficulty weighted share records for the 5 solved blocks so far.  Unless p2pool solves another block, the total below will be the payout at noon today.

Block Unix Timestamp: 1371463152 Total Payout: 0.12534202
Address                                                 shares  payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 137367 0.12534202

Block Unix Timestamp: 1371485192 Total Payout: 0.12702011
Address                                                 shares  payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 15848.3 0.12702011

Block Unix Timestamp: 1371494251 Total Payout: 0.13428729
Address                                                 shares   payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 6578.87

Block Unix Timestamp: 1371507094 Total Payout: 0.1128375
Address                                                 shares   payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 9116.39 0.1128375

Block Unix Timestamp: 1371516945 Total Payout: 0.11625884
Address                                                 shares       payout
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 7198.22      0.11613077
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ 8.04828  0.00012807


Total confirmed payouts:
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr        0.61561769
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ    0.00012807
Total                                                             0.61574576



Current pending weighted shares for next block:
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr 142226
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ 0.999985
13WSYzi1h9S14oN7E8DGbGLk7vHoXC2x3W 174.207
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ 3846.44

Current Pending Payout Per Block: 0.146
legendary
Activity: 1904
Merit: 1002
Ah.  That is probably a much cleaner way to do it.  In fact, you might be able to get your patch included in the main p2pool code if you turn it into a command line option.

Not a bad idea. I'd probably make a separate module with a defined interface and the command line option would just give the python path to this.

I'll work on that and update the patch. While I'm doing that, any other info that I should be including?

It would be nice to log when a p2pool block is found.  I don't really have a way to do that as a proxy, but it should be possible from within the p2pool code.  With my proxy based implementation, I have to manually create a list of p2pool block timestamps in order to properly calculate payouts.
sr. member
Activity: 448
Merit: 250
Ah.  That is probably a much cleaner way to do it.  In fact, you might be able to get your patch included in the main p2pool code if you turn it into a command line option.

Not a bad idea. I'd probably make a separate module with a defined interface and the command line option would just give the python path to this.

I'll work on that and update the patch. While I'm doing that, any other info that I should be including?
legendary
Activity: 1904
Merit: 1002
Good work. However, I don't see where you are changing the address that gets credit.

I'm not running this in any pool capacity yet, but I plan on having 100% fee set and using the '-a' command line option to set the payout address, as per standard options. The specified address would be the shared wallet deposit address.

Ah.  That is probably a much cleaner way to do it.  In fact, you might be able to get your patch included in the main p2pool code if you turn it into a command line option.
sr. member
Activity: 448
Merit: 250
Good work. However, I don't see where you are changing the address that gets credit.

I'm not running this in any pool capacity yet, but I plan on having 100% fee set and using the '-a' command line option to set the payout address, as per standard options. The specified address would be the shared wallet deposit address.
legendary
Activity: 1904
Merit: 1002
Previous patch didn't work, indenting on the exception handler was wrong. I've also updated it to log the network that p2pool is running on (I run BTC, LTC and TRC from one installation):

Code:
root@bitcoin:/var/lib/p2pool/p2pool/p2pool# git diff work.py
diff --git a/p2pool/work.py b/p2pool/work.py
index 7c5823b..d1bbec8 100644
--- a/p2pool/work.py
+++ b/p2pool/work.py
@@ -1,6 +1,7 @@
 from __future__ import division

 import base64
+import csv
 import random
 import sys
 import time
@@ -281,6 +282,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         received_header_hashes = set()

         def got_response(header, user, coinbase_nonce):
+            got_block, got_share = False, False
             assert len(coinbase_nonce) == self.COINBASE_NONCE_LENGTH == 4
             new_packed_gentx = packed_gentx[:-4-4] + coinbase_nonce + packed_gentx[-4:] if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else packed_gentx
             new_gentx = bitcoin_data.tx_type.unpack(new_packed_gentx) if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else gentx
@@ -291,6 +293,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 if pow_hash <= header['bits'].target or p2pool.DEBUG:
                     helper.submit_block(dict(header=header, txs=[new_gentx] + other_transactions), False, self.node.factory, self.node.bitcoind, self.node.bitcoind_work, self.node.net)
                     if pow_hash <= header['bits'].target:
+                        got_block = True
                         print
                         print 'GOT BLOCK FROM MINER! Passing to bitcoind! %s%064x' % (self.node.net.PARENT.BLOCK_EXPLORER_URL_PREFIX, header_hash)
                         print
@@ -332,6 +335,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                     log.err(None, 'Error while processing merged mining POW:')

             if pow_hash <= share_info['bits'].target and header_hash not in received_header_hashes:
+                got_share = True
                 share = get_share(header, pack.IntType(32).unpack(coinbase_nonce))

                 print 'GOT SHARE! %s %s prev %s age %.2fs%s' % (
@@ -364,6 +368,15 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print >>sys.stderr, 'Worker %s submitted share more than once!' % (user,)
             else:
                 received_header_hashes.add(header_hash)
+
+                # P2POOL SHARE LOGGING
+                try:
+                    with open('/tmp/p2pool-%s-shares.csv' % self.net.SYMBOL, 'ab') as csvfile:
+                        diff = bitcoin_data.target_to_difficulty(target) * 1e-8
+                        writer = csv.writer(csvfile)
+                        writer.writerow([time.time(), self.net.SYMBOL, user, diff, on_time, got_share, got_block])
+                except:
+                    log.err(None, 'Could not save share to pool database')

                 self.pseudoshare_received.happened(bitcoin_data.target_to_average_attempts(target), not on_time, user)
                 self.recent_shares_ts_work.append((time.time(), bitcoin_data.target_to_average_attempts(target)))

Good work. However, I don't see where you are changing the address that gets credit.

Anyway, thanks to all the testers!  The first payout will go out tomorrow at noon EST.  Currently, I see shares from these addresses:
178sstRXJ2aF4KHcrkbECzFopjDgHCigyr
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ
13WSYzi1h9S14oN7E8DGbGLk7vHoXC2x3W
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ
sr. member
Activity: 448
Merit: 250
Previous patch didn't work, indenting on the exception handler was wrong. I've also updated it to log the network that p2pool is running on (I run BTC, LTC and TRC from one installation):

Code:
root@bitcoin:/var/lib/p2pool/p2pool/p2pool# git diff work.py
diff --git a/p2pool/work.py b/p2pool/work.py
index 7c5823b..d1bbec8 100644
--- a/p2pool/work.py
+++ b/p2pool/work.py
@@ -1,6 +1,7 @@
 from __future__ import division

 import base64
+import csv
 import random
 import sys
 import time
@@ -281,6 +282,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         received_header_hashes = set()

         def got_response(header, user, coinbase_nonce):
+            got_block, got_share = False, False
             assert len(coinbase_nonce) == self.COINBASE_NONCE_LENGTH == 4
             new_packed_gentx = packed_gentx[:-4-4] + coinbase_nonce + packed_gentx[-4:] if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else packed_gentx
             new_gentx = bitcoin_data.tx_type.unpack(new_packed_gentx) if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else gentx
@@ -291,6 +293,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 if pow_hash <= header['bits'].target or p2pool.DEBUG:
                     helper.submit_block(dict(header=header, txs=[new_gentx] + other_transactions), False, self.node.factory, self.node.bitcoind, self.node.bitcoind_work, self.node.net)
                     if pow_hash <= header['bits'].target:
+                        got_block = True
                         print
                         print 'GOT BLOCK FROM MINER! Passing to bitcoind! %s%064x' % (self.node.net.PARENT.BLOCK_EXPLORER_URL_PREFIX, header_hash)
                         print
@@ -332,6 +335,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                     log.err(None, 'Error while processing merged mining POW:')

             if pow_hash <= share_info['bits'].target and header_hash not in received_header_hashes:
+                got_share = True
                 share = get_share(header, pack.IntType(32).unpack(coinbase_nonce))

                 print 'GOT SHARE! %s %s prev %s age %.2fs%s' % (
@@ -364,6 +368,15 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print >>sys.stderr, 'Worker %s submitted share more than once!' % (user,)
             else:
                 received_header_hashes.add(header_hash)
+
+                # P2POOL SHARE LOGGING
+                try:
+                    with open('/tmp/p2pool-%s-shares.csv' % self.net.SYMBOL, 'ab') as csvfile:
+                        diff = bitcoin_data.target_to_difficulty(target) * 1e-8
+                        writer = csv.writer(csvfile)
+                        writer.writerow([time.time(), self.net.SYMBOL, user, diff, on_time, got_share, got_block])
+                except:
+                    log.err(None, 'Could not save share to pool database')

                 self.pseudoshare_received.happened(bitcoin_data.target_to_average_attempts(target), not on_time, user)
                 self.recent_shares_ts_work.append((time.time(), bitcoin_data.target_to_average_attempts(target)))
sr. member
Activity: 448
Merit: 250
Ah, good ideas, here's up update patch for the part that writes the CSV:

Code:
@@ -364,6 +369,15 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print >>sys.stderr, 'Worker %s submitted share more than once!' % (user,)
             else:
                 received_header_hashes.add(header_hash)
+
+                # P2POOL SHARE LOGGING
+                try:
+                    with open('/tmp/p2pool-shares.csv', 'ab') as csvfile:
+                        diff = bitcoin_data.target_to_difficulty(target) * 1000000000
+                        writer = csv.writer(csvfile)
+                        writer.writerow([time.time(), user, diff, on_time, got_share, got_block])
+                    except:
+                        log.err(None, 'Could not save share to pool database')

                 self.pseudoshare_received.happened(bitcoin_data.target_to_average_attempts(target), not on_time, user)
                 self.recent_shares_ts_work.append((time.time(), bitcoin_data.target_to_average_attempts(target)))
legendary
Activity: 1904
Merit: 1002
Here is a quick patch against work.py which will cause it to log a line to a CSV file every time an actual share is found. I haven't had time to fully work out how to get the hash rate inside that function yet. I'm not sure if you want to only pay out on shares that p2pool counts as valid, or a percentage of the hashrate.

Fields in the CSV are: time.time(), user, on_time, got_share, got_block


Code:
root@bitcoin:/var/lib/p2pool/p2pool/p2pool# git diff work.py
diff --git a/p2pool/work.py b/p2pool/work.py
index 7c5823b..a4c3f38 100644
--- a/p2pool/work.py
+++ b/p2pool/work.py
@@ -5,6 +5,8 @@ import random
 import sys
 import time

+import csv
+
 from twisted.internet import defer
 from twisted.python import log

@@ -281,6 +283,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         received_header_hashes = set()

         def got_response(header, user, coinbase_nonce):
+            got_block, got_share = False, False
             assert len(coinbase_nonce) == self.COINBASE_NONCE_LENGTH == 4
             new_packed_gentx = packed_gentx[:-4-4] + coinbase_nonce + packed_gentx[-4:] if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else packed_gentx
             new_gentx = bitcoin_data.tx_type.unpack(new_packed_gentx) if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else gentx
@@ -291,6 +294,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 if pow_hash <= header['bits'].target or p2pool.DEBUG:
                     helper.submit_block(dict(header=header, txs=[new_gentx] + other_transactions), False, self.node.factory, self.node.bitcoind, self.node.bitcoind_work, self.node.net)
                     if pow_hash <= header['bits'].target:
+                        got_block = True
                         print
                         print 'GOT BLOCK FROM MINER! Passing to bitcoind! %s%064x' % (self.node.net.PARENT.BLOCK_EXPLORER_URL_PREFIX, header_hash)
                         print
@@ -332,6 +336,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                     log.err(None, 'Error while processing merged mining POW:')

             if pow_hash <= share_info['bits'].target and header_hash not in received_header_hashes:
+                got_share = True
                 share = get_share(header, pack.IntType(32).unpack(coinbase_nonce))

                 print 'GOT SHARE! %s %s prev %s age %.2fs%s' % (
@@ -364,6 +369,16 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print >>sys.stderr, 'Worker %s submitted share more than once!' % (user,)
             else:
                 received_header_hashes.add(header_hash)
+
+                # P2POOL SHARE LOGGING
+                if got_share or got_block:
+                    try:
+                        with open('/tmp/p2pool-shares.csv', 'ab') as csvfile:
+                            writer = csv.writer(csvfile)
+                            writer.writerow([time.time(), user, on_time, got_share, got_block])
+                    except:
+                        log.err(None, 'Could not save share to pool database')
+

                 self.pseudoshare_received.happened(bitcoin_data.target_to_average_attempts(target), not on_time, user)
                 self.recent_shares_ts_work.append((time.time(), bitcoin_data.target_to_average_attempts(target)))

With the code I have, it logs every response from p2pool whether the "result" is true of false, but I only use the ones with true for payout calculations.  I also log the current difficulty and time with each share.  My current plan is to just do payouts proportionally based on successful shares weighted by their difficulty requirement.  P2pool changes difficulty frequently, so that needs to be factored in if you are doing things share based.  Using hashrate estimates should get you the same answer since the estimate would be derived from the rate of shares, so it seems like an unnecessary complication.
sr. member
Activity: 448
Merit: 250
Here is a quick patch against work.py which will cause it to log a line to a CSV file every time an actual share is found. I haven't had time to fully work out how to get the hash rate inside that function yet. I'm not sure if you want to only pay out on shares that p2pool counts as valid, or a percentage of the hashrate.

Fields in the CSV are: time.time(), user, on_time, got_share, got_block


Code:
root@bitcoin:/var/lib/p2pool/p2pool/p2pool# git diff work.py
diff --git a/p2pool/work.py b/p2pool/work.py
index 7c5823b..a4c3f38 100644
--- a/p2pool/work.py
+++ b/p2pool/work.py
@@ -5,6 +5,8 @@ import random
 import sys
 import time

+import csv
+
 from twisted.internet import defer
 from twisted.python import log

@@ -281,6 +283,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         received_header_hashes = set()

         def got_response(header, user, coinbase_nonce):
+            got_block, got_share = False, False
             assert len(coinbase_nonce) == self.COINBASE_NONCE_LENGTH == 4
             new_packed_gentx = packed_gentx[:-4-4] + coinbase_nonce + packed_gentx[-4:] if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else packed_gentx
             new_gentx = bitcoin_data.tx_type.unpack(new_packed_gentx) if coinbase_nonce != '\0'*self.COINBASE_NONCE_LENGTH else gentx
@@ -291,6 +294,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 if pow_hash <= header['bits'].target or p2pool.DEBUG:
                     helper.submit_block(dict(header=header, txs=[new_gentx] + other_transactions), False, self.node.factory, self.node.bitcoind, self.node.bitcoind_work, self.node.net)
                     if pow_hash <= header['bits'].target:
+                        got_block = True
                         print
                         print 'GOT BLOCK FROM MINER! Passing to bitcoind! %s%064x' % (self.node.net.PARENT.BLOCK_EXPLORER_URL_PREFIX, header_hash)
                         print
@@ -332,6 +336,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                     log.err(None, 'Error while processing merged mining POW:')

             if pow_hash <= share_info['bits'].target and header_hash not in received_header_hashes:
+                got_share = True
                 share = get_share(header, pack.IntType(32).unpack(coinbase_nonce))

                 print 'GOT SHARE! %s %s prev %s age %.2fs%s' % (
@@ -364,6 +369,16 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print >>sys.stderr, 'Worker %s submitted share more than once!' % (user,)
             else:
                 received_header_hashes.add(header_hash)
+
+                # P2POOL SHARE LOGGING
+                if got_share or got_block:
+                    try:
+                        with open('/tmp/p2pool-shares.csv', 'ab') as csvfile:
+                            writer = csv.writer(csvfile)
+                            writer.writerow([time.time(), user, on_time, got_share, got_block])
+                    except:
+                        log.err(None, 'Could not save share to pool database')
+

                 self.pseudoshare_received.happened(bitcoin_data.target_to_average_attempts(target), not on_time, user)
                 self.recent_shares_ts_work.append((time.time(), bitcoin_data.target_to_average_attempts(target)))
legendary
Activity: 1904
Merit: 1002
So far, in addition to my address, I see shares from these addresses:
1Q68UdKBYgBVy7h4gAAXcipaoBPeoJZrXQ
1yrraLgmRZ1fbgtz2BSVXcWVrJnH785QZ

If you have tried mining on my pool and you are not on the list, please let me know ASAP.  Now that I have testers I will try to make some time tomorrow to work on some stat reporting.
legendary
Activity: 1904
Merit: 1002
Cool, I'll check it out.

I'm in Australia. I was thinking of a separate pool per continent, or multiple per continent maybe, rather than one worldwide pool. I guess that's what you mean by localised.

I've got no experience with Ruby, so I might rework in Python, then it can plug directly into p2pool work.py and there's no need for running it on a separate port. I've already started on a Django schema for the database side of things.

No need for AWS here, I run a hosting company Smiley

Cool.  It's pretty simple so far, and if you make it possible to just patch p2pool that is awesome.  I'm not particularly tied to my code, my objective is primarily to help make p2pool accessible to miners of any size.  Feel free to play around with it and ask questions since the code is a bit dense in places.  If you redo it in python, feel free to post that here.  I'm not a ninja like with ruby, but I do have a bit of python experience. 
sr. member
Activity: 448
Merit: 250
Cool, I'll check it out.

I'm in Australia. I was thinking of a separate pool per continent, or multiple per continent maybe, rather than one worldwide pool. I guess that's what you mean by localised.

I've got no experience with Ruby, so I might rework in Python, then it can plug directly into p2pool work.py and there's no need for running it on a separate port. I've already started on a Django schema for the database side of things.

No need for AWS here, I run a hosting company Smiley
legendary
Activity: 1904
Merit: 1002
This looks like a good idea, I was thinking about implementing something very similar on my p2pool node. What continent are you on? Might be worth pooling (pun intended!) resources.

Interesting.... If we could develop a network of trusted operators we could offer low latency from anywhere in the world.  Actually pooling everything together brings up trust issues between the various operators unless we use a single modified p2pool instance that does the logging, but then we don't have low latency from everywhere.  However, since each pool only needs to be big enough to find enough p2pool shares, I think smaller, localized pools are the way to go.  More important is overall hashpower for p2pool.  N. America, btw.

If you want to spin up your own proxy for your p2pool node the code is here: https://github.com/yrral86/proxy-p2pool
1. Spin up an aws instance near you
2. Install git via package manager
3. Install ruby via rvm (this will take some time)
4. gem install json em-proxy
5. git clone https://github.com/yrral86/proxy-p2pool
6. cd proxy-p2pool
7. In proxy.rb, modify pool address on line 8 and p2pool.address on line 38
8. ruby proxy.rb
9. Point your miners at aws_address:9339
10. Submitted shares will be logged to shares.log (just a csv for now, I'll likely back it with a real db eventually)
11. You're on your own for payouts.  When I get some time I will put together some scripts for parsing the shares.log file.

Pull requests and bug reports are of course welcome.
sr. member
Activity: 448
Merit: 250
This looks like a good idea, I was thinking about implementing something very similar on my p2pool node. What continent are you on? Might be worth pooling (pun intended!) resources.
legendary
Activity: 1904
Merit: 1002
Fundamentally, it comes down to a tradeoff between high stales and high variance.  If you slow down the share rate, it is much harder to find a share and variance will go through the roof.  In order to keep everyone happy from big miners to small, we need a tiered system.  This is actually what I am working towards with my proxy project, but you seem to want to throw out everything already built and start from scratch rather than work incrementally towards a system that suits everyone.  Yes, I want the lower tiers to eventually be decentralized, but I need to work out the kinks in just proxying to an unmodified p2pool for now.  Ultimately, we need to allow multiple addresses to take credit for p2pool shares rather than a single address per share.  Once this is in place, we can have second tier pools that submit p2pool shares that pay out based on their easier share chain.  A centralized proxy is just a first step towards this vision and will help us understand a part of the target system that is achievable today.  Then there is the issue of BFL ASICs.  Once we have a tiered system, we will be able to lengthen the share time on p2pool to something acceptable for all hardware and the second tier pools can provide easier shares and lower variance.
legendary
Activity: 1904
Merit: 1002
This is targeted at those who don't want to maintain a bitcoin daemon and p2pool instance.  I can potentially spin up as many proxies as I want that point to as many different p2pool instances as I want.   I just need to aggregate the share records to calculate the payment.  This will allow for more ddos resistance than any individual p2pool instance or centralized pool.
hero member
Activity: 924
Merit: 1000
Watch out for the "Neg-Rep-Dogie-Police".....
Hi,

A good idea in principal. However, this will lose the one great benefit of p2p mining - vulnerability to ddos attack. Many pools are suffering from this right now despite having many security measures, will your node/pool be able to resist such an attack? Surely the best option would be to create a more efficient p2p mining program that is compatible with all mining hardware & is fully stratum capable & keeps this anti ddos benefit? I wish you luck with this, as something definitely needs to be done, but this is not the answer I fear.
I'm trying to put together a team who is capable of writing a completely new enhanced p2p program that will put p2p mining back on the map, check out my thread:

https://bitcointalksearch.org/topic/m.2234739

I've been approached by a few programmers, but am still looking for somebody with more bitcoin experience if you're interested. I have also been contacted by many miners who are willing to help with testing of various fpga/asics setups, so the need is definitely there.

Again, I wish you luck with this endeavour, but if you decide you really want to help p2p mining as a whole I'd love to hear from you.

Regards & Peace.
legendary
Activity: 1904
Merit: 1002
I am developing some mining proxy software that allows me to pool p2pool shares from multiple users together to the same address.  This allows miners with less hashing power to use p2pool with less variance.  This is alpha quality software and I will be doing manual payouts for now.  Payouts will be proportional.  Please do not use this pool without a fallback since I may restart it frequently.  There are no public stats at the moment, but that is certainly on the TODO list.  At the moment, the best you can do is monitor the pools genearation address (1B1kSM3KfcP9BvGDC1G3cxZAV9LbxovpQi), which will include everybody's hashpower:: http://pool.yrral.net:9339/static/graphs.html

The goal of this project is to bring more interest to p2pool and also keep it accessible to small miners.

In order to mine, connect to pool.yrral.net:9339 with your bitcoin address as your username.  Password can be anything.  If you are using cgminer, you will see "Accepted untracked stratum share" instead of the normal message, but rest assured your shares are being tracked.  Also, if I restart the proxy you may see a message about shares being lost that you can safely ignore.

Fine print:  My p2pool instance is currently set to collect a 2% fee.  Payments will be made biweekly on Mondays and Thursdays at noon EST and will include any p2pool payout that has reached 120 confirmations.  If your payout is below the dust limit for the bitcoin network, your payouts will be accumulated until they exceed the limit (if a transaction has an output that is too small it will not be relayed or included in blocks by most nodes).
Jump to: