-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Python3 #25
base: 1mb_segwit
Are you sure you want to change the base?
Conversation
Enables support for bech32 and p2sh addresses. Bech32 support is defined by HUMAN_READABLE_PART and P2sh support is defined by SEGWIT_ADDRESS_VERSION. Cherry-picked from d2abd263b62043427e1691d49558cb0781c6193d Fixed up for Bitcoin and Litecoin. -Robert LeBlanc <[email protected]>
and Bech32 addresses.
the pubkey hash doesn't have enough information to accurately reconstruct the address. This isn't complete, but at least isn't completely failing. Still need to run test for the different coins and make sure that upgrading works fine.
Enables support for bech32 and p2sh addresses. Bech32 support is defined by HUMAN_READABLE_PART and P2sh support is defined by SEGWIT_ADDRESS_VERSION. Cherry-picked from d2abd263b62043427e1691d49558cb0781c6193d Fixed up for Bitcoin and Litecoin. -Robert LeBlanc <[email protected]>
and Bech32 addresses.
the pubkey hash doesn't have enough information to accurately reconstruct the address. This isn't complete, but at least isn't completely failing. Still need to run test for the different coins and make sure that upgrading works fine.
execution time. Num TXs: 2837 Old calculate_merkle_link run #0: 124.855 ms. Old calculate_merkle_link run p2pool#1: 111.246 ms. Old calculate_merkle_link run p2pool#2: 108.213 ms. Old calculate_merkle_link avg: 114.771 ms. New calculate_merkle_link run #0: 13.263 ms. New calculate_merkle_link run p2pool#1: 12.961 ms. New calculate_merkle_link run p2pool#2: 13.519 ms. New calculate_merkle_link avg: 13.248 ms.
/web/pings is not working yet, the list comprehension that is used is buggy in 3.x (https://bugs.python.org/issue10544) so it needs to be changed to for loops, but I want to get this code out for testing. Removed the UPnP code as it is extreamly old and there is no good SOAP clients that don't have a lot of dependencies. Removing for now, may put it back in later. For now, just manually forward your ports from your router (most people are probably already doing this). Works with peers that are using the Python2 version. Has the stripped out shares for share version 34.
and created a setup.py file that installs p2pool with dependencies. It also builds the scrypt module automatically. P2Pool can be installed system wide, in a user home directory or a virtualenv. It can also be pushed to PyPi and installed with pip if we want later on. Some fixes to the web interface to show something at the very start of a new pool instead of erroring until there is 10 shares. If web-static is specified, the web-static supplied by P2Pool is now avaialable under /orig as well.
I cleaned up the build process in preparation for the work on the share components. I've changed the setup.py so that it builds the ltc_scrypt module and makes sure dependencies are installed (Twisted for now). I've updated the code so that it works in the directory, or it can be installed system wide, in the user home directory or in a virtualenv to make things easier and more flexible. We can build distribution tarballs now with the sdist command as well. I added a few other fixes to the website so it isn't crashing when there are less than 10 shares, it may not be 100% accurate, but better than nothing. I also added serving up the old P2Pool web interface at I'm leaning towards ProtoBuff and gRPC for the peer communication and disk storage for the shares. This was the impitus for updating the build environment, so that the dependencies are automatically resolved and the protoc files are built automatically. I've got a few more tests, but I think we can still support all the transactions in the block by just passing the txids around or maybe even an abbreviated txid. That will make peer communications light and fast, but still allow peers to build the share/block and verify it against bitcoind. Please let me know if anyone finds bugs along the way. |
Also, I removed the ability to build a Windows exe from the project. It wasn't documented and I don't know that it was used. I don't use Windows, but if it's a big deal then I can fire up a VM to make it work, but I'd rather focus on the shares. With P2Pool being able to be installed now, we may want to think about the default location for the |
Sory but i not install to test File "", line 969, in _find_and_load File "", line 956, in _find_and_load_unlocked builtins.ImportError: No module named 'p2pool.pow.ltc_scrypt' |
Did you run 'python3 setup.py build' and then 'sudo python3 setup.py
install'? Or did you install it into your user space or virtual
environment? It looks like the Scrypt module was not built and installed.
These are new instructions with the move to Python3. Be sure to check the
readme file for more info.
Sent from a mobile device, please excuse any typos.
…On Sat, Apr 20, 2019, 1:17 AM komato3huk ***@***.***> wrote:
Sory but i not install to test
builtins.ImportError: No module named 'p2pool.pow.ltc_scrypt'
Error while requesting best block header:
<p2pool.node.poll_header> ImportError: No module named
'p2pool.pow.ltc_scrypt'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588,
in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line
1184, in gotResult
_inlineCallbacks(r, g, deferred)
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line
1126, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389,
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
--- ---
File "/home/pool/p2pool_dev/p2pool/p2pool/util/deferral.py", line 44, in f
result = yield func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line
1128, in _inlineCallbacks
result = g.send(result)
File "/home/pool/p2pool_dev/p2pool/p2pool/node.py", line 296, in
poll_header
self.bitcoind_work.value['previous_block'])))
File "/home/pool/p2pool_dev/p2pool/p2pool/node.py", line 272, in
handle_header
bitcoin_data.block_header_type.pack(new_header))
File "/home/pool/p2pool_dev/p2pool/p2pool/bitcoin/networks/litecoin.py",
line 24, in
'p2pool.pow.ltc_scrypt').getPoWHash(data))
File "/usr/lib/python3.5/importlib/*init*.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 956, in _find_and_load_unlocked
builtins.ImportError: No module named 'p2pool.pow.ltc_scrypt'
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACW6TVY2LAQPDE2R3E4SPW3PRK7PJANCNFSM4GS4ODFA>
.
|
Yes of course I did it. this is after python setup.py install |
Hmm... Let's see if we can figure out where things went bad.
Please run the two commands again (pass -v, I think there is a verbose or
debug flag for setup.py) and post the output and see what shows up there.
Sent from a mobile device, please excuse any typos.
…On Sat, Apr 20, 2019, 8:36 AM komato3huk ***@***.***> wrote:
Yes of course I did it.
this is after python setup.py install
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACW6TV2OAOBYXF434XK4GYDPRMS5JANCNFSM4GS4ODFA>
.
|
|
I think I see what the problem is, I think there is a bug in the code where it is trying to open a file in the system area read/write to update the version information and the regular user can't do that. Try this to see if it works okay, and I'll try to fix this bug.
This will work around the bug by installing everything needed in your home directory with permissions that won't fail because it will not install things into the system directories. Sorry about the bug, this is my first time working with setuptools. |
not load the scrypt pow.
Okay, I think I fixed this bug if you want to try it out, just checkout again, build and install. |
Nice. |
Upgraded the code to work with Python3 (also works with Pypy3). UPnP was removed for now. The /web/pings is not working, I need more time to think about that. Everything else should be working. The code works with Python2 peers so you can use it with existing peers.
Please test the code and help shake out any other bugs. I don't recommend running this on your mainnet coins until more people have tested it.
Some performance numbers (17294 Bitcoin shares load time from disk)
Pyhon3 is almost 10% faster than Python2, but Pypy3 (6.0) is a little bit slower. I did not spend any time optimizing anything for Python3, just getting the codebase to run on Python3 right now. This code includes the code to strip out transactions with share version 34.