< gmaxwell> lol, luke's #6851 reduces the time to add 53k tx to the wallet from 843 seconds to 35 seconds.
< GitHub179> [bitcoin] pstratem closed pull request #6966: [WIP] Wallet: Cache CWalletDB pointer in CWallet to improve performance (master...wallet_speedup) https://github.com/bitcoin/bitcoin/pull/6966
< gmaxwell> Luke-Jr: around?
< Luke-Jr> gmaxwell: ?
< phantomcircuit> gmaxwell, comment changed and merged petertodd's fRelayTxs rpc addition
< GitHub132> [bitcoin] Har01d opened pull request #7072: [RPC] Add transaction size to JSON output (master...master) https://github.com/bitcoin/bitcoin/pull/7072
< midnightmagic> gmaxwell: http://0bin.net/paste/vKUjDmnyTyWAkxP2#gkQ4nb+AGhl0QZKpjE1W0oaQqM0ElXzZMseXDp+fwmY corruption..
< GitHub123> [bitcoin] gmaxwell pushed 2 new commits to master: https://github.com/bitcoin/bitcoin/compare/776848acefa8...616d61b20d56
< GitHub123> bitcoin/master 3e7c891 Luke Dashjr: Optimisation: Store transaction list order in memory rather than compute it every need...
< GitHub123> bitcoin/master 616d61b Gregory Maxwell: Merge pull request #6851...
< GitHub42> [bitcoin] gmaxwell closed pull request #6851: Optimisation: Store transaction list order in memory rather than compute it every need (master...opti_txorder) https://github.com/bitcoin/bitcoin/pull/6851
< gmaxwell> midnightmagic: interesting, so that had been running without interruption and just crashed while syncing?
< midnightmagic> gmaxwell: I did a -reindex and -connect to an internal node.
< midnightmagic> bitcoind -connect=x.y.z.a -listen -daemon -nodnsseed -nodns -reindex
< gmaxwell> I guess I need to fix the ppc host to see if I can repro.
< midnightmagic> Come to think of it.. I'm not sure this machine has ever reliably sync'd to head.
< gmaxwell> midnightmagic: I think before you might have been failing when it was fine for me.
< midnightmagic> gmaxwell: Yes. At one point it seemed to be coincident with a hard-disconnect of the network in the middle of a block transfer.
< midnightmagic> Perhaps this machine is just flakey.
< midnightmagic> no other evidence of a machine problem. everything else has been running for 300+ days
< midnightmagic> drat. another one.
< midnightmagic> ooo tor stream isolation
< gmaxwell> woot, dual G5 is back up.
< midnightmagic> ooo fascinating.
< midnightmagic> http://0bin.net/paste/mK4mOOxCYGHmdN7a#6N5+i3ta5ZuVpyVBPX3Uk5NVna+MZUvDvCz5EGc7cTx
< btcdrak> that's weird
< * midnightmagic> shrugs and reindexes the main node.
< gmaxwell> in any case, my 2xG5 host seems to be catching up fine with git master.. taking like 10 seconds for some blocks. :)
< midnightmagic> what magic incantation do you do to make it go fast
< jtimon> morcos the linked commit doesn't touch TrimToSize, that's the next one
< jtimon> ACK on policy estimator called directly instead of through the mempool (but I've been asked not to worked not to work on policy refactors for now) and that one is certainly disruptive
< jtimon> setting the attribute by calling TrimToSize seems weird, what's wrong with doing it in the constructor (or in a setter if necessary)?
< jtimon> morcos_: the estimator is currently not asking questions to the mempool and it doesn't need to, please don't couple that again
< jtimon> you want the mempool decoupled from policy/fees and I agree, and have done it already in a "private" outdated branch
< jtimon> but to do so, it is not necessary to couple policy/fees to the mempool instead, they can be completely independent
< jtimon> whenever we think is the moment, I can completely decouple them
< morcos> jtimon: the question is where shoould the logic live in smartly estimate fees. in the policyestimator. that logic requires asking question of the mempool. otherwise you're going to have to put that logic repeated in several different places in wallet and gui.
< morcos> s/live in/live to/
< morcos> jtimon: the reason I like setting the mempool size in TrimToSize is you can easily imagine logic where the size is non-constant. So after you have trimmed it the mempool knows what size it currently is (the logic as to what size to trim it lives outside mempool)
< morcos> for instance we discussed using less size for the mempool during IBD so you could use more of your allocated memory for the dbcache
< morcos> or you can imagine other scenarios
< gmaxwell> 1h 11m to rescan a wallet with 11.7m transactions now.
< sipa> how long for a wallet with 0?
< gmaxwell> sipa: less than 10 minutes.
< gmaxwell> listunspent on that wallet is taking 2m10s right now (to return 15870 coins)
< gmaxwell> Wallet.dat is 11G which isn't bad.
< gmaxwell> bleh, and getinfo takes 1m8s.
< gmaxwell> Luke-Jr: It might be useful to add an index of which transactions have unspent coins to make listunspent fast. But I think with the way balance calculations work getinfo is going to remain slow. :(
< Luke-Jr> I have never once had a reason to use listunspent..
< gmaxwell> Luke-Jr: it also means selectcoins will be superslow.
< gmaxwell> 4m 15s for a getbalance "*" 0 true, I dunno why getinfo is faster.
< gmaxwell> ::sigh:: we really need a remove feature for the wallet, but the remove needs to keep track of what was removed so rescan doesn't read... and we can't remove things with spendable txouts because they're not seperate.
< Luke-Jr> jonas is still rewriting it, right?
< gmaxwell> We've fucked over the project for years with that kind of thinking; we can't stop improving the wallet because of a grand rewrite.
< Luke-Jr> sure, it's just one of those things that if I were to personally try to do it, I would end up probably rewriting the wallet myself :p
< sipa> gmaxwell: what do you mean by remove?
< sipa> remove keys?
< gmaxwell> sipa: no, no reason to remove keys. Remove transactions.
< gmaxwell> sipa: right now large parties using bitcoin core have to periodically rotate out wallets to keep things managable. Things are much better now because of varrious fat trimming. (Including the addtowallet fix we just merged from luke)
< sipa> so more like mark transactions as archived
< sipa> ?
< sipa> so they are no longer considered for balance computations etc
< gmaxwell> Yea, in particular, get them out of the linear scans used to getbalance/listunspent/etc.
< gmaxwell> But not do so in a way that causes coins to fall out of balance and listunspent, because that will cause funds loss when you think a wallet is empty and it's not.
< gmaxwell> so that could be refusing to archive when there are unspent outputs, but thats kind of obnoxious, since it would make visible wallet internal behavior that the caller shouldn't really care about.
< gmaxwell> (Though, otoh, it might encourage sweeping the utxo set. :) )
< gmaxwell> Also, 'the must be spent completely' rule wouldn't be reorg robust.
< gmaxwell> And, of course, an archived transaction shouldn't be added back by rescanning.
< gmaxwell> Some parties (e.g. bitstamp about a year ago) also complained about the size of the wallet files when they had long histories because it complicated backups; but I think the key exports patch that somewhat.
< sipa> seems easy enough to build a second map inside that does not contain transactions whose outputs have been spent for ages
< sipa> andnuse that for balance calculations etc
< gmaxwell> I think accounts mess this up somewhat; or at least make it not a transparent implementation detail.
< sipa> uh, right
< gmaxwell> thats why I was talking about remove/archive. :-/
< GitHub9> [bitcoin] gmaxwell pushed 5 new commits to master: https://github.com/bitcoin/bitcoin/compare/616d61b20d56...31de2414c65d
< GitHub9> bitcoin/master 748321e Peter Todd: Add mediantime field to getblockchaininfo RPC call...
< GitHub9> bitcoin/master c277a63 Peter Todd: Clarify nLockTime-by-time comment in CheckFinalTx()
< GitHub9> bitcoin/master 7259769 Peter Todd: Document new mediantime field in getblockchaininfo
< GitHub66> [bitcoin] gmaxwell closed pull request #7011: Add mediantime to getblockchaininfo (master...2015-11-add-mediantime-to-getblockchaininfo) https://github.com/bitcoin/bitcoin/pull/7011
< gmaxwell> phantomcircuit: were you going to fix the trickle logic? it really is broken.
< sipa> yes, please!
< gmaxwell> I'm testing the blocks only mode with relaynetwork client as a whitelisted peer (and I cut out the forced broadcasting for whitelisted peers)... and I'm watching it instantly inv any tx that comes in to all it's neighbors.
< gmaxwell> of course, there is some node connected to me which is sending me every transaction without an INV.