Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version bump and Sigma Reactivation #898

Merged
merged 1 commit into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 4)
define(_CLIENT_VERSION_BUILD, 5)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
7 changes: 5 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ class CMainParams : public CChainParams {
consensus.nSigmaPaddingBlock = ZC_SIGMA_PADDING_BLOCK;
consensus.nDisableUnpaddedSigmaBlock = ZC_SIGMA_DISABLE_UNPADDED_BLOCK;
consensus.nStartSigmaBlacklist = 293790;
consensus.nRestartSigmaWithBlacklistCheck = 296900;
consensus.nOldSigmaBanBlock = ZC_OLD_SIGMA_BAN_BLOCK;
consensus.nZerocoinV2MintMempoolGracefulPeriod = ZC_V2_MINT_GRACEFUL_MEMPOOL_PERIOD;
consensus.nZerocoinV2MintGracefulPeriod = ZC_V2_MINT_GRACEFUL_PERIOD;
Expand Down Expand Up @@ -577,7 +578,8 @@ class CTestNetParams : public CChainParams {
consensus.nSigmaStartBlock = 1;
consensus.nSigmaPaddingBlock = 1;
consensus.nDisableUnpaddedSigmaBlock = 1;
consensus.nStartSigmaBlacklist = 1;
consensus.nStartSigmaBlacklist = INT_MAX;
consensus.nRestartSigmaWithBlacklistCheck = INT_MAX;
consensus.nOldSigmaBanBlock = 1;

consensus.nZerocoinV2MintMempoolGracefulPeriod = ZC_V2_MINT_TESTNET_GRACEFUL_MEMPOOL_PERIOD;
Expand Down Expand Up @@ -761,7 +763,8 @@ class CRegTestParams : public CChainParams {
consensus.nSigmaStartBlock = 400;
consensus.nSigmaPaddingBlock = 550;
consensus.nDisableUnpaddedSigmaBlock = 510;
consensus.nStartSigmaBlacklist = 1;
consensus.nStartSigmaBlacklist = INT_MAX;
consensus.nRestartSigmaWithBlacklistCheck = INT_MAX;
consensus.nOldSigmaBanBlock = 450;
consensus.nZerocoinV2MintMempoolGracefulPeriod = 2;
consensus.nZerocoinV2MintGracefulPeriod = 5;
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 14
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 4
#define CLIENT_VERSION_BUILD 5

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ struct Params {
int nDisableUnpaddedSigmaBlock;

int nStartSigmaBlacklist;
int nRestartSigmaWithBlacklistCheck;

// The block number after which old sigma clients are banned.
int nOldSigmaBanBlock;
Expand Down
7 changes: 4 additions & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, bool fChe
return false;
}

if(nHeight != INT_MAX && nHeight >= ::Params().GetConsensus().nStartBlacklist) {
if (nHeight >= ::Params().GetConsensus().nStartBlacklist) {
for (const auto& vin : tx.vin) {
if(txid_blacklist.count(vin.prevout.hash.GetHex()) > 0) {
return state.DoS(100, error("Spending this tx is temporarily disabled"),
Expand Down Expand Up @@ -761,7 +761,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
}

if (tx.IsSigmaMint() || tx.IsSigmaSpend()) {
return state.DoS(100, error("Sigma is temporarily disabled"),
if (consensus.nStartSigmaBlacklist != INT_MAX && chainActive.Height() < consensus.nRestartSigmaWithBlacklistCheck)
return state.DoS(100, error("Sigma is temporarily disabled"),
REJECT_INVALID, "bad-txns-zerocoin");
}

Expand Down Expand Up @@ -3896,7 +3897,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
nHeight = ZerocoinGetNHeight(block.GetBlockHeader());

for (CTransactionRef tx : block.vtx) {
if (nHeight >= consensusParams.nStartSigmaBlacklist && (tx->IsSigmaMint() || tx->IsSigmaSpend())) {
if (nHeight >= consensusParams.nStartSigmaBlacklist && nHeight < consensusParams.nRestartSigmaWithBlacklistCheck && (tx->IsSigmaMint() || tx->IsSigmaSpend())) {
return state.DoS(100, error("Sigma is temporarily disabled"), REJECT_INVALID, "bad-txns-zerocoin");
}
// We don't check transactions against zerocoin state here, we'll check it again later in ConnectBlock
Expand Down