1 2015-03-02 00:57:13 <phantomcircuit> sipa, wouldn't that require selecting an arbitrary amount of work as "enough"
  2 2015-03-02 00:57:19 <phantomcircuit> something that is likely to change overtime?
  3 2015-03-02 01:17:12 <phantomcircuit> oh and
  4 2015-03-02 01:17:34 <phantomcircuit> i thought i'd mention that the merkle tree root calculator could be implemented in O(log n) space if anybody cared to do so
  5 2015-03-02 01:17:51 <phantomcircuit> although that probably makes using sse harder
  6 2015-03-02 04:06:41 <intx> d
  7 2015-03-02 05:43:35 <phantomcircuit> sipa, oh right i see what you're saying
  8 2015-03-02 05:43:53 <phantomcircuit> make sure the block you're processing is actually on the same chain as the best header
  9 2015-03-02 05:49:44 <sipa> indeed
 10 2015-03-02 05:50:03 <sipa> the code i suggested in the pr is wrong
 11 2015-03-02 05:50:11 <sipa> but it's easy to do
 12 2015-03-02 05:50:26 <sipa> as activatebestchain knows what tip we're working towards
 13 2015-03-02 08:16:16 <sipa> block v3 adopting going up
 14 2015-03-02 08:28:43 <fanquake> sipa %?
 15 2015-03-02 08:30:15 <sipa> 2%
 16 2015-03-02 08:30:47 <sipa> http://bitcoin.sipa.be/ver-10k.png
 17 2015-03-02 08:40:00 <phantomcircuit> heh
 18 2015-03-02 08:58:04 <FUBAR> Been trying to rebuild a wallet with bitcoin-core 0.10 and it's now taken over 3 days and still not done.  I've also experienced several crashes and notice a few errors during the process.  I saved the debug logs from the crashes.  Is this the place to ask about crashes and repot bugs?
 19 2015-03-02 09:10:39 <sipa> FUBAR: that sounds bad; yes
 20 2015-03-02 09:11:02 <sipa> FUBAR: what is the problem, what are you doing, and what do you see?
 21 2015-03-02 09:14:14 <FUBAR> well I upgraded from some 0.8.x revision last week.  a few days later that computer died.  hard drive and psu went possibly more.  had a good backup from right before the upgrade, copied it to a machine that has identical hardware except for the vid card, and then installed 0.10.0.  That was [02/26-23:15 est
 22 2015-03-02 09:15:13 <FUBAR> process ran for awhile then I got a crash.  restarted and it ran for several more hours, another crash, on the third or 4th time I got it I started saving the logs.  2 different crashes it seems.
 23 2015-03-02 09:16:42 <FUBAR> ************************ EXCEPTION: St9bad_alloc        std::bad_alloc        C:\Program Files\Bitcoin\bitcoin-qt.exe in ProcessMessages()         2015-03-01 01:32:17 ProcessMessage(block, 497246 bytes) FAILED peer=44
 24 2015-03-02 09:18:12 <FUBAR> ************************ EXCEPTION: St9bad_alloc        std::bad_alloc        C:\Program Files\Bitcoin\bitcoin-qt.exe in ProcessMessages()         2015-03-01 10:13:35 ProcessMessage(block, 638746 bytes) FAILED peer=357 2015-03-01 10:13:35 Pre-allocating up to position 0x3000000 in blk00189.dat
 25 2015-03-02 09:18:23 <sipa> sounds like it is running out of memory
 26 2015-03-02 09:18:52 <FUBAR> should have pleanty.  2gig in the machine.  it is older core2duo 2.0
 27 2015-03-02 09:19:12 <sipa> what os?
 28 2015-03-02 09:19:17 <FUBAR> xp 32
 29 2015-03-02 09:19:58 <sipa> try running with -par=1 -rpcthreads=1 -dbcache=20
 30 2015-03-02 09:20:06 <sipa> that should reduce memory usage
 31 2015-03-02 09:21:44 <FUBAR> well I'm within 2 weeks now (well actually 3).  The way the weeks are reported seems off.  for instance 3 weeks to go was from feb 2 through feb 9th 2 week started on the 9th
 32 2015-03-02 09:22:07 <sipa> it may be rounding
 33 2015-03-02 09:22:27 <FUBAR> could it have anything to do with number of peers?  I've noticed it has trouble getting over 9 connects for some reason.  other machine had over 80
 34 2015-03-02 09:22:46 <FUBAR> if it's rounding it's always rounding up
 35 2015-03-02 09:23:03 <FUBAR> or wait down
 36 2015-03-02 09:23:13 <sipa> it takes a long time before the network learns about your ip address and how reliable you are
 37 2015-03-02 09:23:27 <sipa> if you haven't synced up, you don't announce your own ip either
 38 2015-03-02 09:23:55 <sipa> 8 connections is enough (those are the outgoing one), the rest is more helping the network than yourself
 39 2015-03-02 09:24:04 <FUBAR> thought this version was supposed to sync a lot faster.
 40 2015-03-02 09:24:04 <sipa> and more xonnections requires more memory
 41 2015-03-02 09:24:09 <sipa> it does
 42 2015-03-02 09:24:24 <sipa> but if it crashes due to too little memory, it won't do much
 43 2015-03-02 09:24:35 <FUBAR> yea I think one of the crash reports had 8 outgoing 3 incoming
 44 2015-03-02 09:24:51 <FUBAR> or maybe that was in the debug page
 45 2015-03-02 09:24:55 <sipa> try -nolisten if you only want outgoing connections
 46 2015-03-02 09:26:43 <FUBAR> one other weird bug.  once when I restarted the splash screen came up, started doing the normal rebuild etc.  I left and came back and it still had the spash screen up at 100% and the actual bitcoin core main page.
 47 2015-03-02 09:27:31 <FUBAR> it was actually running fine.  I tried closing the spash screen with the x and it shut both down
 48 2015-03-02 09:28:05 <sipa> that does sound like a bug
 49 2015-03-02 09:28:33 <sipa> if it returns, can you file an issue? https://github.com/bitfoin/bitcoin/issues
 50 2015-03-02 09:29:04 <sipa> bitcoin, not bitfoin
 51 2015-03-02 09:29:58 <FUBAR> yea I can do that and I'll screenshot it.  didn't think about it at the time.  My first though was maybe I tried to launch it twice but when it closed both I knew something wasn't right.  That and I'm pretty sure it will tell you the files are already in use if you try to launch it a second time.
 52 2015-03-02 09:31:25 <FUBAR> really don't care about the connections or memory use.  only thing this machine is for is running an old u2 (yea make me half a cent a day) firefox, and the wallet.
 53 2015-03-02 09:35:29 <FUBAR> it was in the debug window.  right now it had 0 in and 7 out.  doesn't it need in to sync?
 54 2015-03-02 09:53:06 <sipa> FUBAR: no, it only uses out connections for syncing even
 55 2015-03-02 14:54:24 <zx2c4> ajweiss, fancy seeing you here
 56 2015-03-02 16:50:43 <treehug88> (Cross posted from #bitcoin, sorry) : Hey all, is there a decent init script for bitcoind on centos somewhere? I want bitcoind to auto-start when I reboot my centos machine?
 57 2015-03-02 17:20:32 <ajweiss> treehug88: see the contrib directory in the source tree
 58 2015-03-02 17:21:01 <treehug88> ajweiss: I did, nothing redhat relevant there (or am I missing something)
 59 2015-03-02 17:22:43 <ajweiss> they're pretty generic.  which init are you using?
 60 2015-03-02 17:57:56 <gavinandresen> Ok, I have to rant:  WHAT THE HECK IS GOING ON WITH CHAINPARAMS????
 61 2015-03-02 17:58:25 <gavinandresen> There seems to be no rhyme or reason to it, no useful comments....
 62 2015-03-02 17:58:55 <gavinandresen> Here’s what I want to do: I want to create a unit test that exercises the memory pool and CreateNewBlock.
 63 2015-03-02 17:59:14 <gavinandresen> So cfields or maaku or whoever has been mucking with chainparams:  how do I do that?
 64 2015-03-02 18:00:16 <gavinandresen> Related: https://github.com/bitcoin/bitcoin/pull/5835   … where Sergio seems to come to the end of his rope trying to figure this mess out, too.
 65 2015-03-02 18:00:29 <sipa> how/why would that involve chainparams?
 66 2015-03-02 18:00:30 <sdaftuar> gavinandresen: i am not sure what chainparams has to do with it, but i had an idea recently that unit testing with blocks may be possible using InvalidateBlock to get rid of the state left by the mining tests
 67 2015-03-02 18:00:33 <gavinandresen> whoops, wait, wrong pull....
 68 2015-03-02 18:00:36 <sdaftuar> i haven't tried it yet though myself
 69 2015-03-02 18:00:50 <gavinandresen> sipa: I need a blockchain with coinbase transactions I can spend
 70 2015-03-02 18:00:56 <sipa> ok?
 71 2015-03-02 18:01:18 <gavinandresen> sipa: existing unit test has a public key, but no private key in sight (in miner_tests.cpp)
 72 2015-03-02 18:01:35 <gavinandresen> sipa: … I really would rather not spend the time generating a difficulty-1 chain
 73 2015-03-02 18:01:40 <cfields> gavinandresen: afaik none of the chainparams reorg/mucking work has been merged yet. If you're thinking of the changes jtimon and i are making?
 74 2015-03-02 18:01:40 <gavinandresen> I want a regtest-difficulty chain.
 75 2015-03-02 18:02:12 <gavinandresen> cfields: I saw that pull request, which is making me crazier.....
 76 2015-03-02 18:02:15 <sipa> gavinandresen: then use regtest?
 77 2015-03-02 18:02:24 <gavinandresen> sipa: okey dokey.  How?
 78 2015-03-02 18:02:50 <sipa> SetChainParams(regtest) or something
 79 2015-03-02 18:02:57 <sipa> not at a computer now, sorry
 80 2015-03-02 18:03:08 <sipa> but unit tests can switch the chain, afaik
 81 2015-03-02 18:03:21 <gavinandresen> sipa: aha— that’s the piece of information I’m missing.
 82 2015-03-02 18:03:40 <sipa> no need to mess with chainparams if you don't need to actually build a new chain with different properties than one of the existing ones
 83 2015-03-02 18:03:43 <gavinandresen> sipa: … umm… but that’ll screw up chainActive / pindexBestHeader / etc….. yes?
 84 2015-03-02 18:04:07 <sipa> probably, yes, i wonder how existing unit tests deal with that though
 85 2015-03-02 18:04:20 <sipa> as there are afaik already tests that change the chainparams used
 86 2015-03-02 18:04:23 <gavinandresen> We have no existing unit tests for that type of thing.  Which is really, really bad.
 87 2015-03-02 18:04:28 <sipa> Agree.
 88 2015-03-02 18:04:44 <sipa> perhaps we need a ResetBlockchain() call
 89 2015-03-02 18:04:47 <sipa> actually
 90 2015-03-02 18:04:54 <sipa> I think there is something like that
 91 2015-03-02 18:09:39 <gavinandresen> sipa: I think my problem is I REALLY want the UNITTEST chainparams to default to regtest-difficulty.  Because I don’t want to have to generate a 100-block-long chain for every blockchain-related test. But maybe that’s my work on the regression test framework biasing me
 92 2015-03-02 18:10:12 <sipa> gavinandresen: the unittest chainparams can work without pow checking even, afaik
 93 2015-03-02 18:10:30 <sipa> but we really need a clean way to reinitialize data structures between unit tests
 94 2015-03-02 18:10:36 <gavinandresen> Context is Sergio and Timo’s work: https://github.com/bitcoin/bitcoin/pull/4845   …. which mostly didn’t get merged, unfortunately
 95 2015-03-02 18:11:03 <sipa> yes, because (afaik) they relied on unspecified ordering between unit tests
 96 2015-03-02 18:11:07 <gavinandresen> sipa: yes, reinitializing would be perfect. But reconsiderblock is a second-best solution that should work nicely.
 97 2015-03-02 18:11:19 <sipa> rather than being able to clean up between tests
 98 2015-03-02 18:11:27 <gavinandresen> err, not reconsider, the other one....
 99 2015-03-02 18:11:33 <sipa> invalidate
100 2015-03-02 18:11:37 <gavinandresen> that’s the one
101 2015-03-02 18:11:55 <sipa> invalidateblock does not remove blocks from tje internal data structures
102 2015-03-02 18:12:05 <sipa> just marks them invalid
103 2015-03-02 18:12:27 <sipa> i expect all hell will break lose if you try to use that to switch to dofferent validation parameters
104 2015-03-02 18:13:00 <gavinandresen> sipa: depending on what you’re testing, build-some-blocks-on-top-of-chain, then reset-to-initial-chain could be Good Enough.
105 2015-03-02 18:13:27 <sipa> right
106 2015-03-02 18:13:30 <gavinandresen> Testing with   test_bitcoin —random=1     …. would tell if it is good enough
107 2015-03-02 18:13:53 <sipa> but if the chain you are on is normal chainparams, building blovks could be hard
108 2015-03-02 18:14:10 <gavinandresen> right, that’s why I want it to be regtest difficulty.
109 2015-03-02 18:14:13 <gavinandresen> (by default)
110 2015-03-02 18:14:32 <gavinandresen> main-net difficulty is Always Wrong, in my opinion, for unit tests.
111 2015-03-02 18:14:48 <sipa> i think we want to have unit tests that cover mainnet code!
112 2015-03-02 18:14:58 <sipa> maybe not everything
113 2015-03-02 18:15:18 <gavinandresen> sipa: okey dokey, but we have no unit tests that cover mainnet block validation stuff.
114 2015-03-02 18:15:35 <sipa> we have some miner tests, afaik?
115 2015-03-02 18:15:43 <sipa> that build mainnet blocks and validate them
116 2015-03-02 18:16:16 <sipa> not disagreeing that that part of the unit tests is badly inadequate, though
117 2015-03-02 18:16:21 <gavinandresen> sipa: miner_tests.cpp is… uhh… not a good exercise, in my opinion.
118 2015-03-02 18:16:41 <sipa> but my point is that we can't just have unit tests for regtest, or worse
119 2015-03-02 18:17:11 <sipa> so ideally every unit tests just sets its own params, and we wipe the state between them
120 2015-03-02 18:17:34 <gavinandresen> I’m saying UNITTEST chainparams should use regtest min difficulty target....
121 2015-03-02 18:17:59 <sipa> okey dokey
122 2015-03-02 18:18:06 <sipa> they're mutable
123 2015-03-02 18:18:18 <sipa> set them to anything you likr
124 2015-03-02 18:18:47 <sipa> the name unittest is a bit badly chosen for those params
125 2015-03-02 18:19:29 <sipa> if you want, i can look into the unit tests reset state?
126 2015-03-02 18:19:34 <sipa> *making
127 2015-03-02 18:19:45 <gavinandresen> sipa: that’d be awesome, thanks.
128 2015-03-02 18:20:00 <sipa> afk, food now
129 2015-03-02 18:21:51 <gavinandresen> I’m just pissed off that so much effort is going into code churn apparently for the sake of code churn when really critical pieces like basic testing infrastructure falls through the cracks.
130 2015-03-02 18:26:42 <sipa> gavinandresen: come on
131 2015-03-02 18:27:03 <sipa> gavinandresen: it's good that you point out things that don't receive enough attention
132 2015-03-02 18:27:17 <sipa> but that doesn't mean that everything else is just code churn
133 2015-03-02 18:28:05 <cfields> gavinandresen: the code churn is happening so that more chunks can be tested individually without bringing in the kitchen sink. Calling it churn for the sake of itself is hardly fair.
134 2015-03-02 18:56:57 <gavinandresen> cfields: I see lots of ChainParams methods that are defined but never used in our codebase. That smells like churn to me; code added “just because.”  If there were unit tests that actually used those features, then I wouldn’t complain.