Friday, 2014-08-08

*** tpb has joined #pettycoin00:00
rustyarhuaco: I just sent you 12345 (petty)bits.  It's still pending...01:07
arhuacorusty: Thanks. "./dumbwallet balance" is stuck. "write(3, "{ \"method\" : \"listtransactions\","..., 101) = 101" and now it is waiting for a fread(3).01:46
rustyarhuaco: I think this is the same as but #2201:47
rustyarhuaco: bug #2201:47
rustytbp: help01:48
rustyarhuaco: I'm seeing similar things, where I/O isn't being processed.  Debugging now...01:48
arhuacorusty: Good. I'll be back soon.01:52
arhuacorusty: Back. I'll be around tonight. I'll try to help. I don't know how yet, but I guess I'll find out.02:50
rustyarhuaco: cool... my bug turned out to be different, am chasing now.02:50
rustyarhuaco: well, hopefully fixing now.02:50
rustyarhuaco: might be work make distclean though?02:51
arhuacorusty: Testing.02:52
arhuacorusty: Ah, adding distclean? I am not very good with autotools but I can try. Looking...02:55
rustyarhuaco: no, I have disclean alreeady.02:55
rustyarhuaco: if you grab latest, I rewrote Makefiles a bit.  But they still don't do auto dependencies, so make distclean && ./configure && make02:56
arhuacorusty: Ah, sorry. Got it. I did it twice and I did not notice it worked the first time. And obviously the second time it did not.02:56
rustyarhuaco: ah, the first time it deleted the Makefile :)02:56
arhuacoIt got stuck in the same place. I did not notice new commits to try. But with clean build the result is the same.02:58
arhuacorusty: I'm looking at dumballet.c. It would be nice to (try to) connect to the server from Python. I think it would help me learn a lot about how the keys are being managed and about the protocol. And I guess I could use that to do stress testing .03:05
rustyarhuaco: hmm, great you can reproduce!  I'll try to do the same here.  What are the steps?03:06
rustyarhuaco: did you restart pettycoin BTW?03:07
rustyarhuaco: the API is JSON, but it's very incomplete.  I'm adding it as we go, so feel free to ask for more :)03:07
rustyarhuaco: where it make sense, I'm using the bitcoind commands.03:07
rustybrb, grabbing food....03:07
arhuacorusty: distclean, then build, then start the server "./pettycoin --reward-address=P-mmXqi49TyZFSZCKkCDZm4nVWynDck8nGan --log-level=info", then  "./dumbwallet balance". With strace I notice it gets stuck waiting for a reply after invoking RPC with "listtransactions".03:09
arhuacorusty: Yes.03:09
arhuacorusty: I will have some free time this month and I'd like to learn and contribute a bit. I think that if I start working with the RPC (starting with the python client) I'll understand things and eventually I will be able to contribute in the C world later, when I understand more.03:14
rustyarhuaco: weird.. works fine here.03:23
arhuacorusty: I see. I started the server with debug logleve to see if I can see more.03:26
rustyarhuaco: OTOH, it says I have 0 balance, which is wrong too.  Will fix that, then see if I can reproduce.03:26
arhuacorusty: Good. Mine get stuck and I am sure I have a clean build.03:27
rustyarhuaco: I like bugs which happen every single time :)03:27
rustyarhuaco: oh, wait, it's correct.  Horizon on test network is 12 hours, so no surprise my pettycoin are "gone".03:33
arhuacorusty: :-)03:34
arhuacorusty: They do not get returned to a gateway yet, right?03:34
rustyarhuaco: exactly!03:34
rustyarhuaco: I forgot how short the horizon was on the test network!03:34
rustyarhuaco: actually, comment is wrong, it's 120 hours.   Let me fix that comment, too.03:36
githubby[pettycoin] rustyrussell pushed 5 new commits to master: http://git.io/OwU6wQ03:40
githubbypettycoin/master 97d1853 Rusty Russell: json_add_tx: separate JSON printing of a TX into its own file....03:40
githubbypettycoin/master 2df86f2 Rusty Russell: gettransaction: new JSON command....03:40
githubbypettycoin/master 4cb6d34 Rusty Russell: getinfo, dev-listtodo: beef up output....03:40
*** arhuaco has quit IRC03:57
*** arhuaco has joined #pettycoin04:11
arhuacorusty: This might help. The first two times or so I get the output I sent you, and then it cannot connect.   http://pastebin.com/4atCqZiZ04:11
tpbTitle: So, it starts like this. I can Ctrl+C a few times with the same result. The fir - Pastebin.com (at pastebin.com)04:11
rustyarhuaco: strace -p `pidof pettycoin` might be useful, to see what it's doing...04:12
arhuacorusty: OK.04:12
arhuacorusty: It seems the pool call doesn't accept the new connection. It's stuck with this: poll([{fd=5, events=POLLIN}, {fd=6, events=POLLOUT}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=7, events=POLLIN}], 5, -1) = 3 ([{fd=6, revents=POLLOUT}, {fd=8, revents=POLLIN|POLLHUP}, {fd=7, revents=POLLIN|POLLERR|POLLHUP}])04:20
arhuacowrite(6, "@E\4\0\4\0\0\0\34\225\254`:\4\370k\304\262\374j\322Z\303C\222\326\16\244\370V\365\350"..., 27987204:20
arhuacorusty: So if the backlog is small that would explain why the behavior changes.04:20
arhuaco(poll I mean..)04:20
rustyarhuaco: I'm seeing the same thing... massive delays on that write!04:20
rustyarhuaco: what's weird is that poll() said it was ready.04:21
rustyarhuaco: for example:04:24
rusty04:17:40 poll([{fd=5, events=POLLIN}, {fd=19, events=POLLIN}, {fd=6, events=POLL04:24
rustyIN}, {fd=15, events=POLLIN}, {fd=8, events=POLLIN}, {fd=-11}, {fd=7, events=POLL04:24
rustyOUT}], 7, -1) = 1 ([{fd=7, revents=POLLOUT}]) <0.000014>04:24
rusty04:17:40 write(7, "\224]\4\0\4\0\0\0\200\203\16\234\v\262\276\321h\357\217Y\0\204\21\31\253\304#U\0206}\20"..., 286100) = 159280 <98.894019>04:24
rusty004:24
rustyThat write takes 98 seconds!04:24
arhuaco Oh, so it eventually finishes. I guess you're reaching a timeout.04:26
arhuacorusty:I'll try not canceling the command to see if it finishes.04:27
arhuacorusty: Waiting for peer...04:31
rustyarhuaco: Hmm, let me leave the fd in non-blocking mode and see if that helps.  It shouldn't, but...04:32
arhuacorusty:I It behaves in a different way when there are no connected peers.04:48
rustyarhuaco: I think so... it's that massive write blocking.04:49
rustyarhuaco: I plan on changing the sync protocol so the write isn't as big, but also it shouldn't be doing that anyway.04:49
rustyarhuaco: hmm, making the sockets nonblocking seems to have fixed it.  I'm surprised...05:06
arhuacorusty: :-)05:06
rustyarhuaco: I will commit that now.05:06
rustyarhuaco: pushed!05:36
arhuacorusty: Testing...05:37
arhuacorusty: Not pushed yet...05:38
rustyarhuaco: sorry!  One sec...05:38
rustyarhuaco: ok, this time for sure!05:42
githubby[pettycoin] rustyrussell pushed 2 new commits to master: http://git.io/9TkzIQ05:42
githubbypettycoin/master ae6afdf Rusty Russell: gettransaction: fix tests....05:42
githubbypettycoin/master 5a4c143 Rusty Russell: ccan: update (non-blocking I/O working)...05:42
arhuaco0.00 bits.05:44
rustyarhuaco: I guess that's progress, in a way :)05:50
arhuacorusty: :-)05:50
*** rusty has quit IRC06:00
*** rusty has joined #pettycoin06:12
*** rusty has quit IRC06:21
*** rusty has joined #pettycoin06:33
*** rusty has quit IRC07:13
*** rusty has joined #pettycoin07:20
*** rusty has quit IRC07:26
*** rusty has joined #pettycoin11:19
*** rusty has joined #pettycoin11:20
arhuacorusty: Hello there. I noticed that reading the JSON call form pettycoin is funny because you have to count {} to see when the reply ends (and use non-blocking I/O). I am writing some code that does that, but I am also checking if an existing library works. There are not many examples for UNIX sockets and JSON/RPC.11:32
arhuacorusty: (Or even socket transport, in Python...)11:32
rustyarhuaco: yes, it's weird.  The C/jsmn library works because it will tell your if the JSON is partial, and you can read more :)11:33
rustyarhuaco: I did think about the socket thing, too.  bitcoind uses a TCP socket for JSON commands, which is weird, but I guess more portable?11:33
arhuacorusty: Well, for Windows :-)  I don't know other OSs.. Mostly linux and a bit of other popular UNIXes.11:36
rustyarhuaco: well, we could have a oneshot mode where we ask pettycoin to close the socket after the response?11:36
arhuacorusty: That would make things simpler. I don't think the current way is too problematic, (I'm close to finish the parsing), but that is a bit advaced... With the oneshot it will be easier to implement clients.11:38
arhuacorusty: I was thinking that when I finish the reader, then I can do a pettycoin-rpc to HTTP+rest-RPC proxy. It could be useful.11:40
rustyarhuaco: or perhaps rewrite the pettycoin-rpc to be rest-er? :)11:41
arhuacorusty: :-) Well, the current way of calling pettycoin-rpc is a bit weird. People might get discouraged to write clients. Thinking.11:43
arhuacorusty: The issue is that you might not know the length of the response in advance. So I do not know how clients deal with this. Checking... Most documentation for JSON-RPC deals with HTTP so that's why I'm a bit confused (Cannot find examples for the libraries available in latest Ubuntu).11:46
arhuacorusty: rpc = jsonrpclib.Server('unix:/pettycoin-rpc'). This one gets accepted but I do not know how to proceed form there. Checking...11:48
arhuacorusty: the 'unix:' prefix is accepted, so I guess it is supported. I wonder if it does the partial-reading thing correctly...11:50
arhuacorusty: closing the connection makes things easier with this. But I wonder whether it will make things inefficient.11:52
arhuacorusty: I better finish the reader. It is more efficient this way.  But if you think I can help with the RPC interface let me know.11:58
rustyarhuaco: I stole the interface from bitcoind; suggestions welcome!11:58
arhuacorusty: Yeah, I guess that's why they did this. It is weird (compared with HTTP), but efficient.... so I guess it is OK. I'll finish what I was doing. I was just a bit worried of reinventing the wheel.12:00
rustyarhuaco: OK.  I'm extending the horizon on the test network to 3 days, BTW.  12 hours is too short :)12:06
arhuacorusty: :-) I'm gathering testnet bitcoins. BTW, it seems bitcoind uses HTTP!12:07
rustyarhuaco: yes, it's JSON over https.  That seemed like a security nightmare to me; I'd prefer a proxy for that!12:08
arhuacorusty: Well, I'll finish the reader. More efficient. I can write the proxy then to make things easier for others.12:08
* arhuaco will get grab breakfast. B.B. soon.12:18
* arhuaco will grab breakfast. B.B. soon.12:19
*** rusty has quit IRC12:59
*** rusty has joined #pettycoin22:47

Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!