Skip to content

Commit 4fd5fa2

Browse files
committed
3.5.8.2-Mandatory
Gridcoin Research 3.5.8.2/MSI=41.7 Mandatory Upgrade - At block 725000 we require blocks to be signed with keypairs. - Enable binary superblocks at block 725000. - When keys expire at the 6 month interval, check the keypair by signing a Test block, and if good, renew the keypair, otherwise generate a new keypair and a new beacon and save the new keypair automatically. (The wallet will repair the keypair if one of two keys are missing). - Note: execute beaconstatus to find the status of your Prod keypair.
1 parent 887cb93 commit 4fd5fa2

File tree

9 files changed

+40
-20
lines changed

9 files changed

+40
-20
lines changed

Makefile.Debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: gridcoinresearch
3-
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Oct 15 14:29:26 2016
3+
# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Nov 1 19:00:49 2016
44
# Project: gridcoinresearch.pro
55
# Template: app
66
#############################################################################

Makefile.Release

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: gridcoinresearch
3-
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Oct 15 14:29:26 2016
3+
# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Nov 1 19:00:49 2016
44
# Project: gridcoinresearch.pro
55
# Template: app
66
#############################################################################

contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1120,19 +1120,19 @@
11201120
{
11211121
"Name" = "8:Microsoft Visual Studio"
11221122
"ProductName" = "8:Gridcoin Research"
1123-
"ProductCode" = "8:{F2C51C09-E622-4259-BF15-F6D5BFAA777A}"
1124-
"PackageCode" = "8:{EA9810E9-3C35-42D0-8118-DB23C6DA3AE0}"
1123+
"ProductCode" = "8:{30AAD9EB-F91F-466F-AAC5-E4A0CE7BC53A}"
1124+
"PackageCode" = "8:{B6424258-604A-40D5-BEE0-640A2CAEC4C5}"
11251125
"UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}"
11261126
"AspNetVersion" = "8:4.0.30319.0"
11271127
"RestartWWWService" = "11:FALSE"
11281128
"RemovePreviousVersions" = "11:TRUE"
11291129
"DetectNewerInstalledVersion" = "11:FALSE"
11301130
"InstallAllUsers" = "11:TRUE"
1131-
"ProductVersion" = "8:41.6"
1131+
"ProductVersion" = "8:41.7"
11321132
"Manufacturer" = "8:GridcoinResearch"
11331133
"ARPHELPTELEPHONE" = "8:"
11341134
"ARPHELPLINK" = "8:"
1135-
"Title" = "8:Gridcoin Research 41.6"
1135+
"Title" = "8:Gridcoin Research 41.7"
11361136
"Subject" = "8:"
11371137
"ARPCONTACT" = "8:The Gridcoin Developers"
11381138
"Keywords" = "8:Gridcoin Research"

src/clientversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 3
1010
#define CLIENT_VERSION_MINOR 5
1111
#define CLIENT_VERSION_REVISION 8
12-
#define CLIENT_VERSION_BUILD 1
12+
#define CLIENT_VERSION_BUILD 2
1313

1414
// Converts the parameter X to a string after macro replacement on X has been performed.
1515
// Don't merge these into one macro!

src/kernel.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ int64_t GetRSAWeightByCPIDWithRA(std::string cpid)
394394
int64_t GetRSAWeightByCPID(std::string cpid)
395395
{
396396

397-
if (IsResearchAgeEnabled(pindexBest->nHeight) && bNewbieFeatureEnabled)
397+
if (IsResearchAgeEnabled(pindexBest->nHeight) && AreBinarySuperblocksEnabled(pindexBest->nHeight))
398398
{
399399
return GetRSAWeightByCPIDWithRA(cpid);
400400
//ToDo : During next mandatory, retire this old function.
@@ -421,8 +421,6 @@ int64_t GetRSAWeightByCPID(std::string cpid)
421421
if (IsResearchAgeEnabled(pindexBest->nHeight) && weight < 0) weight=0;
422422
}
423423

424-
//if (IsResearchAgeEnabled(pindexBest->nHeight) && !bNewbieFeatureEnabled) weight = UntrustedHost.Magnitude;
425-
426424
}
427425
else
428426
{

src/main.cpp

+13-6
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ unsigned int nStakeMaxAge = -1; // unlimited
304304
unsigned int nModifierInterval = 10 * 60; // time to elapse before new modifier is computed
305305
bool bCryptoLotteryEnabled = true;
306306
bool bRemotePaymentsEnabled = false;
307-
bool bNewbieFeatureEnabled = false;
308307
bool bOPReturnEnabled = true;
309308
bool bOptionPaymentsEnabled = false;
310309

@@ -481,7 +480,7 @@ extern void FlushGridcoinBlockFile(bool fFinalize);
481480
std::string msHDDSerial = "";
482481
//When syncing, we grandfather block rejection rules up to this block, as rules became stricter over time and fields changed
483482

484-
int nGrandfather = 677500;
483+
int nGrandfather = 714999;
485484
int nNewIndex = 271625;
486485
int nNewIndex2 = 364500;
487486

@@ -5544,7 +5543,6 @@ bool LoadBlockIndex(bool fAllowNew)
55445543
nNewIndex = 10;
55455544
nNewIndex2 = 36500;
55465545
bRemotePaymentsEnabled = false;
5547-
bNewbieFeatureEnabled = true;
55485546
bOPReturnEnabled = false;
55495547
bOptionPaymentsEnabled = false;
55505548
//1-24-2016
@@ -8662,7 +8660,7 @@ std::string GetNeuralNetworkSuperBlock()
86628660
#if defined(WIN32) && defined(QT_GUI)
86638661
contract = qtGetNeuralContract("");
86648662
if (fDebug2 && LessVerbose(5)) printf("Appending SuperBlock %f\r\n",(double)contract.length());
8665-
if (bNewbieFeatureEnabled)
8663+
if (AreBinarySuperblocksEnabled(nBestHeight))
86668664
{
86678665
// 12-21-2015 : Stake a binary superblock
86688666
contract = PackBinarySuperblock(contract);
@@ -10297,7 +10295,7 @@ double GRCMagnitudeUnit(int64_t locktime)
1029710295
double Kitty = MaximumEmission - (network.payments/14);
1029810296
if (Kitty < 1) Kitty = 1;
1029910297
double MagnitudeUnit = 0;
10300-
if (bNewbieFeatureEnabled)
10298+
if (AreBinarySuperblocksEnabled(nBestHeight))
1030110299
{
1030210300
MagnitudeUnit = (Kitty/TotalNetworkMagnitude)*1.25;
1030310301
}
@@ -10318,7 +10316,7 @@ int64_t ComputeResearchAccrual(int64_t nTime, std::string cpid, std::string oper
1031810316
if (pHistorical->nHeight <= nNewIndex || pHistorical->nMagnitude==0 || pHistorical->nTime == 0)
1031910317
{
1032010318
//No prior block exists... Newbies get .01 age to bootstrap the CPID (otherwise they will not have any prior block to refer to, thus cannot get started):
10321-
if (!bNewbieFeatureEnabled)
10319+
if (!AreBinarySuperblocksEnabled(pindexLast->nHeight))
1032210320
{
1032310321
return dCurrentMagnitude > 0 ? ((dCurrentMagnitude/100)*COIN) : 0;
1032410322
}
@@ -10331,9 +10329,18 @@ int64_t ComputeResearchAccrual(int64_t nTime, std::string cpid, std::string oper
1033110329
{
1033210330
double dNewbieAccrualAge = ((double)nTime - (double)iBeaconTimestamp) / 86400;
1033310331
int64_t iAccrual = (int64_t)((dNewbieAccrualAge*dCurrentMagnitude*dMagnitudeUnit*COIN) + (1*COIN));
10332+
if ((dNewbieAccrualAge*dCurrentMagnitude*dMagnitudeUnit) > 500)
10333+
{
10334+
printf("Newbie special stake too high, reward=500GRC");
10335+
return (500*COIN);
10336+
}
1033410337
if (fDebug3) printf("\r\n Newbie Special First Stake for CPID %s, Age %f, Accrual %f \r\n",cpid.c_str(),dNewbieAccrualAge,(double)iAccrual);
1033510338
return iAccrual;
1033610339
}
10340+
else
10341+
{
10342+
return dCurrentMagnitude > 0 ? (((dCurrentMagnitude/100)*COIN) + (1*COIN)): 0;
10343+
}
1033710344
}
1033810345
}
1033910346
// To prevent reorgs and checkblock errors, ensure the research age is > 10 blocks wide:

src/main.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ inline int GetSuperblockAgeSpacing(int nHeight)
103103
return (fTestNet ? 86400 : (nHeight > 364500) ? 86400 : 43200);
104104
}
105105

106+
inline bool AreBinarySuperblocksEnabled(int nHeight)
107+
{
108+
return (fTestNet ? nHeight > 10000 : nHeight > 725000);
109+
}
110+
111+
106112
inline int64_t PastDrift(int64_t nTime, int nHeight) { return IsProtocolV2(nHeight) ? nTime - 20 * 60 : nTime - 20 * 60; }
107113
inline int64_t FutureDrift(int64_t nTime, int nHeight) { return IsProtocolV2(nHeight) ? nTime + 20 * 60 : nTime + 20 * 60; }
108114
inline unsigned int GetTargetSpacing(int nHeight) { return IsProtocolV2(nHeight) ? 90 : 60; }
@@ -151,7 +157,6 @@ extern std::map<uint256, CBlock*> mapOrphanBlocks;
151157
extern int64_t COIN_YEAR_REWARD;
152158
extern bool bCryptoLotteryEnabled;
153159
extern bool bRemotePaymentsEnabled;
154-
extern bool bNewbieFeatureEnabled;
155160
extern bool bOPReturnEnabled;
156161
extern bool bOptionPaymentsEnabled;
157162

src/rpcblockchain.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,19 @@ int GenerateNewKeyPair(std::string sIndex, std::string &sOutPubKey, std::string
14041404
std::string sSuffix = fTestNet ? "testnet" : "";
14051405
sOutPrivKey = GetArgument("PrivateKey" + sIndex + sSuffix, "");
14061406
sOutPubKey = GetArgument("PublicKey" + sIndex + sSuffix, "");
1407-
if (!sOutPrivKey.empty() && !sOutPubKey.empty()) return 1;
1407+
// If current keypair is not empty, but is invalid, allow the new keys to be stored, otherwise return 1: (10-25-2016)
1408+
1409+
if (!sOutPrivKey.empty() && !sOutPubKey.empty())
1410+
{
1411+
uint256 hashBlock = GetRandHash();
1412+
std::string sSignature = SignBlockWithCPID(sIndex,hashBlock.GetHex());
1413+
bool fResult = VerifyCPIDSignature(sIndex, hashBlock.GetHex(), sSignature);
1414+
if (fResult)
1415+
{
1416+
printf("\r\nGenerateNewKeyPair::Current keypair is valid.\r\n");
1417+
return 1;
1418+
}
1419+
}
14081420
// Generate the Keypair
14091421
CKey key;
14101422
key.MakeNewKey(false);

src/wallet.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1884,13 +1884,11 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
18841884
if (!GlobalCPUMiningCPID.initialized)
18851885
{
18861886
printf("Global Mining CPID not initialized yet.. Unable to stake\r\n");
1887-
msMiningErrors7="No Global CPID;";
18881887
return false;
18891888
}
18901889
if (GlobalCPUMiningCPID.cpid == "")
18911890
{
18921891
printf("Global Mining CPID not initialized yet.. Unable to stake\r\n");
1893-
msMiningErrors7="No Global CPID";
18941892
return false;
18951893
}
18961894

0 commit comments

Comments
 (0)