Skip to content

Commit

Permalink
Merge branch 'development' into testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Jan 29, 2024
2 parents 84651c9 + bc4fb57 commit ef6a8d4
Show file tree
Hide file tree
Showing 114 changed files with 6,864 additions and 1,825 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
run: |
./ci/test_run_all.sh
test-macos:
name: macOS 11 native [GOAL install] [GUI] [no depends]
runs-on: macos-11
name: macOS 12 native [GOAL install] [GUI] [no depends]
runs-on: macos-12
env:
DANGER_RUN_CI_ON_HOST: true
CI_USE_APT_INSTALL: no
Expand Down
13 changes: 13 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ fi
command -v autoreconf >/dev/null || \
(echo "configuration failed, please install autoconf first" && exit 1)
autoreconf --install --force --warnings=all

if expr "'$(build-aux/config.guess --timestamp)" \< "'$(depends/config.guess --timestamp)" > /dev/null; then
chmod ug+w build-aux/config.guess
chmod ug+w src/secp256k1/build-aux/config.guess
cp depends/config.guess build-aux
cp depends/config.guess src/secp256k1/build-aux
fi
if expr "'$(build-aux/config.sub --timestamp)" \< "'$(depends/config.sub --timestamp)" > /dev/null; then
chmod ug+w build-aux/config.sub
chmod ug+w src/secp256k1/build-aux/config.sub
cp depends/config.sub build-aux
cp depends/config.sub src/secp256k1/build-aux
fi
9 changes: 7 additions & 2 deletions ci/test_run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@

export LC_ALL=C.UTF-8

# latest_stage.log will contain logs for a silenced stage if it
# fails.
trap "cat latest_stage.log" EXIT

set -o errexit; source ./ci/test/00_setup_env.sh
set -o errexit; source ./ci/test/03_before_install.sh
set -o errexit; source ./ci/test/04_install.sh &> 04.log || (cat 04.log && exit 1)
set -o errexit; source ./ci/test/05_before_script.sh &> 05.log || (cat 05.log && exit 1)
set -o errexit; source ./ci/test/04_install.sh &> latest_stage.log
set -o errexit; source ./ci/test/05_before_script.sh &> latest_stage.log
echo -n > latest_stage.log
set -o errexit; source ./ci/test/06_script_a.sh
set -o errexit; source ./ci/test/06_script_b.sh
7 changes: 4 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 5)
define(_CLIENT_VERSION_MINOR, 4)
define(_CLIENT_VERSION_REVISION, 5)
define(_CLIENT_VERSION_BUILD, 4)
define(_CLIENT_VERSION_BUILD, 5)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_YEAR, 2024)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Gridcoin]])
AC_INIT([Gridcoin],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/gridcoin/Gridcoin-Research/issues],[gridcoin],[https://gridcoin.us/])
Expand Down Expand Up @@ -664,7 +664,8 @@ if test "$use_hardening" != "no"; then

case $host in
*mingw*)
dnl stack-clash-protection doesn't currently work, and likely should just be skipped for Windows.
dnl stack-clash-protection doesn't compile with GCC 10 and earlier.
dnl In any case, it is a no-op for Windows.
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.
;;
*)
Expand Down
1 change: 1 addition & 0 deletions depends/packages/fontconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $(package)_patches=gperf_header_regen.patch
define $(package)_set_vars
$(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_cflags += -Wno-implicit-function-declaration
endef

define $(package)_preprocess_cmds
Expand Down
4 changes: 0 additions & 4 deletions depends/packages/native_clang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ $(package)_download_file=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubunt
$(package)_file_name=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz
$(package)_sha256_hash=48b83ef827ac2c213d5b64f5ad7ed082c8bcb712b46644e0dc5045c6f462c231

define $(package)_preprocess_cmds
rm -f $($(package)_extract_dir)/lib/libc++abi.so*
endef

define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include && \
mkdir -p $($(package)_staging_prefix_dir)/bin && \
Expand Down
4 changes: 2 additions & 2 deletions depends/packages/zlib.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package=zlib
$(package)_version=1.3
$(package)_version=1.3.1
$(package)_download_path=https://www.zlib.net
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23

define $(package)_set_vars
$(package)_config_opts= CC="$($(package)_cc)"
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ add_library(gridcoin_util STATIC
gridcoin/scraper/scraper.cpp
gridcoin/scraper/scraper_net.cpp
gridcoin/scraper/scraper_registry.cpp
gridcoin/sidestake.cpp
gridcoin/staking/difficulty.cpp
gridcoin/staking/exceptions.cpp
gridcoin/staking/kernel.cpp
Expand Down
8 changes: 6 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ GRIDCOIN_CORE_H = \
attributes.h \
banman.h \
base58.h \
bignum.h \
chainparams.h \
chainparamsbase.h \
checkpoints.h \
Expand Down Expand Up @@ -130,6 +129,7 @@ GRIDCOIN_CORE_H = \
gridcoin/scraper/scraper.h \
gridcoin/scraper/scraper_net.h \
gridcoin/scraper/scraper_registry.h \
gridcoin/sidestake.h \
gridcoin/staking/chain_trust.h \
gridcoin/staking/difficulty.h \
gridcoin/staking/exceptions.h \
Expand Down Expand Up @@ -259,6 +259,7 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
gridcoin/scraper/scraper.cpp \
gridcoin/scraper/scraper_net.cpp \
gridcoin/scraper/scraper_registry.cpp \
gridcoin/sidestake.cpp \
gridcoin/staking/difficulty.cpp \
gridcoin/staking/exceptions.cpp \
gridcoin/staking/kernel.cpp \
Expand Down Expand Up @@ -358,6 +359,7 @@ nodist_libgridcoin_util_a_SOURCES = $(srcdir)/obj/build.h


# crypto primitives library
crypto_libgridcoin_crypto_base_a_CFLAGS = $(AM_CFLAGS) $(PIE_FLAGS)
crypto_libgridcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS)
crypto_libgridcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crypto_libgridcoin_crypto_base_a_SOURCES = \
Expand All @@ -383,7 +385,9 @@ crypto_libgridcoin_crypto_base_a_SOURCES = \
crypto/sha512.cpp \
crypto/sha512.h \
crypto/siphash.cpp \
crypto/siphash.h
crypto/siphash.h \
gridcoin/md5.c \
gridcoin/md5.h

if USE_ASM
crypto_libgridcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
Expand Down
7 changes: 7 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ QT_FORMS_UI = \
qt/forms/consolidateunspentwizardsendpage.ui \
qt/forms/diagnosticsdialog.ui \
qt/forms/editaddressdialog.ui \
qt/forms/editsidestakedialog.ui \
qt/forms/favoritespage.ui \
qt/forms/intro.ui \
qt/forms/mrcrequestpage.ui \
Expand Down Expand Up @@ -143,6 +144,7 @@ QT_MOC_CPP = \
qt/moc_csvmodelwriter.cpp \
qt/moc_diagnosticsdialog.cpp \
qt/moc_editaddressdialog.cpp \
qt/moc_editsidestakedialog.cpp \
qt/moc_favoritespage.cpp \
qt/moc_guiutil.cpp \
qt/moc_intro.cpp \
Expand All @@ -161,6 +163,7 @@ QT_MOC_CPP = \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
qt/moc_sidestaketablemodel.cpp \
qt/moc_signverifymessagedialog.cpp \
qt/moc_trafficgraphwidget.cpp \
qt/moc_transactiondesc.cpp \
Expand Down Expand Up @@ -249,6 +252,7 @@ GRIDCOINRESEARCH_QT_H = \
qt/decoration.h \
qt/diagnosticsdialog.h \
qt/editaddressdialog.h \
qt/editsidestakedialog.h \
qt/favoritespage.h \
qt/guiconstants.h \
qt/guiutil.h \
Expand Down Expand Up @@ -285,6 +289,7 @@ GRIDCOINRESEARCH_QT_H = \
qt/rpcconsole.h \
qt/sendcoinsdialog.h \
qt/sendcoinsentry.h \
qt/sidestaketablemodel.h \
qt/signverifymessagedialog.h \
qt/trafficgraphwidget.h \
qt/transactiondesc.h \
Expand Down Expand Up @@ -340,6 +345,7 @@ GRIDCOINRESEARCH_QT_CPP = \
qt/decoration.cpp \
qt/diagnosticsdialog.cpp \
qt/editaddressdialog.cpp \
qt/editsidestakedialog.cpp \
qt/favoritespage.cpp \
qt/guiutil.cpp \
qt/intro.cpp \
Expand Down Expand Up @@ -372,6 +378,7 @@ GRIDCOINRESEARCH_QT_CPP = \
qt/rpcconsole.cpp \
qt/sendcoinsdialog.cpp \
qt/sendcoinsentry.cpp \
qt/sidestaketablemodel.cpp \
qt/signverifymessagedialog.cpp \
qt/trafficgraphwidget.cpp \
qt/transactiondesc.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ GRIDCOIN_TESTS =\
test/base32_tests.cpp \
test/base58_tests.cpp \
test/base64_tests.cpp \
test/bignum_tests.cpp \
test/bip32_tests.cpp \
test/compilerbug_tests.cpp \
test/crypto_tests.cpp \
Expand All @@ -57,6 +56,7 @@ GRIDCOIN_TESTS =\
test/gridcoin/protocol_tests.cpp \
test/gridcoin/researcher_tests.cpp \
test/gridcoin/scraper_registry_tests.cpp \
test/gridcoin/sidestake_tests.cpp \
test/gridcoin/superblock_tests.cpp \
test/key_tests.cpp \
test/merkle_tests.cpp \
Expand Down
21 changes: 20 additions & 1 deletion src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <uint256.h>
#include <crypto/common.h>
#include <util/strencodings.h>


template <unsigned int BITS>
Expand Down Expand Up @@ -146,7 +147,13 @@ double base_uint<BITS>::getdouble() const
template <unsigned int BITS>
std::string base_uint<BITS>::GetHex() const
{
return ArithToUint256(*this).GetHex();
static constexpr ssize_t BYTES = BITS / 8;

uint8_t pn_rev[BYTES];
for (int i = 0; i < BYTES; ++i) {
pn_rev[i] = ((uint8_t*)&pn)[BYTES - 1 - i];
}
return HexStr(pn_rev);
}

template <unsigned int BITS>
Expand Down Expand Up @@ -257,3 +264,15 @@ arith_uint256 UintToArith256(const uint256 &a)
b.pn[x] = ReadLE32(a.begin() + x*4);
return b;
}

// Explicit instantiations for base_uint<320>
template base_uint<320>& base_uint<320>::operator<<=(unsigned int);
template base_uint<320>& base_uint<320>::operator*=(const base_uint<320>& b);
template int base_uint<320>::CompareTo(const base_uint<320>&) const;
template std::string base_uint<320>::GetHex() const;

arith_uint320::arith_uint320(const uint256& b) {
std::memset(pn, 0, sizeof(pn));
std::memcpy(pn, b.data(), b.size());
}

17 changes: 17 additions & 0 deletions src/arith_uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <string>

class uint256;
class arith_uint320;

class uint_error : public std::runtime_error {
public:
Expand Down Expand Up @@ -279,6 +280,22 @@ class arith_uint256 : public base_uint<256> {

friend uint256 ArithToUint256(const arith_uint256 &);
friend arith_uint256 UintToArith256(const uint256 &);
friend class arith_uint320;
};

/** 320-bit unsigned big integer. */
class arith_uint320 : public base_uint<320> {
public:
arith_uint320() {}
arith_uint320(const base_uint<320>& b) : base_uint<320>(b) {}
arith_uint320(uint64_t b) : base_uint<320>(b) {}

arith_uint320(const arith_uint256& b) {
std::memset(pn, 0, sizeof(pn));
std::memcpy(pn, b.pn, sizeof(b.pn));
}

arith_uint320(const uint256& b);
};

uint256 ArithToUint256(const arith_uint256 &);
Expand Down
Loading

0 comments on commit ef6a8d4

Please sign in to comment.