Commit be6e2727 authored by Brannon King's avatar Brannon King
Browse files

set go-live normalization fork numbers

parent 7237708a
......@@ -136,7 +136,7 @@ public:
consensus.nExtendedClaimExpirationForkHeight = 400155;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nNormalizedNameForkHeight = 1000000; // FIXME: pick a real fork height
consensus.nNormalizedNameForkHeight = 539940; // targeting 21 March 2019
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
......@@ -224,7 +224,7 @@ public:
consensus.nExtendedClaimExpirationForkHeight = 278160;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nNormalizedNameForkHeight = 1000000; // FIXME: pick a real fork height
consensus.nNormalizedNameForkHeight = 993380; // targeting, 21 Feb 2019
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
......@@ -305,7 +305,7 @@ public:
consensus.nExtendedClaimExpirationForkHeight = 800;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nNormalizedNameForkHeight = 2000;
consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number
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;
......
......@@ -138,10 +138,9 @@ std::string CClaimTrieCacheNormalizationFork::normalizeClaimName(const std::stri
if (normalized.empty())
return name;
// these methods supposedly only use the "UTF8" portion of the locale object:
normalized = boost::locale::normalize(normalized, boost::locale::norm_nfd, utf8);
// Locale aware lowercase (the non-locale-aware version seemed to struggle with some international chars):
normalized = boost::locale::to_lower(normalized, utf8);
normalized = boost::locale::fold_case(normalized, utf8);
}
catch (const boost::locale::conv::conversion_error& e){
return name;
......
......@@ -532,7 +532,9 @@ UniValue getclaimbyid(const UniValue& params, bool fHelp)
CCoinsViewCache coins(pcoinsTip);
getValueForClaim(coins, claimValue.outPoint, sValue);
claim.push_back(Pair("name", name));
claim.push_back(Pair("normalized_name", cache.normalizeClaimName(name, true)));
if (cache.shouldNormalize())
claim.push_back(Pair("normalized_name", cache.normalizeClaimName(name, true)));
claim.push_back(Pair("value", sValue));
claim.push_back(Pair("claimId", claimValue.claimId.GetHex()));
claim.push_back(Pair("txid", claimValue.outPoint.hash.GetHex()));
......@@ -636,6 +638,7 @@ UniValue getclaimsfortx(const UniValue& params, bool fHelp)
" \"nOut\" (numeric) the index of the claim or support in the transaction's list out outputs\n"
" \"claim type\" (string) 'claim' or 'support'\n"
" \"name\" (string) the name claimed or supported\n"
" \"claimId\" (string) if a claim, its ID\n"
" \"value\" (string) if a name claim, the value of the claim\n"
" \"supported txid\" (string) if a support, the txid of the supported claim\n"
" \"supported nout\" (numeric) if a support, the index of the supported claim in its transaction\n"
......
......@@ -136,6 +136,7 @@ struct ClaimTrieChainFixture{
ENTER_CRITICAL_SECTION(cs_main);
BOOST_CHECK(pclaimTrie->nCurrentHeight == chainActive.Height() + 1);
pclaimTrie->setExpirationTime(originalExpiration); // in case it was changed during the test
setNormalizationForkHeight(1000000);
num_txs_for_next_block = 0;
num_txs = 0;
coinbase_txs_used = 0;
......@@ -157,7 +158,8 @@ struct ClaimTrieChainFixture{
void setNormalizationForkHeight(int targetMinusCurrent) {
int target = chainActive.Height() + targetMinusCurrent;
const Consensus::Params& consensus = Params().GetConsensus();
normalization_original = consensus.nNormalizedNameForkHeight;
if (normalization_original < 0)
normalization_original = consensus.nNormalizedNameForkHeight;
const_cast<Consensus::Params&>(consensus).nNormalizedNameForkHeight = target;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment