Skip to content

Commit

Permalink
5.1.0.0, 2020-11-01, mandatory, "Gladys"
Browse files Browse the repository at this point in the history
Added
 - rpc: Add out-of-sync status to "getinfo" and "getblockchaininfo" #1925 (@cyrossignol)
 - gui: add autocomplete to rpc console #1927 (@Pythonix)
 - consensus: Add checkpoint post block v11 transition #1919 (@cyrossignol)
 - researcher: Add -forcecpid configuration option #1935 (@cyrossignol)
 - gui: Adds detection if version is below last mandatory #1939 (@jamescowens)
 - contract: Reimplement legacy administrative contract validation #1943 (@cyrossignol)
 - voting: Add poll choices to "gettransaction" RPC contract output #1948 (@cyrossignol)

Changed
 - doc: Fix link in build-openbsd.md #1924 (@Pythonix)
 - voting: Decrease poll duration to 90 days #1936 (@cyrossignol)
 - refactor: Revert init order to fix rejected net messages @1941 (@cyrossignol)
 - refactor: port amount.h #1937 (@div72)
 - refactor: Normalize boost::filesystem to fs namespace #1942 (@cyrossignol)
 - accrual: Apply accrual for new CPIDs from existing snapshots #1944 (@cyrossignol)
 - accrual: Reset research account when disconnecting first block #1947 (@cyrossignol)

Removed
 - refactor: Clean up transitional code for block version 11 #1933 (@cyrossignol)

Fixed
 - Modify depends packages for openSUSE and other Redhat like distributions and fix mingw bdb53 compile #1932 (@jamescowens)
 - contract: Fix ability to reorganize contracts #1934 (@cyrossignol)
 - accrual: Fix snapshot accrual for new CPIDs #1931 (@cyrossignol)
 - rpc: Clean up getblockstats #1938 (@jamescowens)
 - scraper, rpc: Correct missing mScraperStats initialization in ConvergedScraperStats (@jamescowens)
  • Loading branch information
jamescowens committed Nov 1, 2020
1 parent 0e7166e commit d4990f8
Show file tree
Hide file tree
Showing 106 changed files with 925 additions and 2,540 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ 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/).

## [5.1.0.0] 2020-11-01, mandatory, "Gladys"
### Added
- rpc: Add out-of-sync status to "getinfo" and "getblockchaininfo" #1925 (@cyrossignol)
- gui: add autocomplete to rpc console #1927 (@Pythonix)
- consensus: Add checkpoint post block v11 transition #1919 (@cyrossignol)
- researcher: Add -forcecpid configuration option #1935 (@cyrossignol)
- gui: Adds detection if version is below last mandatory #1939 (@jamescowens)
- contract: Reimplement legacy administrative contract validation #1943 (@cyrossignol)
- voting: Add poll choices to "gettransaction" RPC contract output #1948 (@cyrossignol)

### Changed
- doc: Fix link in build-openbsd.md #1924 (@Pythonix)
- voting: Decrease poll duration to 90 days #1936 (@cyrossignol)
- refactor: Revert init order to fix rejected net messages @1941 (@cyrossignol)
- refactor: port amount.h #1937 (@div72)
- refactor: Normalize boost::filesystem to fs namespace #1942 (@cyrossignol)
- accrual: Apply accrual for new CPIDs from existing snapshots #1944 (@cyrossignol)
- accrual: Reset research account when disconnecting first block #1947 (@cyrossignol)

### Removed
- refactor: Clean up transitional code for block version 11 #1933 (@cyrossignol)

### Fixed
- Modify depends packages for openSUSE and other Redhat like distributions and fix mingw bdb53 compile #1932 (@jamescowens)
- contract: Fix ability to reorganize contracts #1934 (@cyrossignol)
- accrual: Fix snapshot accrual for new CPIDs #1931 (@cyrossignol)
- rpc: Clean up getblockstats #1938 (@jamescowens)
- scraper, rpc: Correct missing mScraperStats initialization in ConvergedScraperStats (@jamescowens)

## [5.0.2.0] 2020-10-08, leisure
### Added
- trivial: Add and update copyright headers in Gridcoin files #1897 (@cyrossignol)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 5)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
Expand Down
1 change: 1 addition & 0 deletions depends/packages/bdb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $(package)_build_subdir=build_unix

define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts+=--libdir=$($($(package)_type)_prefix)/lib
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
Expand Down
2 changes: 2 additions & 0 deletions depends/packages/bdb53.mk
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $(package)_build_subdir=build_unix

define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts+=--libdir=$($($(package)_type)_prefix)/lib
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
Expand All @@ -20,6 +21,7 @@ endef
define $(package)_preprocess_cmds
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' src/dbinc/atomic.h && \
sed -i.old 's/atomic_init/atomic_init_db/' src/dbinc/atomic.h src/mp/mp_region.c src/mp/mp_mvcc.c src/mp/mp_fget.c src/mutex/mut_method.c src/mutex/mut_tas.c && \
sed -i.old "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h && \
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist
endef

Expand Down
Empty file modified depends/packages/boost.mk
100755 → 100644
Empty file.
Empty file modified depends/packages/bzip2.mk
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion depends/packages/curl.mk
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ define $(package)_set_vars
$(package)_config_opts=--disable-shared
$(package)_config_opts+= --enable-static
$(package)_config_opts+= --without-brotli
$(package)_config_opts+= --libdir=$($($(package)_type)_prefix)/lib
$(package)_config_opts_release+=--disable-debug-mode
$(package)_config_opts_linux+=--with-pic
# Disable OpenSSL for Windows and use native SSL stack (SSPI/Schannel):
$(package)_config_opts_mingw32+= --with-winssl --without-ssl
# This extra flag for macOS is necesarry as curl will append a -mmacosx-version-min=10.8 otherwise
# This extra flag for macOS is necessary as curl will append a -mmacosx-version-min=10.8 otherwise
# which will cause the linker to fail as it cannot optimize away a __builtin_available(MacOS 10.11...) call
# which requires a link to compiler runtime library.
$(package)_cflags_darwin=-mmacosx-version-min=$(OSX_MIN_VERSION)
Expand Down
4 changes: 3 additions & 1 deletion depends/packages/libzip.mk
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ define $(package)_preprocess_cmds
endef

define $(package)_config_cmds
$($(package)_build_opts) CFLAGS=$(i686_cflag) ./configure --host=$(host) --prefix=$(host_prefix) --with-zlib=$(host_prefix) --with-bzip2=$(host_prefix) --with-pic --enable-static --enable-shared=no
$($(package)_build_opts) CFLAGS=$(i686_cflag) ./configure --host=$(host) \
--prefix=$(host_prefix) --with-zlib=$(host_prefix) --with-bzip2=$(host_prefix) \
--with-pic --enable-static --enable-shared=no --libdir=$($($(package)_type)_prefix)/lib
endef

define $(package)_build_cmds
Expand Down
Empty file modified depends/packages/native_ccache.mk
100755 → 100644
Empty file.
Empty file modified depends/packages/openssl.mk
100755 → 100644
Empty file.
Empty file modified depends/packages/packages.mk
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion depends/packages/qrencode.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5

define $(package)_set_vars
$(package)_config_opts=--disable-shared -without-tools --disable-sdltest
$(package)_config_opts=--disable-shared -without-tools --disable-sdltest --libdir="$($($(package)_type)_prefix)/lib"
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags_aarch64_linux = $(GCCFLAGS)
$(package)_cflags_aarch64_linux = $(GCCFLAGS)
Expand Down
Empty file modified depends/packages/zlib.mk
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion doc/build-openbsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ config_opts="runtime-link=shared threadapi=pthread threading=multi link=static v

BerkeleyDB is only necessary for the wallet functionality. To skip this, pass `--disable-wallet` to `./configure`.

See "Berkeley DB" in [build_unix.md](build_unix.md) for instructions on how to build BerkeleyDB 4.8.
See "Berkeley DB" in [build-unix.md](build-unix.md) for instructions on how to build BerkeleyDB 4.8.
You cannot use the BerkeleyDB library from ports, for the same reason as boost above (g++/libstd++ incompatibility).

```bash
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ GRIDCOIN_CORE_H = \
addrdb.h \
addrman.h \
alert.h \
amount.h \
arith_uint256.h \
attributes.h \
banman.h \
Expand Down
29 changes: 29 additions & 0 deletions src/amount.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_AMOUNT_H
#define BITCOIN_AMOUNT_H

#include <stdint.h>

/** Amount in halfords (Can be negative) */
typedef int64_t CAmount;

static const CAmount COIN = 100000000;
static const CAmount CENT = 1000000;

/** No amount larger than this (in Halford) is valid.
*
* Note that this constant is *not* the total money supply, which in Gridcoin
* currently happens to be less than 2,000,000,000 GRC for various reasons, but
* rather a sanity check. As this sanity check is used by consensus-critical
* validation code, the exact value of the MAX_MONEY constant is consensus
* critical; in unusual circumstances like a overflow bug that allowed
* for the creation of coins out of thin air modification could lead to a fork.
* */
static const CAmount MAX_MONEY = 2000000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

#endif // BITCOIN_AMOUNT_H
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class CMainParams : public CChainParams {
{1800000, uint256S("0x61bb76ed90de21016de81855d3dc01bd192d17d90de4bdf62e8203c2dde675d7")},
{1900000, uint256S("0x352ca52f9a22fbf1d241082d3bec716ea5bef6b82811f737ae6486bd7771e1c7")},
{2000000, uint256S("0x2e1252a6ed6d0e7e556d4d0377b10f4b542ae5d6c9822cb08d68490a2a0bb706")},
{2054000, uint256S("0xfa1342b4076ca65be64abd7f9cea50cbbdb6247a6937f1f02d6e76494aab20bf")},
}
};

}
};

Expand Down
5 changes: 5 additions & 0 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,8 @@ inline int GetSuperblockAgeSpacing(int nHeight)
{
return (fTestNet ? 86400 : (nHeight > 364500) ? 86400 : 43200);
}

inline int GetNewbieSnapshotFixHeight()
{
return fTestNet ? 1393000 : 2104000;
}
13 changes: 9 additions & 4 deletions src/gridcoin/account.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include "amount.h"
#include <boost/optional.hpp>
#include <unordered_map>

Expand Down Expand Up @@ -32,8 +33,8 @@ typedef boost::optional<const CBlockIndex*> BlockPtrOption;
class ResearchAccount
{
public:
int64_t m_accrual; //!< Research accrued last superblock.
int64_t m_total_research_subsidy; //!< Total lifetime research paid.
CAmount m_accrual; //!< Research accrued last superblock.
CAmount m_total_research_subsidy; //!< Total lifetime research paid.
uint32_t m_total_magnitude; //!< Total lifetime magnitude sum.
uint32_t m_accuracy; //!< Non-zero magnitude payment count.

Expand All @@ -43,8 +44,12 @@ class ResearchAccount
//!
//! \brief Initialize an empty research account.
//!
ResearchAccount()
: m_accrual(0)
//! \param accrual Research reward accrued as of the last superblock. New
//! accounts may carry pending accrual even though the CPIDs never staked
//! a block before.
//!
ResearchAccount(const CAmount accrual = 0)
: m_accrual(accrual)
, m_total_research_subsidy(0)
, m_total_magnitude(0)
, m_accuracy(0)
Expand Down
13 changes: 7 additions & 6 deletions src/gridcoin/accrual/computer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include "amount.h"
#include "gridcoin/account.h"

#include <memory>
Expand All @@ -26,7 +27,7 @@ class IAccrualComputer
//!
//! \return Max reward allowed in units of 1/100000000 GRC.
//!
virtual int64_t MaxReward() const = 0;
virtual CAmount MaxReward() const = 0;

//!
//! \brief Get the magnitude unit factored into the reward calculation.
Expand Down Expand Up @@ -60,14 +61,14 @@ class IAccrualComputer
//!
//! \return Average research payment in units of 1/100000000 GRC.
//!
virtual int64_t PaymentPerDay() const = 0;
virtual CAmount PaymentPerDay() const = 0;

//!
//! \brief Get the average daily research payment limit of the account.
//!
//! \return Payment per day limit in units of 1/100000000 GRC.
//!
virtual int64_t PaymentPerDayLimit() const = 0;
virtual CAmount PaymentPerDayLimit() const = 0;

//!
//! \brief Determine whether the account exceeded the daily payment limit.
Expand All @@ -83,23 +84,23 @@ class IAccrualComputer
//!
//! \return Expected daily payment in units of 1/100000000 GRC.
//!
virtual int64_t ExpectedDaily() const = 0;
virtual CAmount ExpectedDaily() const = 0;

//!
//! \brief Get the pending research reward for the account without applying
//! any limit rules.
//!
//! \return Pending payment in units of 1/100000000 GRC.
//!
virtual int64_t RawAccrual() const = 0;
virtual CAmount RawAccrual() const = 0;

//!
//! \brief Get the pending research reward for the account as expected by
//! the network.
//!
//! \return Pending payment in units of 1/100000000 GRC.
//!
virtual int64_t Accrual() const = 0;
virtual CAmount Accrual() const = 0;
};

//!
Expand Down
13 changes: 7 additions & 6 deletions src/gridcoin/accrual/newbie.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include "amount.h"
#include "gridcoin/accrual/computer.h"
#include "gridcoin/beacon.h"

Expand Down Expand Up @@ -43,7 +44,7 @@ class NewbieAccrualComputer : public IAccrualComputer
{
}

int64_t MaxReward() const override
CAmount MaxReward() const override
{
return 500 * COIN;
}
Expand Down Expand Up @@ -72,12 +73,12 @@ class NewbieAccrualComputer : public IAccrualComputer
return 0;
}

int64_t PaymentPerDay() const override
CAmount PaymentPerDay() const override
{
return 0;
}

int64_t PaymentPerDayLimit() const override
CAmount PaymentPerDayLimit() const override
{
return MaxReward();
}
Expand All @@ -87,17 +88,17 @@ class NewbieAccrualComputer : public IAccrualComputer
return RawAccrual() > PaymentPerDayLimit();
}

int64_t ExpectedDaily() const override
CAmount ExpectedDaily() const override
{
return m_magnitude * m_magnitude_unit * COIN;
}

int64_t RawAccrual() const override
CAmount RawAccrual() const override
{
return AccrualDays() * ExpectedDaily();
}

int64_t Accrual() const override
CAmount Accrual() const override
{
if (m_magnitude <= 0) {
return 0;
Expand Down
13 changes: 7 additions & 6 deletions src/gridcoin/accrual/null.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include "amount.h"
#include "gridcoin/accrual/computer.h"

namespace {
Expand All @@ -20,7 +21,7 @@ class NullAccrualComputer : public IAccrualComputer
// See IAccrualComputer for inherited API documentation.

public:
int64_t MaxReward() const override
CAmount MaxReward() const override
{
return 0;
}
Expand All @@ -45,12 +46,12 @@ class NullAccrualComputer : public IAccrualComputer
return 0;
}

int64_t PaymentPerDay() const override
CAmount PaymentPerDay() const override
{
return 0;
}

int64_t PaymentPerDayLimit() const override
CAmount PaymentPerDayLimit() const override
{
return 0;
}
Expand All @@ -60,17 +61,17 @@ class NullAccrualComputer : public IAccrualComputer
return false;
}

int64_t ExpectedDaily() const override
CAmount ExpectedDaily() const override
{
return 0;
}

int64_t RawAccrual() const override
CAmount RawAccrual() const override
{
return 0;
}

int64_t Accrual() const override
CAmount Accrual() const override
{
return 0;
}
Expand Down
Loading

0 comments on commit d4990f8

Please sign in to comment.