19:05:11 #startmeeting 19:05:11 Meeting started Thu Oct 22 19:05:11 2015 UTC. The chair is btcdrak. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:05:11 Useful Commands: #action #agreed #help #info #idea #link #topic. 19:05:50 gmaxwell, just note 19:06:10 replacement for leveldb is a good topic IMO 19:06:13 Just letting devs know to resubscribe :) (unless someone wants to discuss) 19:06:43 so. Topics? 19:07:03 let's start with mempool memory usage 19:07:13 #topic mempool memory usage 19:07:16 so 19:07:25 a few things that BlueMatt and i discovered 19:07:26 paste wumpus's gist 19:07:48 there is a discrepancy between the mempool limit that is configured and actual memory usage 19:08:08 investigating turned up that just transaction processing can pull in large amounts of utxo cache data 19:08:15 which is only flushed after block processing 19:08:24 so it can temporarily exceed the limit 19:08:52 also, -checkmempool pulls in all mempool dependencies into the utxo cache, which also can blow it out of bounds 19:09:02 sipa: to be clear there are two limits, utxo dbcache limit and mempool limit and the utxo dbcache limit is exceeded right? 19:09:07 morcos: correct 19:09:22 there is an obvious solution to this, namely just enforcing the utxo limit the whole time 19:09:45 however, that means that if you misconfigure your mempool limit, an attack can basically blow away your utxo cache 19:09:51 well, there are two obvious solutions: always flush utxo cache, or limit mempool in parallel with utxo cache 19:09:56 eg https://github.com/TheBlueMatt/bitcoin/commit/2315cbca8b74197aac022126f0dc0527024c64c9 19:09:58 which has a significant impact on block validation/propagation 19:10:17 (but this opens you up to txn in mempool eating WAY more "space" than others, allowing then to more easily kick out other txn) 19:10:44 aren't there in between answers 19:10:45 sipa: since the utxo cache impact of a mempool transaction can be larger than the transaction itself; do we have an issue that strictly enforcing that limit would slow block verification by resulting in not all mempool txn being cached? 19:11:02 such as not putting into pcoinstip cache utxos for txs which weren't actually accepted into the mempool 19:11:04 morcos: yes 19:11:30 also if the mempool limit and utxo limit are closer to the same size... then it should be hard for the actual mempool to blow up the utxo limit, modulo eviction 19:11:33 gmaxwell: indeed.. basically... we want the chainstate cache to closely match what is in the mempool as an expectation of the next block 19:11:36 we could also be smarter about what we flush, based on what is in the mempool/likelhiood of being mined? 19:11:43 so it makes sense to only have one limit that governs both 19:12:07 morcos: though if we reject them and they are still mined, that again will result in lower block verification speed. (though I agree they're second class citizens for sure) 19:12:11 sdaftuar: yes, exactly. first approx, whats actually in the mempool (and not things that got checked but didn't make it) . next remove things that are evicted 19:12:18 morcos: well, yes, you can do thinks like only kick out cache entries as the txn leave mempool (eg https://github.com/TheBlueMatt/bitcoin/commit/5b90ba0da0e6bb086bf5e793634bd105b2bc45ca ) 19:12:31 two ideas so far for getting closer to that: when a tx is evicted from the mempool, also kick them out of the chainstate cache (if they are not dirty) 19:12:50 the above commit does that 19:13:05 BlueMatt: what about ones that never go in? 19:13:05 and not letting failed-to-accept-to-mempool's dependencies go into the cache 19:13:12 gmaxwell: dont think so 19:13:14 fixing now 19:13:46 i think a better solution is to turn the chainstate cache into a LRU, and be able to on the fly evict things from it 19:13:55 when there are better things to put in 19:13:59 ehhh, i dont think that fixes it? 19:14:03 it's part of it 19:14:08 you dont care about lru here, you care about used-in-high-feerate-txn 19:14:15 BlueMatt: agreed 19:14:22 right, that's independent 19:14:22 BlueMatt: by defniniton that will be LRU 19:14:26 otherwise it'll be mined 19:14:30 morcos: huh? no 19:14:41 you want to give priority to the cache for things in the mempool 19:14:45 morcos: over long timespans, sure, but what about something that barely doesnt get mined for a while 19:14:57 we want to keep it, because its more likely than something for which there is a lot of churn at the bottom of the mempool 19:14:59 but outside of that, you want to be able to evict things from the cache when more space in it is needed for mempool txn 19:15:01 but it may be a while before its mined 19:15:25 how much of a practical problem is this right now 19:15:53 lets say you set dbcache to 2x mempool limit 19:16:06 right now utxo cache is unlimited 19:16:12 do you really get much of a problem, i think there might be more low hanging fruit 19:16:19 only unlimited between blocks though 19:16:22 sure 19:16:24 the problem is that the utxo cache is per tx 19:16:25 not per txout 19:16:43 so if you are spending outputs from large transactions, the impact on the cache is proportionally way larger 19:16:44 but if you create a tx that spends 100 txos from different very-large-txo-set txn, you can pull in a lot of memory 19:17:06 i think if we could do the simple thing of not letting non-accepted txs populated the utxo cache, we'll have closed most of the problem 19:17:10 i believe i've seen single transactions pull in over 10 MB of chainstate cache 19:17:29 though i need to investigate further 19:17:36 still, i mean what kind of attack is that 19:18:06 its pretty tough to do that with a big chunk of txs from the mempool 19:18:53 anyway, i should rebase #5967, as i think it might be good for doing some of this 19:19:03 that allows the intermediate cache to be flushed 19:19:24 ok 19:19:25 so pcoinstip doesn't need to have coins just b/c viewmempool does 19:20:08 ### 1/3 of meeting complete 19:20:29 so are there any action points for this topic? 19:20:41 okay I think people are going to continue existing work to research and optimize here. 19:20:49 yea, lets move forward 19:20:52 #action continue research 19:20:57 next topic 19:21:03 #topic leveldb replacement 19:21:12 is that really a topic? :) 19:21:21 being discussed in #bitcoin-core-dev now 19:21:25 it's more a mention 19:21:28 I know - lol 19:21:37 seems several people are interested in investigating this 19:21:52 This is pretty bitcoin core specific. Leveldb durrability is not good, and we also suffer from its performance... it is also not (apparently) actively maintained anymore (and the FS layer stuff seems to have not really been maintained for sometime). 19:21:55 not sure there is much to say about it any more 19:21:57 People are investigating alternatives. 19:21:58 jeff is researching sqlite as an option 19:22:03 Argument - leveldb not so well maintained. I should have a patch for sqlite by the end of the day. 19:22:12 SQLite is a fine replacement for bdb for the wallet stuff - but for a blockchain store, not sure 19:22:17 i look forward to benchmarking 19:22:25 so would that be sqlite + leveldb? 19:22:30 without benchmark results, any discussing is probably worthless 19:22:37 the problem is leveldb is not being maintained. 19:22:41 (also I vind the leveldb code to be very difficult to review :) ) 19:22:41 and also, would there be an automatic migration from leveldb to sqlite 19:22:45 so i think the action is benchmark lots of things, come back and report (in -core-dev) with results 19:22:46 sqlite appears to perform better than bdb for large numbers of records, according to the sqlite key/value store wiki benchmarks page. 19:23:02 it's pretty much a guarantee that sqlite perf will be much lower than leveldb, but i'd be happy to be surprised 19:23:08 UTXO storage db is part of the consensus protocol, so it really isn't Core-specific 19:23:10 btcdrak: I don't really agree there, in any case. I think all we need to do is note this is being discussed and explorered. 19:23:16 jcorgan, the benchmarks pages disagrees 19:23:24 sqlite also has in-memory database which could be strangely useful for unit testing (sqlite://:memory:) 19:23:32 sqlite is better for synchronous storage, slower for batch updates, faster for random-access reads 19:23:41 all of which are things we rely on very heavily 19:23:45 sqlite seems not to be the type we'd like to have for a leveldb replace. What about other non-sql solutions? 19:23:46 so i don't know the result 19:23:49 kanzure_, yes. that is easily wrapped into the current wrapper, newly s/CLevelDBWrapper/CDBWrapper/ 19:23:54 sipa: benchmarks https://www.sqlite.org/cvstrac/wiki?p=KeyValueDatabase 19:23:54 as i mentioned before, my main reason for advocating sqlite is to be able to use the sqlcipher fork for full db encryption 19:24:04 (sqlite is crazy slow compared with bdb) 19:24:17 jcorgan: and where would the keys go? 19:24:20 oh, wallet. nevermind. 19:24:25 maaku, except for large numbers of records, as shown on that page 19:24:37 jcorgan: encryption for public data seems pointless 19:25:03 well maybe for watches or something.. 19:25:11 I agree with sipa: first we need some research, there are other solutions like RocksDB, etc. We need an overview with benchmarks to evaluate more 19:25:19 ok 19:25:22 next topic? 19:25:23 #action continue research and benchmarking 19:25:34 #topic versionbits 19:25:42 CodeShark wanted to discuss his implementation 19:25:58 #6816 needs more reviews :) 19:26:05 gmaxwell: how much better is sqlite source code for legibility? 19:26:37 CodeShark, are you planning to add some RPC tests? 19:26:41 kanzure_: we're on a new topic. will respond later. 19:27:00 btcdrak: I added versionbits info to the getblockchaininfo RPC 19:27:01 Also, for the record, what's the status of the implementation? 19:27:21 the implementation should be ready for integration barring any issues I'm unaware of 19:28:06 ok is there anything else to discuss on this topic? 19:28:17 we should review implementation 19:28:25 #action review versionbits implementation https://github.com/bitcoin/bitcoin/pull/6816 19:28:25 that includes me 19:28:43 next topic? 19:28:51 I'd like to mention the mailing list for the record 19:28:58 #topic mailing list 19:29:15 have users been moved to bitcoin-discuss, or is that voluntary sign-up only? 19:29:20 We finalised the moderation rules for bitcoin-dev 19:29:27 and have started a 3 month moderation period 19:29:38 have those rules been posted anywhere? 19:29:39 We#d encourage devs to join again 19:29:46 #info http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-October/011591.html 19:29:46 btcdrak: by moderation, does this mean posts have to be manually approved? 19:29:59 is there a white list? 19:30:01 see the link above 19:30:09 On the subject of "take note" -- bitcoin.org had incorrect release notes for 0.11.1. It's corrected now. They had posted the release notes for the initial RC and not updated them. Process wise it would be good to watch out for that in the future. 19:30:11 petertodd: yes, i have had to manually approve email today 19:30:21 only the first 19:30:29 btcdrak: Ah, I missed the "mod bit" part of that message, thanks. 19:30:32 then we take the mod bit off that user 19:30:57 ok next topic, anyone? 19:31:03 gmaxwell: my bad for not bringing it up. I had assumed the only difference was minor, but I should have compared when I noticed it was not identical. :/ 19:31:25 if we want to have actively used bitcoin-discuss there should be someone who currates content for that mailing list, otherwise i doubt people will use it 19:31:32 actually what is the status, has traffic actually been redirected there 19:31:45 "No messages have been posted to this list yet, so the archives are currently empty." 19:31:46 kanzure_ please see the posted link 19:31:49 note: there is still a discuss mailing list on SF 19:31:59 Luke-Jr: in particular it did not have the relay fee bump. 19:32:01 there have been several messages sent there this year 19:32:01 which discuss mailing list should have priority? 19:32:06 sipa: the new official list is now bitcoin-discuss at LF 19:32:12 linuxfoundation has been working well afaik 19:32:15 for mailing list hosting 19:32:34 #action tell SF list about new lists 19:32:38 #link lists.linuxfoundation.org/mailman/listinfo/bitcoin-discuss 19:32:47 we should find someone who wants to actively run -discuss or something 19:32:52 i did hide the old dev list from SF 19:32:54 or replay old -dev messages to -discuss that would have otherwise been moderated 19:33:07 i haven't deleted it yet should we want its archives for whatever reason 19:33:33 (for the record i am not interested in running or moderating -discuss, but "go here where nobody is sending email/reading" is not likely to win anyone over) 19:33:34 ok I think next topic. I've got one ;) 19:33:50 #topic Median Past locktime 19:34:00 #link PR https://github.com/bitcoin/bitcoin/pull/6566 19:34:13 Reviews have been good since last week 19:34:42 maaku: there are a couple of nits from wumpus and gmaxwell. Has anyone else got concerns for this PR? 19:34:54 concept ack 19:34:57 I am a strong concept ack. 19:35:04 (which I'll also go make clear there) 19:35:09 yes same with sipa please 19:35:26 I'll try to finish reviewing it ASAP 19:36:11 #action review https://github.com/bitcoin/bitcoin/pull/6566 19:36:12 There is lots going on in lots of PRs, but I can't think of any that need to be elevated to here. 19:36:32 I only bring up 6566 because we talked about adding it to the CLTV softfork 19:36:44 we're getting close to that now 19:36:53 Topic suggestion: Where are we on CLTV soft-fork deployment? 19:37:03 #topic CLTV softfork deployment 19:37:16 btcdrak: re: CLTV softfork, I'm likely not going to have time to be doing more rebasing/rework on that going forward, so either merge it or someone else should be prepared to take over 19:37:20 btcdrak: that PR is just mempool behavior. 19:37:29 (I no longer have funding for bitcoin core work) 19:38:05 fwiw, #6816 will make merging the soft fork logic itself pretty straightforward ;) 19:38:33 We agreed to roll out the CLTV softfork at the end of October. 19:39:16 btcdrak: no one forgets what the objective was there, but what is the status? 19:39:34 I believe for master the PR is ready to merge 19:39:35 what needs to be done? 19:39:45 there are 0.10 and 0.11 PRs for the packports also 19:39:51 so they just need to be merged. 19:39:57 merge PR, do v4 block ISM softwarez done? 19:40:06 sipa: yes 19:40:07 i will review then 19:40:15 but i expect i will be fine 19:40:24 this is the sort of thing to discuss on the ML though 19:40:28 https://github.com/bitcoin/bitcoin/pull/6707 19:40:35 https://github.com/bitcoin/bitcoin/pull/6706 19:40:53 https://github.com/bitcoin/bitcoin/pull/6351 19:41:11 Those are the PRs. If petertodd isnt around to rebase, one of us can just do it. 19:41:20 yeah 19:41:36 if we want to add media-past-locktime then there is still time 19:42:02 #action review #6707 #6706 #6351 for CLTV deployment. 19:42:25 Has code even been writeen for MPL enforcement as part of that soft fork? if not, someone needs to take the task of doing it. 19:42:28 do we want to try for median-past-locktime with this or just wait? 19:42:52 I would have assume maaku would do it, he was just waiting for the mempool PR to be merged 19:42:52 btcdrak: median past is the type of boring change that'd be an excellent way to deploy versionbits actually 19:43:11 btcdrak: there are three possibilities in my mind. 19:43:16 btcdrak: there's no rush to do it and it's uncontroversial 19:43:24 no MPL. MPL mempool only. MPL in softfork. 19:43:32 I strongly believe we should not do the first. 19:43:46 well somewhat strongly. 19:43:59 so short-term median-past-locktime mempool only, then median-past-locktime soft-fork using versionbits? 19:44:00 gmaxwell: at the least, I would love MPL as mempool together with BIP68 and OP_CSV as mempool. 19:44:11 gmaxwell: the MPL pull is specifically written to not require further code for soft-fork, just setting a flag bit undre a ISM condition 19:44:20 actually, for same reason, MPL-mempool only should be done instead of the softfork. Rational: right now miners will currently mine MPL violations. 19:44:25 deployment is easy 19:44:40 yes, MPL should be deployed mempool-only first 19:44:56 gmaxwell: oh right, that's a good point... further delays MPL deployment, which again is an argument to do it with versionbit 19:45:04 maaku: I know I read the code. But there is no patch to actually set the flag and enforce it. But thats okay at the moment. We should mempool only it first. 19:45:15 same with BIP68, no? 19:45:27 sipa: CSV enforcement is flagged. 19:45:31 current miners will accept bip68 violations 19:45:46 BIP68 is only active for higher tx version right? 19:45:48 sipa: requires nVersion=2 19:45:49 sipa: no, requires a tx version flag. 19:45:55 right, separate tx version 19:46:00 which is already nonstandard 19:46:01 nvm! 19:46:06 gmaxwell: there's no patch because it'd presumably be part of #6351 if rolled out together, so I didn't create a separate PR 19:46:36 maaku: thats okay, I think based on the observation that miners would currently mine violations we'll only do mempool only immediately. 19:47:08 (which also still has the positive effect of stopping new CLTV locktime users from depending on the to-be-replaced behavior. 19:47:13 ) 19:47:33 how about we merge all three mempool PRs and release them with the CLTV deployment to get them out in the wild. We can then consider another ISM or versionbits deployment after? 19:47:57 btcdrak: the mempool related PRs are more or less 0.12 only. 19:48:23 gmaxwell: but we can backport? 19:48:26 They depend on git master exclusive major changes to the mempool code. 19:48:31 btcdrak: I don't think that would be prudent. 19:48:40 we have to backport for softfork deployments anyway 19:48:40 we can release backported policy patches 19:48:49 btcdrak: consensus and policy are not the same 19:48:56 I would recommend 'backporting' TCP_NODELAY. (which I will gladly do, of course) :P if you're looking for upgrade sweetener. 19:48:58 Luke-Jr: ah, I understand 19:49:05 should I start working on #6816 backports? 19:49:25 CodeShark I would get #6816 merged first. 19:49:39 CodeShark: perhaps wait until the first round of review unless you're itching and won't mind redoing it if you get asked to change the design? 19:50:14 the backports should be pretty easy, I think - so it can wait 19:50:15 does median-past-locktime mempool-only also require lots of master-only 0.12 mempool changes that are not in the older versions? re: backporting 19:50:28 the backports can wait, that is - the reviews can't ;) 19:50:46 Kireji: no. 19:50:48 er 19:50:50 kanzure: no. 19:50:58 are there any in flight backportable bug fixes which we should hammer down before we do backport updates for the CLTV soft-fork? 19:51:17 gmaxwell: which "mempool related PRs" are not backportable? 19:51:55 sipa: I assume btcdrak is mostly talking about matt's limiter, which depends on the major data structure changes in the mempool. Do you think we should actually backport all that? 19:52:08 gmaxwell: hell no 19:52:14 sipa: +1 19:52:14 but we're talking about softforks here 19:52:27 I think the point is, if we get the mempool PRs merged in master, then we can start working on backporting them. The actual softfork deployment can be done at any time thereafter at our convenience. 19:52:42 oh dear! okay. I was wires crossed. I thought btcdrap was talking about mempool capacity management. 19:52:45 this way we're doing a pure CLTV release first. 19:52:54 i think that btcdrak is referring to the BIP68/112/113 mempool-only changes with "mempool PRs" 19:52:56 gmaxwell: no :) 19:52:58 kanzure: I don't believe any of #6312, #6564 or #6566 depend on master changes 19:53:02 also, if a backport is going to take a lot of work, you might want to ask miners first if they really want it... 19:53:11 I'm not sure what gmaxwell is referring to 19:53:12 yes, sorry that's my mistake, I was referring to BIUP68/112/113 19:53:49 as I said, I thought he was referring to the mempool limits and friends. 19:53:53 OK 19:53:56 thing is MPL is quite a trivial patch, it would easily backport and be part of the CLTV softfork... 19:54:14 I do not think there is a reason to mempool only any of them except median right now, as they're already non-standard. 19:54:33 The concern I have is that if we deploy a mempool only CSV then now we have a problem if the interperation of the field changes. 19:54:52 (because we may need to first make it non-standard again) 19:54:55 do we have reason to believe the interpretation of the field will change? 19:55:18 maaku: the last few weeks :p 19:55:30 Deploying it as mempool only in the soft fork backport when its already non-standard carries basically only risk. 19:55:35 BIP68 has been refined. 19:56:02 I think everyone nits were addressed for BIP68, so itr should be considered final 19:56:10 gmaxwell: w/ CLTV, the plan was to s/OP_NOP2/OP_NOP3/ - the equivalent for CSV's redefinition of what nSequence means might be to use nVersion>=3 rather than nVersion>=2 19:57:05 petertodd: indeed, thats true. 19:57:14 But again, I do not see the gain. 19:57:26 At least in the context of the CLTV softfork release. 19:57:39 gmaxwell: it's not a gain, just a backup plan if a mempool-only release turns out to need to be changed because the behavior was wrong 19:57:42 gmaxwell: so you're suggesting we properly softfork MPL, and bip68/CSV right off the bat 19:58:08 petertodd: I meant I do not see the gain in putting out CSV mempool only at the same time as CLTV softfork. 19:58:16 gmaxwell: ah, yeah, neither do I 19:58:18 But I agree with your backup plan, good observation. 19:58:26 gmaxwell: the original discussion is to have CLTV + MPL 19:58:33 btcdrak: No. backup. 19:58:50 btcdrak: I am saying, there will be a CLTV soft fork release which also has mempool only MPL. 19:59:14 gmaxwell: ok, understood. 19:59:15 The latter because MPL violates current 'standard' behavior, so we would prefer to have that violation dead in the network before MPL soft-fork moves forward. 19:59:30 For CSV mempool it's already non-standard, so the same argument doesn't apply. 19:59:46 in that case, maaku needs to work on backporting MPL to 0.11 and 0.10 asap. 20:00:05 And we're awfully close right now to the last semantic changes, so I'd rather hold for that. (could still go in mempool only first, but just not in the CLTV soft fork release) 20:00:18 was the mempool limiting stuff something that needs to be discussed? the thing that was misconfused above. 20:00:19 btcdrak: fortunate those backports will be trivial code copying, I believe. 20:00:35 ok so I'll log that as an action point then 20:00:46 kanzure: my wires were crossed, I thought btcdrak brought them up as deployment sweetener for CLTV. 20:00:52 right 20:00:59 it was wrong, but does that need to be discussed anyway 20:01:02 #action backport MPL to 0.10 and 0.11 20:01:03 ### 20:01:13 time's up 20:01:17 we are past time. Thanks everyone! 20:01:21 meeting fini 20:01:24 #endmeeting