From 55c66854023997bfa1e6f0106aff89d208169dc3 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 16 Feb 2015 10:23:22 -0700 Subject: [PATCH 1/5] reference node upgrades --- src/masternode.cpp | 60 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index a86a658e692b..c7790925eaa9 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -735,23 +735,56 @@ void CMasternodePayments::CleanPaymentList() bool CMasternodePayments::ProcessBlock(int nBlockHeight) { - if(!enabled) return false; CMasternodePaymentWinner winner; + LogPrintf("CMasternodePayments() : block %d \n", nBlockHeight); + + //only do this once per blockheight + CScript payee; + if(GetBlockPayee(nBlockHeight, payee)) return true; + + //randomly sort our masternodes + std::random_shuffle ( vecMasternodes.begin(), vecMasternodes.end() ); + + //count the active masternodes + int nActiveMasternodes = 0; + BOOST_FOREACH(CMasterNode& mn, vecMasternodes) { + mn.Check(); + if(!mn.IsEnabled()) { + continue; + } + + nActiveMasternodes++; + } + nActiveMasternodes *= 0.95; + //make an array with 1 payment cycle of active masternodes std::vector vecLastPayments; int c = 0; BOOST_REVERSE_FOREACH(CMasternodePaymentWinner& winner, vWinning){ vecLastPayments.push_back(winner.vin); //if we have one full payment cycle, break - if(++c > (int)vecMasternodes.size()) break; + if(++c >= nActiveMasternodes) break; } - std::random_shuffle ( vecMasternodes.begin(), vecMasternodes.end() ); + //scan for the next winner BOOST_FOREACH(CMasterNode& mn, vecMasternodes) { bool found = false; - BOOST_FOREACH(CTxIn& vin, vecLastPayments) - if(mn.vin == vin) found = true; + BOOST_FOREACH(CTxIn& vin, vecLastPayments){ + if(mn.vin == vin) { + found = true; + break; + } + } + + CScript payee; + payee.SetDestination(mn.pubkey.GetID()); + + CTxDestination address1; + ExtractDestination(payee, address1); + CBitcoinAddress address2(address1); + + if(fDebug) LogPrintf("CMasternodePayments() : Looking for next payee - %s %d \n", address2.ToString().c_str(), found); if(found) continue; @@ -760,20 +793,31 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) continue; } + winner.score = 0; winner.nBlockHeight = nBlockHeight; winner.vin = mn.vin; winner.payee.SetDestination(mn.pubkey.GetID()); + if(fDebug) LogPrintf("CMasternodePayments() : got payee - %s \n", address2.ToString().c_str()); + break; } - //if we can't find someone to get paid, pick randomly + //if we can't find someone to get paid, pick randomly (shouldn't happen) if(winner.nBlockHeight == 0 && vecMasternodes.size() > 1) { + int i = rand() % (int)(vecMasternodes.size() - 1); winner.score = 0; winner.nBlockHeight = nBlockHeight; - winner.vin = vecMasternodes[0].vin; - winner.payee.SetDestination(vecMasternodes[0].pubkey.GetID()); + winner.vin = vecMasternodes[i].vin; + winner.payee.SetDestination(vecMasternodes[i].pubkey.GetID()); + + CTxDestination address1; + ExtractDestination(winner.payee, address1); + CBitcoinAddress address2(address1); + + if(fDebug) LogPrintf("CMasternodePayments() : Looking for next payee - %s \n", address2.ToString().c_str()); + } if(Sign(winner)){ From ecb4fc5f4c0fecdf211990213689e23c4c7e815f Mon Sep 17 00:00:00 2001 From: vertoe Date: Mon, 16 Feb 2015 21:01:49 +0100 Subject: [PATCH 2/5] Draft release notes for 0.11.2 to include BIP 66. --- doc/release-notes.md | 98 +---------------------- doc/release-notes/release-notes-0.11.2.md | 21 +++++ 2 files changed, 25 insertions(+), 94 deletions(-) create mode 100644 doc/release-notes/release-notes-0.11.2.md diff --git a/doc/release-notes.md b/doc/release-notes.md index 7ee73246a9b0..a1d8b4ab8937 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,95 +1,5 @@ -Bitcoin Core version 0.9.4 is now available from: +Darkcoin Core tree 0.11.x release notes can be found here: - https://bitcoin.org/bin/0.9.4/ - -This is a new minor version release, bringing only bug fixes and updated -translations. Upgrading to this release is recommended. - -Please report bugs using the issue tracker at github: - - https://github.com/bitcoin/bitcoin/issues - -How to Upgrade -=============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or -bitcoind/bitcoin-qt (on Linux). - -OpenSSL Warning -================ - -OpenSSL 1.0.0p / 1.0.1k was recently released and is being pushed out by -various operating system maintainers. Review by Gregory Maxwell determined that -this update is incompatible with the Bitcoin system and could lead to consensus -forks. - -Bitcoin Core released binaries from https://bitcoin.org are unaffected, -as are any built with the gitian deterministic build system. - -However, if you are running either - -- The Ubuntu PPA from https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin -- A third-party or self-compiled Bitcoin Core - -upgrade to Bitcoin Core 0.9.4, which includes a workaround, **before** updating -OpenSSL. - -The incompatibility is due to the OpenSSL update changing the -behavior of ECDSA validation to reject any signature which is -not encoded in a very rigid manner. This was a result of -OpenSSL's change for CVE-2014-8275 "Certificate fingerprints -can be modified". - -We are specifically aware of potential hard-forks due to signature -encoding handling and had been hoping to close them via BIP62 in 0.10. -BIP62's purpose is to improve transaction malleability handling and -as a side effect rigidly defines the encoding for signatures, but the -overall scope of BIP62 has made it take longer than we'd like to -deploy. - -0.9.4 changelog -================ - -Validation: -- `b8e81b7` consensus: guard against openssl's new strict DER checks -- `60c51f1` fail immediately on an empty signature -- `037bfef` Improve robustness of DER recoding code - -Command-line options: -- `cd5164a` Make -proxy set all network types, avoiding a connect leak. - -P2P: -- `bb424e4` Limit the number of new addressses to accumulate - -RPC: -- `0a94661` Disable SSLv3 (in favor of TLS) for the RPC client and server. - -Build system: -- `f047dfa` gitian: openssl-1.0.1i.tar.gz -> openssl-1.0.1k.tar.gz -- `5b9f78d` build: Fix OSX build when using Homebrew and qt5 -- `ffab1dd` Keep symlinks when copying into .app bundle -- `613247f` osx: fix signing to make Gatekeeper happy (again) - -Miscellaneous: -- `25b49b5` Refactor -alertnotify code -- `2743529` doc: Add instructions for consistent Mac OS X build names - -Credits --------- - -Thanks to who contributed to this release, at least: - -- Cory Fields -- Gavin Andresen -- Gregory Maxwell -- Jeff Garzik -- Luke Dashjr -- Matt Corallo -- Pieter Wuille -- Saivann -- Sergio Demian Lerner -- Wladimir J. van der Laan - -As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/bitcoin/). +- [v0.11.0](release-notes/release-notes-0.11.0.md) released Jan/15/2015 +- [v0.11.1](release-notes/release-notes-0.11.1.md) released Feb/10/2015. +- [v0.11.2](release-notes/release-notes-0.11.2.md) not released yet. diff --git a/doc/release-notes/release-notes-0.11.2.md b/doc/release-notes/release-notes-0.11.2.md new file mode 100644 index 000000000000..320dc12674cc --- /dev/null +++ b/doc/release-notes/release-notes-0.11.2.md @@ -0,0 +1,21 @@ +*This is a draft!* + +0.11.2 Release notes +==================== + +Mining and relay policy enhancements +------------------------------------ + +Darkcoin Core's block templates are now for version 3 blocks only, and any mining software relying on its `getblocktemplate` must be updated in parallel to use libblkmaker either version 0.4.2 or any version from 0.5.1 onward. If you are solo mining, this will affect you the moment you upgrade Darkcoin Core, which must be done prior to BIP66 achieving its 951/1001 status. If you are mining with the stratum mining protocol: this does not affect you. If you are mining with the getblocktemplate protocol to a pool: this will affect you at the pool operator's discretion, which must be no later than BIP66 achieving its 951/1001 status. + + +BIP 66: strict DER encoding for signatures +------------------------------------------ + +Darkcoin Core 0.11.2 implements BIP 66, which introduces block version 3, and a new consensus rule, which prohibits non-DER signatures. Such transactions have been non-standard since Darkcoin 0.8, but were technically still permitted inside blocks. +This change breaks the dependency on OpenSSL's signature parsing, and is required if implementations would want to remove all of OpenSSL from the consensus code. +The same miner-voting mechanism as in BIP 34 is used: when 751 out of a sequence of 1001 blocks have version number 3 or higher, the new consensus rule becomes active for those blocks. When 951 out of a sequence of 1001 blocks have version number 3 or higher, it becomes mandatory for all blocks. +Backward compatibility with current mining software is NOT provided, thus miners should read the first paragraph of "Mining and relay policy enhancements" above. + +Also compare with [upstream release notes](https://github.com/bitcoin/bitcoin/blob/0.10/doc/release-notes.md#mining-and-relay-policy-enhancements). +More info on [BIP 66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki). From e4ac176abd07690d4f6417dd9444f1ec7aaf5c53 Mon Sep 17 00:00:00 2001 From: vertoe Date: Mon, 16 Feb 2015 21:08:50 +0100 Subject: [PATCH 3/5] Revert commit from wrong branch. This reverts commit 55c66854023997bfa1e6f0106aff89d208169dc3. --- src/masternode.cpp | 60 +++++++--------------------------------------- 1 file changed, 8 insertions(+), 52 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index c7790925eaa9..a86a658e692b 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -735,56 +735,23 @@ void CMasternodePayments::CleanPaymentList() bool CMasternodePayments::ProcessBlock(int nBlockHeight) { + if(!enabled) return false; CMasternodePaymentWinner winner; - LogPrintf("CMasternodePayments() : block %d \n", nBlockHeight); - - //only do this once per blockheight - CScript payee; - if(GetBlockPayee(nBlockHeight, payee)) return true; - - //randomly sort our masternodes - std::random_shuffle ( vecMasternodes.begin(), vecMasternodes.end() ); - - //count the active masternodes - int nActiveMasternodes = 0; - BOOST_FOREACH(CMasterNode& mn, vecMasternodes) { - mn.Check(); - if(!mn.IsEnabled()) { - continue; - } - - nActiveMasternodes++; - } - nActiveMasternodes *= 0.95; - //make an array with 1 payment cycle of active masternodes std::vector vecLastPayments; int c = 0; BOOST_REVERSE_FOREACH(CMasternodePaymentWinner& winner, vWinning){ vecLastPayments.push_back(winner.vin); //if we have one full payment cycle, break - if(++c >= nActiveMasternodes) break; + if(++c > (int)vecMasternodes.size()) break; } - //scan for the next winner + std::random_shuffle ( vecMasternodes.begin(), vecMasternodes.end() ); BOOST_FOREACH(CMasterNode& mn, vecMasternodes) { bool found = false; - BOOST_FOREACH(CTxIn& vin, vecLastPayments){ - if(mn.vin == vin) { - found = true; - break; - } - } - - CScript payee; - payee.SetDestination(mn.pubkey.GetID()); - - CTxDestination address1; - ExtractDestination(payee, address1); - CBitcoinAddress address2(address1); - - if(fDebug) LogPrintf("CMasternodePayments() : Looking for next payee - %s %d \n", address2.ToString().c_str(), found); + BOOST_FOREACH(CTxIn& vin, vecLastPayments) + if(mn.vin == vin) found = true; if(found) continue; @@ -793,31 +760,20 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) continue; } - winner.score = 0; winner.nBlockHeight = nBlockHeight; winner.vin = mn.vin; winner.payee.SetDestination(mn.pubkey.GetID()); - if(fDebug) LogPrintf("CMasternodePayments() : got payee - %s \n", address2.ToString().c_str()); - break; } - //if we can't find someone to get paid, pick randomly (shouldn't happen) + //if we can't find someone to get paid, pick randomly if(winner.nBlockHeight == 0 && vecMasternodes.size() > 1) { - int i = rand() % (int)(vecMasternodes.size() - 1); winner.score = 0; winner.nBlockHeight = nBlockHeight; - winner.vin = vecMasternodes[i].vin; - winner.payee.SetDestination(vecMasternodes[i].pubkey.GetID()); - - CTxDestination address1; - ExtractDestination(winner.payee, address1); - CBitcoinAddress address2(address1); - - if(fDebug) LogPrintf("CMasternodePayments() : Looking for next payee - %s \n", address2.ToString().c_str()); - + winner.vin = vecMasternodes[0].vin; + winner.payee.SetDestination(vecMasternodes[0].pubkey.GetID()); } if(Sign(winner)){ From 3f0f1462581a389c6beb7b9b87e825bbb180d5a8 Mon Sep 17 00:00:00 2001 From: vertoe Date: Mon, 16 Feb 2015 23:33:51 +0100 Subject: [PATCH 4/5] Update release notes for 0.11.2. --- doc/release-notes/release-notes-0.11.2.md | 88 +++++++++++++++++++++-- 1 file changed, 83 insertions(+), 5 deletions(-) diff --git a/doc/release-notes/release-notes-0.11.2.md b/doc/release-notes/release-notes-0.11.2.md index 320dc12674cc..3bfebc986a94 100644 --- a/doc/release-notes/release-notes-0.11.2.md +++ b/doc/release-notes/release-notes-0.11.2.md @@ -3,19 +3,97 @@ 0.11.2 Release notes ==================== + +Darkcoin Core version 0.11.2 is now available from: + + https://darkcoin.io/download + +This is a new minor version release, bringing only bug fixes and updated +translations. Upgrading to this release is recommended. + +Please report bugs using the issue tracker at github: + + https://github.com/darkcoin/darkcoin/issues + + +How to Upgrade +-------------- + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Darkcoin-Qt (on Mac) or +darkcoind/darkcoin-qt (on Linux). + + Mining and relay policy enhancements ------------------------------------ -Darkcoin Core's block templates are now for version 3 blocks only, and any mining software relying on its `getblocktemplate` must be updated in parallel to use libblkmaker either version 0.4.2 or any version from 0.5.1 onward. If you are solo mining, this will affect you the moment you upgrade Darkcoin Core, which must be done prior to BIP66 achieving its 951/1001 status. If you are mining with the stratum mining protocol: this does not affect you. If you are mining with the getblocktemplate protocol to a pool: this will affect you at the pool operator's discretion, which must be no later than BIP66 achieving its 951/1001 status. +Darkcoin Core's block templates are now for version 3 blocks only, and any +mining software relying on its `getblocktemplate` must be updated in parallel +to use libblkmaker either version 0.4.2 or any version from 0.5.1 onward. If you +are solo mining, this will affect you the moment you upgrade Darkcoin Core, +which must be done prior to BIP66 achieving its 951/1001 status. If you are +mining with the stratum mining protocol: this does not affect you. If you are +mining with the getblocktemplate protocol to a pool: this will affect you at the +pool operator's discretion, which must be no later than BIP66 achieving its +951/1001 status. BIP 66: strict DER encoding for signatures ------------------------------------------ -Darkcoin Core 0.11.2 implements BIP 66, which introduces block version 3, and a new consensus rule, which prohibits non-DER signatures. Such transactions have been non-standard since Darkcoin 0.8, but were technically still permitted inside blocks. -This change breaks the dependency on OpenSSL's signature parsing, and is required if implementations would want to remove all of OpenSSL from the consensus code. -The same miner-voting mechanism as in BIP 34 is used: when 751 out of a sequence of 1001 blocks have version number 3 or higher, the new consensus rule becomes active for those blocks. When 951 out of a sequence of 1001 blocks have version number 3 or higher, it becomes mandatory for all blocks. -Backward compatibility with current mining software is NOT provided, thus miners should read the first paragraph of "Mining and relay policy enhancements" above. +Darkcoin Core 0.11.2 implements BIP 66, which introduces block version 3, and a +new consensus rule, which prohibits non-DER signatures. Such transactions have +been non-standard since Darkcoin 0.8, but were technically still permitted +inside blocks. +This change breaks the dependency on OpenSSL's signature parsing, and is +required if implementations would want to remove all of OpenSSL from the +consensus code. +The same miner-voting mechanism as in BIP 34 is used: when 751 out of a +sequence of 1001 blocks have version number 3 or higher, the new consensus +rule becomes active for those blocks. When 951 out of a sequence of 1001 +blocks have version number 3 or higher, it becomes mandatory for all blocks. +Backward compatibility with current mining software is NOT provided, thus +miners should read the first paragraph of "Mining and relay policy +enhancements" above. Also compare with [upstream release notes](https://github.com/bitcoin/bitcoin/blob/0.10/doc/release-notes.md#mining-and-relay-policy-enhancements). More info on [BIP 66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki). + + +0.11.2 changelog +---------------- + +Validation: +- `b8e81b7` consensus: guard against openssl's new strict DER checks +- `60c51f1` fail immediately on an empty signature +- `037bfef` Improve robustness of DER recoding code + +Command-line options: +- `cd5164a` Make -proxy set all network types, avoiding a connect leak. + +P2P: +- `bb424e4` Limit the number of new addressses to accumulate + +RPC: +- `0a94661` Disable SSLv3 (in favor of TLS) for the RPC client and server. + +Build system: +- `f047dfa` gitian: openssl-1.0.1i.tar.gz -> openssl-1.0.1k.tar.gz +- `5b9f78d` build: Fix OSX build when using Homebrew and qt5 +- `ffab1dd` Keep symlinks when copying into .app bundle +- `613247f` osx: fix signing to make Gatekeeper happy (again) + +Miscellaneous: +- `25b49b5` Refactor -alertnotify code +- `2743529` doc: Add instructions for consistent Mac OS X build names + + +Credits +-------- + +Thanks to who contributed to this release, at least: + +- Evan Duffield + +As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/darkcoin/). From 81ab7bec0e74bcc7bda9c6d15f7a00d5daa89d32 Mon Sep 17 00:00:00 2001 From: vertoe Date: Mon, 16 Feb 2015 23:37:46 +0100 Subject: [PATCH 5/5] Update release notes for 0.11.2. --- doc/release-notes/release-notes-0.11.2.md | 51 +++++++---------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/doc/release-notes/release-notes-0.11.2.md b/doc/release-notes/release-notes-0.11.2.md index 3bfebc986a94..8750266f992a 100644 --- a/doc/release-notes/release-notes-0.11.2.md +++ b/doc/release-notes/release-notes-0.11.2.md @@ -6,25 +6,13 @@ Darkcoin Core version 0.11.2 is now available from: - https://darkcoin.io/download - -This is a new minor version release, bringing only bug fixes and updated -translations. Upgrading to this release is recommended. + https://darkcoin.io/downloads Please report bugs using the issue tracker at github: https://github.com/darkcoin/darkcoin/issues -How to Upgrade --------------- - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over /Applications/Darkcoin-Qt (on Mac) or -darkcoind/darkcoin-qt (on Linux). - - Mining and relay policy enhancements ------------------------------------ @@ -46,47 +34,38 @@ Darkcoin Core 0.11.2 implements BIP 66, which introduces block version 3, and a new consensus rule, which prohibits non-DER signatures. Such transactions have been non-standard since Darkcoin 0.8, but were technically still permitted inside blocks. + This change breaks the dependency on OpenSSL's signature parsing, and is required if implementations would want to remove all of OpenSSL from the consensus code. + The same miner-voting mechanism as in BIP 34 is used: when 751 out of a sequence of 1001 blocks have version number 3 or higher, the new consensus rule becomes active for those blocks. When 951 out of a sequence of 1001 blocks have version number 3 or higher, it becomes mandatory for all blocks. + Backward compatibility with current mining software is NOT provided, thus miners should read the first paragraph of "Mining and relay policy enhancements" above. Also compare with [upstream release notes](https://github.com/bitcoin/bitcoin/blob/0.10/doc/release-notes.md#mining-and-relay-policy-enhancements). -More info on [BIP 66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki). - -0.11.2 changelog ----------------- +More info on [BIP 66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki). -Validation: -- `b8e81b7` consensus: guard against openssl's new strict DER checks -- `60c51f1` fail immediately on an empty signature -- `037bfef` Improve robustness of DER recoding code -Command-line options: -- `cd5164a` Make -proxy set all network types, avoiding a connect leak. +How to Upgrade +-------------- -P2P: -- `bb424e4` Limit the number of new addressses to accumulate +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Darkcoin-Qt (on Mac) or +darkcoind/darkcoin-qt (on Linux). -RPC: -- `0a94661` Disable SSLv3 (in favor of TLS) for the RPC client and server. -Build system: -- `f047dfa` gitian: openssl-1.0.1i.tar.gz -> openssl-1.0.1k.tar.gz -- `5b9f78d` build: Fix OSX build when using Homebrew and qt5 -- `ffab1dd` Keep symlinks when copying into .app bundle -- `613247f` osx: fix signing to make Gatekeeper happy (again) +0.11.2 changelog +---------------- -Miscellaneous: -- `25b49b5` Refactor -alertnotify code -- `2743529` doc: Add instructions for consistent Mac OS X build names +- *to do ..* Credits @@ -94,6 +73,6 @@ Credits Thanks to who contributed to this release, at least: -- Evan Duffield +- *to do ..* As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/darkcoin/).