Skip to content

Commit 7d24178

Browse files
committed
3.5.7.9-leisure
Gridcoin Research 3.5.7.9/MSI=41.4 Mandatory Upgrade for TESTNET Leisure Upgrade for PROD - At block 196300 in TestNet, we require POR blocks to be signed (with the CPID private key) - After staking a testnet POR block, run the command "showblock blocknumber" and verify the block signature is valid - Test voting in TestNet - Test Binary superblocks: Verify the superblock is staked, the block number, and in showblock, verify the superblock is binary, and verify the constiuent magnitude (and POR payment) is correct. - Testnet Thread (please go here to continue testing): https://cryptocointalk.com/topic/40141-testnet-research-age/page-34 - Fixed log spam in testnet
1 parent 66227b7 commit 7d24178

File tree

9 files changed

+60
-30
lines changed

9 files changed

+60
-30
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: Sun Sep 25 12:57:44 2016
3+
# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Sep 27 19:34:35 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: Sun Sep 25 12:57:44 2016
3+
# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Sep 27 19:34:35 2016
44
# Project: gridcoinresearch.pro
55
# Template: app
66
#############################################################################

contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj

+35-10
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,19 @@
232232
"Entry"
233233
{
234234
"MsmKey" = "8:_UNDEFINED"
235-
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
235+
"OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB"
236236
"MsmSig" = "8:_UNDEFINED"
237237
}
238238
"Entry"
239239
{
240240
"MsmKey" = "8:_UNDEFINED"
241-
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
241+
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
242242
"MsmSig" = "8:_UNDEFINED"
243243
}
244244
"Entry"
245245
{
246246
"MsmKey" = "8:_UNDEFINED"
247-
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
247+
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
248248
"MsmSig" = "8:_UNDEFINED"
249249
}
250250
"Entry"
@@ -256,19 +256,19 @@
256256
"Entry"
257257
{
258258
"MsmKey" = "8:_UNDEFINED"
259-
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
259+
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
260260
"MsmSig" = "8:_UNDEFINED"
261261
}
262262
"Entry"
263263
{
264264
"MsmKey" = "8:_UNDEFINED"
265-
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
265+
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
266266
"MsmSig" = "8:_UNDEFINED"
267267
}
268268
"Entry"
269269
{
270270
"MsmKey" = "8:_UNDEFINED"
271-
"OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB"
271+
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
272272
"MsmSig" = "8:_UNDEFINED"
273273
}
274274
}
@@ -463,6 +463,11 @@
463463
"AssemblyAsmDisplayName" = "8:GRCSec, Version=1.0.0.3, Culture=neutral, processorArchitecture=MSIL"
464464
"ScatterAssemblies"
465465
{
466+
"_32F2DC723F30362B0B78F9A291EC0098"
467+
{
468+
"Name" = "8:GRCSec.dll"
469+
"Attributes" = "3:512"
470+
}
466471
}
467472
"SourcePath" = "8:GRCSec.dll"
468473
"TargetName" = "8:"
@@ -580,6 +585,11 @@
580585
"AssemblyAsmDisplayName" = "8:OpenPop, Version=2.0.5.0, Culture=neutral, processorArchitecture=MSIL"
581586
"ScatterAssemblies"
582587
{
588+
"_5644D8F767F33372E534FBD5A2384D12"
589+
{
590+
"Name" = "8:openpopstake.dll"
591+
"Attributes" = "3:512"
592+
}
583593
}
584594
"SourcePath" = "8:openpopstake.dll"
585595
"TargetName" = "8:"
@@ -606,6 +616,11 @@
606616
"AssemblyAsmDisplayName" = "8:MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"
607617
"ScatterAssemblies"
608618
{
619+
"_6408A3D03D15E306A4C3FC5FD95ADA69"
620+
{
621+
"Name" = "8:MySql.Data.dll"
622+
"Attributes" = "3:512"
623+
}
609624
}
610625
"SourcePath" = "8:MySql.Data.dll"
611626
"TargetName" = "8:"
@@ -632,6 +647,11 @@
632647
"AssemblyAsmDisplayName" = "8:SQLite.NET, Version=0.21.1869.3794, Culture=neutral, PublicKeyToken=c273bd375e695f9c"
633648
"ScatterAssemblies"
634649
{
650+
"_6AEABB5004EC4B57225B51B085DB5625"
651+
{
652+
"Name" = "8:sqlitestake.net.dll"
653+
"Attributes" = "3:512"
654+
}
635655
}
636656
"SourcePath" = "8:sqlitestake.net.dll"
637657
"TargetName" = "8:"
@@ -889,6 +909,11 @@
889909
"AssemblyAsmDisplayName" = "8:ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73"
890910
"ScatterAssemblies"
891911
{
912+
"_DEB886DE05C496A5AD26B43C4B1B90B9"
913+
{
914+
"Name" = "8:icsharpcode.sharpziplib.dll"
915+
"Attributes" = "3:512"
916+
}
892917
}
893918
"SourcePath" = "8:icsharpcode.sharpziplib.dll"
894919
"TargetName" = "8:"
@@ -1095,19 +1120,19 @@
10951120
{
10961121
"Name" = "8:Microsoft Visual Studio"
10971122
"ProductName" = "8:Gridcoin Research"
1098-
"ProductCode" = "8:{5352F47F-B73B-4E0D-8BED-D64E59DBA238}"
1099-
"PackageCode" = "8:{63E01D50-F3D7-4B0A-83BC-4A2E67469250}"
1123+
"ProductCode" = "8:{FA40F114-AB22-43BA-ACB1-7676683BAD78}"
1124+
"PackageCode" = "8:{FEC4042F-2340-4209-98A0-AF797CED52AD}"
11001125
"UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}"
11011126
"AspNetVersion" = "8:4.0.30319.0"
11021127
"RestartWWWService" = "11:FALSE"
11031128
"RemovePreviousVersions" = "11:TRUE"
11041129
"DetectNewerInstalledVersion" = "11:FALSE"
11051130
"InstallAllUsers" = "11:TRUE"
1106-
"ProductVersion" = "8:41.3"
1131+
"ProductVersion" = "8:41.4"
11071132
"Manufacturer" = "8:GridcoinResearch"
11081133
"ARPHELPTELEPHONE" = "8:"
11091134
"ARPHELPLINK" = "8:"
1110-
"Title" = "8:Gridcoin Research 41.3"
1135+
"Title" = "8:Gridcoin Research 41.4"
11111136
"Subject" = "8:"
11121137
"ARPCONTACT" = "8:The Gridcoin Developers"
11131138
"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 7
12-
#define CLIENT_VERSION_BUILD 8
12+
#define CLIENT_VERSION_BUILD 9
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/main.cpp

+13-12
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,9 @@ MiningCPID GetNextProject(bool bForce)
10701070
uint256 pbh = 1;
10711071
GlobalCPUMiningCPID.cpidv2 = ComputeCPIDv2(GlobalCPUMiningCPID.email,GlobalCPUMiningCPID.boincruntimepublickey, pbh);
10721072
GlobalCPUMiningCPID.lastblockhash = "0";
1073-
1073+
// Sign the block
1074+
GlobalCPUMiningCPID.BoincSignature = SignBlockWithCPID(GlobalCPUMiningCPID.cpid,GlobalCPUMiningCPID.lastblockhash);
1075+
10741076
if (!IsCPIDValidv2(GlobalCPUMiningCPID,1))
10751077
{
10761078
printf("CPID INVALID 2 %s, %s ",GlobalCPUMiningCPID.cpid.c_str(),GlobalCPUMiningCPID.cpidv2.c_str());
@@ -3522,7 +3524,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck, boo
35223524
pindex->nMoneySupply = ReturnCurrentMoneySupply(pindex) + nValueOut - nValueIn;
35233525

35243526
// Gridcoin: Store verified magnitude and CPID in block index (7-11-2015)
3525-
if (pindex->nHeight > nNewIndex)
3527+
if (pindex->nHeight > nNewIndex2)
35263528
{
35273529
pindex->sCPID = bb.cpid;
35283530
pindex->nMagnitude = bb.Magnitude;
@@ -3708,7 +3710,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck, boo
37083710
// End of Network Consensus
37093711

37103712
// Gridcoin: Track payments to CPID, and last block paid
3711-
if (!bb.cpid.empty() && bb.cpid != "INVESTOR" && pindex->nHeight > nNewIndex)
3713+
if (!bb.cpid.empty() && bb.cpid != "INVESTOR" && pindex->nHeight > nNewIndex2)
37123714
{
37133715
StructCPID stCPID = GetInitializedStructCPID2(bb.cpid,mvResearchAge);
37143716
stCPID.InterestSubsidy += bb.InterestSubsidy;
@@ -4487,7 +4489,7 @@ bool CBlock::CheckBlock(std::string sCaller, int height1, int64_t Mint, bool fCh
44874489
if (fDebug10) printf("BV %f, CV %f ",bv,cvn);
44884490
//if (bv+10 < cvn) return error("ConnectBlock[]: Old client version after mandatory upgrade - block rejected\r\n");
44894491
if (bv < 3517 && IsResearchAgeEnabled(height1) && !fTestNet) return error("CheckBlock[]: Old client spamming new blocks after mandatory upgrade \r\n");
4490-
if (bv < 3578 && fTestNet) return DoS(25, error("CheckBlock[]: Old testnet client spamming new blocks after mandatory upgrade \r\n"));
4492+
if (bv < 3579 && fTestNet) return DoS(25, error("CheckBlock[]: Old testnet client spamming new blocks after mandatory upgrade \r\n"));
44914493
}
44924494

44934495
if (bb.cpid != "INVESTOR" && height1 > nGrandfather)
@@ -5063,9 +5065,8 @@ void GridcoinServices()
50635065

50645066
bool AskForOutstandingBlocks(uint256 hashStart)
50655067
{
5066-
if (!fTestNet && IsLockTimeWithinMinutes(nLastAskedForBlocks,2)) return true;
5068+
if (IsLockTimeWithinMinutes(nLastAskedForBlocks,2)) return true;
50675069
nLastAskedForBlocks = GetAdjustedTime();
5068-
if (fTestNet) mapAlreadyAskedFor.clear();
50695070

50705071
int iAsked = 0;
50715072
LOCK(cs_vNodes);
@@ -5538,7 +5539,7 @@ bool LoadBlockIndex(bool fAllowNew)
55385539
bnProofOfWorkLimit = bnProofOfWorkLimitTestNet; // 16 bits PoW target limit for testnet
55395540
nStakeMinAge = 1 * 60 * 60; // test net min age is 1 hour
55405541
nCoinbaseMaturity = 10; // test maturity is 10 blocks
5541-
nGrandfather = 195500;
5542+
nGrandfather = 196300;
55425543
nNewIndex = 10;
55435544
nNewIndex2 = 36500;
55445545
bRemotePaymentsEnabled = false;
@@ -5951,7 +5952,7 @@ bool IsCPIDValidv2(MiningCPID& mc, int height)
59515952
if (height < nGrandfather) return true;
59525953
bool result = false;
59535954
int cpidV2CutOverHeight = fTestNet ? 0 : 97000;
5954-
int cpidV3CutOverHeight = fTestNet ? 195500 : 700000;
5955+
int cpidV3CutOverHeight = fTestNet ? 196300 : 705000;
59555956
if (height < cpidV2CutOverHeight)
59565957
{
59575958
result = IsCPIDValid_Retired(mc.cpid,mc.enccpid);
@@ -7332,7 +7333,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
73327333

73337334

73347335
// Ensure testnet users are running latest version as of 12-3-2015 (works in conjunction with block spamming)
7335-
if (pfrom->nVersion < 180319 && fTestNet)
7336+
if (pfrom->nVersion < 180320 && fTestNet)
73367337
{
73377338
// disconnect from peers older than this proto version
73387339
if (fDebug10) printf("Testnet partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
@@ -10261,7 +10262,7 @@ void TestScan()
1026110262
BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
1026210263
{
1026310264
CBlockIndex* pindex = item.second;
10264-
if (LessVerbose(1) || pindex->nHeight > nNewIndex)
10265+
if (LessVerbose(1) || pindex->nHeight > nNewIndex2)
1026510266
{
1026610267
printf("map block index h %f , cpid %s , Mag %f , RS %f, INT %f \r\n",(double)pindex->nHeight,pindex->sCPID.c_str(), (double)pindex->nMagnitude,
1026710268
pindex->nResearchSubsidy,pindex->nInterestSubsidy);
@@ -10276,7 +10277,7 @@ void TestScan2()
1027610277
while (pindex->nHeight > 1)
1027710278
{
1027810279
pindex = pindex->pprev;
10279-
if (LessVerbose(1) || pindex->nHeight > nNewIndex)
10280+
if (LessVerbose(1) || pindex->nHeight > nNewIndex2)
1028010281
{
1028110282
printf("map block index h %f , cpid %s , Mag %f , RS %f, INT %f \r\n",(double)pindex->nHeight,pindex->sCPID.c_str(), (double)pindex->nMagnitude,
1028210283
pindex->nResearchSubsidy,pindex->nInterestSubsidy);
@@ -10437,7 +10438,7 @@ CBlockIndex* GetHistoricalMagnitude_ScanChain(std::string cpid)
1043710438
// Limit lookback to 6 months
1043810439
int nMinIndex = pindexBest->nHeight-(6*30*BLOCKS_PER_DAY);
1043910440
if (nMinIndex < 2) nMinIndex=2;
10440-
while (pindex->nHeight > nNewIndex && pindex->nHeight > nMinIndex)
10441+
while (pindex->nHeight > nNewIndex2 && pindex->nHeight > nMinIndex)
1044110442
{
1044210443
//8-5-2015; R HALFORD; Find the last block the CPID staked with a research subsidy (IE dont count interest blocks)
1044310444
if (!pindex || !pindex->pprev) return pindexGenesisBlock;

src/rpcblockchain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPri
482482
bool bIsBinary = Contains(bb.superblock,"<BINARY>");
483483
result.push_back(Pair("IsBinary",bIsBinary));
484484
}
485-
result.push_back(Pair("IsSuperBlock", (double)blockindex->nIsSuperBlock));
486-
result.push_back(Pair("IsContract", (double)blockindex->nIsContract));
485+
result.push_back(Pair("IsSuperBlock", (int)blockindex->nIsSuperBlock));
486+
result.push_back(Pair("IsContract", (int)blockindex->nIsContract));
487487
return result;
488488
}
489489

src/txdb-leveldb.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -404,15 +404,14 @@ bool CTxDB::LoadBlockIndex()
404404
pindexNew->nBits = diskindex.nBits;
405405
pindexNew->nNonce = diskindex.nNonce;
406406

407-
//10-4-2015 - Gridcoin - New Accrual Fields
407+
//9-26-2016 - Gridcoin - New Accrual Fields
408408

409409
if (diskindex.nHeight > nNewIndex)
410410
{
411411
pindexNew->sCPID = diskindex.sCPID;
412412
pindexNew->nResearchSubsidy = diskindex.nResearchSubsidy;
413413
pindexNew->nInterestSubsidy = diskindex.nInterestSubsidy;
414414
pindexNew->nMagnitude = diskindex.nMagnitude;
415-
416415
pindexNew->nIsContract = diskindex.nIsContract;
417416
pindexNew->nIsSuperBlock = diskindex.nIsSuperBlock;
418417
}

src/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern int MINOR_VERSION;
2525
///////////////////////////////////////////////////////////
2626
// network protocol versioning //
2727
// //
28-
static const int PROTOCOL_VERSION = 180319; //
28+
static const int PROTOCOL_VERSION = 180320; //
2929
// disconnect from peers older than this proto version //
3030
static const int MIN_PEER_PROTO_VERSION = 180284; //
3131
///////////////////////////////////////////////////////////

src/wallet.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ using namespace std;
1919
static unsigned int GetStakeSplitAge() { return IsProtocolV2(nBestHeight) ? (10 * 24 * 60 * 60) : (1 * 24 * 60 * 60); }
2020
static int64_t GetStakeCombineThreshold() { return IsProtocolV2(nBestHeight) ? (50 * COIN) : (1000 * COIN); }
2121
bool IsLockTimeWithinMinutes(int64_t locktime, int minutes);
22+
std::string SignBlockWithCPID(std::string sCPID, std::string sBlockHash);
2223
std::vector<std::string> split(std::string s, std::string delim);
2324
StructCPID GetLifetimeCPID(std::string cpid,std::string sFrom);
2425
double cdbl(std::string s, int place);
@@ -1944,8 +1945,12 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
19441945
miningcpid.lastblockhash = pindexPrev->GetBlockHash().GetHex();
19451946
miningcpid.RSAWeight = GetRSAWeightByCPID(miningcpid.cpid);
19461947
hashBoinc = SerializeBoincBlock(miningcpid);
1948+
// Sign
1949+
miningcpid.BoincSignature = SignBlockWithCPID(miningcpid.cpid,miningcpid.lastblockhash);
1950+
19471951
if (!IsCPIDValidv2(miningcpid,pindexPrev->nHeight))
19481952
{
1953+
19491954
printf("Unable to create boinc block->CPID INVALID cpid %s %s %s",miningcpid.cpid.c_str(),miningcpid.boincruntimepublickey.c_str(),miningcpid.email.c_str());
19501955

19511956
MilliSleep(300);

0 commit comments

Comments
 (0)