1 2016-09-08 01:39:57	0|veleiro|found the problem. couldnt get the depends build to work, but i removed /usr/local/lib/libboost* and /usr/local/include/boost* and reinstalled libboost-all-dev. thanks for the advice sipa
  2 2016-09-08 05:32:42	0|cfields|jeremyrubin: started reviewing your checkqueue, but the emplacer distracted me. Will pick up where I left off tomorrow.
  3 2016-09-08 07:34:14	0|wumpus|let's try to make cfields network refactor (https://github.com/bitcoin/bitcoin/pull/8085/files) happen , it's been open so long now, line-wise there's a lot of changes so he keeps having to rebase it
  4 2016-09-08 07:35:44	0|wumpus|/home/user/projects/bitcoin/bitcoin/src/test/addrman_tests.cpp:336:471: warning: stack frame size of 328360 bytes in function 'addrman_tests::addrman_delete::test_method' [-Wframe-larger-than=]    whoa :) luckily only in the tests
  5 2016-09-08 07:37:59	0|sipa|what is a reasonable max frame size?
  6 2016-09-08 07:38:05	0|wumpus|largest in the normal core code is a stack frame size of 67256 bytes in function 'ThreadSocketHandler', which is peculiar but not that bad
  7 2016-09-08 07:39:03	0|wumpus|64k or so for non-recursive code? most is far below that, even <10kB
  8 2016-09-08 07:40:34	0|wumpus|whopping 'warning: stack frame size of 984520 bytes in function 'net_tests::caddrdb_read::test_method'
  9 2016-09-08 07:41:46	0|sipa|8654 introduces a 9 kB struct in CTransactionSignatureChecker
 10 2016-09-08 07:41:55	0|wumpus|peanuts
 11 2016-09-08 07:42:09	0|sipa|984kB sounds like mild overkill, indeex
 12 2016-09-08 07:42:11	0|sipa|indeed
 13 2016-09-08 07:42:36	0|sipa|also, agree on making the net refactor happen
 14 2016-09-08 07:50:55	0|jonasschnelli|Yes. Net factor should happen... I have the PR running since a couple of days...
 15 2016-09-08 09:13:35	0|GitHub87|13bitcoin/06master 14f71d4a3 15Jeremy Rubin: Minimal fix to slow prevector tests as stopgap measure
 16 2016-09-08 09:13:35	0|GitHub87|[13bitcoin] 15MarcoFalke pushed 2 new commits to 06master: 02https://github.com/bitcoin/bitcoin/compare/ec139a5621a9...ddc308068d69
 17 2016-09-08 09:13:36	0|GitHub87|13bitcoin/06master 14ddc3080 15MarcoFalke: Merge #8671: Minimal fix to slow prevector tests as stopgap measure...
 18 2016-09-08 09:13:50	0|GitHub67|[13bitcoin] 15MarcoFalke closed pull request #8671: Minimal fix to slow prevector tests as stopgap measure (06master...06simple_faster_tests) 02https://github.com/bitcoin/bitcoin/pull/8671
 19 2016-09-08 11:41:17	0|translatoree3|Hello, need help with contributing a translation
 20 2016-09-08 11:41:54	0|translatoree3|I've seen transfix, so translations there get credit on the github bitcoin repo?
 21 2016-09-08 11:42:04	0|translatoree3|I'd like to get credit as I have a github account
 22 2016-09-08 11:42:55	0|translatoree3|is there a way to send a pull request if the Transifex process doesn't give contributor credit on github repo?
 23 2016-09-08 12:05:44	0|GitHub24|[13bitcoin] 15bitcoinsSG opened pull request #8683: fix incorrect file name bitcoin.qrc  (06master...06patch-1) 02https://github.com/bitcoin/bitcoin/pull/8683
 24 2016-09-08 13:25:45	0|sipa|cfields: nice work with the network refactor, and sorry for not having the courage earlier to read through 34 commits (it wasn't all that bad)
 25 2016-09-08 13:35:30	0|cfields|sipa: thanks. np about review. I haven't been pushy about it because it's pretty rough to get through. The next round should be much easier since after this PR it's mostly self-contained
 26 2016-09-08 13:35:58	0|cfields|and yes, sorry about the fors and ifs. I know that one bugs you. That's a habit that I can't seem to get out of
 27 2016-09-08 13:36:29	0|cfields|mm, I should get vim to fix that for me
 28 2016-09-08 13:36:29	0|sipa|i realize it's just preference, and i'm sure the existing spaces bother you too :p
 29 2016-09-08 13:37:16	0|cfields|not at all, they're only reminders that i forgot to space my changes around it (while re-reading post-commit, of course)
 30 2016-09-08 14:48:45	0|jeremyrubin|cfields: be sure to look on the latest; I fixed it i beleive
 31 2016-09-08 14:56:34	0|cfields|jeremyrubin: see github comments
 32 2016-09-08 15:02:36	0|morcos|cfields: i was just trying to review #8660, so this is also a regression caused by https://github.com/bitcoin/bitcoin/pull/7946?
 33 2016-09-08 15:03:12	0|jeremyrubin|cfields: yeah you weren't looking at the one i sent you yest
 34 2016-09-08 15:03:29	0|cfields|morcos: aha, probably so
 35 2016-09-08 15:04:24	0|morcos|cfields: i wonder if we need to think a bit more carefully about that pull.  is there anything other than the RPC tests that might be depending on wallets being synced onces cs_main is released
 36 2016-09-08 15:04:37	0|morcos|for instance you could imagine someone using bitcoin core has come to depend on that behavior
 37 2016-09-08 15:04:54	0|morcos|not saying it shouldn't eventually be changed, but seems like something that requires a bit more thought
 38 2016-09-08 15:05:13	0|cfields|morcos: think more about 7946, you mean?
 39 2016-09-08 15:05:17	0|morcos|yeah
 40 2016-09-08 15:06:12	0|jeremyrubin|cfields: oops I'm wrong you were sorry -- i need to fix my github notifs they suck
 41 2016-09-08 15:06:12	0|sipa|morcos: 8660? sure you have the right number?
 42 2016-09-08 15:06:14	0|morcos|what the RPC tests are uncovering is that the wallet can now be out of sync with the blockchain.
 43 2016-09-08 15:06:16	0|cfields|morcos: now that you mention it, i wonder if blocknotify is affected
 44 2016-09-08 15:06:41	0|jeremyrubin|sipa: morcos is referring to the already merged one
 45 2016-09-08 15:06:42	0|morcos|yeoops 8680
 46 2016-09-08 15:06:49	0|jeremyrubin|oops nvm
 47 2016-09-08 15:07:38	0|cfields|ok nm, blocknotify uses the same signal, so the wallet would already be synced there
 48 2016-09-08 15:07:49	0|sipa|cfields: for 8680, isn't it possible to use ping/waitforpong instead?
 49 2016-09-08 15:08:01	0|morcos|sipa: the issues isn't fixing it for the RPC tests
 50 2016-09-08 15:08:37	0|morcos|the issue is whether there are things other than the rpc tests that were relying on wallet always being synced with blockchain once cs_main was released
 51 2016-09-08 15:09:17	0|cfields|sipa: isn't that just punting the problem to "now we assume we're all synced" at a different point?
 52 2016-09-08 15:09:28	0|morcos|also ping/waitforpong would happen to work i think with the current architecture, but not necessarily in the future right..
 53 2016-09-08 15:10:11	0|sipa|morcos: i don't think we can get rid of the synchronizing behaviour of ping/pong without breaking half the network software
 54 2016-09-08 15:11:01	0|morcos|sipa: there is a difference between it always synchronizing network behavior and synchronizing other thigns right?  it just happens that the processing of messages happens in the same thread as the wallet syncing code now
 55 2016-09-08 15:11:31	0|morcos|so you couldn't get to the pong until you'd synced the wallets, but that doesn't seem like something that would necessarily always be true
 56 2016-09-08 15:11:37	0|sipa|morcos: i see
 57 2016-09-08 15:11:54	0|sipa|yes, i think we should prepare for a case where wallet syncing happens entirely in the background
 58 2016-09-08 15:12:05	0|sipa|and can lag behind more than one block
 59 2016-09-08 15:12:31	0|sipa|and network synchronizing messages don't change that
 60 2016-09-08 15:12:33	0|cfields|i suppose that's why sdaftuar was thinking more in terms of wait_for_wallet()
 61 2016-09-08 15:13:04	0|morcos|sipa: agreed.  and i think #7946 has forced that issue to be we have to think about that for 0.13.   b/c as far as RPC is concerned the wallet syncing can be happening several blocks behind now.
 62 2016-09-08 15:13:31	0|morcos|sorry, for master, not 0.13.  i'm still behind.  :)
 63 2016-09-08 15:15:44	0|BlueMatt|so what probably should happen, to avoid changing the api, is that any time you call into wallet it blocks until it has a consistent state with current blockchain
 64 2016-09-08 15:15:48	0|cfields|in the event that we start moving towards more async behavior, i think it's only natural to start introducing blocking rpcs
 65 2016-09-08 15:16:12	0|BlueMatt|otherwise you get an inconsistent rpc api - getblockheight will tell you something and then wallet will be behind that
 66 2016-09-08 15:16:15	0|BlueMatt|which is a hugely surprising api change
 67 2016-09-08 15:16:16	0|cfields|heh
 68 2016-09-08 15:16:29	0|morcos|cfields: i thought you just typed super fast
 69 2016-09-08 15:16:38	0|BlueMatt|moving wallet sync out of main thread is an important goal - and unlocking cs_main for it is a first step
 70 2016-09-08 15:17:19	0|BlueMatt|but an api change like that is probaly just not ok
 71 2016-09-08 15:17:31	0|sipa|that does make sense
 72 2016-09-08 15:17:48	0|sipa|just have the wallet rcps wait for sync
 73 2016-09-08 15:18:06	0|morcos|but what exactly should they wait for
 74 2016-09-08 15:18:27	0|BlueMatt|being up-to-date with the chain state at the call entry
 75 2016-09-08 15:18:29	0|morcos|as you're catching up the blockheight could still be increasing i think
 76 2016-09-08 15:18:33	0|BlueMatt|or, maybe, lock cs_main...
 77 2016-09-08 15:19:04	0|cfields|morcos: you'd need to pass in the synced-to-x height to the wallet rpc :(
 78 2016-09-08 15:20:40	0|morcos|i guess what i just described is an existing problem, so maybe thats ok, b/c cs_main is released anyway
 79 2016-09-08 15:21:16	0|BlueMatt|i mean, ok, what makes the rpc consistent? if the rpc request blocks, then its not crazy to make the state returned consistent with where the chainstate was when you entered the rpc, because otherwise the client is multithreaded and thats gonna be broken no matter what we do
 80 2016-09-08 15:21:21	0|cfields|morcos: but, if you've specifically waited for a certain height/hash, and it's blocked/returned until that's hit, then you're at least synced to that height for the next call
 81 2016-09-08 15:21:33	0|cfields|(ignoring invalidate/reconsider, which ruin all of that)
 82 2016-09-08 15:21:37	0|morcos|cfields: yes. agreed. i think we should fix it that much.
 83 2016-09-08 15:22:26	0|cfields|morcos: well, the new rpcs in #8680 do all that we've described here. We could just wrap the old ones around those...
 84 2016-09-08 15:23:29	0|morcos|cfields: yes that sounds right...  i think we need to call getblockheight from the wallet calls and then use your new calls to wait for that
 85 2016-09-08 15:23:59	0|sipa|well the wallet can remember independently up to what block hash it is synced
 86 2016-09-08 15:24:09	0|sipa|which afaik it does not do now
 87 2016-09-08 15:24:45	0|morcos|sipa: i think you want to avoid querying the wallet mid-block
 88 2016-09-08 15:25:09	0|BlueMatt|sipa: oh? I thought it did?
 89 2016-09-08 15:25:13	0|BlueMatt|It used to at least be on-disk, too
 90 2016-09-08 15:25:21	0|sipa|morcos: eh, yes, how does that matter?
 91 2016-09-08 15:25:30	0|sipa|BlueMatt: yes, but that isn't uodated for every block
 92 2016-09-08 15:26:02	0|BlueMatt|ahh, well, ok, lets update it (in memory) for every block :p
 93 2016-09-08 15:26:06	0|sipa|agree
 94 2016-09-08 15:27:35	0|morcos|sipa: if the wallet rpcs aren't synced using cory's mechanism then when you check the wallet you don't know if its in the middle of syncing some next block (that maybe you weren't waiting for)
 95 2016-09-08 15:27:53	0|morcos|but actually, i guess you still don't know that
 96 2016-09-08 15:27:54	0|morcos|shoot
 97 2016-09-08 15:29:08	0|morcos|so maybe we need to lock the wallet around the SyncWithWallets loops?
 98 2016-09-08 15:30:07	0|sipa|hmm?
 99 2016-09-08 15:30:17	0|cfields|brb
100 2016-09-08 15:32:53	0|morcos|sipa: isn't there nothing that stops a getbalance() call from happening in the middle of a SyncWithWallets() loop for a given blcok
101 2016-09-08 15:33:01	0|sipa|so i'm not sure the out of syncness matters to external observers... if you used to wait for a block and then later do and RPC query, it has always been possible that yet another block got processed in between
102 2016-09-08 15:33:10	0|morcos|yes
103 2016-09-08 15:33:17	0|morcos|but now half of another block could be processed
104 2016-09-08 15:33:18	0|sipa|what matters is consistency of wallet rpcs with its own state of the chain
105 2016-09-08 15:33:22	0|morcos|which seems somehow worse
106 2016-09-08 15:33:39	0|BlueMatt|sipa: its very, very, strange to get a balance response that is valid as of the middle of a block, but will change before the end of the block
107 2016-09-08 15:33:44	0|BlueMatt|I'm not sure that ever used to be pososible
108 2016-09-08 15:33:55	0|morcos|it didn't it was protected by cs_main previously
109 2016-09-08 15:34:03	0|sipa|what is the middle of a block?
110 2016-09-08 15:34:11	0|sipa|how can the middle of a block be observed?
111 2016-09-08 15:34:32	0|morcos|don't you just loop through the txs and call SyncWithWallets individually for each one
112 2016-09-08 15:34:34	0|sipa|the only problem is using main's tip to determine wallet confirmations etc
113 2016-09-08 15:34:52	0|sipa|the wallet should use its own tip idea to determine confirmations, instead of main's
114 2016-09-08 15:34:53	0|morcos|why can't you ask for the balance in the rpc thread while you are in the middle of that loop
115 2016-09-08 15:35:34	0|sipa|i think that's fine; it won't be counted as confirmed until it's done
116 2016-09-08 15:35:47	0|sipa|(with the change to use the wallet's idea of the tip)
117 2016-09-08 15:36:12	0|morcos|sipa: its hard to imagine an exact problem, but it just seems an odd change
118 2016-09-08 15:36:21	0|morcos|whats the downside to locking the wallet around that loop?
119 2016-09-08 15:36:35	0|sipa|ah, now i understand what you mean
120 2016-09-08 15:36:46	0|sipa|to prevent a partially updated wallet
121 2016-09-08 15:37:01	0|sipa|i think that's fine, yes
122 2016-09-08 15:37:20	0|sipa|but i think it can be avoided
123 2016-09-08 15:37:29	0|morcos|now someone just has to remember these ideas we've discussed.  on that note, lunch time.  :)
124 2016-09-08 15:37:30	0|BlueMatt|indeed, but we should :)
125 2016-09-08 15:37:52	0|sipa|enjoy nourishment
126 2016-09-08 15:42:08	0|cfields|back. all fixed? :)
127 2016-09-08 15:43:17	0|cfields|morcos: lunch thought: i suppose we'll need the same fencing for individual transactions + wallet interactions
128 2016-09-08 18:00:54	0|morcos|cfields: how do you mean?
129 2016-09-08 18:11:25	0|cfields|morcos: now that i'm poking around, i can't come up with a realistic example
130 2016-09-08 18:12:33	0|cfields|morcos: i was thinking about cases where the mempool holds a tx that the wallet isn't in sync with yet, where the mempool presence would lead the rpc caller to expect a wallet entry
131 2016-09-08 18:22:53	0|sipa|i believe we've had a related discussion to this before
132 2016-09-08 18:23:21	0|sipa|about whether or not external notifications should be sent before or after wallet updates
133 2016-09-08 18:23:33	0|sipa|or something like that
134 2016-09-08 18:23:58	0|sipa|because in some cases you want the update as soon as possible, but if you're going to use it to trigger a wallet request, the wallet should be updated first
135 2016-09-08 18:28:40	0|wumpus|probably there should be an external notification for the core as well as the wallet
136 2016-09-08 18:29:41	0|wumpus|if you want to be updated of the wallet processing some information, you'd listen for the wallet notification, if you want to know as soon as possible after the core rpocessed something you'd listen for the core notification
137 2016-09-08 18:30:13	0|sipa|yup, agree
138 2016-09-08 18:30:31	0|sipa|if the wallet is going to be asynchronously updated from the rest, it should have independent notifications too
139 2016-09-08 18:30:40	0|wumpus|and in the hypothetical case with with multiple wallets you'd want to register for *that* wallet you're interested in
140 2016-09-08 18:30:41	0|wumpus|right
141 2016-09-08 18:31:26	0|wumpus|it would make a lot of sense for wallet processing to be asynchronous
142 2016-09-08 18:31:49	0|wumpus|and indeed, in that case there's no use in getting a signal after the wallet got the signal
143 2016-09-08 18:31:59	0|wumpus|it still has to start processing
144 2016-09-08 18:32:24	0|wumpus|what you need is a notification from the wallet itself that it processed
145 2016-09-08 18:37:15	0|jonasschnelli|we have one! -walletnotify *duck*
146 2016-09-08 18:39:07	0|sipa|yes, but we'd also need a notification from the wallet that it processed a block
147 2016-09-08 18:41:05	0|jonasschnelli|Yes. Maybe an signal short after when the wallet bestblock was updated.
148 2016-09-08 18:41:11	0|wumpus|right
149 2016-09-08 18:42:08	0|jonasschnelli|Though this works agains in the opposite direction then the possible plan of decoupling the wallet process.
150 2016-09-08 18:42:23	0|jonasschnelli|(if the core side is consuming the event)
151 2016-09-08 18:42:57	0|sipa|parse error
152 2016-09-08 18:44:25	0|jonasschnelli|In case we want the wallet be capable of running without the validation (utxo-set/mempool) we should be carefully add signals (or lets say additional coupling between those elements)
153 2016-09-08 18:44:45	0|wumpus|no, the wallet would be emitting the event
154 2016-09-08 18:45:00	0|jtimon|I'll be afk during the meeting but will read later
155 2016-09-08 18:45:02	0|wumpus|the core side doesn't subscribe to it or anything
156 2016-09-08 18:45:36	0|wumpus|'has wallet processed block' is only something that external clients may care about, maybe the GUI, but certainly not the core
157 2016-09-08 18:45:44	0|kanzure|this seems to be someone from a law firm talking about "veil of decentralization" and fork types https://www.youtube.com/watch?v=7aV-k_6nZ8g&t=43m10s
158 2016-09-08 18:45:50	0|jonasschnelli|Ok. Right. This would make sense.
159 2016-09-08 18:45:50	0|kanzure|oh crud.
160 2016-09-08 18:45:53	0|kanzure|please ignore.
161 2016-09-08 18:51:26	0|GitHub36|[13bitcoin] 15jl2012 opened pull request #8685: Discourage P2WSH with too big script or stack (06master...06bigp2wsh) 02https://github.com/bitcoin/bitcoin/pull/8685
162 2016-09-08 18:59:49	0|wumpus|meeting time?
163 2016-09-08 18:59:55	0|jonasschnelli|ack
164 2016-09-08 18:59:58	0|wumpus|#startmeeting
165 2016-09-08 18:59:59	0|lightningbot|Meeting started Thu Sep  8 18:59:58 2016 UTC.  The chair is wumpus. Information about MeetBot at http://wiki.debian.org/MeetBot.
166 2016-09-08 18:59:59	0|lightningbot|Useful Commands: #action #agreed #help #info #idea #link #topic.
167 2016-09-08 19:00:10	0|wumpus|#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
168 2016-09-08 19:00:14	0|morcos|here
169 2016-09-08 19:00:19	0|CodeShark|here
170 2016-09-08 19:00:25	0|jeremyrubin|here
171 2016-09-08 19:00:29	0|BlueMatt|topic: sing morcos happy birthday
172 2016-09-08 19:00:29	0|petertodd|here
173 2016-09-08 19:00:30	0|btcdrak|here
174 2016-09-08 19:00:31	0|cfields|thanks, here
175 2016-09-08 19:00:33	0|kanzure|here
176 2016-09-08 19:00:36	0|petertodd|BlueMatt: ack!
177 2016-09-08 19:00:40	0|wumpus|happy birthday morcos
178 2016-09-08 19:00:41	0|jeremyrubin|leaked PII
179 2016-09-08 19:00:46	0|btcdrak|gmaxwell you missed jl2012
180 2016-09-08 19:00:47	0|kanzure|wumpus: no doxxing :)
181 2016-09-08 19:00:51	0|jeremyrubin|Alex sing your ssn!
182 2016-09-08 19:00:53	0|petertodd|kanzure: lol
183 2016-09-08 19:01:01	0|michagogo|Happy birthday!
184 2016-09-08 19:01:02	0|luke-jr|morcos: happy birthday https://www.youtube.com/watch?v=dQw4w9WgXcQ
185 2016-09-08 19:01:03	0|morcos|thanks
186 2016-09-08 19:01:13	0|sipa|morcos: congrats
187 2016-09-08 19:01:14	0|jcorgan|here in spirit only
188 2016-09-08 19:01:24	0|btcdrak|saved by DCMA filters "The uploader has not made this video available in your country."
189 2016-09-08 19:01:25	0|jonasschnelli|morcos: hey! happy birthday.
190 2016-09-08 19:01:28	0|petertodd|kanzure: happy birthday to anyone who considers themselves born on this date
191 2016-09-08 19:01:39	0|kanzure|much better.
192 2016-09-08 19:01:43	0|petertodd|btcdrak: the copyright on happy birthday got overturned :)
193 2016-09-08 19:01:53	0|btcdrak|petertodd: click the link
194 2016-09-08 19:02:07	0|wumpus|anyone with proposed topics?
195 2016-09-08 19:02:08	0|petertodd|btcdrak: oh, that's a great song
196 2016-09-08 19:02:28	0|sipa|wumpus: just one: we have quite a queue of things for 0.13.1, and i'd like to encourage people to review
197 2016-09-08 19:02:31	0|BlueMatt|real topic: segwit-cb bip
198 2016-09-08 19:02:32	0|btcdrak|wumpus: birthday cake
199 2016-09-08 19:02:35	0|kanzure|not a topic proposal, but i would like to eventually get a resolution on the after_failure weirdness
200 2016-09-08 19:03:01	0|jonasschnelli|I just wanted to let you know that there will be two hack days on monday and tuesday 10th and 11th of October after the SB conference in Milan.
201 2016-09-08 19:03:17	0|petertodd|jonasschnelli: I'll be there
202 2016-09-08 19:03:30	0|gmaxwell|btcdrak: the list was just based the top participants in the past.
203 2016-09-08 19:03:30	0|jonasschnelli|More info and registration will follow...
204 2016-09-08 19:03:33	0|wumpus|yes last week there was an ACTION for "Support for compact blocks together with segwit" (#8393), there has been a bit of review activity in last days, what's the status there?
205 2016-09-08 19:04:06	0|gmaxwell|wumpus: I've been doing some testing. There aren't many segwit transactions on testnet currently. I was going to call for people to create more once I got more testing setup.
206 2016-09-08 19:04:06	0|sipa|BlueMatt: i haven't reviewed the changes for the bip you suggested - does it require any code changes to the bitcoin core pr?
207 2016-09-08 19:04:32	0|wumpus|#info jonasschnelli: I just wanted to let you know that there will be two hack days on monday and tuesday 10th and 11th of October after the SB conference in Milan. More info and registration will follow...
208 2016-09-08 19:04:40	0|BlueMatt|sipa: possibly, two options, though, one minor, one slightly more
209 2016-09-08 19:04:46	0|btcdrak|maybe we can ask roasbeef to help tx generation there
210 2016-09-08 19:04:57	0|wumpus|gmaxwell: more segwit transactions would help, yes :)
211 2016-09-08 19:05:30	0|sipa|can we pick a topic?
212 2016-09-08 19:05:45	0|wumpus|#link re: queue of things for 0.13.1, link is https://github.com/bitcoin/bitcoin/milestones/0.13.1
213 2016-09-08 19:06:15	0|wumpus|#topic segwit-cb bip
214 2016-09-08 19:06:18	0|btcdrak|jl2012: is everything you are working correctly tagged (or not) for 0.13.1?
215 2016-09-08 19:06:44	0|BlueMatt|so, to quote github issue "The last commit changes the protocol entirely, adding a cmpctack message. This has the advantage that you could implement receiving of some version of compactlocks without implementing sending that encoding, as well as simplifying the protocol slightly (instead of having to check if the current protocol version is higher-priority according to your probably-compile-time list of supported version you know
216 2016-09-08 19:06:44	0|BlueMatt|which version you're using directly from the ack message) at the expensee of complicating the implementation somewhat (now you have to add support for another message type and special-case version 1). The last commit is definitely not worth it if we dont anticipate adding more than one or so more versions, but might be worth it if we anticipate compact blocks version 4, 5, 6 at some point. I'll bring this up in the IRC meeting later
217 2016-09-08 19:06:50	0|BlueMatt|today."
218 2016-09-08 19:07:11	0|BlueMatt|essentially, the current proposal is that you annoucne the set of compact block versions you want at startup (BIP text says before you send any pong or other compact block messages)
219 2016-09-08 19:07:22	0|BlueMatt|and each sendcmpct announce implies that you are willing to encode to those
220 2016-09-08 19:07:33	0|jl2012|btcdrak: including those already tagged, I think 8685, 8654 and 8635 are also for 0.13.1
221 2016-09-08 19:07:42	0|BlueMatt|and you send them in the priority of what you want to receive
222 2016-09-08 19:07:58	0|BlueMatt|and the version you use to send is the first one you receive from the other side that you also sent
223 2016-09-08 19:08:02	0|jl2012|at least we may consider to include in 0.13.1
224 2016-09-08 19:08:18	0|BlueMatt|and you use the highest-priority one the other side also announced to decode
225 2016-09-08 19:08:33	0|BlueMatt|(comment text from above link https://github.com/bitcoin/bips/pull/423#issuecomment-245629813 )
226 2016-09-08 19:08:53	0|sipa|i'm not a fan of changing the code again after all testing, but i do agree it's a cleaner solution, and will make things easier for future extensions
227 2016-09-08 19:08:55	0|BlueMatt|so this is obviously somewhat complicated
228 2016-09-08 19:09:16	0|BlueMatt|and the solution would be to introduce a cmpctack which you use to pick the one you want to encode to
229 2016-09-08 19:09:35	0|sipa|cmpctack containing the version you picked?
230 2016-09-08 19:09:41	0|wumpus|jl2012: (tagged. number of pulls for 0.13.1 does seem to be getting a bit out of hand)
231 2016-09-08 19:09:57	0|gmaxwell|can we have some discussion about this outside of the meeting, I want to ask some questions but I think it'll be a design rathole right now. :)
232 2016-09-08 19:10:03	0|BlueMatt|simplifying the which-do-i-use-to-decode code from "for each sendcmpct msg received, is this higher priority than the previously-highest-prirotiy one" to "the one I saw in a sendcmpct"
233 2016-09-08 19:10:14	0|BlueMatt|in practice the proposed cmpctack is way more code, but a bit simpler
234 2016-09-08 19:10:22	0|sipa|BlueMatt: ok, i'll review and adapt the pr
235 2016-09-08 19:10:32	0|BlueMatt|s/""the one I saw in a sendcmpct"/""the one I saw in a cmpctack"/g
236 2016-09-08 19:10:32	0|sipa|gmaxwell: ok
237 2016-09-08 19:10:38	0|BlueMatt|I, personally, dont really like the cmpctack idea
238 2016-09-08 19:10:53	0|BlueMatt|certainly if we plan on having lots of versions, it is simpler protocol-wise
239 2016-09-08 19:10:53	0|sdaftuar|i do like the cmpctack idea!
240 2016-09-08 19:10:53	0|sipa|so what alternative do you propose?
241 2016-09-08 19:10:56	0|jl2012|wumpus: most of mine are pretty trivial. I am no able to do more than that anyway
242 2016-09-08 19:11:16	0|BlueMatt|if we only ever have version 1 and 2 and maybe like a 3, then the previous proposal seems perfectly ok to me
243 2016-09-08 19:11:27	0|morcos|My viewpoint is that we suffer a history of technical debt, and we have a chance now while compact blocks are new to kind of clean up the protocol messages with a bit less fuss
244 2016-09-08 19:11:36	0|sipa|morcos: agree
245 2016-09-08 19:11:39	0|BlueMatt|sipa: either way I'm proposing to switch the priority order to first-is-highest from last-is-highest
246 2016-09-08 19:11:39	0|wumpus|jl2012: agreed
247 2016-09-08 19:11:42	0|morcos|so we shoudl take the added changes now to be happier later with a better design
248 2016-09-08 19:11:52	0|luke-jr|would it ever make sense to support a per-block encoding? for example, if nodes at some point want to pass blocks along as-is from peer A to other peers when possible
249 2016-09-08 19:12:02	0|BlueMatt|note that we have to introduce a backwards compatibility hack if we do cmpctack
250 2016-09-08 19:12:17	0|gmaxwell|I think it's fine to clean things up. But at some point the correct 'upgrade' is to just introduce a seperate mechenism sendcmpt2 and drop the old one, rather than extending.
251 2016-09-08 19:12:25	0|luke-jr|BlueMatt: do we? old CBs will die with segwit anyway..
252 2016-09-08 19:12:25	0|sipa|BlueMatt: just say that if no ack is ever sent, it is implicitly for v1
253 2016-09-08 19:13:39	0|BlueMatt|sipa: this implies you have to announce sendcmpct version 1
254 2016-09-08 19:13:39	0|gmaxwell|past some point trying to create a forever design just guarentees technical debt of a different kind. :)
255 2016-09-08 19:13:48	0|BlueMatt|which the proposal for creating a cmpctack would not do
256 2016-09-08 19:14:03	0|morcos|we should maybe do as gmaxwell said and discuss after meeting, but i don't think we actually need a hack, you just need to still tell 0.13 nodes that you support v1 and they only understand that by sending them a sendcmpct 1
257 2016-09-08 19:14:09	0|morcos|but it doesn't hurt to send that to everyone
258 2016-09-08 19:14:13	0|BlueMatt|alternatively: compact block version 3 can be called something other than compact blocks
259 2016-09-08 19:14:15	0|BlueMatt|then you can do whatever :P
260 2016-09-08 19:14:19	0|sipa|BlueMatt: hahaha
261 2016-09-08 19:14:28	0|sipa|i could live with that too.
262 2016-09-08 19:14:29	0|gmaxwell|BlueMatt: yea, thats what I was saying, effectively.
263 2016-09-08 19:14:59	0|gmaxwell|besides the general framework here has limitations, further latency optinization should basically be a non-goal, because the fiber approach is vastly better in that respect.
264 2016-09-08 19:15:12	0|BlueMatt|anyway, its taken 15 minutes to explain what the issues are, so maybe decide later, or let other topics go ahead first
265 2016-09-08 19:15:39	0|wumpus|I don't think any other topics have been (seriously) proposed
266 2016-09-08 19:16:15	0|wumpus|so go ahead
267 2016-09-08 19:16:29	0|jl2012|I got to go. See you
268 2016-09-08 19:16:38	0|morcos|proposed topic: picking a segwit rollout date and announcing this in a wider format
269 2016-09-08 19:16:39	0|wumpus|see you later jl2012
270 2016-09-08 19:16:48	0|sipa|jl2012: good night
271 2016-09-08 19:16:53	0|sipa|BlueMatt: how about just sending sendcmpct2 for v2 :)
272 2016-09-08 19:17:17	0|gmaxwell|morcos: I think the blocker there was basically having all the things merged in 0.13 branch that we believe would be needed on our end.
273 2016-09-08 19:17:18	0|BlueMatt|alternatively: version negotiation protocol examples are at https://github.com/bitcoin/bips/blob/833dea41c4c757087ef4c35e3b19259ba2f80128/bip-0152.mediawiki#Sample_Version_Implementation and https://github.com/bitcoin/bips/blob/0d9b12cf285762e8ff661fe17e3261d014af1581/bip-0152.mediawiki#Sample_Version_Implementation
274 2016-09-08 19:17:19	0|cfields|topic suggestion: rpc sync assumptions
275 2016-09-08 19:17:36	0|btcdrak|need review of these backport #8679, should be simple enough
276 2016-09-08 19:18:07	0|BlueMatt|though I think the second misses the fact that you have to use sendcmpct instead of cmpctack if its version 1
277 2016-09-08 19:18:22	0|instagibbs_|oh hi. znc bouncer is broke or something.
278 2016-09-08 19:18:34	0|morcos|gmaxwell: yeah i've been a bit out of touch, and i can see that makes sense..   but i also think it would be nice to give as much warning to the community as possible as to when we are proposing to actually release this
279 2016-09-08 19:19:08	0|gmaxwell|morcos: yes, a message that says "This will happen soon, our side waiting for X" to give people a chance to raise any concerns would be reasonable, I think.
280 2016-09-08 19:19:12	0|instagibbs_|/release/activate/ ?
281 2016-09-08 19:19:22	0|morcos|instagibbs_: yes, both
282 2016-09-08 19:19:25	0|CodeShark|we've been giving that message for several weeks already ;)
283 2016-09-08 19:19:30	0|wumpus|#topic picking a segwit rollout date and announcing this in a wider format
284 2016-09-08 19:19:57	0|instagibbs_|I've been pointing out the remaining milestone list, but it's a bit opaque for people who aren't actively reviewing stuff
285 2016-09-08 19:19:58	0|gmaxwell|I went around to soem forks and asked for what their scheduling looked like and the response I got was basically 'after it's deployed in the network'
286 2016-09-08 19:20:06	0|sipa|we can't propose a rollout date before knowing when we can have 0.13.1 out, and there are quite a few things to work out for that
287 2016-09-08 19:20:24	0|morcos|sipa: yeah i suppose i agree
288 2016-09-08 19:20:26	0|CodeShark|I'd rather not pile on additional scheduling issues externally unless we're confident
289 2016-09-08 19:20:57	0|achow101|is a 0.12.2 backport still happening?
290 2016-09-08 19:21:02	0|instagibbs_|Would the amount of lead time differ once we've merged all remaining issuess?
291 2016-09-08 19:21:07	0|wumpus|yes it seems 0.13.1 is a lot more work than expected
292 2016-09-08 19:21:17	0|wumpus|achow101: I don't think so
293 2016-09-08 19:21:51	0|btcdrak|achow101: segwit needs compact block relay, so very unlikely.
294 2016-09-08 19:22:16	0|achow101|ok
295 2016-09-08 19:22:17	0|luke-jr|"needs"?
296 2016-09-08 19:22:22	0|wumpus|achow101: getting this into 0.13 in the first place and assuring it is correct is a lot of work, I doubt anyone can pile up the extra work for 0.12
297 2016-09-08 19:22:51	0|BlueMatt|luke-jr: yea, what? segwit doesnt NEED it
298 2016-09-08 19:23:00	0|instagibbs_|And no one seems to be demanding it, more importantly
299 2016-09-08 19:23:06	0|BlueMatt|just might be painful if you dont have it
300 2016-09-08 19:23:16	0|btcdrak|unless you are happy with bigger blocks being relayed without it...
301 2016-09-08 19:23:25	0|btcdrak|anyway. weeds.
302 2016-09-08 19:23:34	0|sipa|yes, weeds
303 2016-09-08 19:24:07	0|instagibbs_|Which PRs need the most attention at this point
304 2016-09-08 19:24:08	0|gmaxwell|achow101: no we pretty much decided to not do a 0.12. backport over a month ago.
305 2016-09-08 19:24:10	0|wumpus|weeds?
306 2016-09-08 19:24:19	0|sipa|wumpus: "we're getting into the weeds"
307 2016-09-08 19:24:24	0|wumpus|ohh
308 2016-09-08 19:24:34	0|gmaxwell|achow101: not worth the risk and resource investment, and no one was jumping to do it. From measurements and feedback we've found that virtually no one uses backport releases.
309 2016-09-08 19:24:35	0|instagibbs_|mfw pieter is explaining English idioms
310 2016-09-08 19:24:42	0|CodeShark|in the netherlands that might have a different meaning ;)
311 2016-09-08 19:24:45	0|jonasschnelli|heh
312 2016-09-08 19:24:50	0|wumpus|yes, 0.12 just isn't a very important topic right now, let's focus on moving forward
313 2016-09-08 19:24:56	0|wumpus|CodeShark: yes :)
314 2016-09-08 19:25:20	0|luke-jr|also, if someone really needs 0.12, they can put it behind a 0.13.1 node
315 2016-09-08 19:25:21	0|wumpus|next topic?
316 2016-09-08 19:25:47	0|wumpus|#topic rpc sync assumptions
317 2016-09-08 19:25:58	0|gmaxwell|luke-jr: precisely, and any sw backport would create the disruption people were trying to avoid in staying with an older version.
318 2016-09-08 19:26:29	0|gmaxwell|wumpus: I don't understand why people thought it was a problem that getbalance could return a "mid block" response.
319 2016-09-08 19:26:33	0|morcos|just to be clear, the change to reduce cs_main locks is only for 0.14, so we don't have to worry about rpc sync assumptions for 0.13.1 right?
320 2016-09-08 19:26:35	0|cfields|so, marcos pointed out that the reason that the rpc tests are failing and fix is needed is that we broke some timing assumptions by optimizing some stuff
321 2016-09-08 19:27:10	0|cfields|so the question is: are those assumptions ok to break (just fix the tests), or are they part of the api?
322 2016-09-08 19:27:28	0|cfields|wow, re-reading that, that's incredibly vague :)
323 2016-09-08 19:27:33	0|sipa|morcos: yes
324 2016-09-08 19:27:36	0|jonasschnelli|Can you make a clear example?
325 2016-09-08 19:27:46	0|gmaxwell|I think the question should be what do we think the best behavior is. And if the best behavior changes the API, we should do it and document the change.
326 2016-09-08 19:27:58	0|jeremyrubin|WalletSync expected to occur in test
327 2016-09-08 19:28:02	0|jonasschnelli|Do we assume the wallet has processed a transaction after getting informed of a blockupdate?
328 2016-09-08 19:28:04	0|jeremyrubin|*under the lock
329 2016-09-08 19:28:08	0|luke-jr|does "mid block" include "numbers are being changed, so the value is unlike either the previous OR the next correct value"?
330 2016-09-08 19:28:10	0|wumpus|gmaxwell: I don't know either, there's no guarantee that blocks are atomically processed by the wallet
331 2016-09-08 19:28:25	0|sipa|we can make it atomic, as pointed out by morcos earlier
332 2016-09-08 19:28:26	0|jonasschnelli|s/blockupdate/tipupdate
333 2016-09-08 19:28:32	0|morcos|luke-jr: it reflects the full effect of some of the txs in the block but not all
334 2016-09-08 19:28:32	0|wumpus|but is it necessary?
335 2016-09-08 19:28:49	0|gmaxwell|my understanding is that the tests are doing things like handing a node a block, then instantly checking the wallet, and expecting it to be fully consistent with the block right away. Is this understanding correct?
336 2016-09-08 19:28:56	0|sipa|my alternative is that we make the wallet aware of the current tip it knows about, and we let confirmations be computed based on that
337 2016-09-08 19:29:08	0|sipa|that means that mid-block update you can see unconfirmed transactions
338 2016-09-08 19:29:13	0|BlueMatt|jonasschnelli: ex: you do a getblockheight rpc call - under previous versions if you then do a getbalance that balance is up to date to that block, this is no longer true
339 2016-09-08 19:29:19	0|wumpus|the tests need proper synchronization commands, some of those need to be implemented, I don't think we need to change the whole API for that
340 2016-09-08 19:29:25	0|cfields|gmaxwell: correct. as soon as the height/hash is reflected, they assume the wallet is synced with that height/hash
341 2016-09-08 19:29:25	0|morcos|wumpus: well before we get to the atomic block question, there is the question of whether if you wait for the blockchain to be synced to some height, and then query the wallet whether you are getting wallet values of at least that height (mid-block or not)
342 2016-09-08 19:29:32	0|wumpus|(besides adding those syncronization commands)
343 2016-09-08 19:29:54	0|BlueMatt|sipa: I think mid-block updates is a blatant violation of the "principal of least surprise"
344 2016-09-08 19:29:54	0|jonasschnelli|Can we not just have the wallets bestblock in getwalletinfo and use it for sync with getchaintips?
345 2016-09-08 19:30:00	0|gmaxwell|morcos: okay, I think sipa's suggestion would address that esp with coupled with a way of asking for the wallet's tip.
346 2016-09-08 19:30:10	0|wumpus|morcos: well it would make sense for the wallet to track where it is, synchronization-wise, absolutely
347 2016-09-08 19:30:22	0|gmaxwell|BlueMatt: uh then we need to remove unconfirmed transactions too?!
348 2016-09-08 19:30:24	0|wumpus|morcos:  and for thtat info to be available externally
349 2016-09-08 19:30:41	0|luke-jr|showing a best-wallet-block would make the whole mid-block state even more broken IMO (what best-block will it show mid-state?)
350 2016-09-08 19:30:44	0|sipa|BlueMatt: there can always be unconfirmed transactions in the wallet
351 2016-09-08 19:30:48	0|BlueMatt|and, further, if wallet is allowed to return something that is not up to date with the start of the call, this changes literally our entire api....so now anyone using the rpc has to go re-audit all of their uses of it???
352 2016-09-08 19:30:54	0|sipa|luke-jr: the previous one
353 2016-09-08 19:30:56	0|BlueMatt|sipa: huh? I mean things mid-block...am I missing what you said?
354 2016-09-08 19:31:01	0|gmaxwell|luke-jr: it will update its state when its done processing updates, of course.
355 2016-09-08 19:31:04	0|morcos|fixing the mid-block thing seems pretty trivial to me, why wouldnt' we just do that
356 2016-09-08 19:31:07	0|jonasschnelli|luke-jr: the bestblock should only be updated after fully processing? Right?
357 2016-09-08 19:31:23	0|BlueMatt|sipa: i was under the impression you indicated that you would see txn which come later in that block as unconfirmed, while txn earlier in the block are marked confirmed
358 2016-09-08 19:31:28	0|gmaxwell|Why are people regarding mid block as a bug?!?
359 2016-09-08 19:31:31	0|sipa|BlueMatt: no
360 2016-09-08 19:31:45	0|gmaxwell|at _any_ time a transaction can show up and appear in the wallet, unrelated to any blocks.
361 2016-09-08 19:31:52	0|morcos|gmaxwell: b/c its not a feature?
362 2016-09-08 19:31:57	0|sipa|BlueMatt: mid-update you would see the transactions of the new block as unconfirmed
363 2016-09-08 19:32:00	0|luke-jr|that seems the most obvious behaviour, but if you look at bestblock+balance, I would think them a pair, yet balance might be bestblock+partOfNextBlock in reality?
364 2016-09-08 19:32:02	0|morcos|i mean does anyone want that
365 2016-09-08 19:32:03	0|BlueMatt|ahh, yes, ok, so i was just confused....txn which appear in wallet before the block has processed seems reasonable
366 2016-09-08 19:32:07	0|gmaxwell|Unless you want to remove unconfirmed transactions that will always happen.
367 2016-09-08 19:32:27	0|sipa|i also don't think there is any problem with grabbing a wallet lock during the update
368 2016-09-08 19:32:36	0|sipa|which would prevent seeing a mid-update state
369 2016-09-08 19:32:36	0|wumpus|so if changing the balance mid-block is regarded as a bug, that should apply to all other state too: the transaction list, for example. It should hold all updates until it processed the entire block
370 2016-09-08 19:32:42	0|sipa|i'm just questioning if it is necessary
371 2016-09-08 19:32:56	0|gmaxwell|it seems strange to me to hurt concurrency to protect a property that we don't actually have (due to unconfirmed transactions)
372 2016-09-08 19:33:01	0|wumpus|I don't think using the lock for that is a good thing
373 2016-09-08 19:33:21	0|wumpus|agree with gmaxwell
374 2016-09-08 19:33:23	0|jonasschnelli|From the wallet perspective processing doesn't matter, you just want to see confirmations... can slowly appear on a tx list IMO
375 2016-09-08 19:33:24	0|cfields|wumpus: right, that made me cringe. That seems like a major layer violation
376 2016-09-08 19:33:36	0|morcos|wumpus: gmaxwell: but can you explain what concurrency we are hurting?
377 2016-09-08 19:33:45	0|morcos|i'm not suggesting we put cs_main covering those again
378 2016-09-08 19:33:49	0|wumpus|morcos: you have to hold the lock *all* the time while processing the block
379 2016-09-08 19:33:54	0|BlueMatt|gmaxwell: if it were listing your *confirmed* balance as mid-block, then it would be an issue
380 2016-09-08 19:33:55	0|sipa|wumpus: no
381 2016-09-08 19:34:00	0|gmaxwell|Wallet processing shouldn't stall when the node is processing a block, at least not any more than strictly necessary.
382 2016-09-08 19:34:01	0|BlueMatt|which I believe is what people are worried about
383 2016-09-08 19:34:08	0|sipa|wumpus: the proposal is to grab cs_wallet during the wallet updating for the block
384 2016-09-08 19:34:17	0|sipa|wumpus: which happens in its entirety after main processes the block
385 2016-09-08 19:34:19	0|morcos|i'm just suggesting we use cs_wallet or some other lock that prevents a wallet specific call from returning until you are no longer in the middle of a loop that calls SyncWithWallets (on a given block)
386 2016-09-08 19:34:36	0|sipa|wumpus: cs_main isn't even held at the point
387 2016-09-08 19:34:36	0|wumpus|sipa: I know, but you'd still be holding the wallet lock longer than necessary
388 2016-09-08 19:34:45	0|BlueMatt|to be fair, all of this should move onto a background thread in the future anyway
389 2016-09-08 19:34:50	0|gmaxwell|morcos: so now wallet calls will stall block processing? (when the block processing waits to take that lock?)
390 2016-09-08 19:34:51	0|wumpus|BlueMatt: agreed on that
391 2016-09-08 19:34:59	0|sipa|yes, and it may be harder to maining if we parallellize/asynchronize things more
392 2016-09-08 19:35:02	0|wumpus|wallet block processing should be async at some point
393 2016-09-08 19:35:17	0|BlueMatt|so this would be a temporary fix that we should consider something which will happen on a background thread...lets not get too focused on blocking block processing with it
394 2016-09-08 19:35:23	0|sipa|morcos: do you think there is a problem with showing the transactions from the being-processed-block as unconfirmed during the update?
395 2016-09-08 19:35:24	0|morcos|gmaxwell: hmmm, yes i suppose while thats in the main thread thats a bad idea
396 2016-09-08 19:35:36	0|jonasschnelli|IMO the wallet should process a copy of the block on its own, own thread
397 2016-09-08 19:35:43	0|sipa|jonasschnelli: yes yes
398 2016-09-08 19:35:47	0|CodeShark|^]
399 2016-09-08 19:35:49	0|wumpus|sipa: probably it will already be in the wallet as unconfirmed anyhow
400 2016-09-08 19:35:50	0|sipa|jonasschnelli: i think everyone agrees on that
401 2016-09-08 19:35:52	0|gmaxwell|BlueMatt: I'm fine with temporary fixes, I'm just confused as to why anything needs to be fixed here except some unrealistic expectations in the tests.
402 2016-09-08 19:36:05	0|sipa|gmaxwell: i believe the current situation is broken
403 2016-09-08 19:36:20	0|gmaxwell|sipa: great. I'd like to understand why.
404 2016-09-08 19:36:25	0|sipa|mid-update you can see half of the block reflected as confirmed transactions, and miss other transactions from that same block
405 2016-09-08 19:36:32	0|BlueMatt|gmaxwell: two issues: getbalance, by default, shows your *confirmed* balance, so you expect that to be consistent...right now it is not clear (I maybe wrong) that it might not show *half* of your actually confirmed balance
406 2016-09-08 19:36:51	0|morcos|sipa: i think i need to go look more carefully at what SyncWithWallets does with txs from the block, but for instance, coudl you end up removing a conflicted tx, then showing a balance, without having addd the replacement tx yet.  i think yes, and i think thats would be confusing
407 2016-09-08 19:36:53	0|gmaxwell|okay, I agree showing confirmed for some and not others is odd. Showing some and not others, however I think is fine, and consistent with the normal behavior.
408 2016-09-08 19:37:06	0|cfields|let's not focus on the details here. The question at hand (mine, anyway), is whether the blocking behavior from 0.13 is considered part of the api, or if it's ok to deviate. If the answer is the latter, we can just fix the tests and move on.
409 2016-09-08 19:37:20	0|sipa|cfields: blocking what behaviour?
410 2016-09-08 19:37:27	0|sipa|0.13 does not have this change
411 2016-09-08 19:37:52	0|sipa|cfields: i think there is something that needs to be fixed in master, that is deeper than fixing up tests
412 2016-09-08 19:37:56	0|sipa|cfields: but it may not be much
413 2016-09-08 19:38:11	0|cfields|sipa: right, 0.13 doesn't give up the lock
414 2016-09-08 19:38:21	0|sipa|indeed, 0.13 is totally fine
415 2016-09-08 19:38:27	0|BlueMatt|gmaxwell: second, we are making an API change here, which it seems to me is probably going to break clients: previously if you called getblockheigh, and then getbalance, getbalance will be up-to-date at least as of that block...this is no longer true. I can absolutely see clients having assumed this
416 2016-09-08 19:38:29	0|wumpus|"okay, I agree showing confirmed for some and not others is odd" absolutely. This would break the assumption that curtip-block which tx was confirmed in is the number of confirmations
417 2016-09-08 19:38:37	0|gmaxwell|cfields: That the wallet blocks shouldn't be part of the api. Certian consistency properties might reasonably be.  I'm actually dubious that seeing confirmations incrementally is actually a problem.
418 2016-09-08 19:38:57	0|gmaxwell|BlueMatt: no, thats not really true either, since the chain can reorg between those two calls.
419 2016-09-08 19:39:07	0|cfields|sipa: right. and now master has changed that behavior. So if the behavior is considered to be part of the api, we need to revert it
420 2016-09-08 19:39:10	0|jonasschnelli|Why can't we not just use SyncWithWallets or mempool and add a SyncBlockWithWallet(blockcopy) for added and removed tips? Process it in a wallet-thread (similar to periodic flushes) and use cs_wallet there?
421 2016-09-08 19:39:11	0|morcos|ok, how about i write up an issue
422 2016-09-08 19:39:21	0|cfields|(I don't believe that and I'd -1 it. Just clarifying)
423 2016-09-08 19:39:44	0|morcos|i don't think we should revert the change
424 2016-09-08 19:39:58	0|wumpus|we shouldn't revert anything that prevents future paralellization/concurrency
425 2016-09-08 19:40:13	0|sipa|i think the step was a step in the right direction, and we should continue it
426 2016-09-08 19:40:22	0|sipa|but we have time in 0.14 to figure out exactly how
427 2016-09-08 19:40:24	0|wumpus|if there is a need to 'force everything to wait for thewallet' that's a big -1 from me too
428 2016-09-08 19:40:26	0|morcos|i think we should make it so that the existing rpc calls returns omething that make sense.  two issues 1) once you've waited for a certain height, that once you ask for balance you get a balance of at least that height 2) whether mid-block updates are ok
429 2016-09-08 19:40:29	0|gmaxwell|how does this concurrency interact with the wallet's mempool interaction. The wallet cares if tx are in mempool or not, will a wallet look unconfirmed and fallen out of the mempool briefly while it's confirming?
430 2016-09-08 19:40:32	0|morcos|1) needs fixing, 2) needs more investigation
431 2016-09-08 19:40:56	0|cfields|agreed. ok, that answers my question.
432 2016-09-08 19:41:03	0|morcos|1) can be fixed with cfields existing code from 8680 without harming any concurrency
433 2016-09-08 19:41:05	0|sipa|morcos: 1) is easily fixed by reporting the wallet height rather than the core height
434 2016-09-08 19:41:10	0|jonasschnelli|morcos: isn't 1) and 2) solvable from the wallet side?
435 2016-09-08 19:41:17	0|wumpus|wallet height and core height are different things
436 2016-09-08 19:41:26	0|sdaftuar|sipa: yes, but that would be api-breaking right?
437 2016-09-08 19:41:30	0|wumpus|it has always been possible to confound these, but that has to change
438 2016-09-08 19:41:32	0|sipa|sdaftuar: i believe not
439 2016-09-08 19:41:34	0|sdaftuar|i think that's the right idea though
440 2016-09-08 19:41:57	0|gmaxwell|Well it means that someone might need to look in a different place for the wallet height, no?
441 2016-09-08 19:42:04	0|sipa|sdaftuar: if we make 0.14 report the wallet height,  i believe it will look equivalent to 0.13
442 2016-09-08 19:42:09	0|wumpus|gmaxwell: yes, it'd need to be a wallet RPC
443 2016-09-08 19:42:24	0|morcos|sipa: the issue is people probably already use getblockcount and then ask for balances
444 2016-09-08 19:42:32	0|wumpus|either on getwalletinfo or getwalletblockcount
445 2016-09-08 19:42:38	0|morcos|but they do that in their code
446 2016-09-08 19:42:39	0|sipa|morcos: so, make getblockcount by default report the wallet height
447 2016-09-08 19:42:46	0|wumpus|bah
448 2016-09-08 19:42:48	0|morcos|that seems like a crazy change
449 2016-09-08 19:42:53	0|gmaxwell|morcos: thats okay, we would release note that in 0.14. If it's the right behavior to change we shouldn't hesitate to do so here.
450 2016-09-08 19:42:58	0|sipa|why? it's exactly what we've been doing all the time
451 2016-09-08 19:43:02	0|wumpus|change getblockcount to a wallet call?!
452 2016-09-08 19:43:10	0|jonasschnelli|no
453 2016-09-08 19:43:14	0|sdaftuar|that means you need wallet support to use that rpc?
454 2016-09-08 19:43:15	0|CodeShark|bad idea
455 2016-09-08 19:43:15	0|morcos|i think we're getting a bit too worked up
456 2016-09-08 19:43:16	0|sdaftuar|blech
457 2016-09-08 19:43:16	0|wumpus|what if there is no wallet built in?
458 2016-09-08 19:43:25	0|sipa|sigh
459 2016-09-08 19:43:26	0|gmaxwell|that woudl be kind of odd, but it's 99% of the time used as a wallet call, ... and we have getblockchaininfo....
460 2016-09-08 19:43:26	0|jonasschnelli|no blockcount!
461 2016-09-08 19:43:29	0|wumpus|what if there are multiple wallets? ask them all, return the max value?
462 2016-09-08 19:43:38	0|BlueMatt|gmaxwell: certain people have reorg handling code, this api change will not trigger their reorg handling code and will still break clients!
463 2016-09-08 19:43:42	0|sipa|so deprepcate the RPC
464 2016-09-08 19:43:49	0|BlueMatt|it is absolutely not unreasonable for this change to break rpc clients
465 2016-09-08 19:43:49	0|jonasschnelli|Just give out the bestblockhash in getwalletinfo
466 2016-09-08 19:43:50	0|sipa|and introduce a wallet-specific one and main-specific one
467 2016-09-08 19:43:53	0|morcos|its easy enough to make wallet balance calls wait on their own until either the wallet reports a height that matches chainactive height or using cfields mechanism, that slows nothing other than that wallet call and solves 1
468 2016-09-08 19:44:00	0|cfields|why not just have getblockcount block until the block is finished processing (all signals, not wallet specific)? New apis can be async
469 2016-09-08 19:44:09	0|wumpus|yes, there needs to be a wallet-specific one
470 2016-09-08 19:44:12	0|sipa|cfields: that's just delaying the problem
471 2016-09-08 19:44:20	0|BlueMatt|what morcos said
472 2016-09-08 19:44:22	0|gmaxwell|BlueMatt: look, the API is not, should not, and cannot be a suicide pact. We're talking about an change in a major version, and one that would only require minor changes. _WE CAN CHANGE THE API_.
473 2016-09-08 19:44:24	0|sipa|cfields: because that's no longer possible if the wallet works asynchronously
474 2016-09-08 19:44:26	0|BlueMatt|just block wallet calls until they are caught up
475 2016-09-08 19:44:44	0|gmaxwell|Especially in a minor way like "get your height for purpose X this way instead of that"
476 2016-09-08 19:44:54	0|wumpus|wallet processing blocking wallet calls is OK
477 2016-09-08 19:44:55	0|BlueMatt|there is a simple solution to this that doesnt require all the users audit their codebase
478 2016-09-08 19:44:59	0|BlueMatt|that isnt even a big deal
479 2016-09-08 19:44:59	0|wumpus|wallet processing blocking core calls is not
480 2016-09-08 19:45:07	0|BlueMatt|but you're arguing we change the api because its simpler?
481 2016-09-08 19:45:22	0|BlueMatt|just block wallet rpc calls until its caught up at the start of the cs_wallet lock
482 2016-09-08 19:45:35	0|BlueMatt|yes, wumpus, dont think anyone is arguing for that
483 2016-09-08 19:45:36	0|gmaxwell|I haven't heard anything suggested that doesn't require having the wallet and block processing block each other.
484 2016-09-08 19:45:44	0|BlueMatt|noooo
485 2016-09-08 19:45:45	0|BlueMatt|wait, wut?
486 2016-09-08 19:45:46	0|morcos|wumpus: yes, see cory's code in 8680, can easily adopt all wallet calls to use that (or ask the wallet for its height but then they might have to poll) and weight until it hits what chainactive was at the start of the call
487 2016-09-08 19:46:00	0|BlueMatt|the proposal is that rpc calls might block until the wallet has caught up to where main chainstate is
488 2016-09-08 19:46:04	0|morcos|gmaxwell: yeah i think you're misunderstanding
489 2016-09-08 19:46:10	0|sipa|morcos: yup... but at some point we'd want to get rid of that too, i think
490 2016-09-08 19:46:14	0|BlueMatt|the wallet processing can still be in a background thread, or on the main thread, or whatever
491 2016-09-08 19:46:17	0|wumpus|morcos: yes, that makes sense
492 2016-09-08 19:46:19	0|gmaxwell|and I think it's insane to degrade concurrency for an obscure property that anyone who wants can retain by using an appropritate call to ask where the wallet is vs where the blockchain is.
493 2016-09-08 19:46:21	0|BlueMatt|it just has to catch up before the rpc will return
494 2016-09-08 19:46:38	0|BlueMatt|gmaxwell: we arent degregading concurrency except that rpc calls might block, afaict
495 2016-09-08 19:46:46	0|BlueMatt|and then we're returning more up-to-date info anyway
496 2016-09-08 19:46:50	0|BlueMatt|so thats not even so bad
497 2016-09-08 19:46:57	0|morcos|might block but would still return before they would have in 0.13!!!
498 2016-09-08 19:47:01	0|cfields|BlueMatt: and it only blocks as long sa it would've before
499 2016-09-08 19:47:08	0|BlueMatt|true
500 2016-09-08 19:47:38	0|gmaxwell|what was suggested above was the block processing taking the wallet lock; which would bidirectionally block each other.
501 2016-09-08 19:47:48	0|sipa|gmaxwell: no
502 2016-09-08 19:47:52	0|morcos|gmaxwell: that was a proposal to solve problem 2 (the mid block)
503 2016-09-08 19:47:54	0|BlueMatt|that was to a different issue
504 2016-09-08 19:47:57	0|BlueMatt|there are two issues
505 2016-09-08 19:48:01	0|BlueMatt|well, potential issues
506 2016-09-08 19:48:13	0|sipa|the proposal was that _the wallet_ would grab _the wallet lock_ while it was updating its state for a new block
507 2016-09-08 19:48:25	0|morcos|that problem needs more investigation to determine a) whether it needs solving and b) whether there is a simple solution.  i agree with your objection to my first suggested solution
508 2016-09-08 19:49:15	0|morcos|sipa: yes but thats only a good idea when thats not running in teh same thread as block processing in the middle of block processing, otherwise some other independent wallet call holds up block processing
509 2016-09-08 19:49:17	0|sipa|are there other topics? i don't think we need to figure this out completely right now
510 2016-09-08 19:49:20	0|gmaxwell|morcos: Sounds fine to me.
511 2016-09-08 19:49:22	0|wumpus|I think it's better to take this outside the meeting. Any other topics?
512 2016-09-08 19:49:28	0|morcos|wumpus: ha , too late!
513 2016-09-08 19:49:48	0|wumpus|morcos: heh same idea
514 2016-09-08 19:50:00	0|cfields|this can be handled with signals btw, no need to grab actual locks. StartProcessing() -> block rpc -> FinishedProcessing() unblock
515 2016-09-08 19:50:36	0|cfields|yes, later is fine. That got more heated than I expected :)
516 2016-09-08 19:50:59	0|cfields|though, we still have the question of what to do about the tests.
517 2016-09-08 19:51:13	0|sipa|morcos: yes, i'm not saying that's what we should or shouldn't do... just clarifying what the idea was
518 2016-09-08 19:51:14	0|morcos|does 8680 fix the tests or not really?
519 2016-09-08 19:51:26	0|wumpus|cfields: I think your pull is fine for that, as a temp fix at least
520 2016-09-08 19:51:28	0|morcos|i think 8680 seems reasonable to me
521 2016-09-08 19:51:33	0|wumpus|right
522 2016-09-08 19:51:39	0|sipa|let's merge 8680 to fix the annoyance with the test
523 2016-09-08 19:51:42	0|cfields|morcos: i believe so, but not 100% because of the nature
524 2016-09-08 19:51:47	0|sipa|but open a tracker issue to reconsider
525 2016-09-08 19:51:52	0|cfields|(i'm not 100%, sorry)
526 2016-09-08 19:51:53	0|wumpus|#action merge  8680 to fix the annoyance with the test
527 2016-09-08 19:51:54	0|michagogo|<i>8m warning</i>
528 2016-09-08 19:52:15	0|wumpus|michagogo: looks like we're out of topics sooner than out of time
529 2016-09-08 19:52:19	0|cfields|ok, I can slim that down to only the rpc used by the tests then
530 2016-09-08 19:52:25	0|wumpus|cfields: ack
531 2016-09-08 19:52:34	0|sipa|cfields: thanks
532 2016-09-08 19:52:49	0|lightningbot|Log:            http://www.erisian.com.au/meetbot/bitcoin-core-dev/2016/bitcoin-core-dev.2016-09-08-18.59.log.html
533 2016-09-08 19:52:49	0|lightningbot|Meeting ended Thu Sep  8 19:52:49 2016 UTC.  Information about MeetBot at http://wiki.debian.org/MeetBot . (v 0.1.4)
534 2016-09-08 19:52:49	0|lightningbot|Minutes:        http://www.erisian.com.au/meetbot/bitcoin-core-dev/2016/bitcoin-core-dev.2016-09-08-18.59.html
535 2016-09-08 19:52:49	0|lightningbot|Minutes (text): http://www.erisian.com.au/meetbot/bitcoin-core-dev/2016/bitcoin-core-dev.2016-09-08-18.59.txt
536 2016-09-08 19:52:49	0|wumpus|#endmeeting
537 2016-09-08 19:53:42	0|michagogo|2-3 hour commutes are not very fun.
538 2016-09-08 19:53:47	0|wumpus|michagogo: yes we've been missing you lately!
539 2016-09-08 19:54:14	0|michagogo|(Where lately = >1 year, I think…)
540 2016-09-08 19:54:31	0|instagibbs_|michagogo: work from home, your hair will get fuller, and silkier with the reduced stress
541 2016-09-08 19:54:37	0|MarcoFalke|michagogo: Let someone drive for you and use the time to catch up on stuff.
542 2016-09-08 19:54:53	0|michagogo|It's a good thing I scripted gitian builds, so at least I can kick those off and let them run at home
543 2016-09-08 19:55:07	0|michagogo|instagibbs_: unfortunately that's not an option for various reasons
544 2016-09-08 19:55:59	0|michagogo|MarcoFalke: I wish that were feasible, but I'm provided with free public transportation and don't have a car
545 2016-09-08 19:56:06	0|phantomcircuit|which pr changed the wallet handling to be background?
546 2016-09-08 19:56:18	0|gmaxwell|Sorry for contributing to confusion above.  I probably misunderstood people, but it sounded to me that people were saying that the wallet operating non-concurrently was part of the API and that we couldn't change it.  I agree its a minor part of the api but think we must change it.  Making all the blocks 'confirmedness' updates to the wallet atomic seems reasonable to me (though I'm dubious anyt
547 2016-09-08 19:56:24	0|gmaxwell|hing would actually be broken by that which isn't already broken)
548 2016-09-08 19:56:27	0|jonasschnelli|phantomcircuit: i guess there is no PR for that?
549 2016-09-08 19:56:43	0|michagogo|I try to figure out how to get rides whenever I can, but that's not very often
550 2016-09-08 19:56:57	0|phantomcircuit|jonasschnelli: o.O ?
551 2016-09-08 19:57:16	0|jonasschnelli|It was just a discussion.
552 2016-09-08 19:58:16	0|gmaxwell|I don't think "would be an api change" should ever be an argument against something in a major release, and it was kind of worrying me to hear people talking that way... esp. since the current api stinks in a number of minor ways and needs improving. "Would be a rather disruptive API change relative to the benefits" would be a fine argument, but it wasn't what I was hearing, maybe it was implici
553 2016-09-08 19:58:22	0|gmaxwell|t. Though I think making the wallet and block processing mutually concurrent has a lot of obvious benefits.
554 2016-09-08 19:58:22	0|morcos|phantomcircuit: 7964 (its not background, it just happens outside of cs_main now)
555 2016-09-08 19:59:07	0|CodeShark|gmaxwell: if it breaks deployed apps, it's a potential issue - otherwise, it isn't
556 2016-09-08 19:59:09	0|sipa|gmaxwell: absolutely - i think everything that was proposed would never grab cs_main and cs_wallet at the same time (even though they're in the same thread for now)
557 2016-09-08 19:59:39	0|morcos|gmaxwell: i think thats a fair summary.   in the future it probably makes sense for someone (like me in this case) to write up a small issue before the meeting, so people aren't trying to read about a somewhat nuanced issue in interlaced realtime chat
558 2016-09-08 20:00:28	0|jonasschnelli|gmaxwell: I guess it depends from which angle you are looking at it. Current users expect (API) that getblockchaininfo represents the state of the wallet...
559 2016-09-08 20:00:36	0|jonasschnelli|Which I agree we should keep for 0.13.x
560 2016-09-08 20:00:53	0|phantomcircuit|morcos: that seems to be something about c++11 consistency
561 2016-09-08 20:01:03	0|jonasschnelli|But afterwards, I think is a good signal to have own wallet process state calls
562 2016-09-08 20:01:37	0|CodeShark|I'm in favor of any change that further decouples the wallet from the rest of the app ;)
563 2016-09-08 20:01:40	0|jonasschnelli|To slowly make people aware of that the wallet might gets more of its own state/processes
564 2016-09-08 20:02:14	0|michagogo|??? https://usercontent.irccloud-cdn.com/file/JhPBIVrq/IMG_3841.PNG
565 2016-09-08 20:03:08	0|BlueMatt|gmaxwell: sorry, indeed that was my implied argument
566 2016-09-08 20:03:16	0|BlueMatt|gmaxwell: I agree, making an api change is generally fine
567 2016-09-08 20:03:29	0|BlueMatt|but making one that is pervasive across the entire api for such a minor gain seems insane
568 2016-09-08 20:03:50	0|BlueMatt|and generally making a massively pervasive change across the entire api isnt ideal unless its easy to explain how to change your clients to work with it
569 2016-09-08 20:03:51	0|gmaxwell|jonasschnelli: I think we should keep things for 0.13, sure.  though take care, there is no way to perform multiple RPCs atomically. So if you call getblockchaininfo then interact with the wallet, the world might have changed out from under you, .. in any version. :P
570 2016-09-08 20:04:42	0|BlueMatt|gmaxwell: and, generally, I'd prefer for things like that to have an -wrapentireapitomakeitbackwardscompatible option
571 2016-09-08 20:05:02	0|gmaxwell|BlueMatt: okay, my view is that having the wallet and node be concurrent is not a minor gain. (esp since that also means multiple wallets being concurrent with each other, ultimately)
572 2016-09-08 20:05:04	0|jonasschnelli|Yes. Indeed. But users expect – in normal non reorg operations – that getblockchaininfo at least reports a height already processed by a wallet
573 2016-09-08 20:05:10	0|jonasschnelli|*the wallet
574 2016-09-08 20:05:18	0|sipa|well, one question is where do people "wait" for getblockcount to go up, and then take wallet action based on it?
575 2016-09-08 20:05:25	0|sipa|i guess we don't know
576 2016-09-08 20:05:30	0|BlueMatt|gmaxwell: oops, sure, I agree this case is a major gain
577 2016-09-08 20:05:30	0|MarcoFalke|I am fine with breaking the wallet api, but we should make it explicit and not silent.
578 2016-09-08 20:05:39	0|sipa|but it seems much more something unit tests do, because they now exactly what is going to happen
579 2016-09-08 20:05:42	0|MarcoFalke|Eg. include the blockhash/height in every wallet call
580 2016-09-08 20:05:44	0|BlueMatt|if it werent also trivial to keep the api consistent I might have a different view
581 2016-09-08 20:05:45	0|cfields|gmaxwell: to be clear, I don't think the concern (from me, anyway) was "is this an api change", so I suppose I framed the question very poorly. The concern was more "did we break reasonable assumptions by making this more async?"
582 2016-09-08 20:05:55	0|jonasschnelli|I guess the problem really apperars when you listen to notifications (ZMQ)
583 2016-09-08 20:06:02	0|sipa|jonasschnelli: it does not
584 2016-09-08 20:06:21	0|jonasschnelli|Right.. we face the problem during the RPC tests...
585 2016-09-08 20:06:32	0|kanzure|if the wallet does its own block processing, that might be interesting, it could even consume the same notifications as third-party apps would be expected to (like zeromq or rpc communication)
586 2016-09-08 20:06:35	0|sipa|we can control when the notification is sent out
587 2016-09-08 20:06:43	0|jonasschnelli|But I guess you will run more often into this concurrency issues when calling RPC off a ZMQ not.
588 2016-09-08 20:06:44	0|morcos|phantomcircuit: oops.  7946
589 2016-09-08 20:07:06	0|sipa|i think it may be the case that the only ones affected by the asynchronicity is unit tests
590 2016-09-08 20:07:07	0|phantomcircuit|morcos: ty
591 2016-09-08 20:07:26	0|sipa|(that's independent from the partial update thing, which we can fix in various other ways)
592 2016-09-08 20:08:00	0|kanzure|wait why would anyone wait for getblockcount to go up...? there is no conceivable reason i could see to do that.
593 2016-09-08 20:08:21	0|sipa|"i do X, and i wait for Y to happen" is something you can't do in production env
594 2016-09-08 20:08:42	0|kanzure|we are talking about syncing two separate processes that are supposedly monitoring a blockchain right?
595 2016-09-08 20:09:00	0|sipa|no
596 2016-09-08 20:09:07	0|gmaxwell|cfields: basically the tests failing proved its an API change, maybe not an important one, but absolutely a change.
597 2016-09-08 20:09:18	0|sipa|we're even talking about something that happens entirely within one thread :)
598 2016-09-08 20:09:22	0|cfields|kanzure: quick example: tracking how many confirmations your txs have and displaying on your site
599 2016-09-08 20:09:45	0|kanzure|cfields: that would make sense to me, but sipa is talking about one thread?
600 2016-09-08 20:09:55	0|cfields|not saying it's wise, but I can imagine that happening in the wild
601 2016-09-08 20:10:13	0|phantomcircuit|kanzure: you need more imagination
602 2016-09-08 20:10:19	0|sipa|kanzure: oh, ignoring the external process of course
603 2016-09-08 20:10:23	0|phantomcircuit|listsinceblock
604 2016-09-08 20:10:28	0|kanzure|i have recently spent a bunch of time writing and validating software that does blockchain syncing between two stores where one is considered truthy and the other is considered a laggard
605 2016-09-08 20:10:29	0|sipa|kanzure: but all wallet updates and main updates happen within one thread in core
606 2016-09-08 20:10:49	0|kanzure|listsinceblock is also something you shouldn't use. you should instead compute the most recent common block and then get the list of different blocks that your laggy side needs to consider.
607 2016-09-08 20:11:16	0|phantomcircuit|kanzure: listsinceblock is the thing people (not me) have been suggesting for years
608 2016-09-08 20:11:18	0|kanzure|looking at a block counter is backwards because it could go up and down
609 2016-09-08 20:11:33	0|kanzure|and treating it as a monotonic clock is what i would expect most application developers to do heh
610 2016-09-08 20:12:26	0|kanzure|i didn't look at the origiating issue that brought up this topic, so i'm sure my context is wrong here
611 2016-09-08 20:12:34	0|kanzure|here is a toy i was writing a few days ago https://gist.github.com/kanzure/2fa531afaf03fddd6568eb0212ac8c4c
612 2016-09-08 20:13:42	0|phantomcircuit|kanzure: wallet processing of blocks is put into the background, wallet rpc calls can then return results reflecting a partial processing of a block
613 2016-09-08 20:13:52	0|CodeShark|fully async json-over-websockets API: https://github.com/ciphrex/CoinSocket ;)
614 2016-09-08 20:13:56	0|phantomcircuit|ie tx a/b are both in block c but only a shows in the rpc calls
615 2016-09-08 20:14:05	0|kanzure|btw when people above are talking about "unit tests" they mean the rpc tests right?
616 2016-09-08 20:14:13	0|sipa|kanzure: yes
617 2016-09-08 20:14:28	0|cfields|kanzure: unit tests in bitcoind-speak :)
618 2016-09-08 20:15:03	0|kanzure|re: async, then yes i would suggest using zeromq notifications in the testing framework to get information about internal state or for how long to wait (instead of sleeps etc)
619 2016-09-08 20:15:11	0|phantomcircuit|kanzure: they're talking about the functional tests
620 2016-09-08 20:15:15	0|phantomcircuit|not the unit tests
621 2016-09-08 20:17:04	0|cfields|kanzure: the question isn't about how to get the info, it's about what the caller expects. you can query for the current height, then call into the wallet and expect to see tx's from that height, only to find that they haven't been processed yet.
622 2016-09-08 20:17:41	0|kanzure|right... so you could naively sleep to wait for the wallet to be done, or you can query the wallet state (instead of chain height of the non-wallet components)
623 2016-09-08 20:17:48	0|cfields|so who's wrong? the rpc for returning a height without fully processing? or the user for expecting them to be in sync?
624 2016-09-08 20:18:10	0|kanzure|er in this case isn't the rpc test also the user?
625 2016-09-08 20:18:54	0|cfields|yea, i was just phrasing more generally
626 2016-09-08 20:18:54	0|sipa|so i believe there is a slight difference between normal users and the rpc tests
627 2016-09-08 20:19:15	0|sipa|in that rpc tests control the entire world, and use more simplistic means to measure progress
628 2016-09-08 20:19:36	0|cfields|sipa: yes. i doubt many rpc users/scripts are hammering on block-height in tightish loops :)
629 2016-09-08 20:19:38	0|cfields|hope not, anyway
630 2016-09-08 20:19:39	0|kanzure|so- for example- imagine you are operating a lot of bitcoin infrastructure. you do a bunch of per-block processing. when you are running functional/integration tests, you can't run your test checks immediately after issuing a command because things take a while. so when do you expect to run? well you setup a hook and you ask your infrastructure to ping your tester as soon as the data's available, or you poll for some internal state.
631 2016-09-08 20:20:10	0|kanzure|(and polling is considered not ideal)
632 2016-09-08 20:20:52	0|sipa|and non-polling methods exist
633 2016-09-08 20:21:00	0|sipa|we have -walletnotify for exactly this
634 2016-09-08 20:21:58	0|kanzure|walletnotify should certainly be used by the rpc tests
635 2016-09-08 20:22:26	0|sipa|this raises another point: walletnotify should probably fire after all of a block's transactions are processed
636 2016-09-08 20:23:05	0|kanzure|i would like zeromq notifications and -*notify notifications to be unified somehow, and eventually have much more distinct notifications for different events going on
637 2016-09-08 20:23:16	0|kanzure|changing walletnotify behavior and when it fires is sort of unkind to the users that rely on its existing behavior :)
638 2016-09-08 20:23:57	0|cfields|kanzure: and #8680 introduces blocking calls. So you could "./bitcoin-cli waitfornewblock && ./dosomething.sh", which would essentially be blocknotify. Obviously the same could be done for wallet stuff
639 2016-09-08 20:24:01	0|CodeShark|I would like all pub/sub stuff in a separate layer ;)
640 2016-09-08 20:24:28	0|CodeShark|especially if it requires deep knowledge of account structure
641 2016-09-08 20:24:43	0|kanzure|i feel like users are going to not understand how to use waitfornewblock. how are you going to stop them from treating that as a monotonic counter for each new lbock...?
642 2016-09-08 20:26:51	0|cfields|kanzure: that's a hack, hidden for users, just for tests. It's a pretty bad idea to take action on an event so vague :)
643 2016-09-08 20:26:59	0|kanzure|btw i (sheepishly) made a one-line proposal about throwing a component into bitcoind to keep track of external application state, specifically to store a range or diff-set of blocks that an external application should be aware about, and then the implementation proposal would be "please integrate against this" and we give the user an endpoint for saying "my application has processed the latest diff-workload x".  but this might be too ...
644 2016-09-08 20:27:05	0|kanzure|... kitchen-sinky.
645 2016-09-08 20:27:08	0|kanzure|oh it's for testing. hm.
646 2016-09-08 20:27:30	0|cfields|i was just using it as an example of an async approach.
647 2016-09-08 20:29:54	0|kanzure|(the "diff-workload x" is specifically referring to a set of new blocks some of hwich might override previous blocks the other application was aware about. this makes the interface explicitly expose a concept of reorgs.)
648 2016-09-08 20:30:18	0|kanzure|CodeShark: in your link i'm not seeing any tests for that library...
649 2016-09-08 20:30:46	0|CodeShark|the whole thing needs to be repackaged
650 2016-09-08 20:32:01	0|CodeShark|just giving it as an example of how I think an API should work
651 2016-09-08 20:32:31	0|kanzure|cfields: fwiw once i switched to notifications inside my own tests (for some external infrastructure) re: bitcoind integration, everything went much faster and i had much more information about failures. far less timeouts too.
652 2016-09-08 20:32:32	0|cfields|kanzure: what would bitcoind do with the knowledge that the application is done processing?
653 2016-09-08 20:32:36	0|sipa|can we talk about solutions instead of vague design concerns?
654 2016-09-08 20:33:05	0|kanzure|cfields: nothing. it's for the benefit of the application. once bitcoind is informed about the application's new state, it can discard the old diff information. that's about all it would do...
655 2016-09-08 20:34:43	0|CodeShark|two subscription layers - one low level, the other much higher level
656 2016-09-08 20:35:06	0|CodeShark|the low level layer only gives you basic events like new tip or new tx
657 2016-09-08 20:35:28	0|CodeShark|dunno why sipa doesn't like to discuss architecture :(
658 2016-09-08 20:36:05	0|CodeShark|it
659 2016-09-08 20:36:20	0|CodeShark|it's a serious problem for the ecosystem right now that there's no good way for people to build apps
660 2016-09-08 20:40:58	0|cfields|sipa: the more I think about it, the more I think that there needs to be a wallet rpc for getbalanceat(height)
661 2016-09-08 20:41:33	0|cfields|i can't think of anything that doesn't introduce more problems except for explicit/atomic calls
662 2016-09-08 20:41:44	0|kanzure|should be a blockhash not a height
663 2016-09-08 20:42:10	0|cfields|sure
664 2016-09-08 20:43:24	0|sipa|cfields: that makes sense
665 2016-09-08 20:43:38	0|cfields|I think the reason today's discussion devolved so quickly is because "getblockcount" is impossible to define, because there's no global height. So the only fix is to ensure that we're asking a specific interface a specific question. Then there's no way of being out of sync because you've specified your constraints
666 2016-09-08 20:44:04	0|sipa|be back in a while
667 2016-09-08 20:44:08	0|cfields|cya
668 2016-09-08 20:45:00	0|CodeShark|cfields: right
669 2016-09-08 20:46:15	0|CodeShark|there's no such thing as "what's the current state of the network?"
670 2016-09-08 20:46:18	0|cfields|then it's just a matter of how to handle the api. returning "come back later", blocking until there's an answer, or some callback mechanism.
671 2016-09-08 20:47:51	0|cfields|arguably if you need a callback, you should be using a different interface. as kanzure suggested above. I'm of the opinion that blocking is the way to go because that lets the user chain his own callback
672 2016-09-08 20:48:26	0|kanzure|blocking in what context? rpc ?
673 2016-09-08 20:48:29	0|CodeShark|depends on what model you're after - I think async is generally cleaner but requires a bit more clientside framework
674 2016-09-08 20:49:03	0|cfields|kanzure: yes, rpc blocks for a specified time (or forever) and returns when it has an answer, or timeout, or shutdown
675 2016-09-08 20:49:33	0|kanzure|oh. i've had so may issues with rpc socket timeouts that i haven't traced down yet that i would recommend not considering that direction heh.
676 2016-09-08 20:49:44	0|kanzure|(but also i haven't been able to make good reports about these problems, so they don't really count.)
677 2016-09-08 20:50:18	0|cfields|kanzure: heh, i was actually surprised i didn't bump into those during testing. good to know :)
678 2016-09-08 20:50:37	0|kanzure|well i think what i was doing could be considered "torture testing" and weird stuff, so.... yeah..
679 2016-09-08 20:51:28	0|kanzure|to some degree aren't we already tracking peer state on the p2p layer? e.g. like which chains the peers seem to be following lately?
680 2016-09-08 20:51:47	0|kanzure|or is that purely a function of the banning behavior heh
681 2016-09-08 20:53:19	0|cfields|lately?
682 2016-09-08 20:53:29	0|kanzure|(by virtue that you could ban everyone feeding you unhelpful data, as opposed to tracking which blocks you think peers have already)
683 2016-09-08 20:54:37	0|kanzure|nevermind. just an abstract thought, it's not important, i was thinking that "peer communication" is sometimes similar to "application communication" but more one-way. anyway, just a minor distraction.
684 2016-09-08 20:56:43	0|cfields|we keep tabs on what they shouldn't be sending, but i don't remember to what extent
685 2016-09-08 20:59:03	0|CodeShark|a peer can query for inventory at any time regardless of whether it is in agreement with the node's best chain
686 2016-09-08 21:00:10	0|CodeShark|I think peers get sent invs whenever there are tip changes regardless
687 2016-09-08 21:53:11	0|gmaxwell|"(and polling is considered not ideal)
688 2016-09-08 21:53:13	0|gmaxwell|"
689 2016-09-08 21:53:42	0|gmaxwell|This bugs me. Polling is highly reliable. And we're taking about things that have inherent latencies in real of seconds to tends of minutes.
690 2016-09-08 21:54:34	0|phantomcircuit|polling is the correct way to interact with the wallet
691 2016-09-08 21:54:37	0|gmaxwell|I do not know why people eschew polling as often as they do... there are contexts where its exactly the right tool and keeping track of a wallet state is likely one of them.
692 2016-09-08 21:54:41	0|phantomcircuit|if you're not polling you're doing it wrong
693 2016-09-08 22:08:46	0|kanzure|well one trivial example is in scenarios where you have long-term polling, you will miss the update and spend extra time waiting
694 2016-09-08 22:08:56	0|kanzure|this is apparent in scenarios with, say, exponential backoff
695 2016-09-08 22:11:26	0|phantomcircuit|kanzure, call listtransactions
696 2016-09-08 22:11:37	0|phantomcircuit|does the list contain a transaction you have previously seen?
697 2016-09-08 22:11:43	0|kanzure|instead of hoping you catch wallet state transitions by polling, what about just having the wallet notify you directly of each change event? then you consume the feed/queue of events.
698 2016-09-08 22:11:44	0|phantomcircuit|yes? great do nothing
699 2016-09-08 22:11:52	0|phantomcircuit|no? increase the list size
700 2016-09-08 22:12:19	0|phantomcircuit|handle reorgs? need to call the blockchain things and do a bunch of work
701 2016-09-08 22:12:45	0|kanzure|which application are you imagining for listtransactions in particular?
702 2016-09-08 22:13:17	0|phantomcircuit|anything which needs to know that a payment has been made
703 2016-09-08 22:13:40	0|kanzure|i don't know what the behavior of listtransactions is. how does it behave when a transaction has been removed from your chaintip..?
704 2016-09-08 22:15:00	0|phantomcircuit|kanzure: it's buried in the list and has -1 confirmations
705 2016-09-08 22:15:40	0|kanzure|for how long...? it occurs to me that listtransactions is probably a wallet-specific rpc command and that's why i know so little about it.
706 2016-09-08 22:17:11	0|kanzure|getting notified when a transaction is about to be permanently removed from that list sonuds like a useful thing, but you could probably infer that detail from polling regularly and knowing the lifecycle i guess.
707 2016-09-08 22:17:35	0|phantomcircuit|kanzure, listtransactions only shows you transactions in your wallet
708 2016-09-08 22:17:53	0|phantomcircuit|nothing is ever removed from the list there's just a parameter which truncates the list
709 2016-09-08 22:18:12	0|phantomcircuit|listtransactions "*" 4294967295
710 2016-09-08 22:18:22	0|phantomcircuit|will give you all the transactions your wallet has ever seen
711 2016-09-08 22:19:24	0|kanzure|incremental updates and messaging would not require so much data transfer all at once. :)
712 2016-09-08 22:19:48	0|phantomcircuit|kanzure, messaging is unreliable
713 2016-09-08 22:19:53	0|phantomcircuit|polling is inherently reliable
714 2016-09-08 22:19:55	0|phantomcircuit|fin
715 2016-09-08 22:20:34	0|sipa|we shouldn't make assumptions about how people use the api
716 2016-09-08 22:23:55	0|kanzure|my above concerns are mostly about polling interval
717 2016-09-08 22:34:42	0|kanzure|and blockheight can't be a heartbeat
718 2016-09-08 22:54:13	0|BlueMatt|check before requesting cmpcblocks and otherwise dont need the complicated other semantics
719 2016-09-08 22:54:13	0|BlueMatt|sipa: https://github.com/TheBlueMatt/bitcoin/commit/96cef326f9184aefd1c562f64a21298a15f0adde simplifies the total diff from master to be more readable, to me...it matches the bip, but another way to look at it is that you have two booleans: which version of compact blocks they want (which you use to send to them) and whether they will send us segwit cmpctblocks...you simply introduce the the do-they-support-v2 bool as an additional
720 2016-09-08 22:54:57	0|BlueMatt|(warning: mostly untested...it compiles, though :p)
721 2016-09-08 23:02:49	0|BlueMatt|ehh, nvm, need to fix a bug there, but I'm tired so will do it later/tomorrow