Bitcoin Forum
May 24, 2024, 03:25:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 »
201  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: June 05, 2017, 04:12:18 PM
Speaking of BIP148, are there any contingency plans in place for P2Pool handling the fork? As far as I'm aware, both mainnet and jtoomimnet are currently not compatible with segwit. So when BIP148 activates — and in the off-chance that it replaces the legacy non-segwit chain, or if circumstances post-BIP148 manage to trigger the 95% segwit threshold on the legacy chain — we P2Pool miners would be hung out to dry.
BIP148 states that all miners must signal for SegWit after August 1st. Currently, p2pool is capable of signaling for SegWit, so p2pool is compatible with this phase. If a majority of miners are following BIP148, then SegWit (BIP141) will enter into the LOCKED_IN state for two weeks, followed by the ACTIVE period two weeks after that. If 100% of miners follow BIP148, then the signaling phase will last 2 weeks. (If 10% follow, then 20 weeks, etc.) This plus the LOCKED_IN period means that we will have at least 4 weeks after August 1st before p2pool becomes incompatible with the Bitcoin chain.

It should take a week or less to merge and test SegWit support into jtoomimnet and/or mainnet's code. We'll be fine.
202  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 29, 2017, 10:49:43 PM
If P2Pool were to include block propagation, would blocks received from other P2Pool nodes then be subsequently forwarded to and verified by the recipient's bitcoind before being mined on?
Yes. p2pool has no code for maintaining a mempool of valid transactions or deciding which transactions to include in a block, so the block would need to be processed by bitcoind and a new block template received from bitcoind before p2pool could start new work. That should take a little less than a second, so it's not a big deal.
203  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 29, 2017, 09:42:31 PM
Maybe if p2pool can relay blocks to other nodes, but why should that be faster then core get the block from an other core node?...
This is actually pretty straightforward to do. P2pool has access to the share chain as an index of recently used and recently seen transactions, so it is generally able to encode a block in much less space than bitcoind can. I think most transactions take 2 bytes to encode (8 bits to refer to which ancestor share first mentioned the transaction, and another 8 bits to refer to the index of the transaction within that share), although the mean is much higher than that, especially when there are a lot of novel transactions.

There are other changes to make to p2pool that are a higher priority (e.g. improving fairness), so it's not likely that I'll implement block propagation via p2pool any time soon.
204  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 29, 2017, 12:55:28 AM
I heard from one of the Nicehash miners. He abandoned p2pool because the DOA rates he was getting from Nicehash were significantly eating into his revenue, and he can get more by solo mining. I can think of three ways of addressing this issue.

The first one is to submit DOA shares to the network and have them compete with non-DOA shares, and possibly change the preference algorithm on the receiver's side to give DOA shares a significant and fair chance of winning the subsequent orphan race. This approach would be likely to increase the possibility and severity of selfish mining attacks, so I'm a bit reluctant to pursue it. It would be pretty simple in terms of code changes, though. Some more detailed thoughts on this below.

The second one is to add an uncle mechanism or DAG structure to the share chain. This would likely be much fairer, but it would require a p2pool hard fork and a substantial amount of new code. This would be the best option if developer time weren't an issue.

The third one is to try to increase the average share interval by increasing the default or minimum share difficulty. Changes to the minimum share difficulty require a hard fork, but a simple one. Changes to the default share difficulty just require that some nodes (especially the large ones) run different code. If the average share took 4x as long, then both orphan and DOA rates would be 1/4th their current values. Drawbacks of this approach are (1) that small miners would find it more difficult to get shares into the share chain (unless share difficulty were a function of the number of shares in the chain), and (2) that it's potentially not incentive-compatible, as the benefit of making high-difficulty shares goes to everyone who mines afterwards, and not to the person who mines the high-diff share. A person with a lot of hashrate has a greater chance of winning an orphan race if he works on low-diff shares than if he works on high-diff shares, since p2pool essentially just uses (1) the share height and (2) the time of arrival when determining which share to base its work off of, and ignores difficulty.

But maybe that isn't the best way to choose the share to base work off of? Ultimately, the problem we're having with fairness comes from the fact that some shares have greater expected revenue in the share chain than other shares, due to differences in orphan risk caused by differences in node performance and propagation times. If we no longer take time-of-arrival into account (or weight it less heavily), then the incentive to run a large, high-performance p2pool node dissipates. That might sound like a bad thing, since it could result in a higher block orphan rate for p2pool, but it's not really that bad. The issue comes from the fact that Bitcoin block intervals are 600 seconds, but shares are 30 seconds, which means that we are punishing low-performance nodes by 20x more than is fair.

Another problem with the existing algorithm for choosing which share to base work off of is that all shares are treated the same, regardless of their difficulty, which makes low-diff shares have an advantage for selfish mining attacks. Large-diff shares contribute more work to p2pool, so they should have a greater chance of winning an orphan race, ceteris paribus. But you can't just pick the highest-diff share of all shares in an orphan race, since that would cause a race-to-the-top scenario where the optimal difficulty to use for your shares is the highest diff that a competitor uses plus one. That would also allow a selfish miner to reliably win orphan races against siblings: instead of working on a child share of the best known share, you could just orphan it by creating a sibling with +1 difficulty. So it needs to be probabilistic.

The algorithm I'm thinking of for choosing the winner of an orphan race is this:

1. Take all of the shares at the best chain height (using the current 5th-gen-parent work done heuristic)
2. Find the time that the first of those candidate shares arrived, and call that start_time.
3. For each share, calculate the difference between that share's arrival time and start_time, and call that share_delay.
4. Calculate share_nonorphan_chance = 1 - share_delay/600 (for Bitcoin) for each share. This gives a correction factor for how much less likely than the best share this share would have been to not be orphaned as a bitcoin block. That is, a share that took 6 seconds longer than the fastest share would get a 1% higher orphan risk, and would get a share_nonorphan_chance of 0.99.
5. Calculate share_corr_share_diff = share_diff * share_nonorphan_chance.
6. Pick a share randomly, giving a chance of share_corr_share_diff/sum(share_corr_share_diffs) for each share.
7. Mine using that share as the parent.

If my math/logic is correct, this algorithm would give pretty much everyone a fair chance of winning a share orphan race, regardless of their node performance or share difficulty.
205  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 27, 2017, 11:29:49 PM
Thus you are saying there's some problem with p2pool receiving blocks.
That 12 seconds doesn't exist for me.
No, the 12 seconds was due to my bitcoind process, not p2pool, as you would know if you had read all of my original post. I'm not running Falcon or FIBRE on my node, just theblumatt's old relay network, which is probably why it took 12 seconds. If you think it is bullshit that it took 12 seconds to download that block, then I'm inclined to agree with you. If you think that it's bullshit that p2pool choose to mine an empty block during those 12+2.7 seconds, then I'm inclined to disagree with you.
206  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 27, 2017, 06:16:03 AM
Takes me less than 1 second - so I guess you have the same problem as LukeJr.
(less than 1 second includes: from block arrives, processed, work generated, new work sent out to miners)
We're not counting the same way. In my example above, it took 12 seconds (after p2pool received the header) for the block to arrive, less than one second for the block to be validated and a new block template to be pushed to p2pool, and 2.7 seconds (because CPython p2pool is slow) for p2pool to issue new work to the miners. You're not counting what took 12 seconds in the case above.
207  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 27, 2017, 02:49:29 AM
I'm having trouble following your assertion. Is 14.68 seconds not slow to you? Or is it bullshit that it's so slow? Or is it bullshit to mine transaction-less blocks during those 14.68 seconds? Or is it just bullshit because Luke-jr was involved?
208  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 26, 2017, 06:53:12 PM
It's more an issue of processing and propagation latency than mempool size. P2pool (along with most other pools) has code in it to generate empty blocks when the pool has heard of a new block header on the network, but has not yet gotten a block template from bitcoind. bitcoind can't generate a new block template until after it has fully downloaded and verified the previous block, since otherwise it might include transactions twice or include double-spends. Since downloading a block header is faster than downloading and verifying a full block, there can sometimes be a substantial amount of time in between where the best you can do is mine an empty block. The idea is that if you have a miner hashing on something, it's better to hash on an empty block at the right height than a full block at the wrong height (which would result in an orphan race). This condition should only last for a few seconds, though. The 23 actual seconds that elapsed seems excessive. It's possible that I need to do something to improve block propagation latency on that node. It's also possible that p2pool didn't poll getblocktemplate frequently enough or something.

If this happens when blocks are found in the first 30 15 seconds of mining, that would correspond to a 5% 2.5% reduction in average transactions included. That seems undesirable, but not excessive. The alternative -- mining on the wrong block height for up to 15 seconds -- sounds worse. I wish I had time to look into this more and improve performance, but at the moment I don't.

Edit: It appears that the timestamps on the blocks are wrong. This is pretty common, as generally timestamps are set when the stratum job is issued to the miner, not when the miner actually finds the block. Here's what shows up in my bitcoind logs:

Code:
2017-05-26 05:03:32 UpdateTip: new best=0000000000000000019c0b9124dd971ca31d59deac39f23cac484495895eb2af  height=468
172  log2_work=86.489404  tx=226059198  date=2017-05-26 05:02:56 progress=1.000000  cache=144.7MiB(44861tx)
2017-05-26 05:03:32 CreateNewBlock(): total size 999899 txs: 2197 fees: 296309213 sigops 7618
2017-05-26 05:03:35 Acceptable block: ver:20000000 time:1495775000 size: 1623 Tx:1 Sig:41
2017-05-26 05:03:35 UpdateTip: new best=00000000000000000117d37aba3cd8d9d1811f4f719834f5b8f71c78f8c504d7  height=468173  log2_work=86.489438  tx=226059199  date=2017-05-26 05:03:20 progress=1.000000  cache=144.7MiB(44877tx)

Then, in my p2pool logs:

Code:
2017-05-25 22:03:20.093931 Skipping from block 156cb130cb9ee78a01dd6d5ed4f144fb05c222f117829e7 to block 19c0b9124dd971ca31d59deac39f23cac484495895eb2af!
2017-05-25 22:03:20.102054 New work for 1PXxBrUbWUMZemAQknEqDTSHKaKmVmhJCK! Diff: 65681.48 Share diff: 9893593.66 Block value: 12.50 BTC (0 tx, 0 kB)
2017-05-25 22:03:34.275890 Generating a share with 998819 bytes (348901 new) and 2197 transactions (678 new)
2017-05-25 22:03:34.316686 New work for 1PXxBrUbWUMZemAQknEqDTSHKaKmVmhJCK! Diff: 69877.30 Share diff: 9893593.66 Block value: 15.46 BTC (2197 tx, 999 kB)
2017-05-25 22:03:34.384701 Generating a share with 998819 bytes (348901 new) and 2197 transactions (678 new)
2017-05-25 22:03:34.788256
2017-05-25 22:03:34.788319 GOT BLOCK FROM MINER! Passing to bitcoind! https://blockchain.info/block/00000000000000000117d37aba3cd8d9d1811f4f719834f5b8f71c78f8c504d7
2017-05-25 22:03:34.788340
2017-05-25 22:03:34.791621 GOT SHARE! 1EyWF5ZQ9BHxbLAKuFj2MfQT9daE1sVsTx f8c504d7 prev 91af17f0 age 14.68s DEAD ON ARRIVAL
2017-05-25 22:03:34.802307

It's worth noting that this was a DOA share that happened to be a block. P2pool learned of the block at height 468172 at 3m20s, bitcoind learned of it 12 seconds later at 3m32s and had work for p2pool around that time, but p2pool didn't have it bundled into a stratum job until 3m34.7s. While p2pool was bundling the stratum job, a miner returned the block from the previous stratum job, and p2pool didn't process it until after it finished assigning the new work because p2pool is single-threaded. This means that the block was found at some point between 3m32s and 3m34.7s.

This node was running CPython, not pypy, because that server is running low on RAM. This may have contributed to the slow (2.7s) processing of new work, and increases the likelihood of a DOA share.

So in this case, we're talking about a 15 second time window, not 30 or 24. Of those 15 seconds, 12 seconds were due to bitcoind being a bit slow, and 3 seconds were due to p2pool being slow. Overall, I think finding an empty block in this scenario is a reasonable outcome, and do not consider this to be a priority for optimization right now.
209  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 22, 2017, 04:27:32 AM
And what about the p2pool ltc node testing
LTC now requires SegWit, which requires veqtrus's PR. It would take some more work to get LTC working with both my code and veqtrus's. It would need to be a different alt for testing.

At the moment, I'm more interested in the memory issues and the share size issues than in doing testing and merging. I'd also like to add some code that checks the system clock against NTP (when reachable) at startup in order to reduce the clock offset issues that people have been having, and I think that might be good to do before merging into p2pool master.
210  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 21, 2017, 09:28:23 PM
Quick reminder: the jtoomimnet 1mb_hardforked branch of p2pool uses about 2x as much RAM, since the share chain contains around 2x as many transactions. If you are using pypy, this means that your memory consumption may get up to 6 GB. If you're using CPython, it's a little under 1 GB. Please make sure that you have enough RAM in your nodes. If you don't have enough RAM, you will get massive swapping, and you might notice that bitcoind is unable to keep up with blocks and may fall behind, causing p2pool to stop working.

Lowering RAM usage is my next goal for p2pool.
211  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 19, 2017, 09:14:47 PM
To whomever is mining on ml.toom.im:9332 with address 3GU89xZmzJfCBXFzbB3mC2dsxDyKqrD7nz:

P2pool does not support multisig or P2SH addresses. Any worker name that is not a regular P2PKH address (starting with a 1) ends up contributing to the default address for that node. In other words, you're mining into my wallet, not your own.

I'll send you the 0.125 btc you made in the last block soon-ish (few days? I don't currently have access to that wallet), but I think everyone would be happier if you mined directly into your own address. Edit: sent.
212  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 19, 2017, 01:57:42 AM
If you mine a share that exceeds the difficulty threshold do you get paid more for a share that way exceeds the threshold over one that just squeaks by?
The difficulty of the share is different from the hash that the share actually gets. The threshold for the share is encoded into the share itself, and is part of what gets hashed, which means it's like saying "I promised you I would make a share with difficulty X, and if you hash this sentence (which includes nonce Y) you'll see that it meets that difficulty level." It doesn't matter how far you exceed that difficulty threshold.
213  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 17, 2017, 05:38:30 PM
Hey! Where did all the Petahashes go? Huh It's 1.8 instead of recent 12-18 Ph. I mean jtoomims fork of course)
Nicehash rates are probably high right now. This will give you a chance to get more of your shares into the share chain and increase the amount of reward per block you'll get should a block be found. The ≥1 PH/s of hashrate on my nodes will be staying on jtoomimnet p2pool no matter what, so we will find a block eventually even if the Nicehash renters never come back. It might take a few weeks, though.
214  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 16, 2017, 08:27:24 PM
sawa, I didn't touch any code related to the json-rpc stuff. My guess is that this is a recently introduced bug on the miningrigrentals end. It seems that they're appending an extra parameter on their share submission messages. Have you tried the same rentals on mainnet recently? My guess is that you'd see the same issue. You could also try packet sniffing (e.g. with tcpdump -X port 9332) to see what parameters they're sending; they might just be using some stratum extension that p2pool doesn't yet support.

If you use tcpdump, you're looking for lines that look like this:
Code:
13:27:03.541709 IP tbs9-44.36404 > feather.9336: Flags [P.], seq 3992288327:3992288497, ack 1433189083, win 1304, options [nop,nop,TS val 147459895 ecr 1475188945], length 170
0x0000:  4500 00de a5a5 4000 4006 1a46 0a00 652c  E.....@.@..F..e,
0x0010:  0a00 0103 8e34 2478 edf5 7c47 556c badb  .....4$x..|GUl..
0x0020:  8018 0518 bce4 0000 0101 080a 08ca 0f37  ...............7
0x0030:  57ed 98d1 7b22 7061 7261 6d73 223a 205b  W...{"params":.[
0x0040:  2231 4775 446e 4579 5953 4533 5261 3370  "1GuDnEyYSE3Ra3p
0x0050:  4d61 7237 3331 3174 7835 706f 5235 5047  Mar7311tx5poR5PG
0x0060:  5852 3322 2c20 2231 3133 3233 3031 3730  XR3",."113230170
0x0070:  3839 3331 3033 3539 3437 3630 3432 3831  8931035947604281
0x0080:  3630 3638 3830 3530 3633 3033 3034 222c  60688050630304",
0x0090:  2022 3838 3530 3032 3030 222c 2022 3539  ."88500200",."59
0x00a0:  3162 3630 3732 222c 2022 6132 3163 6163  1b6072",."a21cac
0x00b0:  6265 225d 2c20 2269 6422 3a20 3233 3836  be"],."id":.2386
0x00c0:  392c 2022 6d65 7468 6f64 223a 2022 6d69  9,."method":."mi
0x00d0:  6e69 6e67 2e73 7562 6d69 7422 7d0a       ning.submit"}.
If we know what extra data they're sending, we might be able to patch p2pool to support it (or, if it's safe, to ignore it).
215  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 16, 2017, 05:53:20 PM
2017-05-10 20:50:23.585000 >   File "C:\Users\ppif\Documents\GitHub\p2pool\p2pool\data.py", line 323, in check
2017-05-10 20:50:23.585000 >     if self.timestamp > int(time.mktime(time.gmtime()) - time.mktime(time.gmtime(0))) + 300:
2017-05-10 20:50:23.585000 > exceptions.OverflowError: mktime argument out of range
I did some testing, and I was unable to reproduce this error. Is it still occurring? If so, do you think you might be able to give me remote access to this machine (e.g. via showmypc.com or teamviewer) so I could do some debugging and testing?
216  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 16, 2017, 05:51:48 PM
I successfully got jtoomim's fork up and running with the below instructions.
However, it appears it is running Version: 15.0-43-gcc6fd7d rather than Version: 16.0-7-gb0d472e-dirty at ml.toom.im:9332
Ignore that. The version that p2pool advertises is not based on the code itself, but instead on the git history of the branch that you're logged into. Specifically, p2pool runs "git describe --dirty --always" in order to determine its version number. git describe will look for the most recent tag that is reachable from a commit. As I haven't tagged any new versions yet (though I totally should have), git describe doesn't say anything helpful. For some unknown reason, it shows up as 16.0-7-* on my nodes but 15.0-43-* on the nodes that other people have made from cloned repositories, even though the code is exactly the same.

If you run "git log", that will list the most recent changes that were made on the branch you're using. As of today, the most recent commit should be:

commit cc6fd7d227f869aa02cdf9f89e8349aa9d2a4344
Author: Jonathan Toomim
Date:   Wed May 10 06:11:49 2017 -0700

    Don't attempt retransmission of shares when transactions are missing (avoid hang on sync)
217  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 12, 2017, 02:00:26 PM
With regard to development efforts, jtoomim: I'll merge any pull requests from you from now on that pass a quick review (I don't have means to test currently). If you want, we can discuss giving you push access to https://github.com/p2pool/p2pool.
Sounds good. 1mb_hardforked isn't quite ready for master yet, as it hasn't been tested with any altcoins -- this commit (https://github.com/jtoomim/p2pool/commit/fe9179e4a81543aadfcc840c0697df0aa475748f) in particular worries me -- but once I've tested it at least with one altcoin and have investigated the timezone issue a bit better, I'll put in a PR.
218  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 12, 2017, 12:49:31 AM
OK, with the old fork my server was never happy running for 1Mb blocks.
This commit (https://github.com/jtoomim/p2pool/commit/e71535e4401d0e0b6d19b2c0741b1fff2d9770a1) significantly reduces the CPU load from p2pool dealing with large numbers of transactions. CPU load vs transaction volume was O(n^2) in the old version of p2pool, but should be O(n) in my branch.
219  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 12, 2017, 12:45:18 AM
No comment on this? You are hijacking forrestv's thread and forking his pool away from him...
As you may have noticed, forrestv isn't very active in this community any more. As such, I have been treating this more as a p2pool community thread rather than forrestv's thread. If he views it differently, then I will defer to that.

The branch that I made is still mostly his code, and still defaults to including a 0.5% donation to him. I'm not trying to steal p2pool away from him; I'm just trying to keep the project alive even though the official maintainer and sole github committer is inactive.
220  Bitcoin / Pools / Re: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool on: May 11, 2017, 08:36:30 PM
Anyone, tell, please when it will be compiled on Windows.
That is a good question for jtoomim
Bugs first, binaries later.
Pages: « 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!