Skip to content

Commit

Permalink
3.7.8.0-Mandatory
Browse files Browse the repository at this point in the history
Fixed:
 - Move context sensitive DPoR block checks to ConnectBlock, #912 (@tomasbrod).
 - Check incoming blocks for malformed DPoR signature, #912.
 - Corect tally height on init, #917 (@denravonska).
 - Prevent staking of a block with a failed signature, #948 (@Foggyx420).
 - Fix UI and RPC slowdown regression, #961 (@denravonska).
 - Fix Debian lint errors, #886, #885, #884, #883 (@caraka).
 - Fix fork issue due to research age calculation inconsistencies, #939
   (@denravonska).
 - Fix crashes when tallying, #934 (@denravonska).
 - Revert reorganize of the chain trust becomes less than what it was, #957
   (@tomasbrod).
 - Fix sync issues with incorrectly accepted v8 beacons, #979 (@tomasbrod).

Changed:
  - Double check PoS kernel, #958 (@tomasbrod).
  - Don't tally until V9 to speed up syncing, #943 (@denravonska).
  - Double check proof of stake kernel, #958 (@tomasbrod).
  • Loading branch information
denravonska committed Mar 1, 2018
2 parents feb5aa7 + 8f97c77 commit 3ffccdb
Show file tree
Hide file tree
Showing 15 changed files with 672 additions and 478 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,7 +4,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.7.7.0]
## [3.7.8.0] 2018-03-01, mandatory
### Fixed
- Move context sensitive DPoR block checks to ConnectBlock, #912 (@tomasbrod).
- Check incoming blocks for malformed DPoR signature, #912.
- Corect tally height on init, #917 (@denravonska).
- Prevent staking of a block with a failed signature, #948 (@Foggyx420).
- Fix UI and RPC slowdown regression, #961 (@denravonska).
- Fix Debian lint errors, #886, #885, #884, #883 (@caraka).
- Fix fork issue due to research age calculation inconsistencies, #939
(@denravonska).
- Fix crashes when tallying, #934 (@denravonska).
- Revert reorganize of the chain trust becomes less than what it was, #957
(@tomasbrod).
- Fix sync issues with incorrectly accepted v8 beacons, #979 (@tomasbrod).

### Changed
- Double check PoS kernel, #958 (@tomasbrod).
- Don't tally until V9 to speed up syncing, #943 (@denravonska).
- Double check proof of stake kernel, #958 (@tomasbrod).

## [3.7.7.0] 2018-02-02
### Fixed
- Beacon validation are now done when accepting blocks, not when receiving,
#899 (@denravonska).
Expand Down
6 changes: 4 additions & 2 deletions gridcoinresearch.pro
Expand Up @@ -260,7 +260,8 @@ HEADERS += src/qt/bitcoingui.h \
src/boinc.h \
src/qt/diagnosticsdialog.h \
src/backup.h \
src/appcache.h
src/appcache.h \
src/tally.h


SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
Expand Down Expand Up @@ -340,7 +341,8 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/boinc.cpp \
src/allocators.cpp \
src/backup.cpp \
src/appcache.cpp
src/appcache.cpp \
src/tally.cpp

##
#RC_FILE = qaxserver.rc
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.include.objs
Expand Up @@ -39,4 +39,5 @@ OBJS= \
obj/boinc.o \
obj/allocators.o \
obj/backup.o \
obj/appcache.o
obj/appcache.o \
obj/tally.o
14 changes: 11 additions & 3 deletions src/beacon.cpp
Expand Up @@ -4,7 +4,7 @@
#include "key.h"
#include "main.h"

extern std::string SignBlockWithCPID(std::string sCPID, std::string sBlockHash);
bool SignBlockWithCPID(const std::string& sCPID, const std::string& sBlockHash, std::string& sSignature, std::string& sError, bool bAdvertising = false);
extern bool VerifyCPIDSignature(std::string sCPID, std::string sBlockHash, std::string sSignature);
std::string RetrieveBeaconValueWithMaxAge(const std::string& cpid, int64_t iMaxSeconds);
int64_t GetRSAWeightByCPIDWithRA(std::string cpid);
Expand All @@ -29,8 +29,16 @@ bool GenerateBeaconKeys(const std::string &cpid, std::string &sOutPubKey, std::s
if (!sOutPrivKey.empty() && !sOutPubKey.empty())
{
uint256 hashBlock = GetRandHash();
std::string sSignature = SignBlockWithCPID(cpid,hashBlock.GetHex());
bool fResult = VerifyCPIDSignature(cpid, hashBlock.GetHex(), sSignature);
std::string sSignature;
std::string sError;
bool fResult;
fResult = SignBlockWithCPID(cpid, hashBlock.GetHex(), sSignature, sError, true);
if (!fResult)
{
printf("GenerateNewKeyPair::Failed to sign block with cpid -> %s\n", sError.c_str());
return false;
}
fResult = VerifyCPIDSignature(cpid, hashBlock.GetHex(), sSignature);
if (fResult)
{
printf("\r\nGenerateNewKeyPair::Current keypair is valid.\r\n");
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 7
#define CLIENT_VERSION_REVISION 7
#define CLIENT_VERSION_REVISION 8
#define CLIENT_VERSION_BUILD 0

// Converts the parameter X to a string after macro replacement on X has been performed.
Expand Down
11 changes: 6 additions & 5 deletions src/init.cpp
Expand Up @@ -9,6 +9,8 @@
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "tally.h"

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
Expand All @@ -23,8 +25,7 @@
bool LoadAdminMessages(bool bFullTableScan,std::string& out_errors);

StructCPID GetStructCPID();
void BusyWaitForTally_retired();
void TallyNetworkAverages_v9();
void TallyResearchAverages(CBlockIndex* index);
extern void ThreadAppInit2(void* parg);

void LoadCPIDs();
Expand Down Expand Up @@ -1013,13 +1014,13 @@ bool AppInit2(ThreadHandlerPtr threads)
uiInterface.InitMessage(_("Loading Network Averages..."));
if (fDebug3) printf("Loading network averages");

TallyNetworkAverages_v9();
CBlockIndex* tallyHeight = FindTallyTrigger(pindexBest);
if(tallyHeight)
TallyResearchAverages(tallyHeight);

if (!threads->createThread(StartNode, NULL, "Start Thread"))
InitError(_("Error: could not start node"));

BusyWaitForTally_retired();

if (fServer)
threads->createThread(ThreadRPCServer, NULL, "RPC Server Thread");

Expand Down

0 comments on commit 3ffccdb

Please sign in to comment.