As a separate issue, I now realize that current P2Pool doesn't allow *expressing* support for SegWit, due to line 372 in
work.py, which veqtrus's changes don't touch:
version=max(self.current_work.value['version'], 0x20000000),
If anyone can confirm that fixing that is as simple as changing it to
version=max(self.current_work.value['version'], 0x20000002),
, then I will publish a new P2Pool release with that change.
forrestv, I think you might be confusing min and max here. The current code allows for people to signal for SegWit if they want, but it requires that people signal for BIP9 (that is, if 0x20000000 is greater than bitcoind's reported version, then we use 0x20000000). The code you are proposing would *require* p2pool users to signal for SegWit, even if they're running a version of bitcoind that doesn't support SegWit, and even after SegWit is activated (which itself is a violation of BIP9).
It might be best to change that line of code to this, and end the editing of this line once and for all:
version=self.current_work.value['version'],