Skip to content

Commit

Permalink
Merge 0.15.1 for the PoW hardfork
Browse files Browse the repository at this point in the history
  • Loading branch information
h4x3rotab committed Jun 21, 2018
2 parents 4f688f5 + 06b0b0e commit 99c1224
Show file tree
Hide file tree
Showing 25 changed files with 636 additions and 152 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

[![Build Status](https://travis-ci.org/BTCGPU/BTCGPU.svg?branch=master)](https://travis-ci.org/BTCGPU/BTCGPU)

Bitcoin Gold (codename BTCGPU) is a fork of the Bitcoin blockchain that will occur at block height 491407, at roughly 12:00:00 UTC October 25, 2017.
Bitcoin Gold (codename BTCGPU) began as a fork of Bitcoin after block height 491406 on Tue, 24 Oct 2017 01:17:35 GMT and began being mined as a separate chain at block height 491407 on Sun, 12 Nov 2017 13:34:01 GMT.

At the predetermined block height, Bitcoin Gold miners will begin creating blocks with a new proof-of-work algorithm, and this will cause a bifurcation of the Bitcoin blockchain. The original Bitcoin blockchain will continue on unaltered, but a new branch of the blockchain will split off from the original chain. The new branch is a distinct blockchain with the same transaction history as Bitcoin up until the fork, but then diverges from it. As a result of this process, a new cryptocurrency will be born.
The primary goal is to maintain a variant of Bitcoin that is more decentralized by using an ASIC-resistant Proof of Work algorithm, removing barriers to entry for new miners around the world and reducing the concentration of power in the hands of massive-scale mining operations.

Bitcoin Gold preserves and implements Bitcoin features such as SegWit. Significant differences at launch time included:

- ASIC-resistant GPU-minable PoW algorithm (Equihash)
- Per-block difficulty adjustment algorithm
- Replay protection (SIGHASH_FORK_ID)
- Unique wallet addresses (prefixes of G and A)

Although BTG was bootstrapped on 12 Nov to create an entirely new network, it contains the entire Bitcoin blockchain until block 491406. As a result, Bitcoin Gold became a full fork with all Bitcoin transaction history since 2009. Any Bitcoin wallet address which held Bitcoin in BTC block 491406 before the fork held an equal number of Bitcoin Gold in BTG block 491407 after the fork.

## Links

* Website: https://bitcoingold.org
* Tech Spec: https://github.com/BTCGPU/BTCGPU/wiki/Technical-Spec
* Slack: [invitation](https://join.slack.com/t/bitcoin-gold/shared_invite/enQtMjY1MzkzMzUxNjY4LWM1YmQ4MjZhZTQxMWE1ZDQyNjA4N2QwZTkyZjYzMjhiMzdlMmVkNjQ3NzZlZDdmMDE4NWIyY2JmYzdjYmE2MzA)
* Forum: https://forum.bitcoingold.org
* Discord: [invitation](https://discord.gg/HmVUU6S)
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 15)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down Expand Up @@ -727,12 +727,12 @@ AC_CHECK_LIB(sodium, sodium_init,[],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sodium.h>
], [
#if SODIUM_LIBRARY_VERSION_MAJOR < 9 || SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR < 5
#if SODIUM_LIBRARY_VERSION_MAJOR < 9 || SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR < 1
# error
#endif
])],
[AC_MSG_RESULT([checking for version of libsodium... yes])],
[AC_MSG_ERROR([Wrong libsodium: version >= 1.0.13 required])])
[AC_MSG_ERROR([Wrong libsodium: version >= 1.0.8 required])])

BITCOIN_QT_INIT

Expand Down
22 changes: 21 additions & 1 deletion contrib/gitian-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ then
# Linux
if [[ $linux = true ]]
then
echo ""
echo ""
echo "Compiling ${VERSION} Linux"
echo ""
./bin/gbuild -j ${proc} -m ${mem} --commit BTCGPU=${COMMIT} --url BTCGPU=${url} ../BTCGPU/contrib/gitian-descriptors/gitian-linux.yml
Expand All @@ -317,6 +317,26 @@ then
# Windows
if [[ $windows = true ]]
then
if [ ! -f inputs/nsis-win32-utils.zip ];
then
echo ""
echo "Starting Utilities build for Windows"
echo ""
./bin/gbuild -j ${proc} -m ${mem} --allow-sudo ../BTCGPU/contrib/gitian-descriptors/gitian-win-utils.yml
if [ $? -ne 0 ];
then
echo ""
echo "FAILED to build Utilities for Windows"
echo ""
exit 1
fi

cd inputs
cp -a ../build/out/*-utils.zip .
mv nsis-*-win32-utils.zip nsis-win32-utils.zip
cd ..
fi

echo ""
echo "Compiling ${VERSION} Windows"
echo ""
Expand Down
97 changes: 97 additions & 0 deletions contrib/gitian-descriptors/gitian-win-utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: "utils-windows"
sudo: true
suites:
- "trusty"
architectures:
- "amd64"
packages:
- "libtool"
- "automake"
- "libfaketime"
- "mingw-w64"
- "g++-mingw-w64"
- "zip"
- "unzip"
# Needed for compiling nsis.
- "scons"
- "libcppunit-dev"
- "zlib1g"
- "zlib1g-dev"
reference_datetime: "2016-01-01 00:00:00"
remotes: []
files: []
script: |
WRAP_DIR="$HOME/wrapped"
INSTDIR="$HOME/install"
NSIS_VER=3.03
NSIS_PACKAGE=nsis-${NSIS_VER}-src.tar.bz2
NSIS_DEBIAN_PACKAGE=nsis_${NSIS_VER}-2.debian.tar.xz
NSIS_HASH=abae7f4488bc6de7a4dd760d5f0e7cd3aad7747d4d7cd85786697c8991695eaa
NSIS_DEBIAN_HASH=b12956c561d7ad2e078561684a8a06c95c583c14c4d904ec93d252e2d2c2d75c
NSIS_URL=http://downloads.sourceforge.net/nsis/${NSIS_PACKAGE}
NSIS_DEBIAN_URL=http://http.debian.net/debian/pool/main/n/nsis/${NSIS_DEBIAN_PACKAGE}
echo "${REFERENCE_DATETIME}" | sudo tee --append /etc/faketimerc
echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" | sudo tee --append /etc/ld.so.preload
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
get() {
local file="$1"; shift
local url="$1"; shift
if ! wget --no-check-certificate -U "" -N "$url"; then
echo >&2 "Error: Cannot download $url"
mv "${file}" "${file}.DLFAILED"
exit 1
fi
}
dzip() {
export LC_ALL=C
ZIPFILE=${1:?}
shift
if [ -n "$REFERENCE_DATETIME" ]; then
find "$@" -exec touch --date="$REFERENCE_DATETIME" -- {} +
fi
find "$@" -executable -exec chmod 700 {} +
find "$@" ! -executable -exec chmod 600 {} +
find "$@" | sort | zip $ZIPOPTS -X -@ "$ZIPFILE"
}
for i in NSIS NSIS_DEBIAN
do
URL="${i}_URL"
PACKAGE="${i}_PACKAGE"
get "${!PACKAGE}" "${!URL}"
HASH="${i}_HASH"
if ! echo "${!HASH} ${!PACKAGE}" | sha256sum -c -; then
echo "Package hash for ${!PACKAGE} differs from our locally stored sha256!"
exit 1
fi
done
get Zlib-1.2.7-win32-x86.zip http://nsis.sourceforge.net/mediawiki/images/c/ca/Zlib-1.2.7-win32-x86.zip
unzip -d Zlib-1.2.7 Zlib-1.2.7-win32-x86.zip
# Building nsis
tar xf $NSIS_PACKAGE
cd nsis-${NSIS_VER}-src
tar xf ../$NSIS_DEBIAN_PACKAGE
scons VERSION=${NSIS_VER} SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=i686-w64-mingw32- ZLIB_W32=${HOME}/build/Zlib-1.2.7 PREFIX=$INSTDIR/nsis
scons VERSION=${NSIS_VER} SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=i686-w64-mingw32- ZLIB_W32=${HOME}/build/Zlib-1.2.7 PREFIX=$INSTDIR/nsis install
cd ..
# Grabbing the remaining results
cd $INSTDIR
dzip nsis-$NSIS_VER-win32-utils.zip nsis
cp nsis-$NSIS_VER-win32-utils.zip $OUTDIR/
9 changes: 7 additions & 2 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ packages:
- "bsdmainutils"
- "mingw-w64"
- "g++-mingw-w64"
- "nsis"
- "zip"
- "unzip"
- "ca-certificates"
- "python"
remotes:
- "url": "https://github.com/BTCGPU/BTCGPU.git"
"dir": "BTCGPU"
files: []
files:
- "nsis-win32-utils.zip"
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
Expand Down Expand Up @@ -94,6 +95,10 @@ script: |
done
}
# Extract nsis
unzip -d $HOME/install ${BUILD_DIR}/nsis-win32-utils.zip
export PATH=$HOME/install/nsis/bin:$PATH
# Faketime for depends so intermediate results are comparable
export PATH_orig=${PATH}
create_global_faketime_wrappers "2000-01-01 12:00:00"
Expand Down
2 changes: 1 addition & 1 deletion contrib/verify-commits/gpg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if ! $VALID; then
exit 1
fi
if $VALID && $REVSIG; then
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "^\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
echo "$GOODREVSIG"
else
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
Expand Down
17 changes: 17 additions & 0 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@ ZMQ dependencies (provides ZMQ API 4.x):

sudo apt-get install libzmq3-dev

3. On Ubuntu 16.04.3 you need to install the newest libsodium (at least 1.0.13)

configure: error: Wrong libsodium: version >= 1.0.13 required

I tested it with version 1.0.15 (from the `depends` directory) at it works.

$ cd BTCGPU
$ cd depends
$ make
$ cd ..
$ ./autogen.sh
$ ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
$ make
$ make install

The command `make install` installs the executables in the `./depends/x86_64-pc-linux-gnu/bin/` directory.

Dependencies for the GUI: Ubuntu & Debian
-----------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* Maximum amount of time that a block timestamp is allowed to exceed the
* current network-adjusted time before the block will be accepted.
*/
static const int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60;
static const int64_t BITCOIN_MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60;

/**
* Timestamp window used as a grace period by code that compares external
* timestamps (such as timestamps passed to RPCs, or wallet key creation times)
* to block timestamps. This should be set at least as high as
* MAX_FUTURE_BLOCK_TIME.
* BITCOIN_MAX_FUTURE_BLOCK_TIME.
*/
static const int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME;
static const int64_t TIMESTAMP_WINDOW = BITCOIN_MAX_FUTURE_BLOCK_TIME;

class CBlockFileInfo
{
Expand Down
Loading

0 comments on commit 99c1224

Please sign in to comment.