diff --git a/CMakeLists.txt b/CMakeLists.txt index 1685f0a7c..460c51b16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,129 +1,129 @@ # Copyright (c) 2017 The Bitcoin developers cmake_minimum_required(VERSION 3.16) set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/cmake/modules/OverrideInitFlags.cmake" ) project(bitcoin-abc - VERSION 0.22.13 + VERSION 0.23.0 DESCRIPTION "Bitcoin ABC is a full node implementation of the Bitcoin Cash protocol." HOMEPAGE_URL "https://www.bitcoinabc.org" ) add_custom_target(print-version COMMENT "Print the current ${PROJECT_NAME} version" COMMAND "${CMAKE_COMMAND}" -E echo "${PROJECT_VERSION}" ) # Package information set(PACKAGE_NAME "Bitcoin ABC") set(PACKAGE_BUGREPORT "https://github.com/Bitcoin-ABC/bitcoin-abc/issues") # Copyright set(COPYRIGHT_YEAR 2021) set(COPYRIGHT_HOLDERS "The %s developers") set(COPYRIGHT_HOLDERS_SUBSTITUTION Bitcoin) string(REPLACE "%s" ${COPYRIGHT_HOLDERS_SUBSTITUTION} COPYRIGHT_HOLDERS_FINAL ${COPYRIGHT_HOLDERS}) # Add path for custom modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) # Make contrib script accessible. set(CONTRIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/contrib) # Default to RelWithDebInfo configuration if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Select the configuration for the build" FORCE) set(__NO_USER_CMAKE_BUILD_TYPE ON CACHE BOOL "True if the user didn't set a build type on the command line") endif() # Find the python interpreter. This is required for several targets. find_package(Python 3.5 COMPONENTS Interpreter REQUIRED) # Add the magic targets `check-*` add_custom_target(check-all) add_custom_target(check) add_custom_target(check-extended) add_custom_target(check-upgrade-activated) add_custom_target(check-upgrade-activated-extended) # Add the global install targets add_custom_target(install-all) add_custom_target(install-debug) add_custom_target(install-all-debug) include(PackageHelper) exclude_git_ignored_files_from_source_package() # Ignore hidden files and directories (starting with a '.') set_property(GLOBAL APPEND PROPERTY SOURCE_PACKAGE_IGNORE_FILES "/\\\\.") # If the build is out-of-tree, then the build directory can be ignored. if(NOT CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) set_property(GLOBAL APPEND PROPERTY SOURCE_PACKAGE_IGNORE_FILES "${CMAKE_BINARY_DIR}/" ) endif() exclude_from_source_package( # Subdirectories "arcanist/" "depends/" # Files "[^.]+[.]md$" ) option(ENABLE_COVERAGE "Enable coverage" OFF) option(ENABLE_BRANCH_COVERAGE "Enable branch coverage" OFF) if(ENABLE_COVERAGE) include(Coverage) enable_coverage(${ENABLE_BRANCH_COVERAGE}) include(AddCompilerFlags) # If no build type is manually defined, override the optimization level. # Otherwise, alert the user than the coverage result might be useless. if(__NO_USER_CMAKE_BUILD_TYPE) set_c_optimization_level(0) # Setting -Og instead of -O0 is a workaround for the GCC bug 90380: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90380 # # This bug is fixed upstream, but is not widely distributed yet. # Fixed in GCC versions: # - GCC 7.x: versions <= 7.2 are unaffected # - GCC 8.x: versions >= 8.3.1 # - GCC 9.x: versions >= 9.1.1 # - GCC 10.x: all versions set_cxx_optimization_level(g) else() message(WARNING "It is advised to not enforce CMAKE_BUILD_TYPE to get the best coverage results") endif() exclude_from_coverage( "depends" "src/bench" "src/crypto/ctaes" "src/leveldb" "src/univalue" ) add_custom_target_coverage(check) add_custom_target_coverage(check-all) add_custom_target_coverage(check-extended) add_custom_target_coverage(check-upgrade-activated) add_custom_target_coverage(check-upgrade-activated-extended) endif() add_subdirectory(src) add_subdirectory(test) add_subdirectory(contrib) add_subdirectory(doc) include(PackageOptions.cmake) diff --git a/contrib/aur/bitcoin-abc-qt/PKGBUILD b/contrib/aur/bitcoin-abc-qt/PKGBUILD index d5a5fc269..f3e105db7 100644 --- a/contrib/aur/bitcoin-abc-qt/PKGBUILD +++ b/contrib/aur/bitcoin-abc-qt/PKGBUILD @@ -1,103 +1,103 @@ # Maintainer: Josh Ellithorpe pkgname=bitcoin-abc-qt -pkgver=0.22.13 +pkgver=0.23.0 pkgrel=0 pkgdesc="Bitcoin ABC with bitcoind, bitcoin-cli, bitcoin-tx, bitcoin-seeder and bitcoin-qt" arch=('i686' 'x86_64') url="https://bitcoinabc.org" depends=('boost-libs' 'libevent' 'desktop-file-utils' 'qt5-base' 'protobuf' 'openssl' 'miniupnpc' 'zeromq' 'qrencode' 'jemalloc') makedepends=('cmake' 'ninja' 'boost' 'qt5-tools' 'python' 'help2man' 'xorg-server-xvfb') license=('MIT') source=(https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v$pkgver.tar.gz bitcoin.conf bitcoin.logrotate bitcoin.service bitcoin-reindex.service bitcoin.install) backup=('etc/bitcoin/bitcoin.conf' 'etc/logrotate.d/bitcoin') provides=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-qt' 'bitcoin-seeder' 'bitcoin-wallet') conflicts=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-qt' 'bitcoin-seeder' 'bitcoin-wallet') install=bitcoin.install build() { cd "$srcdir/bitcoin-abc-$pkgver" msg2 'Building...' mkdir -p build pushd build cmake -GNinja .. \ -DENABLE_CLANG_TIDY=OFF \ -DCLIENT_VERSION_IS_RELEASE=ON \ -DENABLE_REDUCE_EXPORTS=ON \ -DENABLE_STATIC_LIBSTDCXX=ON \ -DCMAKE_INSTALL_PREFIX=$pkgdir/usr ninja popd } check() { cd "$srcdir/bitcoin-abc-$pkgver/build" msg2 'Testing...' ninja check } package() { cd "$srcdir/bitcoin-abc-$pkgver" msg2 'Installing desktop shortcut...' install -Dm644 contrib/debian/bitcoin-qt.desktop \ "$pkgdir"/usr/share/applications/bitcoin.desktop install -Dm644 share/pixmaps/bitcoin-abc128.png \ "$pkgdir"/usr/share/pixmaps/bitcoin-abc128.png msg2 'Installing license...' install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/${pkgname}" msg2 'Installing examples...' install -Dm644 "contrib/debian/examples/bitcoin.conf" \ -t "$pkgdir/usr/share/doc/bitcoin/examples" msg2 'Installing documentation...' install -dm 755 "$pkgdir/usr/share/doc/bitcoin" for _doc in \ $(find doc -maxdepth 1 -type f -name "*.md" -printf '%f\n') \ release-notes; do cp -dpr --no-preserve=ownership "doc/$_doc" \ "$pkgdir/usr/share/doc/bitcoin/$_doc" done msg2 'Installing essential directories' install -dm 700 "$pkgdir/etc/bitcoin" install -dm 755 "$pkgdir/srv/bitcoin" install -dm 755 "$pkgdir/run/bitcoin" pushd build msg2 'Installing executables...' ninja install/strip msg2 'Installing man pages...' xvfb-run ninja install-manpages popd msg2 'Installing bitcoin.conf...' install -Dm 600 "$srcdir/bitcoin.conf" -t "$pkgdir/etc/bitcoin" msg2 'Installing bitcoin.service...' install -Dm 644 "$srcdir/bitcoin.service" -t "$pkgdir/usr/lib/systemd/system" install -Dm 644 "$srcdir/bitcoin-reindex.service" \ -t "$pkgdir/usr/lib/systemd/system" msg2 'Installing bitcoin.logrotate...' install -Dm 644 "$srcdir/bitcoin.logrotate" "$pkgdir/etc/logrotate.d/bitcoin" msg2 'Installing bash completion...' for _compl in bitcoin-cli bitcoin-tx bitcoind; do install -Dm 644 "contrib/${_compl}.bash-completion" \ "$pkgdir/usr/share/bash-completion/completions/$_compl" done } diff --git a/contrib/aur/bitcoin-abc/PKGBUILD b/contrib/aur/bitcoin-abc/PKGBUILD index b41193910..736f4f8bc 100644 --- a/contrib/aur/bitcoin-abc/PKGBUILD +++ b/contrib/aur/bitcoin-abc/PKGBUILD @@ -1,99 +1,99 @@ # Maintainer: Josh Ellithorpe pkgname=bitcoin-abc -pkgver=0.22.13 +pkgver=0.23.0 pkgrel=0 pkgdesc="Bitcoin ABC with bitcoind, bitcoin-tx, bitcoin-seeder and bitcoin-cli" arch=('i686' 'x86_64') url="https://bitcoinabc.org" depends=('boost-libs' 'libevent' 'openssl' 'zeromq' 'miniupnpc' 'jemalloc') makedepends=('cmake' 'ninja' 'boost' 'python' 'help2man') license=('MIT') source=(https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v$pkgver.tar.gz bitcoin.conf bitcoin.logrotate bitcoin.service bitcoin-reindex.service bitcoin.install) backup=('etc/bitcoin/bitcoin.conf' 'etc/logrotate.d/bitcoin') provides=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-seeder') conflicts=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-seeder') install=bitcoin.install build() { cd "$srcdir/${pkgname}-$pkgver" msg2 'Building...' mkdir -p build pushd build cmake -GNinja .. \ -DENABLE_CLANG_TIDY=OFF \ -DCLIENT_VERSION_IS_RELEASE=ON \ -DENABLE_REDUCE_EXPORTS=ON \ -DENABLE_STATIC_LIBSTDCXX=ON \ -DBUILD_BITCOIN_WALLET=OFF \ -DBUILD_BITCOIN_QT=OFF \ -DCMAKE_INSTALL_PREFIX=$pkgdir/usr ninja popd } check() { cd "$srcdir/${pkgname}-$pkgver/build" msg2 'Testing...' ninja check } package() { cd "$srcdir/${pkgname}-$pkgver" msg2 'Installing license...' install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/${pkgname}" msg2 'Installing examples...' install -Dm644 "contrib/debian/examples/bitcoin.conf" \ -t "$pkgdir/usr/share/doc/bitcoin/examples" msg2 'Installing documentation...' install -dm 755 "$pkgdir/usr/share/doc/bitcoin" for _doc in \ $(find doc -maxdepth 1 -type f -name "*.md" -printf '%f\n') \ release-notes; do cp -dpr --no-preserve=ownership "doc/$_doc" \ "$pkgdir/usr/share/doc/bitcoin/$_doc" done msg2 'Installing essential directories' install -dm 700 "$pkgdir/etc/bitcoin" install -dm 755 "$pkgdir/srv/bitcoin" install -dm 755 "$pkgdir/run/bitcoin" pushd build msg2 'Installing executables...' ninja install/strip msg2 'Installing man pages...' ninja install-manpages popd msg2 'Installing bitcoin.conf...' install -Dm 600 "$srcdir/bitcoin.conf" -t "$pkgdir/etc/bitcoin" msg2 'Installing bitcoin.service...' install -Dm 644 "$srcdir/bitcoin.service" -t "$pkgdir/usr/lib/systemd/system" install -Dm 644 "$srcdir/bitcoin-reindex.service" \ -t "$pkgdir/usr/lib/systemd/system" msg2 'Installing bitcoin.logrotate...' install -Dm 644 "$srcdir/bitcoin.logrotate" "$pkgdir/etc/logrotate.d/bitcoin" msg2 'Installing bash completion...' for _compl in bitcoin-cli bitcoin-tx bitcoind; do install -Dm 644 "contrib/${_compl}.bash-completion" \ "$pkgdir/usr/share/bash-completion/completions/$_compl" done } diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py index 13652ceb1..89fa4e215 100755 --- a/contrib/seeds/makeseeds.py +++ b/contrib/seeds/makeseeds.py @@ -1,214 +1,214 @@ #!/usr/bin/env python3 # Copyright (c) 2013-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Generate seeds.txt from Pieter's DNS seeder # import collections import dns.resolver import re import sys NSEEDS = 512 MAX_SEEDS_PER_ASN = 2 MIN_BLOCKS = 540000 # These are hosts that have been observed to be behaving strangely (e.g. # aggressively connecting to every node). SUSPICIOUS_HOSTS = { "23.92.36.9", "72.36.89.11", "130.211.129.106", "178.63.107.226", "83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6", "54.173.72.127", "54.174.10.182", "54.183.64.54", "54.194.231.211", "54.66.214.167", "54.66.220.137", "54.67.33.14", "54.77.251.214", "54.94.195.96", "54.94.200.247" } PATTERN_IPV4 = re.compile( r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$") PATTERN_ONION = re.compile( r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$") # Used to only select nodes with a user agent string compatible with the # BCH/UAHF specification. -PATTERN_AGENT = re.compile(r"^(/Bitcoin ABC:0.(22).(\d+)\(.+\)/)") +PATTERN_AGENT = re.compile(r"^(/Bitcoin ABC:0.(22|23).(\d+)\(.+\)/)") def parseline(line): sline = line.split() if len(sline) < 11: return None # The user agent is at the end of the line. It may contain space, so we # concatenate. for i in range(12, len(sline)): sline[11] += ' ' + sline[i] # Remove leftovers del sline[12:] m = PATTERN_IPV4.match(sline[0]) sortkey = None ip = None if m is None: m = PATTERN_IPV6.match(sline[0]) if m is None: m = PATTERN_ONION.match(sline[0]) if m is None: return None else: net = 'onion' ipstr = sortkey = m.group(1) port = int(m.group(2)) else: net = 'ipv6' # Not interested in localhost if m.group(1) in ['::']: return None ipstr = m.group(1) # XXX parse IPv6 into number, could use name_to_ipv6 from # generate-seeds sortkey = ipstr port = int(m.group(2)) else: # Do IPv4 sanity check ip = 0 for i in range(0, 4): if int(m.group(i + 2)) < 0 or int(m.group(i + 2)) > 255: return None ip = ip + (int(m.group(i + 2)) << (8 * (3 - i))) if ip == 0: return None net = 'ipv4' sortkey = ip ipstr = m.group(1) port = int(m.group(6)) # Skip bad results. if sline[1] == 0: return None # Extract uptime %. uptime30 = float(sline[7][:-1]) # Extract Unix timestamp of last success. lastsuccess = int(sline[2]) # Extract protocol version. version = int(sline[10]) # Extract user agent. agent = sline[11][1:-1] # Extract service flags. service = int(sline[9], 16) # Extract blocks. blocks = int(sline[8]) # Construct result. return { 'net': net, 'ip': ipstr, 'port': port, 'ipnum': ip, 'uptime': uptime30, 'lastsuccess': lastsuccess, 'version': version, 'agent': agent, 'service': service, 'blocks': blocks, 'sortkey': sortkey, } def filtermultiport(ips): '''Filter out hosts with more nodes per IP''' hist = collections.defaultdict(list) for ip in ips: hist[ip['sortkey']].append(ip) return [value[0] for (key, value) in list(hist.items()) if len(value) == 1] # Based on Greg Maxwell's seed_filter.py def filterbyasn(ips, max_per_asn, max_total): # Sift out ips by type ips_ipv46 = [ip for ip in ips if ip['net'] in ['ipv4', 'ipv6']] ips_onion = [ip for ip in ips if ip['net'] == 'onion'] # Filter IPv46 by ASN result = [] asn_count = {} for ip in ips_ipv46: if len(result) == max_total: break try: if ip['net'] == 'ipv4': ipaddr = ip['ip'] prefix = '.origin' else: # http://www.team-cymru.com/IP-ASN-mapping.html # 2001:4860:b002:23::68 res = str() # pick the first 4 nibbles for nb in ip['ip'].split(':')[:4]: # right padded with '0' for c in nb.zfill(4): # 2001 4860 b002 0023 res += c + '.' # 2.0.0.1.4.8.6.0.b.0.0.2.0.0.2.3 ipaddr = res.rstrip('.') prefix = '.origin6' asn = int([x.to_text() for x in dns.resolver.query('.'.join( reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com', 'TXT').response.answer][0].split('\"')[1].split(' ')[0]) if asn not in asn_count: asn_count[asn] = 0 if asn_count[asn] == max_per_asn: continue asn_count[asn] += 1 result.append(ip) except Exception: sys.stderr.write( 'ERR: Could not resolve ASN for "' + ip['ip'] + '"\n') # Add back Onions result.extend(ips_onion) return result def main(): lines = sys.stdin.readlines() ips = [parseline(line) for line in lines] # Skip entries with valid address. ips = [ip for ip in ips if ip is not None] # Skip entries from suspicious hosts. ips = [ip for ip in ips if ip['ip'] not in SUSPICIOUS_HOSTS] # Enforce minimal number of blocks. ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS] # Require service bit 1. ips = [ip for ip in ips if (ip['service'] & 1) == 1] # Require at least 50% 30-day uptime. ips = [ip for ip in ips if ip['uptime'] > 50] # Require a known and recent user agent. ips = [ip for ip in ips if PATTERN_AGENT.match(ip['agent'])] # Sort by availability (and use last success as tie breaker) ips.sort(key=lambda x: (x['uptime'], x['lastsuccess'], x['ip']), reverse=True) # Filter out hosts with multiple bitcoin ports, these are likely abusive ips = filtermultiport(ips) # Look up ASNs and limit results, both per ASN and globally. ips = filterbyasn(ips, MAX_SEEDS_PER_ASN, NSEEDS) # Sort the results by IP address (for deterministic output). ips.sort(key=lambda x: (x['net'], x['sortkey'])) for ip in ips: if ip['net'] == 'ipv6': print('[{}]:{}'.format(ip['ip'], ip['port'])) else: print('{}:{}'.format(ip['ip'], ip['port'])) if __name__ == '__main__': main() diff --git a/doc/release-notes.md b/doc/release-notes.md index d11818a6e..d0574ab89 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,11 +1,7 @@ -# Bitcoin ABC 0.22.13 Release Notes +# Bitcoin ABC 0.23.0 Release Notes -Bitcoin ABC version 0.22.13 is now available from: +Bitcoin ABC version 0.23.0 is now available from: - + This release includes the following features and fixes: - - Netmasks that contain 1-bits after 0-bits (the 1-bits are not contiguous on - the left side, e.g. 255.0.255.255) are no longer accepted. They are invalid - according to RFC 4632. Netmasks are used in the `-rpcallowip` and `-whitelist` - configuration options and in the `setban` RPC. diff --git a/doc/release-notes.md b/doc/release-notes/release-notes-0.22.13.md similarity index 100% copy from doc/release-notes.md copy to doc/release-notes/release-notes-0.22.13.md