19:00:02 #startmeeting 19:00:02 Meeting started Thu Feb 2 19:00:02 2017 UTC. The chair is wumpus. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:00:02 Useful Commands: #action #agreed #help #info #idea #link #topic. 19:00:07 hi 19:00:08 oh thats today? 19:00:18 #bitcoin-core-dev Meeting: wumpus sipa gmaxwell jonasschnelli morcos luke-jr btcdrak sdaftuar jtimon cfields petertodd kanzure bluematt instagibbs phantomcircuit codeshark michagogo marcofalke paveljanik NicolasDorier 19:00:29 yow. 19:00:37 BlueMatt: no, it's fake news. 19:00:37 BlueMatt: it's thursday I hope? 19:00:38 /s 19:00:49 luke-jr: alternative news 19:00:52 wumpus: alternative facts 19:00:53 heh 19:00:59 jinx 19:01:28 i don't have topics 19:01:32 foremost topic would be what to still include in 0.14, as rc1 release is planned for monday 19:02:09 I propose not including any bugs. 19:02:13 I think the current list (+#9671) are going to be required for release, sooooo 19:02:15 https://github.com/bitcoin/bitcoin/issues/9671 | Fix super-unlikely race introduced in 236618061a445d2cb11e72 by TheBlueMatt · Pull Request #9671 · bitcoin/bitcoin · GitHub 19:02:25 These are the issues tagged for 0.14 : https://github.com/bitcoin/bitcoin/issues?q=is%3Aopen+is%3Aissue+milestone%3A0.14.0 19:02:34 I think only remaining is the net stuff? 19:03:02 rebasing 9609 now. 19:03:14 hi 19:03:25 MarcoFalke: we added the signrawtransaction assertion too 19:03:25 do we have a fix for #9027 in the works yet? 19:03:26 https://github.com/bitcoin/bitcoin/issues/9027 | Unbounded reorg memory usage · Issue #9027 · bitcoin/bitcoin · GitHub 19:03:27 Imo the importmulti fixes can be done after 0.14 19:03:28 and importmulti 19:03:30 probably a good time to call for release notes additions 19:03:33 wumpus: I vote we push that one 19:03:36 (to 0.15) 19:03:48 BlueMatt: ok, no problem with that 19:03:55 because not-regression, it turns out 19:04:03 not regression? 19:04:07 slightly worse than it tused to be, but not so massively so that I think we definitely need to fix it asap 19:04:09 changing the API in the very next release would be unfortunate. 19:04:24 are the three rpc things necessary for this release? 19:04:24 gmaxwell: context? 19:04:29 sipa: you're the one who decided it wasnt! 19:04:30 gmaxwell: importmulti? 19:04:32 gmaxwell: fixing 9027 does not need an api change afaik 19:04:42 BlueMatt: oh! 19:05:04 we could disable importmulti if it isn't safe in time for the release 19:05:31 or leave it undocumented? 19:05:44 depends on whether the issue of #9491 is serious enough 19:05:45 https://github.com/bitcoin/bitcoin/issues/9491 | Importmulti api is confusing in a way that could lead to funds loss. · Issue #9491 · bitcoin/bitcoin · GitHub 19:05:58 fixing the fact that it's very easy to fail to rescan anything, when you thought it was... does. 19:06:22 yes undocumented or could add a "warning: experimental, API will likely change next release" in any case too 19:06:41 Or we just fix 9491... seems not very complex? 19:06:51 Can fix in rc2 if it's to late for monday? 19:07:26 sure 19:07:36 but there's no guarantee there is a rc2 19:07:40 okay, lets see where that goes in the next couple days. 19:07:47 I don't know how hard it is? it seems to have caused quite a discussion but no fix 19:07:50 importmulti seems akin to importprivkey which shouldn't be used by users anyway? 19:07:57 We can hide it right before cutting RC1 if nothing else. 19:08:10 yes 19:08:19 ashame, as it's a nice improvement. 19:08:27 i think the fix would be easy? 19:08:43 sure, that is why I said lets see. 19:08:52 who is working on it? 19:08:53 can't you just change the default timestamp to be 0? 19:08:55 but we have a fallback if it doesn't get fixed. 19:08:58 "lets see" only works if someone does it :p 19:09:08 achow101: then there is no easy way to express now. 19:09:29 Would a fix where we set the importmulti timestamp to 0 instead of "now" do it for 0.14? 19:09:37 gmaxwell: using time() from your OS? 19:09:40 *default timestamp 19:10:04 -1 for "now" 19:10:05 or have no default at all and require a time to be specified 19:10:14 wumpus: +1 19:10:19 wumpus: no default at all is nice since it allows a default to be chosen later 19:10:31 0 as timestamp is very inefficient. 19:10:34 Lets not hash it out here, there is an issue. 19:10:45 Okay. Lets comment there. Agree with gmaxwell 19:10:57 I agree with jonasschnelli in the sense there that we really have to stop assuming a full rescan is possible. 19:11:28 good point, yes 19:11:34 Is also very inefficient if you have pruned or run hybrid SPV 19:11:37 it certainly shouldn't be the default 19:11:37 It takes many hours on my normal development system, and is still quite slow even on the fastest hardware available. But avoiding the rescan takes second seat to surprising the user. :) 19:11:40 it's inefficient and lazy 19:12:37 in my view, except for certan recover operations that are infrequently done-- rescan effectively doesn't work anymore (takes more time than converting your entire usage to a third party api...) 19:13:22 users of the API should be encouraged to keep track of key birthdates 19:14:05 if we define a new private key format in the not so far future, we should make sure its string clearly integrates a birthdate. :P 19:14:25 ok, so discuss on the issue....next topic? 19:14:26 a full rescan is indeed only something that should be done for infrequent recovery reasons 19:15:58 no other topics? 19:16:22 shortest meeting ever 19:16:58 I had expected heated debates on what to include last-minute in 0.14 and why to delay the rc, what a disappointment! 19:17:02 great, lets get 0.14 done so I can get back to writing code :) 19:17:10 Heh. 19:17:13 let's talk about code style again 19:17:15 wumpus: I vote we push it back a month so we can do all the things we wanted to a month ago :p 19:17:25 BlueMatt: lol! 19:17:42 wait, i had something to talk about re: cde style 19:17:43 hum 19:17:54 BlueMatt: die 19:17:55 i'll get the baseball bat 19:17:56 oh, auto 19:18:02 Bumpfee: is there a reason why the logic is in the rpcwallet.cpp and not in wallet.cpp? 19:18:13 Makes it really hard to use in the gui... 19:18:24 jonasschnelli: please move it, agreed 19:18:25 jonasschnelli: it can be moved 19:18:25 jonasschnelli: i think we can refactor as needed 19:18:29 in 0.15* 19:18:33 jonasschnelli: because it's only used in rpcwallet.cpp, if you need it in a more general place move it 19:18:40 Okay. 19:18:54 BlueMatt: i am strongly in favor of auto. 19:18:59 * sipa hides 19:19:00 jonasschnelli: although moving everything to wallet.cpp isn't very nice either, we should refactor the wallet code some day 19:19:03 I did suggest it earlier, but didn't seem like a blocker for merging 19:19:06 I'm also in favor of auto 19:19:15 sipa: it makes certain review much, much harder (I often grep for "everywhere X is used") 19:19:15 wumpus: well, it's wallet code.. 19:19:23 and have already missed things as a result 19:19:24 luke-jr: so? not all wallet code needs to be in one file 19:19:35 forbidding auto is just masochism 19:19:41 wumpus: yes. Thats a good point. 19:19:42 wumpus: i wasnt voding forbidding it 19:19:46 BlueMatt: introduce an incompatible change to the type, and recompile. tadaa, all places it is used 19:19:49 only carefully considering its use 19:19:50 sipa: same. BlueMatt: maybe paste the thread in question? 19:19:56 I like auto when the type is implied by some other type; eg, instead of xyz::value_type 19:20:05 yeah, but not forbidding it doesn't mean recommending it always either 19:20:10 https://github.com/bitcoin/bitcoin/pull/9609#discussion_r98335218 19:20:15 we have a whole src/wallet directory which could have tons of different implementation files for different facets of the wallet, instead of stashing it all into one file 19:20:39 (I believe gmaxwell's comment there was intedned for a different line) 19:20:44 yes. Stuff like coin selection should be more modular 19:21:04 sure, as with any use of any c++ statement, use of auto should be measured 19:21:08 Lets do it after priority removal 19:21:18 Otherwise we step on each others toes 19:21:24 if you have some specific cases where it's bad to use auto, please document them 19:21:27 wumpus: mostly only things that are /actually/ a mile of text to type, imo 19:21:57 BlueMatt: and not needing to change things all over the place when you turn a tuple into a struct 19:22:07 or add a wrapper 19:22:08 sipa: I have no problem reviewing sed-based changes 19:22:16 in fact prefer that 19:22:18 BlueMatt: there's plenty of those - c++ is overly verbose, auto is a great advancement 19:22:21 they're still annoying to fo 19:22:27 since I'm gonna go read every single place the change effected anyway 19:22:28 to review 19:22:30 *to do 19:22:50 and of course, let's consider on a case by case basis 19:22:55 right 19:22:56 wumpus: sure, iterators in iterators, np 19:23:03 yea, ok, whatever, I'll shut up 19:23:04 but in my own preference, that is overwhelmingly the case 19:24:00 well the specific case here is for loops. "for (auto& foo : bar)" 19:24:01 Agree with BlueMatt, that auto should not be used unless necessary. 19:24:04 any reason not to use auto there? 19:24:04 BlueMatt: the question is, do you have a general advice on when not to use auto? 19:24:22 it's never *necessary* auto is just nice 19:24:24 cfields: yes, so I can grep and review if the type's behavior changes in some way 19:24:36 jtimon: personally, if the type really, really doesnt matter 19:24:40 cfields: if it's liable to produce bad results with bar changing under it 19:24:50 (which means very rarely use it) 19:24:56 BlueMatt: I'm afraid "doesn't matter" it's too vague here 19:25:04 I don't think this is going anywhere, too much isagreement 19:25:04 eg if you're taking an iterator and passing it through to another function 19:25:08 any other topics? 19:25:22 BlueMatt: function arguments can't use auto, right? 19:25:29 indeed 19:25:50 c++14 and later introduce some auto types in lambdas 19:25:53 wumpus: correct, but eg doing auto it = map.find(thing); if (it != ma.end()) DoThingWith(*it); 19:25:56 is like not a problem 19:26:23 auto it = map.find(thing); if (it != ma.end()) ILikePonies(it->second.rainbows); I do not like 19:26:24 BlueMatt: how is that different from a for (const auto& x : container) {} 19:27:08 sipa: because in the specific case here the thing in the loop is not defined to take a specific type 19:27:12 it is templated 19:27:15 my question was, do you have a deductive method for finding the not ok cases instead of an inductive one for the "not a problem cases"? 19:27:21 you can see that as an oblivious loop with iterators, and passing *it to a function that is tje body of the loop 19:27:38 jtimon: jtimon: personally, if the type really, really doesnt matter 19:28:12 i see your point, but i don't think it weighs up against the benefitd 19:28:14 *benefits 19:28:20 if you're iterating over some container, the type of container usually really doesn't matter, unless you make specific assumptions (but then you'd generally not be using a range for loop in the first place) 19:28:41 wumpus: imo if you are ever actually dereferencing the type you should not use auto 19:28:56 BlueMatt: your own example dereferences... 19:28:57 if you're dereferencing the iterator to eg a pair or just taking the element and passing it to something else, ok 19:29:08 but if you're dereferencing it and accessing something inside it, no 19:29:27 then we might as well not use it at all, i think 19:29:46 ok, I think I get what you mean by "doesn't matter" now 19:29:52 sipa: there are many places where you might do for (auto& thing: list) ActOn(thing); 19:29:55 thats reasonable 19:30:08 requiring programmers to spell out redundant information just so you can grep for it seems extreme to me 19:30:27 sipa: so functions shouldn't have prototypes? :) 19:30:27 yes, I didnt expect people to agree with me...I have extreme distaste for auto, personally 19:30:33 yes, that' extreme, and not going tohhappen. Just use smarter tools. 19:30:42 wumpus: suggestions? 19:31:00 * BlueMatt would love a grep --allusesoftype thing 19:31:30 it should be fairly easy to implement using clang's parser, would be surprised if it doesn't exist 19:31:50 There is another side to it is that auto enables you to write code that acts on a type while having no idea of the type yourself. Which is safe 99% of the time and deadly the rest. 19:32:20 because in C++ not all operations which are catgorically unsafe on a type are actually stopped by typechecking. :( 19:33:41 I have an auto to a container... and then I extract an auto to an iterator on it and erase things. Is my code guilty of the sin of using an invalidated iterator? It depends on what container was in use, and that was hid by auto... 19:34:08 But... that sort of thing is an edge case, I'd love to see a realistic list of where auto is likely to cause problems, just to keep it in mind. 19:34:29 right - just keep it in mind while reviewing 19:34:43 and if there are well-defined cases where auto is dangerous, they should be documented in the developer notes 19:34:57 ehh, ok, well I go read all of wallet half the time reviewing wallet changes, i guess I'll just start doing that for net, too :p 19:35:13 (not a bad thing, that) 19:35:29 unfortunately, auto is most interesting when you have some horrible complex signature. But those are the cases where it is also more of an issue. 19:36:07 gmaxwell: for(auto& : foo) doesn't give you an iterator though, just a reference. So imo that should be highly preferred when possible to avoid your example. 19:36:19 well no, it's most interesting for bog-standard loops, 99% of the cases. If you're doing anything horribly complex, that's probably where you should be careful 19:36:32 BlueMatt: we can agree that auto is totally fine for unittests too, right? :p 19:37:20 (preferred over auto foo = bar.begin(), that is) 19:37:23 wumpus: well my point is that stating the type explicitly is just as easy as auto when it's simple and obvious. 19:37:29 gmaxwell: when you have some horrid complex type signature, best practice is to introduce a typedef for it... that also results in succint usage, and lacks the review concerns that BlueMatt has i think 19:37:36 I agree it removes clarity some times 19:37:48 gmaxwell: it's *easy* but the point is to avoid unnecessary verbosity/typing, not so you can forget the type 19:37:54 sipa: yes, agreed, also means dont use auto in place, which some people like to do 19:38:10 but I don't have a clear criterion on when to use it like matt 19:38:14 wumpus: I'm generally 100% in favor of extra verbosity 19:38:25 e.g. to avoid having to type std::vector for the zillionth time 19:38:25 fking java programmers. :P 19:38:27 BlueMatt: go use java 19:38:28 extra verbosity generally means less magic, which makes review easier 19:38:33 lol, i expected that.... 19:38:36 (though on type signatures, I usually also prefer being explicit more often) 19:38:44 BlueMatt: that's not categorically true, more verbosity also means more distraction 19:38:51 agree 19:38:58 wumpus: well, ok, more verbosity as long as it actually provides information 19:39:05 nobody actually looks at what large type definitions contain 19:39:06 having lot's of boilerplate does *not* equal easier review 19:39:11 public static void main(String[] args) {} probably doesnt provide more information 19:39:26 anyhow 19:39:29 sipa: I do! 19:39:35 any other topics? this is going the wrong way 19:39:40 haha 19:39:44 lol 19:40:23 soooo...endmeeting? 19:40:26 #endmeeting