1 2016-10-24 01:24:23	0|GitHub14|[13bitcoin] 15gmaxwell opened pull request #9002: Make connect=0 disable automatic outbound connections. (06master...06connect0) 02https://github.com/bitcoin/bitcoin/pull/9002
  2 2016-10-24 02:29:04	0|midnightmagic|:-/
  3 2016-10-24 04:11:56	0|luke-jr|does it not do that again? :x
  4 2016-10-24 04:15:09	0|sipa|do what?
  5 2016-10-24 04:18:31	0|luke-jr|sipa: disable outbound connections.
  6 2016-10-24 04:18:52	0|luke-jr|it used to do so at least, and seemed to work when I recently did it for testing
  7 2016-10-24 04:32:42	0|gmaxwell|My belief is that it used to work, but what it does right now is just loop continually trying to connect to '0' and on my system this manages to connect to myself.
  8 2016-10-24 04:32:58	0|gmaxwell|this, indeed, does prevent it from connecting to other parties...
  9 2016-10-24 04:33:01	0|luke-jr|O.o
 10 2016-10-24 04:33:23	0|gmaxwell|but in a fairly log spammy way (esp with debugging turned up)
 11 2016-10-24 04:34:07	0|sipa|any theory why '0' results in a connect to self? :s
 12 2016-10-24 04:34:25	0|sipa|that shouldn't even resolve to a valid ip
 13 2016-10-24 04:34:52	0|luke-jr|sipa: most integers are a valid IP
 14 2016-10-24 04:35:02	0|aj|sipa: telnet 0 22 -> -> ssh to localhost
 15 2016-10-24 04:35:02	0|gmaxwell|I didn't bother checking my belief that it used to behave better.
 16 2016-10-24 04:35:07	0|gmaxwell|$ telnet 0 8333
 17 2016-10-24 04:35:07	0|gmaxwell|Trying
 18 2016-10-24 04:35:10	0|gmaxwell|Connected to 0.
 19 2016-10-24 04:35:13	0|gmaxwell|Escape character is '^]'.
 20 2016-10-24 04:35:16	0|gmaxwell|^]
 21 2016-10-24 04:35:19	0|gmaxwell|telnet> close
 22 2016-10-24 04:35:29	0|sipa|well i knew it'd resolve to
 23 2016-10-24 04:35:48	0|sipa|i'm surprised is a valid thing to connect to
 24 2016-10-24 04:35:57	0|gmaxwell|This surprised me too. I figured it was some quirk of my system... but in any case, better to just not have the useless thread.
 25 2016-10-24 04:36:08	0|luke-jr|ping 2130706433
 26 2016-10-24 04:36:41	0|luke-jr|(this is 0x7f000001)
 27 2016-10-24 04:36:42	0|aj| means "all ipv4 addresses on the local machine", so seems kinda plausible
 28 2016-10-24 04:36:59	0|sipa|luke-jr: some browsers even allow much larger integers (up to 2^1000-ish), resolving them modulo 2^32
 29 2016-10-24 04:37:08	0|luke-jr|>_<
 30 2016-10-24 04:38:01	0|sipa|as to why anyone ever tbought to support that: i believe a naive decimal-to-uint32 converter will actually behave that way
 31 2016-10-24 04:38:27	0|gmaxwell|we it would stop at 2^1000 isn't clear. :P
 32 2016-10-24 04:39:07	0|luke-jr|I should access my KVMoIP by decimal. I don't have DNS on it anyway. :p
 33 2016-10-24 04:44:51	0|sipa|gmaxwell: ish
 34 2016-10-24 04:45:04	0|sipa|it's probably just an input buffer size limit
 35 2016-10-24 04:51:43	0|midnightmagic|0 is the inaddr_any wildcard/alias address, and in some systems (the ones I'm familiar with) it means "the first interface that was ifconfig'd at boot" -- in other words, it's *not* guaranteed to be
 36 2016-10-24 04:52:15	0|luke-jr|I would have expected to be a blackhole :/
 37 2016-10-24 04:52:40	0|luke-jr|midnightmagic: what if you ifconfig the first interface with <.<
 38 2016-10-24 04:55:33	0|midnightmagic|luke-jr: i dunno, can you ifconfig an interface to
 39 2016-10-24 04:55:39	0|luke-jr|probably not
 40 2016-10-24 04:55:43	0|luke-jr|I think that means unconfigure
 41 2016-10-24 06:15:45	0|midnightmagic|or on some machines you get:
 42 2016-10-24 06:15:48	0|midnightmagic|0: No address associated with hostname
 43 2016-10-24 06:15:48	0|midnightmagic|:dom13:06:14:57 ~# telnet 0 22
 44 2016-10-24 06:25:09	0|wumpus|IP parsing is not guaranteed to parse '0' as '', in this csae it just thinks it's a hostname
 45 2016-10-24 06:27:12	0|wumpus|any other 0.x.y.z IP seems to give "invalid argument" on linux
 46 2016-10-24 06:30:03	0|wumpus|anyhow the problem here is that bitcoin core uses the OS's IP parsing, this has resulted in confusion before
 47 2016-10-24 06:30:57	0|gmaxwell|I don't ~think~ special casing "0" is too ugly, but I am open to that idea. :)
 48 2016-10-24 06:31:29	0|wumpus|but it's not just 0, some IP parsers will happily parse any int32 into a IPv4
 49 2016-10-24 06:32:16	0|wumpus|+have other OS/libc specific quirks
 50 2016-10-24 06:33:35	0|gmaxwell|right, this discussion is inspired by my patch that special cases "0" to disable connect. Which itself was inspired by me getting irritated with my logs being flooded with connects to self after setting connect=0 to disable automatic outbound connections.
 51 2016-10-24 06:34:03	0|wumpus|yes, the reason to special-case 0 would be for -noconnect
 52 2016-10-24 06:34:22	0|wumpus|which is fine with me
 53 2016-10-24 06:34:42	0|gmaxwell|Yes, right now, my PR doesn't handle -noconnect (I believe), good point on that.
 54 2016-10-24 06:34:59	0|wumpus|noconnect should automatically get converted to connect=0
 55 2016-10-24 06:35:22	0|wumpus|you shoudln't have to do anything special for that
 56 2016-10-24 06:35:37	0|wumpus|-noX bcomes X=1 in the low-level arg handling
 57 2016-10-24 06:35:43	0|wumpus|ehhh X=0
 58 2016-10-24 06:36:06	0|gmaxwell|Will test.
 59 2016-10-24 06:36:14	0|wumpus|in any case special-casing 0 makes sense because the argument handling special-cases 0 for 'no'
 60 2016-10-24 06:38:42	0|wumpus|we do that in plenty of places in init.cpp, and adding one more is not a problem at all. If someone really wants to connect to, let them specify
 61 2016-10-24 06:39:14	0|wumpus|-noconnect should ideally mean "no outgoing connections"
 62 2016-10-24 06:40:13	0|wumpus|ooh rowhammer on ARM, we're nowhere safe are we
 63 2016-10-24 06:40:44	0|gmaxwell|positive news, now that ECC memory will be needed to prevent users from controlling their own devices, we might get ecc memory in more devices.
 64 2016-10-24 06:41:23	0|gmaxwell|so I thought about "should it imply nodnsseed" and "what if you are goofy and combine connect=0 and addnode? should it still addnode?".
 65 2016-10-24 06:42:02	0|gmaxwell|the former seems like a harmless and reasonable thing to do, the latter... I dunno if it should touch the addnode behavior, I think probably not.
 66 2016-10-24 06:42:06	0|wumpus|I guess it should mean "no automatic connections"
 67 2016-10-24 06:42:20	0|gmaxwell|Yes. No automatic connections makes sense.
 68 2016-10-24 06:42:23	0|wumpus|if you really want to force a connection using addnode, I don't see why it should stop it
 69 2016-10-24 06:42:45	0|gmaxwell|Okay, I'll add the imply on dnsseed.
 70 2016-10-24 06:43:06	0|wumpus|yes stopping dnsseed is an optimiziation that makes sense
 71 2016-10-24 06:43:21	0|wumpus|why dnsseed if you're going to ignore the result
 72 2016-10-24 06:43:32	0|gmaxwell|hardly likely to cause a negative surprise... you won't know if you got seeded or not, with no automatic connections. :)
 73 2016-10-24 06:43:51	0|gmaxwell|well it's not a total no-op as it does update your peers.dat. If a tree falls in the forrest...
 74 2016-10-24 06:44:16	0|wumpus|well if you really insist on that you can still override it to true right? I suppose you're using 'soft' parameter interaction?
 75 2016-10-24 06:44:24	0|gmaxwell|Yep.
 76 2016-10-24 06:46:02	0|gmaxwell|oh actually any seting of connect already softsets dnsseed to off, even -noconnect.  (also listen too, which is potentially confusing, but historic, and conservative)
 77 2016-10-24 06:46:09	0|wumpus|re: android I'm happy that these kind of exploits allow full control of the device by their owner, on the other hand, OSes such as android *invite* people to install all kinds of bullshit apps because of their claimed secure sandbox, and all of those can take full control of the device too, that worries me
 78 2016-10-24 06:47:03	0|wumpus|ah yes that's true
 79 2016-10-24 06:50:46	0|wumpus|although the DRM-on-IoT thing is perverse, if someone hacks your phone (or toaster) through a rogue app, they will have root, but you can't get control yourself to chase them off again
 80 2016-10-24 06:51:59	0|wumpus|"how to hand the world to blackhats with one easy trick"
 81 2016-10-24 06:53:59	0|midnightmagic|wumpus: you're talking about rowhammer?
 82 2016-10-24 06:54:26	0|gmaxwell|part of the reson we have this problem is due to technical illiteracy-- to Joe Blow, he doesn't know how to control his device in a meaningful way no matter how much root you give him;  so to actually take control from him (even while still accidentally giving it to hackers) doesn't seem like that big of a loss.
 83 2016-10-24 06:54:50	0|wumpus|yes rowhammer, though it similarly applies to dirty cow, or still-undisclosed-exploit-of-the-day
 84 2016-10-24 06:59:20	0|wumpus|technical illiteracy is certainly part of the problem - another one would be lack of standards in regard to gaining control of a device by someone with technical literacy
 85 2016-10-24 06:59:52	0|midnightmagic|"It's okay I'm just going to root your phone.." "Uh, okay Jim. Would you like another beer too?"
 86 2016-10-24 07:01:21	0|wumpus|+ stupid laws that disallow circumventing "
 87 2016-10-24 07:01:25	0|wumpus|security measures"
 88 2016-10-24 07:01:42	0|wumpus|all to protect mickey mouse, of course
 89 2016-10-24 07:06:58	0|wumpus|"International Journal of Proof-of-Concept or Get The Fuck Out" hah I'd never seen that one written out
 90 2016-10-24 07:15:49	0|wumpus|-noconnect seems to work fine w/ 9002
 91 2016-10-24 07:18:56	0|GitHub101|13bitcoin/06master 141d8e12b 15Pavel Janík: Fix doxygen comment: the transaction is returned in txOut
 92 2016-10-24 07:18:56	0|GitHub101|[13bitcoin] 15laanwj pushed 2 new commits to 06master: 02https://github.com/bitcoin/bitcoin/compare/f08222e882b1...fd29348dbe82
 93 2016-10-24 07:18:57	0|GitHub101|13bitcoin/06master 14fd29348 15Wladimir J. van der Laan: Merge #8993: Trivial: Fix doxygen comment: the transaction is returned in txOut...
 94 2016-10-24 07:19:11	0|GitHub145|[13bitcoin] 15laanwj closed pull request #8993: Trivial: Fix doxygen comment: the transaction is returned in txOut (06master...0620161021_fix_GetTransaction_comment) 02https://github.com/bitcoin/bitcoin/pull/8993
 95 2016-10-24 07:50:36	0|GitHub87|[13bitcoin] 15unsystemizer opened pull request #9004: Clarify `listenonion` (06master...06patch-3) 02https://github.com/bitcoin/bitcoin/pull/9004
 96 2016-10-24 08:14:39	0|da2ce7|Hello, is there a overview of this blocksign feature that is being developed?
 97 2016-10-24 08:15:36	0|gmaxwell|da2ce7: I presume it would be a cut down port of whats in elements alpha.
 98 2016-10-24 08:16:12	0|da2ce7|I can only suppose it is only to be used for testnet.
 99 2016-10-24 08:16:14	0|gmaxwell|the motivation is just to have testnets that are less unreliable than a very small pow blockchain for use for testing that doesn't really care about the consensus mechenism.
100 2016-10-24 08:16:25	0|gmaxwell|yea, of course.
101 2016-10-24 08:16:35	0|gmaxwell|I'm curious where you heard about it where that wasn't clear?
102 2016-10-24 08:16:47	0|wumpus|yes, which is the only thing that makes the implementation difficult in practice
103 2016-10-24 08:18:16	0|da2ce7|I'm curious as it is similar to a feature that where a miner signs their block with a random key (with the pk fingerprint included in the coin base), where after-the-fact the miner could prove that he/she mined that block.
104 2016-10-24 08:18:16	0|wumpus|if you are looking for a proposal to enable it on mainnet, there's none, no chance
105 2016-10-24 08:18:51	0|gmaxwell|that doesn't make a lot of sense, someone signing something doesn't demonstrate authorship
106 2016-10-24 08:19:16	0|gmaxwell|instead, to achieve what you describe needs only a commitment to a public key in the block.
107 2016-10-24 08:19:51	0|gmaxwell|Though it's somewhat important to the system that miners operate anonymously, to reduce their exposure to coersion.
108 2016-10-24 08:20:03	0|da2ce7|well it dose prove that you own that public key, so it means that I cannot put _your_ public key in my block.
109 2016-10-24 08:21:49	0|luke-jr|not necessarily. you could sign the template and ask me to mine it for you :p
110 2016-10-24 08:21:51	0|gmaxwell|If the key is random and used once it doesn't really matter.
111 2016-10-24 08:23:26	0|da2ce7|however then you would need a mechanism to enforce using a different key eveyblock.  Otherwise, BadMiner could put a GoodMiner public key, and be a nuance.
112 2016-10-24 08:24:10	0|gmaxwell|da2ce7: huh? no... if you care about that you just ignore reuse.
113 2016-10-24 08:24:17	0|da2ce7|*nuisance
114 2016-10-24 08:24:22	0|gmaxwell|same as someone not providing a key at all.
115 2016-10-24 08:27:46	0|da2ce7|well anyway, maybe there is no demand (or it isn't a wise thing at all), for there to be a standard way for miners to prove they made a particular block.
116 2016-10-24 08:29:05	0|gmaxwell|Sort of the opposite. I think it's extremely risky for the system for miners to be attaching any kind of identity to blocks at all.
117 2016-10-24 08:29:06	0|da2ce7|it could/would make miner/share statistics more reliable if used, again, if that is a wise idea is very debatable.
118 2016-10-24 08:29:28	0|gmaxwell|There are ways to do that without any publication of info to the general public though.
119 2016-10-24 08:32:09	0|gmaxwell|(presumably we'll see a change to miners self identifying the first time after someone gets sued because someone was unhappy about which transactions they happened to confirm. :( )
120 2016-10-24 08:32:44	0|da2ce7|I can imagine that it could be useful in the case the network was under a 51% attack, if miners could attach pseudo-anonymous identities to blocks. However it would be much preferable to never be in such a dystopian state.
121 2016-10-24 08:34:35	0|da2ce7|anyway, off-topic.  Blocksign for testnet is good for testing :).
122 2016-10-24 08:38:27	0|gmaxwell|yes, centeralizing the system can make it more secure against many kinds of attacks... :)
123 2016-10-24 09:17:34	0|GitHub42|13bitcoin/06master 14dfe7906 15Matt Corallo: Add missing cs_main lock to ::GETBLOCKTXN processing...
124 2016-10-24 09:17:34	0|GitHub42|[13bitcoin] 15laanwj pushed 2 new commits to 06master: 02https://github.com/bitcoin/bitcoin/compare/fd29348dbe82...ced22d035ac0
125 2016-10-24 09:17:35	0|GitHub42|13bitcoin/06master 14ced22d0 15Wladimir J. van der Laan: Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processing...
126 2016-10-24 09:17:44	0|GitHub156|[13bitcoin] 15laanwj closed pull request #8995: Add missing cs_main lock to ::GETBLOCKTXN processing (06master...062016-10-fix-getblocktxn-locks) 02https://github.com/bitcoin/bitcoin/pull/8995
127 2016-10-24 10:47:24	0|arubi|wumpus, so specifically re. parsing partial transactions as pre-segwit (#8837), I actually hit this issue in my own toy parser and it shows in core too: http://paste.debian.net/plainh/8c80d8cd  so having some flag would be great
128 2016-10-24 10:47:47	0|wumpus|thanks, so I wasn't being overly paranoid about that
129 2016-10-24 10:48:46	0|arubi|yea those 0 inputs pre segwit are something to think about when fundrawtransaction
130 2016-10-24 10:49:56	0|wumpus|please comment on the issue too
131 2016-10-24 10:50:00	0|wumpus|ah yes :(
132 2016-10-24 10:50:25	0|arubi|well those fivepiece comments are mine :)
133 2016-10-24 10:50:42	0|arubi|I'll copy this comment too
134 2016-10-24 11:04:14	0|wumpus|does anyone care about DecodeBase58 performance? If so, please review/test https://github.com/bitcoin/bitcoin/pull/8736
135 2016-10-24 11:49:22	0|jonasschnelli|during IBD, there is "chainActive" like (CChain) object that contains the headers-only chain?
136 2016-10-24 11:49:34	0|jonasschnelli|*there is no "chainActive"
137 2016-10-24 11:50:11	0|jonasschnelli|It looks like that getchaintips is ripping out the headers-tip from setOrphans
138 2016-10-24 12:04:54	0|jonasschnelli|nm: I think pindexBestHeader is acceptable for my usecase
139 2016-10-24 12:05:15	0|wumpus|ok :)
140 2016-10-24 12:11:55	0|jonasschnelli|hmm.. why points pindexBestHeader->pprev to pindexBestHeader?!
141 2016-10-24 12:12:10	0|jonasschnelli|looks like it not traversable
142 2016-10-24 12:12:47	0|jonasschnelli|again... nm! local issue.
143 2016-10-24 16:25:15	0|BlueMatt|wait, what?
144 2016-10-24 16:25:52	0|BlueMatt|argh, we did break addnode :(
145 2016-10-24 16:26:09	0|sipa|how so?
146 2016-10-24 16:26:38	0|BlueMatt|i was just trying to use it for fibre and the hostname as both ipv4 and ipv6 but it will only try to connect to one resolved addr even though the other one will work
147 2016-10-24 16:27:06	0|sipa|hmm
148 2016-10-24 16:27:11	0|BlueMatt|i didnt realize we broke the pick-different-address-if-it-doesnt-connect logic :(
149 2016-10-24 16:28:03	0|sipa|i didn't think so either
150 2016-10-24 16:28:39	0|BlueMatt|there doesnt seem to be any handling for it
151 2016-10-24 16:29:06	0|sipa|ConnectSocketByName should pick a random resolved address for each attempt
152 2016-10-24 16:29:57	0|BlueMatt|ThreadOpenAddedConnections does a LooupNumeric before calling OpenNetworkConnection
153 2016-10-24 16:30:51	0|BlueMatt|lol, the client in question doesnt even have a v6 default route...bitcoind was trying (and failing) to connect to the v6 host, it seems :/
154 2016-10-24 16:30:53	0|sipa|and LookupNuumeric will fail if it's not a x.y.z.w or aaaa::bbbb:ccc or .onion style string
155 2016-10-24 16:30:58	0|BlueMatt|ahh
156 2016-10-24 16:31:03	0|BlueMatt|hmm, maybe they just didnt wait long enough
157 2016-10-24 16:31:45	0|BlueMatt|but it did try to connect to v6, get a network unreachable error, and give up :(
158 2016-10-24 16:32:19	0|sipa|it will only retry 2 minutes later, i think
159 2016-10-24 16:32:57	0|BlueMatt|yes, it did, and tried again to ipv6
160 2016-10-24 16:33:06	0|BlueMatt|though if its random i suppose he could have waited longer and maybe it would have worked
161 2016-10-24 16:33:22	0|BlueMatt|though its possible the hosts ipv6-preference logic is bad?
162 2016-10-24 16:33:42	0|Lightsword|it’s a fairly standard EC2 ubuntu 16.04 VPS
163 2016-10-24 16:34:12	0|sipa|maybe it only resolves to IPv6 addresses for some reason?
164 2016-10-24 16:34:16	0|BlueMatt|Lightsword: can you disconnect the ipv4 peer and just addnode the hostname and wait a few sets of 2 minutes?
165 2016-10-24 16:44:36	0|Lightsword|BlueMatt, yeah not seeing any connection
166 2016-10-24 16:44:55	0|Lightsword|2016-10-24 16:40:07.057232 trying connection us-west.fibre.bitcoinrelaynetwork.org lastseen=0.0hrs
167 2016-10-24 16:44:56	0|Lightsword|2016-10-24 16:40:07.237914 connect() to [2607:f0d0:2002:169::2]:8333 failed: Network is unreachable (101)
168 2016-10-24 16:45:21	0|BlueMatt|yea, so it seems broken :(
169 2016-10-24 16:46:18	0|BlueMatt|argh, someone wanna tag https://github.com/bitcoin/bitcoin/issues/9007 0.13.1?
170 2016-10-24 16:49:35	0|paveljanik|I can't do so, sorry.
171 2016-10-24 16:52:03	0|wumpus|already done
172 2016-10-24 16:53:19	0|wumpus|another assert that should be removed, like 1ab21cf344ed0547de5ae679b7e479cb4b1a923b I guess...
173 2016-10-24 16:53:37	0|wumpus|should check there's no other weird asserts added
174 2016-10-24 16:53:53	0|sipa|is 9007 in 0.13?
175 2016-10-24 16:54:59	0|wumpus|yes
176 2016-10-24 16:56:07	0|wumpus|https://github.com/bitcoin/bitcoin/blob/0.13/src/net.cpp#L1024
177 2016-10-24 16:56:47	0|sipa|ah, caused by feelers?
178 2016-10-24 16:57:28	0|wumpus|yes, maxconnections cannot be lower than maxoutbound+maxfeeler, I suppose if he'd just set maxconnections=9 it'd be ok
179 2016-10-24 16:58:13	0|gmaxwell|addnode can take you beyond the nMaxOutbound count.
180 2016-10-24 16:58:47	0|wumpus|that's not what that assert is checking though
181 2016-10-24 16:59:10	0|wumpus|it doesn't look at your actual connections, just the max possible
182 2016-10-24 16:59:26	0|gmaxwell|ah, indeed.
183 2016-10-24 16:59:48	0|gmaxwell|that should be a return, not an assert, in any case.
184 2016-10-24 17:04:14	0|gmaxwell|There was another inappropriate assert added in the same commit, but it was already removed by PR 8944.
185 2016-10-24 17:04:17	0|wumpus|well the previous assert based bug was that
186 2016-10-24 17:04:22	0|wumpus|right
187 2016-10-24 17:07:44	0|gmaxwell|sipa: I can't see how that couldn't be reproduced in rc2.
188 2016-10-24 17:10:22	0|gmaxwell|even returning there wouldn't be right.
189 2016-10-24 17:10:56	0|gmaxwell|lets say I set -connect= and maxconnections=4 ... I should still be able to accept 3 connections.
190 2016-10-24 17:11:56	0|sipa|if you set -connect, isn't listening disabled by default?
191 2016-10-24 17:12:35	0|gmaxwell|its softset off.
192 2016-10-24 17:12:50	0|gmaxwell|so if you -connect + listen=1 to be precise.
193 2016-10-24 17:13:15	0|sipa|ok
194 2016-10-24 17:14:13	0|gmaxwell|I was about to suggest that maxconnections<8 should hard force listen off, because then it would make it easier to troubleshoot why things aren't connecting; then realized that no actually in some configs inbounds should still be working even with low max connections.
195 2016-10-24 17:16:51	0|gmaxwell|wait.. what.. is eviction now broken?!
196 2016-10-24 17:18:27	0|gmaxwell|okay, its not, just kind of stupid.
197 2016-10-24 17:20:40	0|gmaxwell|without the insert, the -noconnect + listen=1 case with maxconnections<8 will continually try evicting a connection and fail.
198 2016-10-24 18:06:35	0|morcos|sipa: sorry for the annoying questions here..  it appears to me that the dynamic memory usage tracking in CCoinsViewCache assumes that the memory usage of a pruned coins is 0.  i'm guess this is usually the case, but its not guaranteed right?   (depends on capacity = 0)
199 2016-10-24 18:07:26	0|sipa|morcos: i believe we actually always call CCoins::Cleanup()
200 2016-10-24 18:07:45	0|sipa|which sets the capacity to 0
201 2016-10-24 18:07:48	0|morcos|i was trying to track down some signficant variations between actual usage and the tracked usage that appear in my code.. and am starting by trying to understand why the existing code is correct
202 2016-10-24 18:07:56	0|morcos|well it calls a new vector and swaps
203 2016-10-24 18:08:09	0|sipa|yes, that was the C++03 trick to set the capacity to 0
204 2016-10-24 18:08:10	0|morcos|but from my googling it seems implementation dependent whether a new vector has capacity 0?
205 2016-10-24 18:08:39	0|sipa|ok, i agree there is in theory a standard-compliant implementations which doesn't have that behaviour
206 2016-10-24 18:09:03	0|morcos|ok..  i noticed that a while ago.. and its probably not the cause of my problem, but just wanted to understand
207 2016-10-24 18:09:11	0|morcos|second , kind of unrelated question
208 2016-10-24 18:09:34	0|morcos|prevector.resize(0) doesn't seem like the fastest way to clean up a prevector<unsigned char> does it?
209 2016-10-24 18:09:42	0|sipa|the c++11 way is std::vector::shrink_to_fit() btw
210 2016-10-24 18:10:14	0|morcos|looking at the resize code, it calls erase, which iterates the elements destructing them
211 2016-10-24 18:10:47	0|morcos|but in our case where we're always using unsigned chars and we want to clear the whole thing.. couldn't we do that faster?
212 2016-10-24 18:11:09	0|sipa|so there is a question of what prevector should support
213 2016-10-24 18:11:29	0|sipa|if it can only contain POD types, i think more complexity can go away
214 2016-10-24 18:12:04	0|sipa|but if it's to be value for any movable c++ type (as it does now), it has to call erase (which may still be optimized out, when instanciated for simple types)
215 2016-10-24 18:12:15	0|sipa|i thought cfields_ was working on some improvements to prevector?
216 2016-10-24 18:12:41	0|cfields_|sipa: one of many things that got to 90% and shelved.
217 2016-10-24 18:13:01	0|sipa|s/erase/destructors/
218 2016-10-24 18:13:05	0|morcos|maybe.. i'm not sure.   seems like it might be nice to at least optimize that one particular case, would we subtemplate or something that particular call.
219 2016-10-24 18:13:33	0|cfields_|sipa: in particular, I was doing a specialiazation for size=1
220 2016-10-24 18:13:43	0|sipa|yes, in c++11 you can use templates to figure out whether it's POD, and use a simpler implementation in that case or something
221 2016-10-24 18:13:50	0|cfields_|since that's our main use-case, and you can get huge speedups with that assumption
222 2016-10-24 18:14:10	0|morcos|ok..   thanks for the thoughts..
223 2016-10-24 20:13:39	0|GitHub49|[13bitcoin] 15MarcoFalke opened pull request #9008: [net] Remove assert(nMaxInbound > 0) (06master...06Mf1610-netAssert) 02https://github.com/bitcoin/bitcoin/pull/9008
224 2016-10-24 20:48:57	0|btcdrak|https://github.com/bitcoin-core/bitcoincore.org/pull/239
225 2016-10-24 21:58:58	0|nibor|Could someone let me know what they think about:  https://gist.github.com/n1bor/d5b0330a9addb0bf5e0f869518883522
226 2016-10-24 21:59:46	0|nibor|Is a functioning proof of concept of chainstate only sync. Syncs in about 30mins to a pruned full node state.
227 2016-10-24 22:00:29	0|nibor|Obviously need a soft-fork to be any use.
228 2016-10-24 22:10:06	0|gmaxwell|nibor: it's more frequent than the model I've been thinking of. For security reasons you really don't want to have a case where miners could make a 100 block fork and then forward print themselves a lot of coins. :)  Also it's quite common for nodes to be offline for 1-2 weeks, so if nodes aren't keeping that much in blocks easily available, then security redegrades to SPV history (new chainstat
229 2016-10-24 22:10:12	0|gmaxwell|e sync). ... and downloading and syncing a few thousand blocks isn't really slow compared to 100 (relative to current sync times).
230 2016-10-24 22:10:26	0|gmaxwell|This is all particular relevant because the snapshot management means that different peers really can't choose their own checking time.
231 2016-10-24 22:10:35	0|gmaxwell|I'd been thinking of something that was more like a 3 month interval.
232 2016-10-24 22:11:25	0|gmaxwell|Petertodd will protest that requring a particular UTXO set construction will be a hard barrier to even more scalable things like STXO commitments in the future.  I came up with a solution to that which you might want to use:
233 2016-10-24 22:12:31	0|gmaxwell|Two softfork rules: (1) if the commitment is present, it must be correct. and (2) the commitment must be present from activation until block XXX.   If halfway to XXX everyone is still happy with the scheme, a new softfork is applied that says the commitment must be presnet until YYY.
234 2016-10-24 22:12:49	0|gmaxwell|That way if someothing better comes along, the commitment can eventually be dropped in a smooth and compatible manner.
235 2016-10-24 22:13:07	0|gmaxwell|(perhaps making new installs of old software take a long time to sync :) )
236 2016-10-24 22:14:01	0|gmaxwell|nibor: the hash chunking thing should use some kind of tree hash, it probably doesn't need to go down to the indivigual entry, but if I fetch chunks from N peers in parallel and one peer gives me garbage, I should be able to tell _which_ peer gave me garbage, otherwise you get DOS attacks.
237 2016-10-24 22:15:22	0|nibor|Could not see how tree helped. The snapshot message contains hash of all the chunks. So you know if a node is nasty after the 1st chunk.
238 2016-10-24 22:16:32	0|gmaxwell|okay, that potentially makes the snapshot message quite large, the only difference that a tree would make is that the snapshot value is just the single hash in the blockchain, and the chunks give you enough to verify membership.
239 2016-10-24 22:17:13	0|nibor|Regarding gap between snapshots problem with going too long is that the chainstate grows quite fast. Keeping snapshot from 300 blocks back makes chainstate 2.4G vs 1.7G with no snapshots.
240 2016-10-24 22:17:14	0|gmaxwell|The other important thing about this proposal is that it needs to be very upfront about this being a signficant change to the Bitcoin security model, and justify it.  I believe it is a nessary one.
241 2016-10-24 22:18:19	0|gmaxwell|We generally need to engineer for the worst case, so we should probably just assume that they're maximum size even though fancy COW handling could reduce that.
242 2016-10-24 22:18:25	0|nibor|Current snapshot message is about 200k and chunks are about 200k each. So msgs small so should scale by factor of 10..
243 2016-10-24 22:18:36	0|gmaxwell|reorginizing chainstate into 'old' and 'new' could help with that churn fwiw.
244 2016-10-24 22:19:33	0|nibor|Annoyingly the leveldb snapshots are only held in RAM. So with a big gap node would really need to do a bit rewind to check state.
245 2016-10-24 22:19:49	0|gmaxwell|yea, I was surprised you got this working using leveldb snapshots.
246 2016-10-24 22:20:09	0|nibor|s/bit/big/
247 2016-10-24 22:20:54	0|nibor|Not sure I understand your 1st comment though. About miners creating big fork?
248 2016-10-24 22:21:07	0|gmaxwell|no rewind should be needed however, you should compute the hash as it goes by, e.g. snapshot at the height as you validate it, then at two blocks after, start computing the hash, and just save it.
249 2016-10-24 22:22:12	0|nibor|Sorry - yes you are right. Was thinking of putting hash 20 blocks after chainstate. So have time to compute even when chainstate say 50gig.
250 2016-10-24 22:22:57	0|gmaxwell|(50 gb chainstate is likely unworkable with leveldb :(  but thats an aside. :) )
251 2016-10-24 22:23:46	0|nibor|Prob ok with 64Gig RAM... In day job just order 2 boxes with 2Tb so not so much..
252 2016-10-24 22:23:52	0|gmaxwell|nibor: majority hashpower can make their new commitment say that a million bitcoin that wasn't theirs is now theirs. Then all newly joining nodes will get the new chainstate, and eventually all old nodes will think they've hit a reorg larger than people have blocks available, and so they'll do a chainstate sync too...
253 2016-10-24 22:24:15	0|gmaxwell|nibor: we'd like to have a decenteralized system you know, :P
254 2016-10-24 22:26:29	0|nibor|With a 100gig download?...
255 2016-10-24 22:26:38	0|gmaxwell|nibor: did you understand my "phase out" suggestion? (the line refereincing petertodd)
256 2016-10-24 22:27:29	0|gmaxwell|nibor: more people handle a 100 GB download today than have more than 8GB ram available. (in particular hosted systems, VPSes, are often quite ram starved) but we're on a tangent.
257 2016-10-24 22:28:35	0|nibor|Not sure I do.. but might in a bit...
258 2016-10-24 22:29:08	0|gmaxwell|OKAY.
259 2016-10-24 22:29:12	0|gmaxwell|In any case, exciting work
260 2016-10-24 22:29:18	0|gmaxwell|Your POC is awesome.
261 2016-10-24 22:29:35	0|nibor|Thinking about a 3month interval. That is quite easy. Just copy the whole chainstate to another leveldb. Is not more work than hashing it really.
262 2016-10-24 22:30:18	0|gmaxwell|Or not another leveldb but just a seralized flat blob.
263 2016-10-24 22:30:34	0|gmaxwell|It would be faster and more space efficient. And random access is not needed, except to chunks.
264 2016-10-24 22:30:53	0|gmaxwell|(could be one file per chunk. Though 8000 chunks is a bit excessive for that.)
265 2016-10-24 22:31:33	0|nibor|Not really - leveldb is up to 1000 files.
266 2016-10-24 22:31:38	0|gmaxwell|I believe that only needs two snapshots at any time too...
267 2016-10-24 22:32:22	0|nibor|Yes - I only had 3 cos was short gap. And did not want a client that took over 100 blocks to download be left with nothing to find.
268 2016-10-24 22:33:16	0|nibor|Will think about Petertodd issue to. Is nasty to cause future issues.
269 2016-10-24 22:34:01	0|nibor|I guess some of the 100fork issues would be reduced if client back populated blocks over time.
270 2016-10-24 22:34:09	0|gmaxwell|There is a longer term proposal that would eliminate the utxo set, effectively, that we don't want to block.
271 2016-10-24 22:34:46	0|gmaxwell|nibor: yes, though if we just want the fastest possible start, it could start immediately as SPV, and then back populate.. irrespective of the snapshotting behavior.
272 2016-10-24 22:36:37	0|gmaxwell|(just as background for you: the way the utxo set is eliminated, is that there is a small, perhaps fixed size utxo set, and transactions are expired out of it and commited into an insertion ordered hash tree... then when spending one of those outputs the spending transaction must provide a membership and update proof that lets nodes verify it was there and mark the entry as spent)
273 2016-10-24 22:36:37	0|nibor|Thanks for thoughts... am off now. Will see what others think..
274 2016-10-24 22:36:43	0|gmaxwell|Great!
275 2016-10-24 22:38:26	0|murch|Hey gmaxwell, I was missing you at Scaling Bitcoin. :)
276 2016-10-24 22:39:11	0|murch|I was curios what you'd say about my coin selection talk after we had chatted here about it.
277 2016-10-24 22:48:32	0|gmaxwell|molz: I was sad to see that wider-match only made a fairly modest improvement!
278 2016-10-24 22:49:02	0|sipa|s/molz/murch/
279 2016-10-24 22:49:05	0|gmaxwell|oops!
280 2016-10-24 22:49:07	0|gmaxwell|murch:
281 2016-10-24 22:49:28	0|molz|haha i was scratching my head "what's the wider-match" lol
282 2016-10-24 22:50:04	0|murch|gmaxwell: After Scaling Bitcoin I came up with a new algorithm. I'm still running experiments on it (and writing my evaluation chapter, thesis is due next week), but it looks pretty promising in all aspects.
283 2016-10-24 22:50:25	0|molz|gmaxwell, btw, is there a way to load the ban list into my node or do i have to type each line manually?
284 2016-10-24 22:50:25	0|murch|It has a much higher rate of direct matches than the current core coin selection and is less computationally expensive.
285 2016-10-24 22:50:46	0|sipa|molz: they're remembered across restarts already
286 2016-10-24 22:50:48	0|sipa|bans.dat
287 2016-10-24 22:51:06	0|gmaxwell|murch: one thing your framework doesn't consider is patalogical cases, in the past, people actually attacked litecoin wallets by paying them lots of dust, with enough of it, the subset sum solver would come up with solutions so bad that it couldn't transact.
288 2016-10-24 22:51:11	0|molz|sipa but i haven't banned any bad nodes
289 2016-10-24 22:51:21	0|gmaxwell|They 'solved' this in a really kludgy way just making the wallet ignore payments below a dust threshold.
290 2016-10-24 22:51:40	0|gmaxwell|molz: just paste the lines in a sutiable format.
291 2016-10-24 22:52:20	0|molz|yea i meant copy and paste, ok thanks
292 2016-10-24 22:52:24	0|gmaxwell|murch: so I think SRD would suffer badly from that.  But I think that could be addressed by trying multiple strategies and taking the 'best'.
293 2016-10-24 22:52:44	0|gmaxwell|molz: I put up pastbins with the commands in cli format as well as sutiable for pasting into the debug console..
294 2016-10-24 22:52:48	0|murch|gmaxwell: Yeah, that's true. My new algorithm uses a two phase approach. First it purposefully looks for direct matches. It will not consider inputs there that have a negative payload (more fees than value), but after that it falls back to random selection, which may spend small inputs over time.
295 2016-10-24 22:53:05	0|murch|(Experiment is still running, can't give you good details on the final set composition yet)
296 2016-10-24 22:54:14	0|gmaxwell|By direct matches, you mean no change created--but possible 'extra fee', not one-input only, right?
297 2016-10-24 22:54:33	0|murch|gmaxwell: yeah, that
298 2016-10-24 22:54:39	0|gmaxwell|Good! sounds reasonable to me.
299 2016-10-24 22:54:48	0|gmaxwell|Then again lots of things that didn't work sounded reasonable to me.
300 2016-10-24 22:55:41	0|murch|Since a change output causes an additional output on creation, then an additional input some time in the future. So I allow up to the cost of one input + one output as a padding for the "exact" match.
301 2016-10-24 22:56:49	0|murch|gmaxwell: Is a "flood with dust" attack still reasonable? I thought that transactions with dust outputs are considered non-standard and they'd have a hard time getting confirmed?
302 2016-10-24 22:57:00	0|gmaxwell|Good, that is a rational way to set it. (arguably, even more would be justified either on the basis of of fees being higher in the future, or on the basis of that you may get faster confirmation for it... but your approach sounds reasonably conservative)
303 2016-10-24 22:57:51	0|gmaxwell|murch: That particular one, perhaps less so (well a miner could do it fine)-- but I meant it more of a concrete example that patalogical cases could be created and it is desirable if the wallet doesn't behave badly in any situation easily setup by an attacker.
304 2016-10-24 22:58:14	0|murch|mh.
305 2016-10-24 22:58:26	0|murch|I haven't considered that attack scenario too much yet.
306 2016-10-24 22:58:32	0|gmaxwell|e.g. if you have one 50 btc input and 200 0.00001 inputs (still above dust threshold!) ... then the random selection would pick a pretty bad solution.
307 2016-10-24 22:58:46	0|murch|I was thinking to replace the SDR fall back with 7 random drawings and the median input set size
308 2016-10-24 22:58:51	0|murch|or some similar scheme
309 2016-10-24 22:59:07	0|gmaxwell|(er my example just now should have also said "and you try to pay 1 btc")
310 2016-10-24 22:59:19	0|murch|random drawing should have nice privacy properties though, and generates a wider range of utxos which are beneficial for finding direct matches
311 2016-10-24 22:59:42	0|murch|gmaxwell: Yes, of course.
312 2016-10-24 23:00:25	0|gmaxwell|I agree, well you don't have data for it too, but I think all cases the selection should try to spend all inputs paid to a particular scriptpubkey to limit linkage graph inflation, but that can be layered right on top of your ideas by treating a input set as an input.
313 2016-10-24 23:00:48	0|murch|exactly
314 2016-10-24 23:01:10	0|murch|I'm planning to put addresses in my simulation in the future, but right now I'm focusing on writing up what I have. ;)
315 2016-10-24 23:01:19	0|murch|I have to print next wednesday. :D
316 2016-10-24 23:01:34	0|murch|gmaxwell: https://github.com/Xekyo/CoinSelectionSimulator/blob/master/src/BnBWallet.scala#L59
317 2016-10-24 23:01:49	0|murch|This is the new algorithm I have come up with, in case you want to take a look
318 2016-10-24 23:02:40	0|murch|gmaxwell: some preliminary results on the same data set I talked about at Scaling Bitcoin: https://docs.google.com/spreadsheets/d/1dzugGnAw2nBNL_BwpFR44jci8rO3RkkF5M9OcP2ESN0/pubhtml
319 2016-10-24 23:03:01	0|murch|the perpetrator is "BranchAndBoundWallet"
320 2016-10-24 23:04:36	0|murch|What I also like is that it has a very low standard deviation in the input set. (Although, as you have pointed out, I have not considered pathological cases yet.)