--- Log opened Fri Apr 12 00:00:42 2019 01:29 -!- TamasBlummer1 [~Thunderbi@p200300DD670F9D916506B7C4D522E0CB.dip0.t-ipconnect.de] has joined #rust-bitcoin 01:31 -!- TamasBlummer [~Thunderbi@p200300DD670F9D436506B7C4D522E0CB.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 01:31 -!- TamasBlummer1 is now known as TamasBlummer 01:50 < stevenroose> andytoshi: about Amount being used as value in txout 01:51 < stevenroose> There's two things: There is currently no default serde impl for Amount. 01:52 < stevenroose> I avoided adding the satoshi one as default (which would be the same one), to avoid users dealing with Core's RPC to accidentally forget to indicate to use the as_btc one and being in trouble. 01:52 < stevenroose> I could easily implement a default serde impl and use the as_sat one. 01:53 < stevenroose> But I do agree that doing JSON-specific stuff, or worse serde_json specific stuff, in our implementation is not nice. If we do that, we'd need to rename as_btc to json_as_btc or something. 02:01 < stevenroose> (The as_sat serde impl just serializes as a 64-bit int. That should be safe for all JSON impls except Javascript's, I suppose.) 02:03 < stevenroose> andytoshi, gmaxwell: what would be the ideal RPC/API protocol? What are the issues with gRPC? Except for the "ongoing maintaince problem". It's true that it's heavily Google-backed which could be a problem if they ditch it. 02:05 < stevenroose> But I've used it quite a bit a few years ago when dealing with lnd and btcd and it seems ok. I also like how it forces you to specify your API beforehand and your server can't accidentally deviate from it. 02:22 < gwillen> stevenroose: I like to plug capnproto over grpc, it is a full-featured protobuf+rpc system 02:23 < gwillen> grpc has the advantage of google backing, capnproto has the advantage of being by the same guy who wrote protobuf v2, and whose judgement I tend to approve of 02:23 < gwillen> (after he left google) 02:53 < gmaxwell> at least capnproto stopped leaking random bits of process memory by serializing out padding from structs... 03:01 < stevenroose> gwillen: so what is capnproto exactly? like an alternative protobuf rpc to grpc? 03:04 < stevenroose> Cap’n Proto was built to be used in Sandstorm.io, where security is a major concern. 03:04 < stevenroose> Wow, sandstorm is still a thing :o 03:10 < gwillen> stevenroose: it is a sequel to protobuf, plus a sequel to stubby (the google internal RPC thing), rolled into one package 03:10 < gwillen> it predates the existence of protobuf 3 03:10 < gwillen> so there are sort of duelling sequels to protobuf 2 now 03:17 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 03:21 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 252 seconds] 04:06 < stevenroose> gwillen: and how does it compare to protobuf 3? 04:06 < stevenroose> I would expect pb3 to have adopted the improvements they made as well if they make sense 04:15 < gwillen> they went fairly different directions, I think 04:15 < gwillen> I am not especially familiar with protobuf 3 04:20 < gwillen> if you read kenton's own assessment of protobufs vs capnproto, he gave up some stuff in capnproto to be able to get zero-copy 04:20 < gwillen> whereas protobufs have to be marshalled/unmarshalled at each end 04:21 < gwillen> so I think it probably depends on how important that is to you 07:15 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:28 < BlueMatt> ariard: cool! looks like its still failing tests on travis? 07:33 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 07:46 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:47 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 08:26 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 08:29 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 08:31 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 08:36 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Ping timeout: 250 seconds] 08:40 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 09:16 < ariard> BlueMatt: oh sorry, was good locally, accidentally pushed wrong branch! 10:09 < BlueMatt> ariard: hah, oos'd, I've done that before 10:09 < BlueMatt> ariard: looks like its still the same one? 10:19 < ariard> BlueMatt: ah corrected, was 1.22, others build were good 10:54 -!- schmidty_ [~schmidty@104-7-216-111.lightspeed.austtx.sbcglobal.net] has quit [] 10:54 -!- schmidty [~schmidty@unaffiliated/schmidty] has joined #rust-bitcoin 10:58 < stevenroose> nickler: you catched an interesting case 10:58 < stevenroose> it flips around the 1 10:58 < stevenroose> 0.0; 0.0; 0.00000001; 0.000000000000002220446049250313 10:58 < stevenroose> 0.0; 0.0; 0.00001; 0.000000000000002220446049250313 10:58 < stevenroose> 0.0; 0.0; 0.01; 0.000000000000002220446049250313 10:58 < stevenroose> 0.0; 0.0; 1000.0; 0.000000000000002220446049250313 10:58 < stevenroose> 0.999999999998181; 0.00000000999999999998181; 0.00000001; 0.000000000000002220446049250313 10:58 < stevenroose> I really hate dealing with this. We really shouldn't have to do this. I'm just gonna use the parsing logic for the float dumped to string. 11:01 < stevenroose> andytoshi: you're gonna hate the extra allocation probably, though.. I'm really open to a safe way to convert an f64 to an Amount. Again, I don't feel confident implementing such a thing. 11:13 < andytoshi> is there an analagous type in rust-bitcoincore-rpc? what is the relationship between that type and the rust-bitcoin Amount? 11:13 < andytoshi> can we just drop Decimal and not add Amount? 11:14 < andytoshi> the reason for Decimal was that we wouldn't have to deal with this shit.. 11:15 < andytoshi> i think Amount should just be a wrapper around u64, which de/serializes as a u64, which we can use in TxOut 11:15 < andytoshi> and basically just removes multiplication from u64 11:16 < andytoshi> then rust-bitcoincore-rpc can have its own type which does floating-point and string conversions and all that crazy stuff, and which knows how to convert to/from Amount 11:16 < andytoshi> or maybe rust-bitcoincore-rpc can implement its own json parser/serializer that can deal with Amount 12:07 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 12:18 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] 12:19 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 12:21 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 12:40 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 12:42 < nickler> stevenroose: I don't understand those numbers but okay ;) 13:05 < stevenroose> andytoshi: no, just currently I have the old Amount impl copied to rust-liquid-rpc for a project where we needed it 13:05 < stevenroose> Hmm, I do think it makes sense to have an Amount type in rust-bitcoin, fwiw. 13:05 < stevenroose> And the explicit serde impls take out accidental misuse. Like I said, I'm ok with having the satoshi serde impl as the default one. 13:06 < stevenroose> Even though I do like that it's explicit the way it is now, so it can never give us trouble when anything about amounts change in Bitcoin 13:07 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 13:08 < stevenroose> It is possible to move the Bitcoin serde impl to rust-bitcoincore-rpc. The main drawback is that any other project that deals with it would have to copy it or so. Like rust-liquid-rpc. 13:09 < stevenroose> It's also less convenient with things like jsonrpc's `into_result()` (i.e. when you can't use the `#[serde(with = "")]` construction. But that's already the case, tbh. 13:12 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Ping timeout: 255 seconds] 13:16 < stevenroose> andytoshi: another thing: how would I go about adding a fuzzer that generates random sequences of digits, then adds a randomly placed decimal point and then try parse this with all the possible denominators, and then serialize and parse this again? 13:38 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 13:41 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 13:42 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 14:39 -!- willpier_ [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 14:39 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Read error: Connection reset by peer] 14:57 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 256 seconds] 15:02 -!- willpier_ [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 15:10 < andytoshi> i'd just interpret the byte input as a string and try to parse that 15:10 < andytoshi> rather than trying to be exhaustive in explicit code 15:10 < andytoshi> if the parsing succeeds, serialize and check for equality with the input 16:01 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 17:05 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 17:32 -!- havik [uid311481@gateway/web/irccloud.com/x-alunefnlrdynpyvo] has quit [Ping timeout: 258 seconds] 17:34 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 17:38 -!- havik [uid311481@gateway/web/irccloud.com/x-gmhqpvhftbptzjgn] has joined #rust-bitcoin 17:49 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 17:49 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 17:54 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 264 seconds] 20:30 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 20:34 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 252 seconds] 23:52 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 23:57 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 264 seconds] --- Log closed Sat Apr 13 00:00:43 2019