F483 / btctxstore

I simple library to store/retrieve information in bitcoin transactions using OP_RETURN
MIT License
10 stars 15 forks source link

Port c_secp256k1to PY3 and use for signing/recovering #12

Closed F483 closed 8 years ago

F483 commented 8 years ago

Improve signing/validation performance buy using c implementation c_secp256k1.

See https://pypi.python.org/pypi/c_secp256k1

heunland commented 8 years ago

I hope you guys will kick this issue up in priority, considering that there are more and more people affected by the 401 Error now (see slack comments). I think this should be treated as a bug that needs to be fixed asap rather than just an enhancement. Setting my clock ahead by 10 sec did not help either.

mabeebam commented 8 years ago

Hey @F483, I absolutely agree with @heunland! Important for slow machines. (My machine is a raspberry pi, only process that is running besides system processes is dataserv-client)

Also happy to support in fixing this issue.

CJClaude commented 8 years ago

Just adding my support for getting this fixed. I'm seeing it frequently on a Linux box that is running NTP. Machine is a quad-core semi-current machine with idle cores.

F483 commented 8 years ago

I just noticed https://github.com/ludbb/secp256k1-py after I initially ported c_secp256k1 to python 3.

Will checkout if it is adequate and use it instead since it instead supports python 3.

nelsonpk commented 8 years ago

nelsonpk [9:54 AM] Server instability / slow response - I don't know whether anything is wrong with my setup (although nothing has changed recently), but over the last 24 hours or so, my non-GUI clients (2.1.4) keep hanging after failed responses when pinging the server - also the StorjTrackr utility doesn't seem to refresh successfully very often - anybody else seeing problems? I'm getting failures of UNAUTHORISED although the clocks are synced and URLError (TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time..........................)

pthalodezin [10:59 AM] @nelsonpk: try upgrading to 2.1.12 it may not take care of the issues, but at least you will be current and you won't be able to blame the old version

@pthalodezin: OK - I've updated a couple of my clients and am now getting strings of messages in the command window - sample attached - do you know if this is normal? pasted_image_at_2015_12_19_11_55_am_960

pthalodezin [12:04 PM] @nelsonpk, I don't know, I don't see that on my end or in my logs

​[12:04] seems like the beginning of network communication

nelsonpk [12:22 PM] @pthalodezin: Yes - looks like that to me as well, but it's happening far more on this client than the other.............the other just says 'refreshing neighbours' but they are the same executable - maybe this is something to do with the DHT implementation. It also keeps complaining about synchronising time due to Invalid Authentication headers, but I've done that and it doesn't make any difference - I wonder whether the test server that is being pinged is struggling to handle the load.................. Anyway, it appears that the clients are staying up, so I'll upgrade the others to match (I can still revert if it all starts going pear-shaped!)

pthalodezin [12:26 PM] are you also using the GUI? Just trying to figure out why my client isn't doing this. 2.1.12

nelsonpk [1:03 PM] @pthalodezin: No just command line - I don't trust the GUI as of yet...........

heunland [4:11 PM] @nelsonpk this issue has recently been reported by several users and @skunk explained that it has to do with the machine having a slow CPU and/or network. There is an issue on github already but it seems to be on low priority unfortunately

​[4:11] https://github.com/F483/btctxstore/issues/12

​[4:13] feel free to add a comment to the issue on github, I personally am experiencing the same problem and sure hope it will be treated as a bug to be fixed rather than an optional enhancement, as it seems to be affecting a significant number of testers.

nelsonpk [4:23 PM] @heunland: Interesting - The processes that keep hanging are on a dedicated I7 32GB machine with a 1GB n/w card - I also have 2 x internet connections, which aggregate to 250 Mb/s through a Vigor 2860 router with 1GB connection to my switch (I'm using 3 different users to keep the farms to 10T each) - they are connected by SCSI to 2 x Infortrend arrays, so there really shouldn't be any bottlenecks at my end. The problem has on;y manifested itself over the last 36 hours, which leads me to think it is at the server end where the problem is.

new messages heunland [4:27 PM] yes I agree it seems weird this just started affecting a lot of us in the last couple of days. I encourage you to report the info you just posted above as a comment to the issue on github I cited, this way Fabe will have some more info to go on when trying to address this problem.

mabeebam commented 8 years ago

Hi, "HTTP Error 401: UNAUTHORIZED" happened sometimes for me which I could fix with time resync, but in the last couple of days time-resync-ing doesn't help at all any more. Not listed in the stats since then.

F483 commented 8 years ago

pycoin has also added native binding which are optional. This should reduce dependencies and improve the validation speed so I will try this solution first.

I already pushed on the develop branch and will continue on the 26th, so anyone is free to continue if they have time over the holidays.

F483 commented 8 years ago

In examples/verify_speed.py you can find a test file to check if the speed improved.

To activate the native functions you will have to do the following.

$ PYCOIN_NATIVE=openssl
$ export PYCOIN_NATIVE
F483 commented 8 years ago

Done using the pycoin native functions.