--- Log opened Wed Dec 23 00:00:55 2020 00:08 < dr-orlovsky> andytoshi: what do you think of https://github.com/rust-bitcoin/rust-bitcoin/issues/534 ? 01:21 -!- shesek [~shesek@164.90.217.137] has joined #rust-bitcoin 01:21 -!- shesek [~shesek@164.90.217.137] has quit [Changing host] 01:21 -!- shesek [~shesek@unaffiliated/shesek] has joined #rust-bitcoin 01:57 -!- jeremyrubin [~jr@2601:645:c200:14:d16a:4949:3622:4cc0] has quit [Ping timeout: 264 seconds] 03:19 -!- Everett35Okuneva [~Everett35@static.57.1.216.95.clients.your-server.de] has joined #rust-bitcoin 03:23 -!- Everett35Okuneva [~Everett35@static.57.1.216.95.clients.your-server.de] has quit [Ping timeout: 246 seconds] 04:02 -!- tibo [~tibo@2400:4050:2a83:7000:7549:8143:68ed:2722] has quit [Remote host closed the connection] 04:02 -!- tibo [~tibo@2400:4050:2a83:7000:7549:8143:68ed:2722] has joined #rust-bitcoin 04:07 -!- tibo [~tibo@2400:4050:2a83:7000:7549:8143:68ed:2722] has quit [Ping timeout: 260 seconds] 04:36 -!- jonatack [~jon@88.124.242.136] has quit [Ping timeout: 240 seconds] 05:13 < darosior> cloudhead: no, since 0.19.0.1 iirc 05:14 < darosior> ok nvm " Note: this version of Bitcoin Core does not serve block filters over the P2P network" 06:54 -!- jonatack [~jon@88.124.242.136] has joined #rust-bitcoin 06:58 -!- jonatack [~jon@88.124.242.136] has quit [Ping timeout: 246 seconds] 06:58 -!- jonatack [~jon@213.152.162.15] has joined #rust-bitcoin 07:24 < andytoshi> dr-orlovsky: hmm, for OutPoint I see the value 07:25 < andytoshi> but for even TxIn and TxOut, these contain Script objects which are Vec 07:25 < andytoshi> and as elichai says there isn't any C repr for Vecs 07:36 < cloudhead> darosior: ok yeah, updated to master and all good now :) 07:36 < cloudhead> was confused too 07:57 < andytoshi> elichai2: see my comment at https://github.com/rust-bitcoin/rust-secp256k1/pull/264 ... i don't know how to fix the doctest :( 07:58 -!- belcher_ [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 08:01 -!- belcher [~belcher@unaffiliated/belcher] has quit [Ping timeout: 246 seconds] 08:03 -!- belcher_ is now known as belcher 08:17 < dr-orlovsky> Hm, fast reserch for `repr(C)` in Vec-containing structs shows that they are basically pointers + two extra `usizes` after pointer data. elichai2: can you pls provide more info of your experience with `repr(c)` for Vecs? 08:18 < andytoshi> Vec itself is not repr(C) though is it? 08:18 < dr-orlovsky> andytoshi: BTW `Script` is `Box<[u8]>`, not `Vec`, which makes the task even simplier 08:19 < andytoshi> i'm _sure_ that Box<[u8]> is not repr(C) lol 08:19 < elichai2> as andytoshi said. you can't wrap a non-repr(C) struct inside a repr(C) struct 08:19 < elichai2> all fat pointers have unstable memory repr 08:19 < andytoshi> yeah Vec is not repr(C) 08:19 < elichai2> so `Box<[u8]>` and even `[u8]` is not FFI safe 08:20 < elichai2> FYI you can easily check that by writing a extern "C" function that returns that type 08:20 < elichai2> it will print you a warning if it's not ffi safe and sometime why 08:20 < elichai2> (I wrote that lint :) ) 08:20 < elichai2> example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3b66a92c0c0227cb5c54e4d1aa6ef00d 08:21 < elichai2> (actually only part of the lint) 08:22 < dr-orlovsky> oh, I see. So the fact that rustc does not warns/errors on `repr(C)` does not mean anything... 08:23 < elichai2> yeah rustc only warns on improper_ctypes when you try to use them 08:37 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] 08:38 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 09:06 < dr-orlovsky> andytoshi, elichai2: Ok, I did `repr(C)` for OutPoint and SigHashType: https://github.com/rust-bitcoin/rust-bitcoin/pull/535 09:06 < dr-orlovsky> however this also require bitcoin_hashes modification https://github.com/rust-bitcoin/bitcoin_hashes/pull/108 09:09 < elichai2> If we want FFI I'd rather someone build a separate library that uses rust-bitcoin and converts to its own FFI types, IMO rust-bitcoin should concentrate on rust 09:09 < elichai2> (that's just my opinion though) 09:10 < elichai2> I'd love to help with a rust-bitcoin-ffi crate though if that's a real direction 09:11 < elichai2> It also sounds similar to BlueMatt's ldk 09:11 < andytoshi> i think that's reasonable 09:11 < andytoshi> dr-orlovsky: would there be a lot of value in only having those two types? 09:11 < andytoshi> i think it's potentially constraining to us and realistically they're the simplest possible things 09:12 < dr-orlovsky> Well, OutPoint is very oftenly used struct, so since it takes only 2 lines of code, why not have it? For others, I agree that w/o separate lib this will simply not work 09:13 < dr-orlovsky> (I mean frequently used even outside of TxIn and Transaction scope themselves) 09:45 < andytoshi> for OutPoint, it makes the library a tiny bit uglier for almost no benefit 09:45 < andytoshi> for SigHashType it might actually eliminate optimizations 09:46 < andytoshi> elichai2: got the unit tests to work with fuzzing! 09:46 < andytoshi> and good thing too, we actually broke them with the alignment stuff 09:46 < andytoshi> as in, Matt's code would segfault because he replaced some of the context-creation functions and our alignment code didn't adapt for this 09:49 < elichai2> dr-orlovsky: because it disables potential layout optimizations 09:50 < elichai2> andytoshi: nice! 09:50 < elichai2> I should probably rebase my c2rust branch so I could run miri on everything 09:53 -!- jeremyrubin [~jr@2601:645:c200:14:d16a:4949:3622:4cc0] has joined #rust-bitcoin 10:10 < dr-orlovsky> andytoshi: I agree that is not hard to replicate simple structure of OutPoint since we anyway need c wrappers for the rest of structs. Feel free to decline & close PRs 10:12 -!- brightblade [~brightbla@li1543-67.members.linode.com] has joined #rust-bitcoin 10:13 -!- brightblade [~brightbla@li1543-67.members.linode.com] has quit [Remote host closed the connection] 11:55 < BlueMatt> elichai2: i dont currently have any projects using external-symbols. the original motivation for it was to build rust-bitcoin-using stuff into bitcoin core, but that project basically faceplanted. 11:57 < BlueMatt> as for ffi, I believe valwal_ at least ran the ldk/rust-lightning ffi generator against rust-bitcoin and it didn't crash, so it may make sense to see if that generates sane ffi. 11:58 < BlueMatt> for rust-bitcoin it would likely require some "type X manually maps to Y" hard-coding, but thats ok. 11:59 < BlueMatt> of course we have a very different library from rust-bitcoin - lots of traits and user-provided stuff...hence the need to build an ffi generation layer 12:00 < valwal_> bluematt: i did have to fix a few things, never fully got it to run completely but came close. but since then we've added a bunch more support so it prob works better now 12:48 < BlueMatt> wait, andytoshi did you mean out of ragne pubkeys? 12:48 < BlueMatt> i managed to confuse myself. 12:49 < andytoshi> BlueMatt: no, i meant out of range seckeys 12:49 < BlueMatt> right, yea, please dont do that 12:49 < andytoshi> hehe ok 12:49 < BlueMatt> we panic all over if we get invalid privkeys...and i stand by that as reasonable and good practice 12:49 < BlueMatt> its more likely an indication that your rng is broken than anything else. 12:50 < andytoshi> yep that's air 12:51 < andytoshi> lol, amusingly in rust secp we actually have a rng test which makes 1000 keys and checks they don't collide 12:51 < andytoshi> which ofc fails just by dint of using an order-13 group 12:52 < BlueMatt> lol 12:53 < andytoshi> i don't -think- any real code would be doing something like this 12:54 < BlueMatt> yea....plus you get all kidns of funky hash collission edge cases in fuzztarget mode anyway, having to debug one more isn't the end of the world 13:08 < andytoshi> moving to #secp256k1 .. having some trouble with schnorrsigs 13:13 < andytoshi> pushed some example code though that you can look at 15:50 -!- tibo [~tibo@2400:4050:2a83:7000:448a:1b7d:d275:599] has joined #rust-bitcoin 18:36 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 18:38 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 21:20 -!- junderw [sid43070@gateway/web/irccloud.com/x-ytneqqleilqeaikv] has quit [Ping timeout: 260 seconds] 21:20 -!- jeremyrubin [~jr@2601:645:c200:14:d16a:4949:3622:4cc0] has quit [Remote host closed the connection] 21:21 -!- jeremyrubin [~jr@2601:645:c200:14:d16a:4949:3622:4cc0] has joined #rust-bitcoin 21:21 -!- fjahr [sid374480@gateway/web/irccloud.com/x-rtehnbkvgybyoxca] has quit [Ping timeout: 260 seconds] 21:21 -!- b10c [~b10c@2a01:4f8:192:612a:216:3eff:fef3:dc6a] has quit [Ping timeout: 260 seconds] 21:21 -!- b10c [~b10c@2a01:4f8:192:612a:216:3eff:fef3:dc6a] has joined #rust-bitcoin 21:23 -!- junderw [sid43070@gateway/web/irccloud.com/x-xfidcerscmeegofe] has joined #rust-bitcoin 21:23 -!- fjahr [sid374480@gateway/web/irccloud.com/x-vsrtwhdhadmhgjgq] has joined #rust-bitcoin 21:48 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 21:49 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 22:45 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 22:46 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 22:49 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 22:50 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 22:58 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 22:59 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 23:01 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 23:02 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 23:16 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-lsbztgetyjllqsza] has quit [Read error: Connection reset by peer] 23:18 -!- fjahr [sid374480@gateway/web/irccloud.com/x-vsrtwhdhadmhgjgq] has quit [Ping timeout: 258 seconds] 23:19 -!- fjahr [sid374480@gateway/web/irccloud.com/x-gcdbhvogjdnlkdpw] has joined #rust-bitcoin 23:20 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-oubabtrrrwohufbo] has joined #rust-bitcoin --- Log closed Thu Dec 24 00:00:56 2020