4 ms·
The bug here is interesting. There are three separate pieces of new code which was added. First, is code which implements a new ordering rule. The second is con
by zaroth 11y ago
The bug here is interesting. There are three separate pieces of new code which was added. First, is code which implements a new ordering rule. The second is consensus code which actually requires the new ordering to be in place in order to consider a block valid. The third is a flag in the header.
The consensus rule was pre-programmed to automatically activate after 995 of the last 1000 blocks (in theory 99.5% of the network) included a flag in the block indicating that they would auto-activate the new consensus rule. So think of it like green and red lights. If there is no set of 1000 blocks where at least 995 of them are green, then the old ordering is still valid.
Important to note that the new ordering is a stricter subset of the old, so new ordering is perfectly fine under the old rules, just old ordering is not acceptable under the new rules. This is called a SOFT fork. As soon as there are any 1000 blocks where 995 are green, then every block from that point onward MUST be properly ordered. (BTW, if you change rules such that something new you are doing would be invalid under the old code, like say, increasing the block size limit, it is called a HARD fork. Hard forks are considered much more disruptive to the network, soft forks are supposed to be easier to orchestrate)
By "showing green" the miners were supposed to be advertising that they would enforce the rule once the cutoff point was met. The problem is enough miners showed green, the cutoff was hit, but then when an "incorrectly" ordered block came up sometime after the threshold was met, too many miners still accepted the block as VALID and so now we have a significant (majority?) hashpower running on blocks which are "supposed" to be invalid.
Of course consensus is, by definition, whatever the majority is doing. So now it's a battle of dev's trying to cajole enough hashpower into enforcing the rule, or somehow backing off the change. With every new block mined on each head, there's more money at stake for which way the decision ultimately falls. For Bitcoin to survive, "There Can Be Only One".
It will be interesting to see how exactly this came about. Were there bugs in the trigger code which was supposed to activate the new consensus rule? Did ignoramus miners simply turn on the flag without actually priming the new consensus code for activation? Did miners mistakenly think they just needed to show "green" and then their blocks would be valid, but then they published a "green" block with the older ordering?
- Adlai 11y agoTwo mining pools (Discus Fish and Antpool) were engaged in what's called "SPV Mining", where they assume a block broadcast by another miner is valid based solely upon the block header (essentially, just checking that the block was "difficult enough"), without verifying (or downloading!) the transactions in that block. This strategy lowers their orphan rate at the cost of the risk that they'd waste work by mining on an invalid chain. This low risk was increased by the BIP66 enforcement (activation happened once only 75% of the blocks had the version 3 "flag").
- maaku 11y agoWhat ordering? BIP 66 isn't about ordering. It's about the validity non-DER signature encoding.
- zaroth 11y agoHmm... :-( Somehow I had the words "canonical ordering" in my head while I was writing that earlier today. Of course as you say it's nothing to do with ordering. Very sorry I can't edit it now. Not quite sure how I botched that one so badly, thanks for pointing it out.
- vessenes 11y agoNot only were some mining pools SPV mining, but they were advertising compliance with BIP66 at the same time; if they had not been advertising compliance, then it is unlikely we'd have switched over to enforcing BIP66. So, don't lie about your SPV status in your coinbase is one of the lessons here for a pool operator. When I ran a (small but noticeable) pool, the bitcoin core team would occasionally reach out with warnings when an impending network change was coming that we didn't look compliant with; often we'd get two or three e-mails independently with plenty of warning. So, I would say this is chinese mining pools not playing by the rules, either because they didn't care to listen, or didn't care to have engineers do anything about it, and now they are eating it a bit, (and of course we all have some minor knock-on effects for a little while).
- Adlai 11y agoFor the sake of quoting Greg Maxwell, I'd like to pick a nit. Bitcoin has no rules other than those you enforce yourself, and all these pools did was enforce fewer rules of their fellow players, than we assume they do.[4] Optimize would be less judgmental than cheat and speaks more precisely to the motivations[1]... we do need to be careful about this and make sure we're managing the incentives. Cheating is a moral judgement[2] Bonus quote, unearthed while digging up the above: While the identifiable parties in question here were Chinese; the first miners I saw doing this in the pastwere not Chinese-- it's not a Chinese specific issue; its a response to orphan rate. (China just has lots of hash power and poor connectivity).[3] [1] https://www.reddit.com/r/Bitcoin/comments/3c305f/if_you_are_using_any_wallet_other_than_bitcoin/csrsyfq?context=3 https://www.reddit.com/r/Bitcoin/comments/3c305f/if_you_are_... [2] https://www.reddit.com/r/BitcoinMarkets/comments/3c2jci/daily_discussion_saturday_july_04_2015/csrtuou?context=3 https://www.reddit.com/r/BitcoinMarkets/comments/3c2jci/dail... [3] https://www.reddit.com/r/Bitcoin/comments/3c305f/if_you_are_using_any_wallet_other_than_bitcoin/csrtejw?context=3 https://www.reddit.com/r/Bitcoin/comments/3c305f/if_you_are_... [4] One could interpret the block version increment as a policy advertisement, but you know what they say about assumptions.
- vessenes 11y agoIt's all good to quote Gmax, but I didn't say anyone was cheating, so I feel a bit straw-manned here. And incrementing your version number is precisely a policy advertisement, full stop. It is saying you are in compliance with v1/2/3 of the spec. If you want to lie about that to other miners, there may well be consequences.
- lappa 11y ago>Of course consensus is, by definition, whatever the majority is doing. So now it's a battle of dev's trying to cajole enough hashpower into enforcing the rule, or somehow backing off the change. With every new block mined on each head, there's more money at stake for which way the decision ultimately falls. For Bitcoin to survive, "There Can Be Only One". Consensus is what everyone is doing. That is why the terminology used here would be "split consensus". The purpose of the devs trying to get the hash power back into the correct blockchain is so consensus can be re-established.
- maxerickson 11y agoNeeds better terms. For instance, "split consensus" is dangerously close to being self evident nonsense. I think "untenable distributed state" captures the picture there.