Skip to content

Commit

Permalink
Merge pull request #103 from anonymousbitcoin/development
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
thomasluis authored Feb 4, 2019
2 parents 5d4afa5 + a8ce5a0 commit c452aeb
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.com/ByeBugDevelopment/anon-backup.svg?token=WBBgtRXJbdCRsjxqqhJy&branch=master)](https://travis-ci.com/ByeBugDevelopment/anon-backup)

**Anonymous Bitcoin v.2.0.0**
**Anonymous Bitcoin v.2.1.0**

ANON is an implementation of the zerocash protocol, bootstrapped with a merge of the Official Bitcoin and Zclassic UTXO sets via a snapshot and airdrop, and with the additional implementation of masternodes.

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 51)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "ANON-2.0.0"
name: "ANON-2.1.0"
enable_cache: true
distro: "debian"
suites:
Expand Down
41 changes: 32 additions & 9 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class CMainParams : public CChainParams {
consensus.nBudgetPaymentsCycleBlocks = 4380; // (blocks per day times ~ days in a month) 144 * (365/12)
consensus.nSuperblockStartBlock = 43800; // The block at which 1st superblock goes live
consensus.nSuperblockCycle = 4380; // (blocks per day times ~ days in a month) 144 * (365/12)

// masternode
consensus.nMasternodeMinimumConfirmations = 3;

// governance
consensus.nGovernanceMinQuorum = 25;
consensus.nGovernanceFilterElements = 20000;

consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
Expand Down Expand Up @@ -159,6 +166,8 @@ class CMainParams : public CChainParams {
// total number of tx / (checkpoint block height / (24 * 24))
};


//setup airdrop blocks range
nForkStartHeight = 3;
nForkHeightRange = 16737;
nZtransparentStartBlock = 9893 + nForkStartHeight;
Expand Down Expand Up @@ -228,6 +237,13 @@ class CTestNetParams : public CMainParams {
consensus.nSuperblockStartBlock = 30; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPaymentsStartBlock
consensus.nSuperblockCycle = 10; // Superblocks can be issued hourly on testnet

//masternode
consensus.nMasternodeMinimumConfirmations = 1;

// governance
consensus.nGovernanceMinQuorum = 3;
consensus.nGovernanceFilterElements = 20000;

consensus.prePowLimit = consensus.powLimit;
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.fPowAllowMinDifficultyBlocks = false;
Expand All @@ -243,12 +259,18 @@ class CTestNetParams : public CMainParams {
pchMessageStart[1] = 0xa3;
pchMessageStart[2] = 0x39;
pchMessageStart[3] = 0xbc;

//setup airdrop blocks range
nForkStartHeight = 2;
nForkHeightRange = 1;
nZtransparentStartBlock = 5;
nZshieldedStartBlock = 6;

eh_epoch_1 = eh200_9;
eh_epoch_2 = eh144_5;
eh_epoch_1_endblock = nForkStartHeight + nForkHeightRange + 999999998;
eh_epoch_2_startblock = nForkStartHeight + nForkHeightRange + 999999999;

eh_epoch_1_endblock = nForkStartHeight + nForkHeightRange + 1616; //actual block 1619
eh_epoch_2_startblock = nForkStartHeight + nForkHeightRange + 1617; //actual block 1620

vAlertPubKey = ParseHex("048679fb891b15d0cada9692047fd0ae26ad8bfb83fabddbb50334ee5bc0683294deb410be20513c5af6e7b9cec717ade82b27080ee6ef9a245c36a795ab044bb3");
nDefaultPort = 33129;
Expand Down Expand Up @@ -307,12 +329,6 @@ class CTestNetParams : public CMainParams {
0
};

//setup airdrop blocks range
nForkStartHeight = 2;
nForkHeightRange = 1;
nZtransparentStartBlock = 5;
nZshieldedStartBlock = 6;

//masternode collateral
masternodeCollateralChangeBlock = 1;
masternodeCollateralOld = 500;
Expand Down Expand Up @@ -372,6 +388,13 @@ class CRegTestParams : public CTestNetParams {
consensus.nPowMaxAdjustDown = 0; // Turn off adjustment down
consensus.nPowMaxAdjustUp = 0; // Turn off adjustment up

//masternode
consensus.nMasternodeMinimumConfirmations = 1;

// governance
consensus.nGovernanceMinQuorum = 3;
consensus.nGovernanceFilterElements = 20000;

consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 51

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
9 changes: 7 additions & 2 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ struct Params {
int nSuperblockStartBlock;
int nSuperblockCycle; // in blocks

// Masternode
int nMasternodeMinimumConfirmations;
// int nGovernanceFilterElements;
// int nGovernanceMinQuorum;

// Aidrop
int nForkStartHeight;
int nForkHeightRange;

// Governance
int nGovernanceFilterElements;
int nGovernanceMinQuorum;

/** Block height and hash at which BIP34 becomes active */
int BIP34Height;
uint256 BIP34Hash;
Expand Down
2 changes: 2 additions & 0 deletions src/governance-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@ void CGovernanceObject::UpdateSentinelVariables()
// CALCULATE THE MINUMUM VOTE COUNT REQUIRED FOR FULL SIGNAL

// todo - 12.1 - should be set to `10` after governance vote compression is implemented
int nGovernanceMinQuorum = Params().GetConsensus().nGovernanceMinQuorum;

int nAbsVoteReq = std::max(nGovernanceMinQuorum, int(nMnCount * (nGovernanceMinQuorum * 0.01)));
int nAbsDeleteReq = std::max(nGovernanceMinQuorum, (2 * nMnCount) / 3);
// todo - 12.1 - Temporarily set to 1 for testing - reverted
Expand Down
2 changes: 1 addition & 1 deletion src/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ void CGovernanceManager::RequestGovernanceObject(CNode* pfrom, const uint256& nH
CGovernanceObject* pObj = FindGovernanceObject(nHash);

if(pObj) {
filter = CBloomFilter(nGovernanceFilterElements, GOVERNANCE_FILTER_FP_RATE, GetRandInt(999999), BLOOM_UPDATE_ALL);
filter = CBloomFilter(Params().GetConsensus().nGovernanceFilterElements, GOVERNANCE_FILTER_FP_RATE, GetRandInt(999999), BLOOM_UPDATE_ALL);
std::vector<CGovernanceVote> vecVotes = pObj->GetVoteFile().GetVotes();
for(size_t i = 0; i < vecVotes.size(); ++i) {
filter.insert(vecVotes[i].GetHash());
Expand Down
3 changes: 0 additions & 3 deletions src/governance.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class CGovernanceVote;

extern CGovernanceManager governance;

static const int nGovernanceMinQuorum = 25;
static const int nGovernanceFilterElements = 20000;

typedef std::pair<CGovernanceObject, int64_t> object_time_pair_t;

static const int RATE_BUFFER_SIZE = 5;
Expand Down
13 changes: 0 additions & 13 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ bool IsBlockPayeeValid(const CTransaction &txNew, int nBlockHeight, CAmount bloc
return true;
}

// we are still using budgets, but we have no data about them anymore,
// we can only check masternode payments

const Consensus::Params& consensusParams = Params().GetConsensus();

if(nBlockHeight < consensusParams.nSuperblockStartBlock) {
// NOTE: old budget system is disabled since 12.1 and we should never enter this branch
// anymore when sync is finished (on mainnet). We have no old budget data but these blocks
// have tons of confirmations and can be safely accepted without payee verification
LogPrint("gobject", "IsBlockPayeeValid -- WARNING: Client synced but old budget system is disabled, accepting any payee\n");
return true;
}

// superblocks started
// SEE IF THIS IS A VALID SUPERBLOCK

Expand Down
4 changes: 2 additions & 2 deletions src/masternode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ static const int MNPAYMENTS_SIGNATURES_TOTAL = 8;
// vote for masternode and be elected as a payment winner
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 180005;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 180006;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 180006;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 180007;

extern CCriticalSection cs_vecPayees;
extern CCriticalSection cs_mapMasternodeBlocks;
Expand Down
1 change: 1 addition & 0 deletions src/rpcgovernance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ UniValue getgovernanceinfo(const UniValue& params, bool fHelp)
// Get chain parameters
int nSuperblockStartBlock = Params().GetConsensus().nSuperblockStartBlock;
int nSuperblockCycle = Params().GetConsensus().nSuperblockCycle;
int nGovernanceMinQuorum = Params().GetConsensus().nGovernanceMinQuorum;

// Get first superblock
int nFirstSuperblockOffset = (nSuperblockCycle - nSuperblockStartBlock % nSuperblockCycle) % nSuperblockCycle;
Expand Down
3 changes: 2 additions & 1 deletion src/sendalert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ void ThreadSendAlert()
// 180004 : 1.0.0
// 180005 : 1.2.0
// 180006 : 2.0.0
// 180007 : 2.1.0
alert.nMinVer = 180006;
alert.nMaxVer = 180007;
alert.nMaxVer = 180008;

//
// main.cpp:
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* network protocol versioning
*/

static const int PROTOCOL_VERSION = 180006;
static const int PROTOCOL_VERSION = 180007;

//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
Expand Down

0 comments on commit c452aeb

Please sign in to comment.