Pages:
Author

Topic: [1500 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool - page 32. (Read 2591920 times)

hero member
Activity: 818
Merit: 1006
P2pool does not care where the share/block fits in the Bitcoin2x/BitcoinCash/BitcoinNo2x blockchains. It does not care if the block has a valid parent at all. It probably should, but it currently does not.
Your fork works like that because you removed the "Block-stale detected" punishment.
Additionally for quicker resolution of what the valid last block header is I should cherry-pick PR#334 into segwit.

Alas, block-stale punishment is not nearly enough. Here's the code for choosing which sharechain tip to prioritize the highest:

Code:
        decorated_heads = sorted(((
            self.verified.get_work(self.verified.get_nth_parent_hash(h, min(5, self.verified.get_height(h)))),
            #self.items[h].peer_addr is None,
            -self.items[h].should_punish_reason(previous_block, bits, self, known_txs)[0],
            -self.items[h].time_seen,
        ), h) for h in self.verified.tails.get(best_tail, []))
        best_head_score, best = decorated_heads[-1] if decorated_heads else (None, None)

P2pool will choose a share to work on based on the work done as of the 5th-grandparent of the shares first, and punishment is only the 2nd priority in case of a tie (i.e. shares that both have the same 5th grandparent). So if, for example, there is a Segwit2x sharechain that has 1.5x the hashrate as a Bitcoin Cash sharechain, and if a p2pool node sees both, it will choose the Segwit2x chain even if the bitcoind is Bitcoin Cash. This means that there will not be two completely separate sharechains, and that sharechain forks will generally be "resolved" (albeit incorrectly) in 5 shares or less. All Bitcoin forks will fight over the same share chain. But wait, there's more just below that:

Code:
        if best is not None:
            best_share = self.items[best]
            punish, punish_reason = best_share.should_punish_reason(previous_block, bits, self, known_txs)
            if punish > 0:
                print 'Punishing share for %r! Jumping from %s to %s!' % (punish_reason, format_hash(best), format_hash(best_share.previous_hash))
                best = best_share.previous_hash

That's a second check for punishment. If the share chosen by the first block of code is getting punished, then p2pool will just use its parent. This would mean that our hypothetical Bitcoin Cash miner would be mining a share based on the Segwit2x chain, but he would use the second-to-last share in that chain. This would make his shares have a disproportionately high chance of being orphaned, but not a 100% chance. If he and other BCH miners mine two shares in quick succession, they stand a reasonable chance of being used by Segwit2x miners.

Malicious miners could improve their chances by using the minimum share difficulty instead of the default share difficulty to further increase the probability of mining multiple shares in quick succession. A Bitcoin Cash proponent with a significant minority of hashrate could use this mechanism to preferentially orphan many or most shares submitted by Segwit2x or SegwitNo2x miners. On one of my nodes right now, the default share difficulty is about 30x higher than the consensus-enforced minimum share difficulty, so this attack would actually be quite feasible and effective even with only around 1/30th of the total p2pool hashrate.

In other words, the block-stale detection is not a solution to the forking blockchain problem. It is relevant to p2pool's behavior in forking situations, but it's mostly a weirding factor, and can be exploited by malicious, selfish, or politically motivated entities.
member
Activity: 107
Merit: 10
P2pool does not care where the share/block fits in the Bitcoin2x/BitcoinCash/BitcoinNo2x blockchains. It does not care if the block has a valid parent at all. It probably should, but it currently does not.
Your fork works like that because you removed the "Block-stale detected" punishment.
Additionally for quicker resolution of what the valid last block header is I should cherry-pick PR#334 into segwit.
sr. member
Activity: 351
Merit: 410
If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.

P2Pool should provide support for separate BitcoinCore or BTC1 or BCH with separate sharechains...

...

P2Pool is forking and Bitcoin is forking. I think it is all healthy. But there is a real danger if miners are not able to choose the forks they want.

I intend to continue mining with Bitcoin Core, and I agree with nonnakip.

(Edited to remove unnecessary comments.)
hero member
Activity: 818
Merit: 1006
P2pool does not care where the share/block fits in the Bitcoin2x/BitcoinCash/BitcoinNo2x blockchains. It does not care if the block has a valid parent at all. It probably should, but it currently does not.

P2pool also does not care if the transactions included in the block are valid or not. Doing that verification requires that p2pool have access to the blockchain and/or the UTXO set, which p2pool does not itself have.

The solution I have in mind is to have p2pool query bitcoind with the getblockheader RPC for the parentblock for all shares, and if that share's parentblock is not known by our bitcoind, then we reject the share. This shouldn't be super-difficult to implement, but it will take more time than I have right now. If anyone else has some time to work on this, I'd be happy to give some guidance.
hero member
Activity: 633
Merit: 591
P2Pool should provide support for separate BitcoinCore or BTC1 or BCH with separate sharechains. Will not sharechain splits occur naturally as Bitcoin forks diverge?
I agree that this is preferable. Unfortunately, sharechain splits will NOT automatically occur with the current code. This presents the issue where a person mining one one blockchain (e.g. Cash) would get paid by miners on a different blockchain (e.g. no-2x). Fixing this is a medium-difficulty task.

BCH already exists. How could a BCH miner get paid for P2Pool work now? The BCH blocks do not fit BTC head. Only if the miner is mining BCH transactions on the BTC head. And although P2Pool should avoid that I think it is not a real issue.
hero member
Activity: 818
Merit: 1006
Jtoomim I need to point something out to you. Irrespective of what your and my positions may be on the fork, this forum will be following core's lead since it is a private forum run by Theymos. This means that if and when a 2x fork happens, anything mining on 2x will be considered an altcoin and your p2pool will be relegated to the altcoin pool section. Let me make it clear that I'm not passing my own judgement on the issue here, but simply pointing out how it will be handled on the forum. Feel free to debate it in meta/ (and not with me, I'm not the one deciding here) but I can guarantee you that's how it will play out.

Yes it's going to be very lonely in here...
Noted.
hero member
Activity: 818
Merit: 1006
P2Pool should provide support for separate BitcoinCore or BTC1 or BCH with separate sharechains. Will not sharechain splits occur naturally as Bitcoin forks diverge?
I agree that this is preferable. Unfortunately, sharechain splits will NOT automatically occur with the current code. This presents the issue where a person mining one one blockchain (e.g. Cash) would get paid by miners on a different blockchain (e.g. no-2x). Fixing this is a medium-difficulty task.
-ck
legendary
Activity: 4088
Merit: 1631
Ruu \o/
veqtrus, what I personally prefer or what you personally prefer is irrelevant. SegWit2x has 92.76% support among miners at the moment, well above the needed threshold of 80% for activation. The only reason SegWit is being enabled is because it is part of SegWit2x. P2pool needs to support the majority blockchain.

Supporting minority blockchains like Bitcoin Core or Bitcoin Cash is desirable if it can be implemented in a way that does not conflict with support for the majority chain. Until that code is written, p2pool should consider minority chains to be unsupported.

You don't like 2x. I don't like SegWit. It doesn't matter. The majority has spoken.

https://coin.dance/blocks/proposals

If you wish to maintain your own no-2x fork of p2pool with a separate share chain, that would be appropriate.
Jtoomim I need to point something out to you. Irrespective of what your and my positions may be on the fork, this forum will be following core's lead since it is a private forum run by Theymos. This means that if and when a 2x fork happens, anything mining on 2x will be considered an altcoin and your p2pool will be relegated to the altcoin pool section. Let me make it clear that I'm not passing my own judgement on the issue here, but simply pointing out how it will be handled on the forum. Feel free to debate it in meta/ (and not with me, I'm not the one deciding here) but I can guarantee you that's how it will play out.

Yes it's going to be very lonely in here...
hero member
Activity: 633
Merit: 591
P2pool does not currently have any functionality to handle chainsplits gracefully. If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.

P2Pool should provide support for separate BitcoinCore or BTC1 or BCH with separate sharechains. Will not sharechain splits occur naturally as Bitcoin forks diverge? Nodes will begin to ban each other for sending work that does not apply to local Bitcoin HEAD?

It seems to me that if P2Pool can be tuned for SegWit or SegWit2x or 8MB blocks then P2Pool miners can happily choose the fork they want.

For me I am interested in a P2Pool to support SegWit. I monitor various work to choose patches for this but hope maybe official P2Pool pull will bring in support.

P2Pool is forking and Bitcoin is forking. I think it is all healthy. But there is a real danger if miners are not able to choose the forks they want.
member
Activity: 107
Merit: 10
veqtrus, signaling on bit 4 terminated after it was locked in. Showing a graph of current voting and saying "hey, there's no SegWit2x version bit signaling right now!" is like saying "hey, there's no BIP65 (OP_CHECKLOCKTIMEVERIFY) signaling going on right now!" Signaling terminates after it's locked in.
Do you have any evidence that bit 4 signaling was ever significant on P2Pool?
hero member
Activity: 818
Merit: 1006
veqtrus, signaling on bit 4 terminated after it was locked in. Showing a graph of current voting and saying "hey, there's no SegWit2x version bit signaling right now!" is like saying "hey, there's no BIP65 (OP_CHECKLOCKTIMEVERIFY) signaling going on right now!" Signaling terminates after it's locked in.

Xantus, that seems like a Windows-specific bug in my code. I'll have to look into it later.
member
Activity: 107
Merit: 10
Duce, that's not a bug in p2pool. It's because Bitcoin Core 14.2 does not support Segwit2x, which was enacted by 80-90% of miners about 2 weeks ago.  All versions of Bitcoin Core are about to become incompatible with the majority of the Bitcoin hashrate, as they do not support Segwit2x. If you continue to use Bitcoin Core, it is expected that you will be on the minority fork of a chainsplit in 2-3 months, when the 2x part of SegWit2x is enabled. I recommend that you either switch to btc1 or lobby Bitcoin Core to change their policy regarding SegWit2x.

P2pool does not currently have any functionality to handle chainsplits gracefully. If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.

So this means I've been syncing Bitcoin Core complete blockchain for months and I'll still be in March 2017
to my external drive for nothing?  Shocked

Nope. Jtoomim is misleading. If you want to continue mining Bitcoin stick to Core.
Also even if you choose to mine the 2x altcoin the btc1 client should be able to use the blockchain downloaded by Core.
hero member
Activity: 496
Merit: 500
Duce, that's not a bug in p2pool. It's because Bitcoin Core 14.2 does not support Segwit2x, which was enacted by 80-90% of miners about 2 weeks ago.  All versions of Bitcoin Core are about to become incompatible with the majority of the Bitcoin hashrate, as they do not support Segwit2x. If you continue to use Bitcoin Core, it is expected that you will be on the minority fork of a chainsplit in 2-3 months, when the 2x part of SegWit2x is enabled. I recommend that you either switch to btc1 or lobby Bitcoin Core to change their policy regarding SegWit2x.

P2pool does not currently have any functionality to handle chainsplits gracefully. If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.

So this means I've been syncing Bitcoin Core complete blockchain for months and I'll still be in March 2017
to my external drive for nothing?  Shocked
member
Activity: 107
Merit: 10
veqtrus, what I personally prefer or what you personally prefer is irrelevant. SegWit2x has 92.76% support among miners at the moment, well above the needed threshold of 80% for activation. The only reason SegWit is being enabled is because it is part of SegWit2x. P2pool needs to support the majority blockchain.

Supporting minority blockchains like Bitcoin Core or Bitcoin Cash is desirable if it can be implemented in a way that does not conflict with support for the majority chain. Until that code is written, p2pool should consider minority chains to be unsupported.

You don't like 2x. I don't like SegWit. It doesn't matter. The majority has spoken.

https://coin.dance/blocks/proposals

If you wish to maintain your own no-2x fork of p2pool with a separate share chain, that would be appropriate.

I have no problem with your fork other than it is misleading. Bitcoin isn't defined by miners but by the economic majority which hasn't reached consensus on 2x. Therefore labeling your fork as "Bitcoin P2Pool" is misleading.

Also where is this majority support among miners you speak of?

Block versions on main P2Pool
newbie
Activity: 43
Merit: 0
hey, it seams to run using phyton to exicute ...
so i downloading the share ..
well, http://131.117.146.223:9332 -> could that be right ?  Version 1 ?

seams it dont work  Undecided
now it lost al of the 6 connections, and wath does that mean ? :
Code:
Share check failed: 000000000000005a15a2a9eef3379f7c1e0c063774fff9f728b38dd9e7efeb17 -> 00000000000000609b18d98d223dffbb34b3a176f9969d0ff847f8ce0ba7fb40

Code:
2017-08-14 22:47:20.920000 P2Pool: 0 shares in chain (0 verified/16590 total) Peers: 0 (0 incoming)
2017-08-14 22:47:20.920000  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???

Code:
Unhandled Error
Traceback (most recent call last):
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\main.py", line 685, in run
    reactor.run()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1243, in run
    self.mainLoop()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1252, in mainLoop
    self.runUntilCurrent()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 878, in runUntilCurrent
    call.func(*call.args, **call.kw)
--- ---
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\bitcoin\stratum.py", line 38, in _send_work
    x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\work.py", line 212, in preprocess_request
    raise jsonrpc.Error_for_code(-12345)(u'p2pool is not connected to any peers')
p2pool.util.jsonrpc.NarrowError: -12345 p2pool is not connected to any peers

Share check failed: 00000000000000609b18d98d223dffbb34b3a176f9969d0ff847f8ce0ba7fb40 -> 0000000000000122d9e5182a7c37cb23400ae2995c13d62497671cd017b19394
Traceback (most recent call last):
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\util\deferral.py", line 233, in it
    res = gen.send(cur) # external code is run here
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\util\deferral.py", line 284, in _worker
    self.func(*self.args, **self.kwargs)
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\node.py", line 309, in clean_tracker
    best, desired, decorated_heads, bad_peer_addresses = self.tracker.think(self.get_height_rel_highest, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value)
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\data.py", line 554, in think
    if self.attempt_verify(share):
--- ---
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\data.py", line 532, in attempt_verify
    share.check(self)
  File "C:\Python27\p2pool-1mb_segwit\p2pool-1mb_segwit\p2pool\data.py", line 377, in check
    if self.timestamp > int(time.mktime(time.gmtime()) - time.mktime(time.gmtime(0))) + 300:
exceptions.OverflowError: mktime argument out of range


so i go to sleep  , gn8 2all
hero member
Activity: 818
Merit: 1006
jtoomim_performance is an obsolete branch from 3 years ago and is not supported.

To run p2pool from source, you need to install python 2.7, twisted, zope.interface, and a couple other things. There are some instructions on the github page for what you need to install:

https://github.com/jtoomim/p2pool/tree/1mb_segwit

Code:
Windows:

Install Python 2.7: http://www.python.org/getit/
Install Twisted: http://twistedmatrix.com/trac/wiki/Downloads
Install Zope.Interface: http://pypi.python.org/pypi/zope.interface/3.8.0
Install python win32 api: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/
Install python win32 api wmi wrapper: https://pypi.python.org/pypi/WMI/#downloads
Unzip the files into C:\Python27\Lib\site-packages

I've never actually run it from source on Windows, so beyond those instructions I can't help you. Maybe someone else has done it?
newbie
Activity: 43
Merit: 0
 Huh
Hey People, i downloaded from Github the jtoomim_preformance branche by chosing "Download zip" to test it.
But, i am a Windows user, unable to compile it...

is there an easy way ? - or should i easy wait until our tests are finished ?
hero member
Activity: 818
Merit: 1006
veqtrus, what I personally prefer or what you personally prefer is irrelevant. SegWit2x has 92.76% support among miners at the moment, well above the needed threshold of 80% for activation. The only reason SegWit is being enabled is because it is part of SegWit2x. P2pool needs to support the majority blockchain.

Supporting minority blockchains like Bitcoin Core or Bitcoin Cash is desirable if it can be implemented in a way that does not conflict with support for the majority chain. Until that code is written, p2pool should consider minority chains to be unsupported.

You don't like 2x. I don't like SegWit. It doesn't matter. The majority has spoken.

https://coin.dance/blocks/proposals

If you wish to maintain your own no-2x fork of p2pool with a separate share chain, that would be appropriate.
member
Activity: 107
Merit: 10
Duce, that's not a bug in p2pool. It's because Bitcoin Core 14.2 does not support Segwit2x, which was enacted by 80-90% of miners about 2 weeks ago.  All versions of Bitcoin Core are about to become incompatible with the majority of the Bitcoin hashrate, as they do not support Segwit2x. If you continue to use Bitcoin Core, it is expected that you will be on the minority fork of a chainsplit in 2-3 months, when the 2x part of SegWit2x is enabled. I recommend that you either switch to btc1 or lobby Bitcoin Core to change their policy regarding SegWit2x.

P2pool does not currently have any functionality to handle chainsplits gracefully. If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.

Bitcoin Core is also not compatible with Bitcoin Cash and all the other altcoins out there. "2x" will be an altcoin and therefore is irrelevant to the Bitcoin P2Pool network. Then again you are a BU supporter which is on par with your P2Pool fork attempt.
hero member
Activity: 818
Merit: 1006
Duce, that's not a bug in p2pool. It's because Bitcoin Core 14.2 does not support Segwit2x, which was enacted by 80-90% of miners about 2 weeks ago.  All versions of Bitcoin Core are about to become incompatible with the majority of the Bitcoin hashrate, as they do not support Segwit2x. If you continue to use Bitcoin Core, it is expected that you will be on the minority fork of a chainsplit in 2-3 months, when the 2x part of SegWit2x is enabled. I recommend that you either switch to btc1 or lobby Bitcoin Core to change their policy regarding SegWit2x.

P2pool does not currently have any functionality to handle chainsplits gracefully. If you are aware of the SegWit2x issue and wish to continue to mine with Bitcoin Core even though doing so will support a chainsplit, let me know and I will consider adding code to p2pool to make the p2pool sharechain split in parallel to the Bitcoin chain.
Pages:
Jump to: