< sipa> compiling bitcoind with -flto -O2 -g0 results in a 1.42x smaller binary than just -O2 -g0
< sipa> (dynamically linked)
< sipa> i haven't benchmarked to see if there is any performance difference
<@wumpus> lto also improves memory usage during compilation. But memory usage during linking was pretty bad.
< sipa> it is hard to compile though... it seems ./configure does not allow setting gcc-ar as ar binary
<@wumpus> we've been considering using it for gitian at some point, no idea why we don't yet
<@wumpus> $1/configure --with-incompatible-bdb CC="${CLANGPATH}/bin/clang " CXX="${CLANGPATH}/bin/clang++" \
<@wumpus> OBJCXX="${CLANGPATH}/bin/clang++" \
<@wumpus> AR="${CLANGPATH}/bin/llvm-ar" RANLIB="${CLANGPATH}/bin/llvm-ranlib" \
<@wumpus> CFLAGS="-flto -O2 -ggdb" CXXFLAGS="-flto -O2 -ggdb" LDFLAGS="-flto -O2 -ggdb -fuse-ld=gold"
<@wumpus> that's my configure line for clang lto
<@wumpus> gcc should be similar?
<@wumpus> the leveldb sub-build used to break overriding AR, but now that it is integrated it just works
< sipa> ah, the env variables go after ./confiugre?
<@wumpus> the 'official' convention is to put them after, yes, I don't know if it makes a difference in practice
<@wumpus> (but it would depend on the shell then)
< sipa> /usr/bin/ranlib: leveldb_libleveldb_a-filter_block.o: plugin needed to handle lto object
< sipa> ah wait
<@wumpus> and you do overlload ranlib?
< sipa> i set RANLIB=gcc-ranlib, not the full path
<@wumpus> well if you have only one and it is in your path, that should be ok
<@wumpus> I provide full paths because I have multiple toolchains installed, which aren't in the path
<@wumpus> so if it doesn't use your ranlib if you do RANLIB=xxx that's a build system bug
< sipa> lto memory usage has been significantly improved after 4.8 though
<@wumpus> yes, for 0.14 we should upgrade the build image to ubuntu 16.04, which has gcc 5.3.x
< sipa> from gcc 4.9 release notes:
< sipa> Memory usage building Firefox with debug enabled was reduced from 15GB to 3.5GB; link time from 1700 seconds to 350 seconds.
<@wumpus> we need to upgrade the toolchain for windows too: https://github.com/bitcoin/bitcoin/pull/8249
< sipa> building with -O2 -g0 -flto here with make -j1 has max res memusage 850MiB here
< sipa> and that's during compiling of main.o, not linking
< sipa> linking has max 375MiB
< sipa> gcc 5.3.1
<@wumpus> ok, nice, so we can start recomming using lto to people that want to reduce compile memory usage and have sufficiantly new compiler
< sipa> with debug enabled it's likely more
< sipa> though debugging lto binaries is harder in any case
< sipa> trying the same without lto
< sipa> i can't imagine it to use more memory
<@wumpus> it's exactly what I expected, that compiling is faster and uses less memory with lto
< sipa> lto is purely additive at the compilation stage
< sipa> it builds normal single-object-optimized assembly output, and internal representation as well
<@wumpus> it emits intermediate code instead of processor code
<@wumpus> so can skip a step
< sipa> ah, since 4.9:
< sipa> When using a linker plugin, compiling with the -flto option now generates slim object files (.o) which only contain intermediate language representation for LTO. Use -ffat-lto-objects to create files which contain additionally the object code. To generate static libraries suitable for LTO processing, use gcc-ar and gcc-ranlib; to list symbols from a slim object file use gcc-nm. (This requires that ar, ranlib and nm have been compiled with...
<@wumpus> that's how it is for clang at least, maybe gcc is different in that regard
< sipa> plugin support.)
<@wumpus> clang -flto .o files are actually llvm bitcode
<@wumpus> ok, so gcc started doing the same
< sipa> max 995 MiB res when compiling without lto
<@wumpus> which joker is signalling TESTDUMMY on testnet? "errors": "Warning: unknown new rules activated (versionbit 28)"
< sipa> trying with gcc 4.8 now
< sipa> no clue
< sipa> hmm, has anyone tried using the various sanitizers that gcc now has?
< sipa> -fsanitize=address -fsanitize=thread -fsanitize=leak -fsanitize=undefined
<@wumpus> I haven't
<@wumpus> would be interesting to try
< sipa> -fsanitize=address -fsanitize=thread -fsanitize=leak -fsanitize=undefini hadn't even heard about -fanitize=undefined
< sipa> i hadn't even heard about -fsanitize=undefined
< sipa> compiling with g++-4.8 fails here:
< sipa> libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&)':
< sipa> util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs[_ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs]+0x8e): undefined reference to `boost::program_options::to_internal(std::string const&)'
< sipa> i guess there is something deficient about my g++-4.8 setup
<@wumpus> my guess: ABI conflict between c++ libraries compiled with 5.3 and 4.8
<@wumpus> I'm sure compiling with 4.8 works, as it compiles fine on trusty
< sipa> yes, indeed
<@wumpus> a depends build with g++4.8 will probably also work on your system
<@wumpus> (as it has no external c++ dependencies)
<@wumpus> (and as long as you skip the GUI, building the depends is very fast)
<@wumpus> doing a depends build with flto would be interesting as well, the final link could optimize use of all the dependencies too, although with qt that will probably be a memory explosion
< sipa> wumpus: jinx
< sdaftuar> wumpus: i assume the bit 28 activation on TESTNET is a bip109 thing (nothing to do with TESTDUMMY, which inadvertently reused the same bit)
<@wumpus> okay
< btcdrak> sdaftuar: correct.
< gmaxwell> oh I thought that was TESTDUMMY.
< gmaxwell> if it were 109 I would have expected it to not trigger BIP9 due to the longer activation window and higher trehshold.
< gmaxwell> threshold*
< sdaftuar> it wasn't totally clear to me from the bip, but i assume the semantics specified there called for hte bit to continue to be set after activation:
< sdaftuar> Miners that support this BIP should set bit 0x10000000 in the block version until 1-Jan-2018. After that date, that bit can be safely re-used for future consensus rule upgrades.
< gmaxwell> Just so.
< btcdrak> we should prolly have a switch to mute warnings we specifically want to ignore
< btcdrak> oh ha! I've been too busy watching brexit :p
<@wumpus> --ignore-testdummy
<@wumpus> no, #8266 sounds better :)
< sipa> ?
< btcdrak> sipa: see the ticket
< sipa> han
< sipa> ha!
< GitHub117> [bitcoin] laanwj opened pull request #8273: Bump `-dbcache` default to 300MiB (master...2016_06_dbcache) https://github.com/bitcoin/bitcoin/pull/8273
< GitHub139> [bitcoin] laanwj pushed 2 new commits to master: https://github.com/bitcoin/bitcoin/compare/1922e5a65458...5a06ebbf2d5f
< GitHub139> bitcoin/master 409f833 jl2012: RPC: Hide softfork if timeout is 0
< GitHub139> bitcoin/master 5a06ebb Wladimir J. van der Laan: Merge #8258: RPC: Hide softfork if timeout is 0...
< GitHub19> [bitcoin] laanwj closed pull request #8258: RPC: Hide softfork if timeout is 0 (master...bip9rpcdisable) https://github.com/bitcoin/bitcoin/pull/8258
< sipa> wumpus: how hard is it to add a python dependency? (specifically: siphash)
<@wumpus> you mean for testing? we'd prefer to not add one, a lot of people stumble on the zmq one
<@wumpus> AFAIK siphash is a single python file, why not just import it
< GitHub97> [bitcoin] laanwj closed pull request #8232: Add IRC link to README.md (master...patch-1) https://github.com/bitcoin/bitcoin/pull/8232
< sipa> wumpus: ok, i'll just copy some code in
< dgenr8> would it not be a good idea to reserve bit 28 for sizeforks?
< paveljanik> e.g. reserve it for the softfork to 0.5M?
< paveljanik> or maybe 0.75M so we finally close these PRs to bump the default block size?
< sipa> for a hardfork you don't nedd bip9
< sipa> you can use bip 31 if you really want a means to indicate tgat the rules changed
< sipa> it's also not very relevant here: currently bit 28 is unusable for anything
< dgenr8> sipa: to be clear, are you saying you believe block version is unsuitable for signaling sizefork support?
< sipa> dgenr8: i believe bip9 is unsuitable for hardforks
< sipa> because it measures miner support, which is not relevant
< sipa> a hardfork is the ecosystem deciding to switch to new rules; if miners don't follow, that's their own problem
< dgenr8> so "yes" then? (since not only bip9 but anything in the block header is showing miner support)
< sipa> if for you a sizefork implies a hardfork, yes
< dgenr8> I think I detect another rabbit-hole softfork on the horizon
< btcdrak> dgenr8: what does that mean?
< dgenr8> I would imagine something like the old adam3us expansion blocks proposal
< dgenr8> sipa: the ecosystem would follow miners to a larger max block size, just as they are dragged along with all the softforks
< dgenr8> With either a soft or hard fork, the effect of not following is the same: total inability to validate part of the block
< dgenr8> the best thing for bitcoin is for you guys to adopt bip109
<@wumpus> bit 28 is the tabboo bit
<@wumpus> this is not the place for hard/soft fork disussion, and certainly not block size discussions
<@wumpus> with the current escalating reindex times, and utxo set size, there's no manouvring room either inside or in expansion blocks to increase transaction space
< GitHub29> [bitcoin] laanwj opened pull request #8274: util: Update tinyformat (master...2016_06_update_tinyformat) https://github.com/bitcoin/bitcoin/pull/8274
< GitHub53> [bitcoin] btcdrak opened pull request #8275: Remove bad chain alert partition check (master...partitionalerts) https://github.com/bitcoin/bitcoin/pull/8275
< gmaxwell> wumpus: So I made this change:
< gmaxwell> + nCacheSize = std::min(nCacheSize,(size_t)1024*1024);
< gmaxwell> in dbwrapper.cpp GetOptions
< gmaxwell> and a reindex with no txindex, and no signature checking went from 31021.760436 seconds before to 31360.383818000002 seconds after.
< gmaxwell> (dbcache settings default)
< gmaxwell> so I think this suggests the leveldb cache is doing almost nothing.
< gmaxwell> it's a 1% difference to go from the defaults to 1MB.
< gmaxwell> going to try 2mb now and see if I can turn that into almost nothing.
< sipa> gmaxwell: with what dbcache size was your benchmark?
< sipa> my guess is that the leveldb cache becomes relatively less important as the chainstate cache grows
< gmaxwell> sipa: the default.
< gmaxwell> my plan was to determine if leveldb cache could be radically reduced without harming performance. Then give over all that memory to the coincache.
< morcos> wumpus: RE: #8273: FWIW, I was the one I think who advocated for 300MB for the mempool and I now think that is more than is really necessary.
< morcos> I haven't seen if the ratio to wire size vs memory size has changed substantially with all the recent mempool changes, but previously 300MB of mempool was roughly 100MB of wire bytes. I think thats a larger backlog than is necessary to handle normal operation.
< morcos> Although lowering that is something that may warrant a bit of testing. There can be these weird feedback loops with eviction and tx time outs, and I wouldn't be sure that say 100MB mempool wouldn't somehow lead to worse network behavior.
< gmaxwell> morcos: it changed substantially.
< gmaxwell> it's about 150mb now.
< morcos> oh, its that much more efficient? that's nice. anyway, i'm just mentioning this, b/c i thought i saw discussion about potentially lowering maxmempool in conjunction with raising dbcache in order to not overly affect the total mem footprint. i'd agree with doing that.
< gmaxwell> "bytes": 149293989,
< gmaxwell> "usage": 274484752,
< gmaxwell> for CPFP to work though it does need to be a fair bit bigger than it would otherwise.
< morcos> gmaxwell: well i should look again, but last time i looked, i never saw it go over 100M of usage for things that weren't spam (defined as those 14kB tx that paid 15000 satoshis in fee)
< morcos> of course there was occasionally legitmate free or min fee rate txs mixed in with the spam. but no size mempool will be big enough to reliably include those if they aren't paying higher price thant he spam
< gmaxwell> A useful question is, what is the probablity that a txn confirms during a measurement window, as a function of the worst 'depth' it expirenced in the mempool.
< morcos> I guess what I'm saying put another way is that any tx paying <= 1 sat per byte had an extremely variable chance of ever being confirmed at all
< morcos> Tx's paying > 1 sat per byte may be interesting to study more, but they seem to have always fit in a 100MB (usage) mempool.
< morcos> At least thats my casual observation