diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index d466b0e65..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,37 +0,0 @@ - - -This issue tracker is only for technical issues related to Avian. - -General ravencoin questions and/or support requests and are best directed to the [Avian Discord](https://discord.gg/xDDMYA2SqV). - -For reporting security issues, please direct message one of the core developers in discord. - -### Describe the issue - -### Can you reliably reproduce the issue? -#### If so, please list the steps to reproduce below: -1. -2. -3. - -### Expected behaviour -Tell us what should happen - -### Actual behaviour -Tell us what happens instead - -### Screenshots. -If the issue is related to the GUI, screenshots can be added to this issue via drag & drop. - -### What version of bitcoin-core are you using? -List the version number/commit ID, and if it is an official binary, self compiled or a distribution package such as PPA. - -### Machine specs: -- OS: -- CPU: -- RAM: -- Disk size: -- Disk Type (HD/SDD): - -### Any extra information that might be useful in the debugging process. -This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..df8c7c8a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: '[bug] ' +--- + + + + + + + +# Bug Report + +**Current behavior:** + + +**Expected behavior** + + +**Steps to reproduce:** + + +**Screenshots** + + +**Avian Core version** + + +**Machine specs** +- OS: +- CPU: +- RAM: +- Disk size: +- Disk Type (HD/SDD): + +**Extra information** + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..f9fda8fe4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,30 @@ +--- +name: Feature Request +about: Suggest an idea for this project +title: '[feat] ' +--- + + + + + + + +# Feature Request + +**Describe the Feature Request** + + +**Describe Preferred Solution** + + +**Describe Alternatives** + + +**Related Code** + + +**Additional Context** + diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8ca7ed259..d8e9abb08 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -36,27 +36,27 @@ jobs: include: - name: armhf-linux host: arm-linux-gnueabihf - os: ubuntu-18.04 + os: ubuntu-20.04 packages: g++-arm-linux-gnueabihf run-tests: false dep-opts: "" - config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" + config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports" goal: install - name: aarch64-linux host: aarch64-linux-gnu - os: ubuntu-18.04 + os: ubuntu-20.04 packages: g++-aarch64-linux-gnu run-tests: false dep-opts: "" - config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" + config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports" goal: install - name: x86_64-linux host: x86_64-unknown-linux-gnu - os: ubuntu-18.04 + os: ubuntu-20.04 packages: bc python3-zmq run-tests: false dep-opts: "" - config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" + config-opts: "--enable-gui=qt5 --enable-zmq --enable-glibc-back-compat --enable-reduce-exports" goal: install strip-cmd: "strip" - name: x86_64-win @@ -70,7 +70,7 @@ jobs: sudo update-binfmts --import /usr/share/binfmts/wine run-tests: false dep-opts: "" - config-opts: "--enable-reduce-exports --enable-gui=qt5" + config-opts: "--disable-shared --enable-gui=qt5" goal: install strip-cmd: "x86_64-w64-mingw32-strip" - name: x86_64-macos diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..1dba2022a --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,69 @@ +# CodeQL GH Actions file for Avian Core +name: CodeQL + +on: + push: + paths-ignore: + - '**/*.md' + - '**/*.txt' + - 'contrib' + - 'doc' + - 'share' + - 'test' + pull_request: + paths-ignore: + - '**/*.md' + - '**/*.txt' + - 'contrib' + - 'doc' + - 'share' + - 'test' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-18.04 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Update system + run: | + sudo apt-get update --yes + sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils --yes + - name: Dependency cache + uses: actions/cache@v2 + env: + cache-name: depends + with: + path: ./depends/built + key: codeql-${{ env.cache-name }}-${{ hashFiles('depends/packages/*') }} + + - name: Build depends + run: | + pushd depends + make -j4 HOST=x86_64-pc-linux-gnu + popd + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Build Avian Core + run: | + ./autogen.sh + ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu + make -j4 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.gitignore b/.gitignore index e3128aabd..577aaf8c3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ src/config/stamp-h1 share/setup.nsi share/qt/Info.plist src/config/avian-config.h - +src/config/avian-config.h.in src/qt/*.moc src/qt/moc_*.cpp @@ -124,3 +124,13 @@ contrib/devtools/split-debug.sh cmake-build-debug CMakeLists.txt + +# qtcreator +.qtc_clangd +Avian.cflags +Avian.config +Avian.creator +Avian.cxxflags +Avian.files +Avian.includes +Avian.creator.user diff --git a/COPYING b/COPYING index 0f18fde08..d2412ca96 100644 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ The MIT License (MIT) Copyright (c) 2009-2018 The Bitcoin Core developers Copyright (c) 2018 The Raven Core developers -Copyright (c) 2022 The Raven Core developers +Copyright (c) 2022 The Avian Core developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 485bddf3c..5c3e519e7 100644 --- a/README.md +++ b/README.md @@ -29,68 +29,95 @@ the Avian Core software, see https://avn.network Avian Core is released under the terms of the MIT license. See [COPYING](COPYING) for more information or see https://opensource.org/licenses/MIT. -# Development Process +# Development + +Avian is open source and community driven. The development process is publicly visible and anyone can contribute. + +### Branches + +There are **2** types of branches: + + - master: *Stable*, contains the code of the latest version. + - dev: *Unstable*, contains new code for planned releases. Format: ``, Example: `4.1` The `master` branch is regularly built and tested, but is not guaranteed to be completely stable. [Tags](https://github.com/AvianNetwork/Avian/tags) are created regularly to indicate new official, stable release versions of Avian Core. -The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md). +### Contributing -# Testing +If you find a bug with this software, please report it using the issue system. -Testing and code review is the bottleneck for development; we get more pull -requests than we can review and test on short notice. Please be patient and help out by testing -other people's pull requests, and remember this is a security-critical project where any mistake might cost people -lots of money. +The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md). -Testnet is now up and running and available to use during development. There is an issue when connecting to the testnet that requires the use of the -maxtipage parameter in order to connect to the test network initially. After the initial launch the -maxtipage parameter is not required. +### Running on Testnet -Use this command to initially start aviand on the testnet. ./aviand -testnet -maxtipage=259200 +Testnet is up and running and available to use during development. It is recommended to run the testnet using the `-maxtipage` parameter in order to connect to the test network if there has been no recently mined blocks. +Use this command to initially start `aviand` on the testnet. ./aviand -testnet -maxtipage=259200 -# Running on Mainnet +### Running on Mainnet -Use this command to start aviand on the mainnet. -./aviand -seednode=dnsseed.us.avn.network +Use this command to start `aviand` (CLI) on the mainnet. +./aviand + +Use this command to start `avian-qt` (GUI) on the mainnet. +./avian-qt # Building #### Linux ```shell -#The following packages are needed: +# The following packages are needed (Debian-based distros): sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl ``` ```shell +# Clone Avian repo git clone https://github.com/AvianNetwork/Avian -cd avian +cd Avian + +# Build Avian Core ./autogen.sh ./configure # -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use make -j8 -#This can take some time. + +# Note: This can take some time. ``` -#### OSX (Cross-compile using Linux) +#### Windows -Before start, read the following docs: [depends](https://github.com/bitcoin/bitcoin/blob/master/depends/README.md) and [macdeploy](https://github.com/bitcoin/bitcoin/blob/master/contrib/macdeploy/README.md). +Use a debian cross-compilation setup OR *mingw-w64* for windows and run: -Install dependencies: -``` -sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools libtinfo5 xorriso -``` +```shell +# If using linux cross-build (Debian-based distros) +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl cmake mingw-w64 -Place prepared SDK file `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz` in repo root, run `./zcutil/build-mac-cross.sh` in the terminal to build. +# Clone Avian repo +git clone https://github.com/AvianNetwork/Avian +cd Avian -#### OSX (Native) +# Build Avian Core +./autogen.sh +./configure +# -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use +make -j8 + +# Note: This can take some time. +``` + +#### OSX **(Native)** Ensure you have [brew](https://brew.sh) and Command Line Tools installed. + ```shell # Install brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + # Install Xcode, opens a pop-up window to install CLT without installing the entire Xcode package xcode-select --install + # Update brew and install dependencies brew update brew upgrade @@ -99,42 +126,30 @@ brew install binutils brew install protobuf brew install coreutils brew install wget + # Clone Avian repo git clone https://github.com/AvianNetwork/Avian -cd avian -./autogen.sh -./configure -# -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use -make -j8 -# This can take some time. -``` +cd Avian -#### Windows -Use a debian cross-compilation setup OR mingw for windows and run: -```shell -# if using linux cross-build -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl cmake mingw-w64 -git clone https://github.com/AvianNetwork/Avian -cd avian +# Build Avian Core ./autogen.sh ./configure # -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use make -j8 -#This can take some time. -``` - -# About Avian -A digital peer to peer network for the facilitation of asset transfer. - -Having started development on August 12th of 2021, and active on mainnet since September 1st, Avian (AVN) is a fork of Ravencoin Lite (RVL) which is a fork of Ravencoin Classic (RVC), aimed primarily at bringing the means of development back into the hands of the community after RVC had been abandoned by its creators. With the RVC github locked, and software in disrepair, RVL seeked to improve upon the existing foundations by implementing the necessary updates and bug fixes need to bring the original x16r fork of Ravencoin Classic up to par with modern cryptocurrencies. +# Note: This can take some time. +``` -This project is being spearheaded by a small group of enthusiasts, representing the interests of the actual community, as opposed to the original fork, which was created and maintained by Chinese ASIC manufacturers looking to make a return on their machines after AVN switched to the x16rv2 algorithm. As such, we are always seeking for people wishing to contribute their experience and knowhow to the development of Avian. +# Avian History +*Note: This is orignal description for when Avian was called RVL (Ravencoin Lite)* -Our oringinal goal was to stick to the x16r algorithm as previously declared by the RVC project, however, we were aware of the potential threat that ASICs pose to the network, and looked to mitigate it while staying true to our roots. All existing bugs have been fixed, and asset functionality is being developed. We implemented a secondary CPU algorithm, somewhat akin to Myriad (XMY) called MinotaurX which was developed by LitecoinCash (LCC), in order to help decentralize the mining of AVN without resorting to replacing the primary algo. +Avian is a digital peer-to-peer network for the facilitation of asset transfer. -I would like to reiterate that there are no professional developers on the dev team as of this date; we are merely a group of dedicated community members who got tired of waiting around for change and took matters into their own hands. As such, the speed of development will greatly depend on the amount of contributors. Let us come together as a community and help give AVN the wings it needs to soar high into the sky! +Having started development on August 12th of 2021, and active on mainnet since September 1st, Avian (AVN) is a fork of Ravencoin Lite (RVL) which is a fork of Ravencoin Classic (RVC), aimed primarily at bringing the means of development back into the hands of the community after RVC had been abandoned by its creators. With the RVC GitHub locked, and software in disrepair, RVL sought to improve upon the existing foundations by implementing the necessary updates and bug fixes needed to bring the original x16r fork of Ravencoin Classic up to par with modern cryptocurrencies. -Thank you to the Bitcoin developers and the rest of the open source community for your hard work in the cryptospace. +This project is being spearheaded by a small group of enthusiasts, representing the interests of the actual community, as opposed to the original fork, which was created and maintained by Chinese ASIC manufacturers looking to make a return on their machines after AVN switched to the x16rv2 algorithm. As such, we are always seeking people wishing to contribute their experience and know-how to the development of Avian. +Our original goal was to stick to the x16r algorithm as previously declared by the RVC project, however, we were aware of the potential threat that ASICs pose to the network, and looked to mitigate it while staying true to our roots. All existing bugs have been fixed, and asset functionality is being developed. We implemented a secondary CPU algorithm, somewhat akin to Myriad (XMY) called MinotaurX which was developed by LitecoinCash (LCC), to help decentralize the mining of AVN without resorting to replacing the primary algorithm. -The Avian project is launched based on the hard work and continuous effort of over 400 Bitcoin developers who made over 14,000 commits over the life to date of the Bitcoin project. We are eternally grateful to you for your efforts and diligence in making a secure network and for their support of free and open source software development. The Avian experiment is made on the foundation you built and we will continue to expand upon the foundations laid. +I would like to reiterate that there are no professional developers on the dev team as of this date; we are merely a group of dedicated community members who got tired of waiting around for change and took matters into their own hands. As such, the speed of development will greatly depend on the number of contributors. Let us come together as a community and help give AVN the wings it needs to soar high into the sky! +Thank you to the Bitcoin developers and the rest of the open-source community for your hard work in the crypto space. +The Avian project is launched based on the hard work and continuous effort of over 400 Bitcoin developers who made over 14,000 commits over the life to date of the Bitcoin project. We are eternally grateful to you for your efforts and diligence in making a secure network and for your support of free and open-source software development. The Avian experiment is made on the foundation you built and we will continue to expand upon the foundations laid. diff --git a/binaries/README.md b/binaries/README.md deleted file mode 100644 index 2f1233c25..000000000 --- a/binaries/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Releases have been moved to: - -https://github.com/AvianNetwork/Avian/releases/latest diff --git a/configure.ac b/configure.ac index 7d78662bd..9f41b9bfc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 4) -define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 3) +define(_CLIENT_VERSION_MINOR, 1) +define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_RC, 0) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh index a928cdfa2..78c517ee9 100755 --- a/contrib/devtools/gen-manpages.sh +++ b/contrib/devtools/gen-manpages.sh @@ -6,7 +6,6 @@ MANDIR=${MANDIR:-$TOPDIR/doc/man} AVIAND=${AVIAND:-$SRCDIR/aviand} AVIANCLI=${AVIANCLI:-$SRCDIR/avian-cli} -AVIANTX=${AVIANTX:-$SRCDIR/avian-tx} AVIANQT=${AVIANQT:-$SRCDIR/qt/avian-qt} [ ! -x $AVIAND ] && echo "$AVIAND not found or not executable." && exit 1 @@ -20,7 +19,7 @@ AVNVER=($($AVIANCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')) echo "[COPYRIGHT]" > footer.h2m $AVIAND --version | sed -n '1!p' >> footer.h2m -for cmd in $AVIAND $AVIANCLI $AVIANTX $AVIANQT; do +for cmd in $AVIAND $AVIANCLI $AVIANQT; do cmdname="${cmd##*/}" help2man -N --version-string=${AVNVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} sed -i "s/\\\-${AVNVER[1]}//g" ${MANDIR}/${cmdname}.1 diff --git a/contrib/devtools/optimize-pngs.py b/contrib/devtools/optimize-pngs.py index 2ad34c608..15fe1a815 100755 --- a/contrib/devtools/optimize-pngs.py +++ b/contrib/devtools/optimize-pngs.py @@ -1,12 +1,26 @@ -#!/usr/bin/env python -# Copyright (c) 2014-2016 The Bitcoin Core developers -# Copyright (c) 2017-2020 The Raven Core developers +#!/usr/bin/env python3 +# Copyright (c) 2014-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. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). #pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text + + +Install instructions +==== + +virtualenv ./optimize-pngs-env +source ./optimize-pngs-env/bin/activate +pip install Pillow + +Running +==== + +./optimize-pngs.py ../bitcoin_core/src/qt/res/movies/ ../bitcoin_core/src/qt/res/icons/ ../bitcoin_core/share/pixmaps/ + ''' +import argparse import os import sys import subprocess @@ -25,55 +39,59 @@ def content_hash(filename): data = i.tobytes() return hashlib.sha256(data).hexdigest() +zopflipng = 'zopflipng' pngcrush = 'pngcrush' git = 'git' -folders = ["src/qt/res/movies", "src/qt/res/icons", "share/pixmaps"] -basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel']).rstrip('\n') + +parser = argparse.ArgumentParser() +parser.add_argument('folder', nargs='+') +folders = parser.parse_args().folder +folders = [os.path.abspath(f) for f in folders] + totalSaveBytes = 0 noHashChange = True outputArray = [] -for folder in folders: - absFolder=os.path.join(basePath, folder) +for absFolder in folders: for file in os.listdir(absFolder): extension = os.path.splitext(file)[1] if extension.lower() == '.png': - print("optimizing "+file+"..."), + print("optimizing {}...".format(file), end =' ') file_path = os.path.join(absFolder, file) fileMetaMap = {'file' : file, 'osize': os.path.getsize(file_path), 'sha256Old' : file_hash(file_path)} - fileMetaMap['contentHashPre'] = content_hash(file_path) - - pngCrushOutput = "" + contentHashPre = content_hash(file_path) + try: - pngCrushOutput = subprocess.check_output( - [pngcrush, "-brute", "-ow", "-rem", "gAMA", "-rem", "cHRM", "-rem", "iCCP", "-rem", "sRGB", "-rem", "alla", "-rem", "text", file_path], - stderr=subprocess.STDOUT).rstrip('\n') + subprocess.call([pngcrush, "-brute", "-ow", "-rem", "gAMA", "-rem", "cHRM", "-rem", "iCCP", "-rem", "sRGB", "-rem", "alla", "-rem", "text", file_path], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + subprocess.call([zopflipng, '-m', '-y', file_path, file_path], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) except: - print "pngcrush is not installed, aborting..." + print("pngcrush or zopflipng is not installed, aborting...") sys.exit(0) - + #verify - if "Not a PNG file" in subprocess.check_output([pngcrush, "-n", "-v", file_path], stderr=subprocess.STDOUT): - print "PNG file "+file+" is corrupted after crushing, check out pngcursh version" + if "Not a PNG file" in subprocess.check_output([pngcrush, "-n", "-v", file_path], stderr=subprocess.STDOUT, universal_newlines=True, encoding='utf8'): + print("PNG file "+file+" is corrupted after crushing, check out pngcursh version") sys.exit(1) - + fileMetaMap['sha256New'] = file_hash(file_path) - fileMetaMap['contentHashPost'] = content_hash(file_path) + contentHashPost = content_hash(file_path) - if fileMetaMap['contentHashPre'] != fileMetaMap['contentHashPost']: - print "Image contents of PNG file "+file+" before and after crushing don't match" + if contentHashPre != contentHashPost: + print("Image contents of PNG file {} before and after crushing don't match".format(file)) sys.exit(1) fileMetaMap['psize'] = os.path.getsize(file_path) outputArray.append(fileMetaMap) - print("done\n"), + print("done") -print "summary:\n+++++++++++++++++" +print("summary:\n+++++++++++++++++") for fileDict in outputArray: oldHash = fileDict['sha256Old'] newHash = fileDict['sha256New'] totalSaveBytes += fileDict['osize'] - fileDict['psize'] noHashChange = noHashChange and (oldHash == newHash) - print fileDict['file']+"\n size diff from: "+str(fileDict['osize'])+" to: "+str(fileDict['psize'])+"\n old sha256: "+oldHash+"\n new sha256: "+newHash+"\n" - -print "completed. Checksum stable: "+str(noHashChange)+". Total reduction: "+str(totalSaveBytes)+" bytes" + print(fileDict['file']+"\n size diff from: "+str(fileDict['osize'])+" to: "+str(fileDict['psize'])+"\n old sha256: "+oldHash+"\n new sha256: "+newHash+"\n") + +print("completed. Checksum stable: "+str(noHashChange)+". Total reduction: "+str(totalSaveBytes)+" bytes") diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py index 172e34b19..a81661b7d 100755 --- a/contrib/seeds/makeseeds.py +++ b/contrib/seeds/makeseeds.py @@ -31,7 +31,7 @@ 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+)$") -PATTERN_AGENT = re.compile(r"^(/Satoshi:0.13.(1|2|99)/|/Satoshi:0.14.(0|1|2|99)/)$") +PATTERN_AGENT = re.compile(r"^(/Avian:4.0.(1|2|3)/)$") def parseline(line): sline = line.split() diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index f9b65c3b7..0afa1055b 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1 +1,71 @@ -2.228.70.198:8767 +68.13.199.14:7895 +67.87.26.172:7895 +46.107.174.247:7895 +178.71.19.68:7895 +137.117.212.201:7895 +72.199.173.98:7895 +202.185.42.252:7895 +209.216.180.52:7895 +47.196.190.126:7895 +159.65.178.148:7895 +144.91.77.184:7895 +51.89.166.31:7895 +66.191.202.105:7895 +71.202.82.78:7895 +82.66.14.46:7895 +194.223.29.153:7895 +83.31.98.33:7895 +176.38.198.17:7895 +211.244.179.123:7895 +178.128.92.97:7895 +123.24.83.184:7895 +220.240.12.176:7895 +190.211.227.94:7895 +162.202.32.106:7895 +201.143.152.95:7895 +138.197.146.60:7895 +83.221.211.116:7895 +159.65.178.148:7895 +66.151.242.154:7895 +125.168.95.217:7895 +98.222.16.114:7895 +31.15.132.102:7895 +130.185.202.159:7895 +73.214.0.28:7895 +78.180.249.141:7895 +94.212.19.84:7895 +65.21.133.242:7895 +162.19.18.142:7895 +85.153.156.206:7895 +141.95.146.47:7895 +62.68.29.179:7895 +89.58.31.143:7895 +132.148.76.226:7895 +73.170.62.25:7895 +62.195.146.12:7895 +50.109.97.133:7895 +65.21.142.32:7895 +74.59.52.85:7895 +144.91.123.186:7895 +47.42.105.183:7895 +5.188.104.245:7895 +95.191.37.104:7895 +99.233.25.27:7895 +92.234.128.115:7895 +68.34.104.63:7895 +185.9.146.122:7895 +73.26.30.14:7895 +161.35.212.142:7895 +31.25.241.224:7895 +24.141.193.240:7895 +38.242.230.153:7895 +67.150.84.126:7895 +188.25.17.130:7895 +81.193.133.115:7895 +47.160.64.15:7895 +90.101.92.214:7895 +125.253.17.30:7895 +15.204.140.151:7895 +5.58.69.237:7895 +119.18.30.117:7895 +213.91.128.133:7895 diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk index 8d06882cd..1c251d382 100644 --- a/depends/packages/expat.mk +++ b/depends/packages/expat.mk @@ -1,8 +1,8 @@ package=expat -$(package)_version=2.2.6 -$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_6/ +$(package)_version=2.4.1 +$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/ $(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2 +$(package)_sha256_hash=2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40 define $(package)_set_vars $(package)_config_opts=--disable-static --without-docbook diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 5f622f8e6..dad317193 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -1,17 +1,19 @@ package=libevent -$(package)_version=2.1.8-stable -$(package)_download_path=https://github.com/libevent/libevent/archive/ -$(package)_file_name=release-$($(package)_version).tar.gz -$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d - -define $(package)_preprocess_cmds - ./autogen.sh -endef +$(package)_version=2.1.12-stable +$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-$($(package)_version)/ +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb +# When building for Windows, we set _WIN32_WINNT to target the same Windows +# version as we do in configure. Due to quirks in libevents build system, this +# is also required to enable support for ipv6. See #19375. define $(package)_set_vars $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples + $(package)_config_opts += --disable-dependency-tracking --enable-option-checking $(package)_config_opts_release=--disable-debug-mode $(package)_config_opts_linux=--with-pic + $(package)_config_opts_android=--with-pic + $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601 endef define $(package)_config_cmds @@ -27,4 +29,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds + rm lib/*.la endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 01146c26f..8c1ff8e1e 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,20 +1,23 @@ package=zeromq -$(package)_version=4.1.5 -$(package)_download_path=https://github.com/zeromq/zeromq4-1/releases/download/v$($(package)_version)/ +$(package)_version=4.3.4 +$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=04aac57f081ffa3a2ee5ed04887be9e205df3a7ddade0027460b8042432bdbcf -$(package)_patches=9114d3957725acd34aa8b8d011585812f3369411.patch 9e6745c12e0b100cd38acecc16ce7db02905e27c.patch +$(package)_sha256_hash=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 +$(package)_patches=remove_libstd_link.patch define $(package)_set_vars - $(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve + $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf + $(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci + $(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking + $(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking $(package)_config_opts_linux=--with-pic + $(package)_config_opts_android=--with-pic $(package)_cxxflags=-std=c++11 endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/9114d3957725acd34aa8b8d011585812f3369411.patch && \ - patch -p1 < $($(package)_patch_dir)/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch && \ - ./autogen.sh + patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config endef define $(package)_config_cmds @@ -22,7 +25,7 @@ define $(package)_config_cmds endef define $(package)_build_cmds - $(MAKE) libzmq.la + $(MAKE) src/libzmq.la endef define $(package)_stage_cmds @@ -30,5 +33,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf bin share + rm -rf bin share lib/*.la endef diff --git a/depends/patches/zeromq/9114d3957725acd34aa8b8d011585812f3369411.patch b/depends/patches/zeromq/9114d3957725acd34aa8b8d011585812f3369411.patch deleted file mode 100644 index f704b3d94..000000000 --- a/depends/patches/zeromq/9114d3957725acd34aa8b8d011585812f3369411.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 9114d3957725acd34aa8b8d011585812f3369411 Mon Sep 17 00:00:00 2001 -From: Jeroen Ooms -Date: Tue, 20 Oct 2015 13:10:38 +0200 -Subject: [PATCH] enable static libraries on mingw - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 393505b..e92131a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -265,7 +265,7 @@ case "${host_os}" in - libzmq_dso_visibility="no" - - if test "x$enable_static" = "xyes"; then -- AC_MSG_ERROR([Building static libraries is not supported under MinGW32]) -+ CPPFLAGS="-DZMQ_STATIC" - fi - - # Set FD_SETSIZE to 1024 \ No newline at end of file diff --git a/depends/patches/zeromq/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch b/depends/patches/zeromq/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch deleted file mode 100644 index 9aff2c179..000000000 --- a/depends/patches/zeromq/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 9e6745c12e0b100cd38acecc16ce7db02905e27c Mon Sep 17 00:00:00 2001 -From: David Millard -Date: Tue, 10 May 2016 13:53:53 -0700 -Subject: [PATCH] Fix autotools for static MinGW builds - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 5a0fa14..def6ea7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -259,7 +259,7 @@ case "${host_os}" in - libzmq_dso_visibility="no" - - if test "x$enable_static" = "xyes"; then -- CPPFLAGS="-DZMQ_STATIC" -+ CPPFLAGS="-DZMQ_STATIC $CPPFLAGS" - fi - - # Set FD_SETSIZE to 1024 \ No newline at end of file diff --git a/depends/patches/zeromq/remove_libstd_link.patch b/depends/patches/zeromq/remove_libstd_link.patch new file mode 100644 index 000000000..ddf91e6ab --- /dev/null +++ b/depends/patches/zeromq/remove_libstd_link.patch @@ -0,0 +1,25 @@ +commit 47d4cd12a2c051815ddda78adebdb3923b260d8a +Author: fanquake +Date: Tue Aug 18 14:45:40 2020 +0800 + + Remove needless linking against libstdc++ + + This is broken for a number of reasons, including: + - g++ understands "static-libstdc++ -lstdc++" to mean "link against + whatever libstdc++ exists, probably shared", which in itself is buggy. + - another stdlib (libc++ for example) may be in use + + See #11981. + +diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in +index 233bc3a..3c2bf0d 100644 +--- a/src/libzmq.pc.in ++++ b/src/libzmq.pc.in +@@ -7,6 +7,6 @@ Name: libzmq + Description: 0MQ c++ library + Version: @VERSION@ + Libs: -L${libdir} -lzmq +-Libs.private: -lstdc++ @pkg_config_libs_private@ ++Libs.private: @pkg_config_libs_private@ + Requires.private: @pkg_config_names_private@ + Cflags: -I${includedir} @pkg_config_defines@ diff --git a/doc/dependencies.md b/doc/dependencies.md index 82e340289..c02d85899 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -13,14 +13,13 @@ These are the dependencies currently used by Avian Core. You can find instructio | cdrkit | 1.1.11 | | | | | | Clang | [11.0.1](http://llvm.org/releases/download.html) | (C++11 support) | | | | | D-Bus | [1.10.18](https://cgit.freedesktop.org/dbus/dbus/tree/NEWS?h=dbus-1.10) | | No | Yes | | -| ds_store | 1.3.0 | | | | | -| Expat | [2.3.0](https://libexpat.github.io/) | | Yes | Yes | | +| Expat | [2.4.1](https://libexpat.github.io/) | | No | Yes | | | fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | | | FreeType | [2.7.1](http://download.savannah.gnu.org/releases/freetype) | | No | | | | GCC | | [4.7+](https://gcc.gnu.org/) | | | | | HarfBuzz-NG | | | | | | | libdmg-hfsplus | | | | | | -| libevent | [2.1.11-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | | +| libevent | [2.1.12-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | | | libICE | 1.0.9 | | | | | | libjpeg | | | | | [Yes](https://github.com/AvianNetwork/Avian/blob/master/depends/packages/qt.mk#L75) | | libpng | | | | | [Yes](https://github.com/AvianNetwork/Avian/blob/master/depends/packages/qt.mk#L74) | @@ -36,8 +35,8 @@ These are the dependencies currently used by Avian Core. You can find instructio | protobuf | [2.6.1](https://github.com/google/protobuf/releases) | | No | | | | Python (tests) | | [3.4](https://www.python.org/downloads) | | | | | qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | | -| Qt | [5.12.10](https://download.qt.io/official_releases/qt/) | 4.7+ | No | | | -| XCB | 1.10 | | | | [Yes](https://github.com/AvianNetwork/Avian/blob/master/depends/packages/qt.mk#L94) (Linux only) | -| xkbcommon | 0.8.4 | | | | [Yes](https://github.com/AvianNetwork/Avian/blob/master/depends/packages/qt.mk#L93) (Linux only) | -| ZeroMQ | [4.1.5](https://github.com/zeromq/libzmq/releases) | | No | | | +| Qt | [5.7.1](https://download.qt.io/official_releases/qt/) | 4.7+ | No | | | +| XCB | | | | | [Yes](https://github.com/RavenProject/Ravencoin/blob/master/depends/packages/qt.mk#L94) (Linux only) | +| xkbcommon | | | | | [Yes](https://github.com/RavenProject/Ravencoin/blob/master/depends/packages/qt.mk#L93) (Linux only) | +| ZeroMQ | [4.3.4](https://github.com/zeromq/libzmq/releases) | | No | | | | zlib | [1.2.11](http://zlib.net/) | | | | No | diff --git a/doc/man/avian-cli.1 b/doc/man/avian-cli.1 index 1ec537a1c..51ea3ead0 100644 --- a/doc/man/avian-cli.1 +++ b/doc/man/avian-cli.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH AVIAN-CLI "1" "September 2017" "avian-cli v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. +.TH AVIAN-CLI "1" "September 2022" "avian-cli v4.1.0.0" "User Commands" .SH NAME -avian-cli \- manual page for avian-cli v0.15.99.0 +avian-cli \- manual page for avian-cli v4.1.0.0 .SH DESCRIPTION -Avian Core RPC client version v0.15.99.0 +Avian Core RPC client version v4.1.0.0 .SS "Usage:" .TP avian\-cli [options] [params] @@ -25,6 +25,14 @@ Specify configuration file (default: avian.conf) \fB\-datadir=\fR .IP Specify data directory +.HP +\fB\-getinfo\fR +.IP +Get general information from the remote server. Note that unlike +server\-side RPC calls, the results of \fB\-getinfo\fR is the result of +multiple non\-atomic requests. Some entries in the result may +represent results from different states (e.g. wallet balance may +be as of a different block from the chain state reported) .PP Chain selection options: .HP @@ -48,7 +56,7 @@ Send commands to node running on (default: 127.0.0.1) .HP \fB\-rpcport=\fR .IP -Connect to JSON\-RPC on (default: 8766 or testnet: 18766) +Connect to JSON\-RPC on (default: 7896 or testnet: 18766) .HP \fB\-rpcwait\fR .IP @@ -85,14 +93,13 @@ input is used for the RPC password. \fB\-rpcwallet=\fR .IP Send RPC for non\-default wallet on RPC server (argument is wallet -filename in aviand directory, required if aviand/\-Qt runs -with multiple wallets) +filename in aviand directory, required if aviand/\-Qt runs with +multiple wallets) .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers -Copyright (c) 2017-2019 The Raven Core developers +Copyright (C) 2009-2022 The Avian Core developers -Please contribute if you find Avian Core useful. Visit - for further information about the software. +Please contribute if you find Avian Core useful. Visit +for further information about the software. The source code is available from . This is experimental software. diff --git a/doc/man/avian-qt.1 b/doc/man/avian-qt.1 index a2b91990d..21d2e6849 100644 --- a/doc/man/avian-qt.1 +++ b/doc/man/avian-qt.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH AVIAN-QT "1" "September 2017" "avian-qt v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. +.TH AVIAN-QT "1" "September 2022" "avian-qt v4.1.0.0" "User Commands" .SH NAME -avian-qt \- manual page for avian-qt v0.15.99.0 +avian-qt \- manual page for avian-qt v4.1.0.0 .SH DESCRIPTION -Avian Core version v0.15.99.0 (64\-bit) +Avian Core version v4.1.0.0 (64\-bit) Usage: .IP avian\-qt [command\-line options] @@ -32,9 +32,9 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a, +0000000247de51f4188fc43316cc5e1f8711cff6210b242d234004aae39163d5, testnet: -0000000002e9e7b00e1f6dc5123a04aad68dd0f0968d8c7aa45f6640795c37b1) +00016603365e3252687eeb7a309d9d6b903b81239d9bce670286a7a9d26131b9) .HP \fB\-conf=\fR .IP @@ -48,10 +48,29 @@ Specify data directory .IP Set database cache size in megabytes (4 to 16384, default: 450) .HP +\fB\-disablemessaging\fR +.IP +Turn off the databasing the messages sent with assets (default: 0) +.HP \fB\-loadblock=\fR .IP Imports blocks from external blk000??.dat file on startup .HP +\fB\-maxreorg=\fR +.IP +Set the Maximum reorg depth (default: 60) +.HP +\fB\-minreorgpeers=\fR +.IP +Set the Minimum amount of peers required to disallow reorg of chains of +depth >= maxreorg. Peers must be greater than. (default: 4) +.HP +\fB\-minreorgage=\fR +.IP +Set the Minimum tip age (in seconds) required to allow reorg of a chain +of depth >= maxreorg on a node with more than minreorgpeers +peers. (default: 43200) +.HP \fB\-maxorphantx=\fR .IP Keep at most unconnectable transactions in memory (default: 100) @@ -76,9 +95,19 @@ Extra transactions to keep in memory for compact block reconstructions .HP \fB\-par=\fR .IP -Set the number of script verification threads (\fB\-2\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-4\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP +\fB\-autofixmempool\fR +.IP +When set, if the CreateNewBlock fails because of a transaction. The +mempool will be cleared. (default: 0) +.HP +\fB\-bypassdownload\fR +.IP +When set, if the chain is in initialblockdownload the getblocktemplate +rpc call will still return block data (default: 0) +.HP \fB\-pid=\fR .IP Specify pid file (default: aviand.pid) @@ -112,12 +141,33 @@ Create new files with system default permissions, instead of umask 077 .IP Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0) +.HP +\fB\-assetindex\fR +.IP +Keep an index of assets, used by the requestsnapshot rpc call. Requires +a \fB\-reindex\fR. +.HP +\fB\-addressindex\fR +.IP +Maintain a full address index, used to query for the balance, txids and +unspent outputs for addresses (default: 0) +.HP +\fB\-timestampindex\fR +.IP +Maintain a timestamp index for block hashes, used to query blocks hashes +by a range of timestamps (default: 0) +.HP +\fB\-spentindex\fR +.IP +Maintain a full spent index, used to query the spending txid and input +index for an outpoint (default: 0) .PP Connection options: .HP \fB\-addnode=\fR .IP -Add a node to connect to and attempt to keep the connection open +Add a node to connect to and attempt to keep the connection open (see +the `addnode` RPC command help for more info) .HP \fB\-banscore=\fR .IP @@ -136,7 +186,8 @@ for IPv6 \fB\-connect=\fR .IP Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections +connections (the rules for this peer are the same as for +\fB\-addnode\fR) .HP \fB\-discover\fR .IP @@ -158,7 +209,7 @@ Specify your own public address .HP \fB\-forcednsseed\fR .IP -Always query for peer addresses via DNS lookup (default: 0) +Always query for peer addresses via DNS lookup (default: 1) .HP \fB\-listen\fR .IP @@ -184,7 +235,7 @@ Maximum per\-connection send buffer, *1000 bytes (default: 1000) .IP Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this -amount. (default: 4200 seconds) +amount. (default: 675 seconds) .HP \fB\-onion=\fR .IP @@ -206,7 +257,7 @@ Support filtering of blocks and transaction with bloom filters (default: .HP \fB\-port=\fR .IP -Listen for connections on (default: 8767 or testnet: 18767) +Listen for connections on (default: 7895 or testnet: 18770) .HP \fB\-proxy=\fR .IP @@ -258,31 +309,50 @@ Tries to keep outbound traffic under the given target (in MiB per 24h), .PP Wallet options: .HP -\fB\-disablewallet\fR +\fB\-bip44=\fR .IP -Do not load the wallet and disable wallet RPC calls +Sets the wallet to use/not use bip44 12\-words, non\-bip44=0 or bip44=1 +(default: 1). Note: By default 12\-words will automatically be +generated for you (random word selection). See \fB\-mnemonic\fR and +\fB\-mnemonicpassphrase\fR below to create a wallet using a specific +word list (use an existing bip\-44 wallet word\-list), or use the +RPC/CLI getmywords or dumpwallet to retrieve the auto\-generated +word\-list. This flag is ignored if there is already an existing +non\-bip44 wallet. .HP -\fB\-keypool=\fR +\fB\-discardfee=\fR .IP -Set key pool size to (default: 1000) +The fee rate (in AVN/kB) that indicates your tolerance for discarding +change by adding it to the fee (default: 0.00025). Note: An +output is discarded if it is dust at this rate, but we will +always discard up to the dust relay fee and a discard fee above +that is limited by the fee estimate for the longest target +.HP +\fB\-disablewallet\fR +.IP +Do not load the wallet and disable wallet RPC calls .HP \fB\-fallbackfee=\fR .IP A fee rate (in AVN/kB) that will be used when fee estimation has -insufficient data (default: 0.0002) +insufficient data (default: 0.01025) .HP -\fB\-discardfee=\fR +\fB\-keypool=\fR .IP -The fee rate (in AVN/kB) that indicates your tolerance for discarding -change by adding it to the fee (default: 0.0001). Note: An output -is discarded if it is dust at this rate, but we will always -discard up to the dust relay fee and a discard fee above that is -limited by the fee estimate for the longest target +Set key pool size to (default: 1000) .HP \fB\-mintxfee=\fR .IP Fees (in AVN/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) +transaction creation (default: 0.01) +.HP +\fB\-mnemonic=\fR +.IP +A space separated list of 12\-words used to import a bip44 wallet +.HP +\fB\-mnemonicpassphrase=\fR +.IP +Passphrase securing your 12\-word mnemonic word\-list .HP \fB\-paytxfee=\fR .IP @@ -305,14 +375,14 @@ Spend unconfirmed change when sending transactions (default: 1) If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: 6) .HP -\fB\-walletrbf\fR -.IP -Send transactions with full\-RBF opt\-in enabled (default: 0) -.HP \fB\-upgradewallet\fR .IP Upgrade wallet to latest format on startup .HP +\fB\-walletrbf\fR +.IP +Send transactions with full\-RBF opt\-in enabled (default: 0) +.HP \fB\-wallet=\fR .IP Specify wallet file (within data directory) (default: wallet.dat) @@ -332,6 +402,16 @@ Delete all wallet transactions and only recover those parts of the blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) +.HP +\fB\-miningaddress=\fR
+.IP +When getblocktemplate is called. It will create the coinbase transaction +using this address(default: empty string) +.HP +\fB\-minrewardheight=\fR +.IP +The default height that is required before rewards are allowed to be +sent out (default: 60) .PP ZeroMQ notification options: .HP @@ -350,6 +430,10 @@ Enable publish raw block in
\fB\-zmqpubrawtx=\fR
.IP Enable publish raw transaction in
+.HP +\fB\-zmqpubrawmessage=\fR
+.IP +Enable publish raw asset messages in
.PP Debugging/Testing options: .HP @@ -364,7 +448,7 @@ optional). If is not supplied or if = 1, output all debugging information. can be: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, -libevent, coindb, qt, leveldb. +libevent, coindb, qt, leveldb, rewards, crow. .HP \fB\-debugexclude=\fR .IP @@ -422,7 +506,7 @@ Maximum size of data in data carrier transactions we relay and mine .HP \fB\-mempoolreplacement\fR .IP -Enable transaction replacement in the memory pool (default: 1) +Enable transaction replacement in the memory pool (default: 0) .HP \fB\-minrelaytxfee=\fR .IP @@ -497,7 +581,7 @@ option can be specified multiple times .HP \fB\-rpcport=\fR .IP -Listen for JSON\-RPC connections on (default: 8766 or testnet: +Listen for JSON\-RPC connections on (default: 7896 or testnet: 18766) .HP \fB\-rpcallowip=\fR @@ -515,6 +599,16 @@ non\-verbose mode, non\-segwit(0) or segwit(1) (default: 1) \fB\-rpcthreads=\fR .IP Set the number of threads to service RPC calls (default: 4) +.HP +\fB\-powalgo\fR=\fI\,x16rt\/\fR|minotaurx +.IP +Default pow mining algorithm. Miners who can't easily adjust their +getblocktemplate calls should use this argument to set their +preferred mining algorithm. (default: x16rt) +.HP +\fB\-flightplans\fR +.IP +Enable Avian Flightplans for use via JSON\-RPC .PP UI Options: .HP @@ -542,11 +636,10 @@ Show splash screen on startup (default: 1) .IP Reset all settings changed in the GUI .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers -Copyright (c) 2017-2019 The Raven Core developers +Copyright (C) 2009-2022 The Avian Core developers -Please contribute if you find Avian Core useful. Visit - for further information about the software. +Please contribute if you find Avian Core useful. Visit +for further information about the software. The source code is available from . This is experimental software. diff --git a/doc/man/aviand.1 b/doc/man/aviand.1 index 289788d39..1c3ca54dc 100644 --- a/doc/man/aviand.1 +++ b/doc/man/aviand.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH AVIAND "1" "September 2017" "aviand v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. +.TH AVIAND "1" "September 2022" "aviand v4.1.0.0" "User Commands" .SH NAME -aviand \- manual page for aviand v0.15.99.0 +aviand \- manual page for aviand v4.1.0.0 .SH DESCRIPTION -Avian Core Daemon version v0.15.99.0 +Avian Core Daemon version v4.1.0.0 .SS "Usage:" .TP aviand [options] @@ -33,9 +33,9 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a, +0000000247de51f4188fc43316cc5e1f8711cff6210b242d234004aae39163d5, testnet: -0000000002e9e7b00e1f6dc5123a04aad68dd0f0968d8c7aa45f6640795c37b1) +00016603365e3252687eeb7a309d9d6b903b81239d9bce670286a7a9d26131b9) .HP \fB\-conf=\fR .IP @@ -53,10 +53,29 @@ Specify data directory .IP Set database cache size in megabytes (4 to 16384, default: 450) .HP +\fB\-disablemessaging\fR +.IP +Turn off the databasing the messages sent with assets (default: 0) +.HP \fB\-loadblock=\fR .IP Imports blocks from external blk000??.dat file on startup .HP +\fB\-maxreorg=\fR +.IP +Set the Maximum reorg depth (default: 60) +.HP +\fB\-minreorgpeers=\fR +.IP +Set the Minimum amount of peers required to disallow reorg of chains of +depth >= maxreorg. Peers must be greater than. (default: 4) +.HP +\fB\-minreorgage=\fR +.IP +Set the Minimum tip age (in seconds) required to allow reorg of a chain +of depth >= maxreorg on a node with more than minreorgpeers +peers. (default: 43200) +.HP \fB\-maxorphantx=\fR .IP Keep at most unconnectable transactions in memory (default: 100) @@ -81,9 +100,19 @@ Extra transactions to keep in memory for compact block reconstructions .HP \fB\-par=\fR .IP -Set the number of script verification threads (\fB\-2\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-4\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP +\fB\-autofixmempool\fR +.IP +When set, if the CreateNewBlock fails because of a transaction. The +mempool will be cleared. (default: 0) +.HP +\fB\-bypassdownload\fR +.IP +When set, if the chain is in initialblockdownload the getblocktemplate +rpc call will still return block data (default: 0) +.HP \fB\-pid=\fR .IP Specify pid file (default: aviand.pid) @@ -117,12 +146,33 @@ Create new files with system default permissions, instead of umask 077 .IP Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0) +.HP +\fB\-assetindex\fR +.IP +Keep an index of assets, used by the requestsnapshot rpc call. Requires +a \fB\-reindex\fR. +.HP +\fB\-addressindex\fR +.IP +Maintain a full address index, used to query for the balance, txids and +unspent outputs for addresses (default: 0) +.HP +\fB\-timestampindex\fR +.IP +Maintain a timestamp index for block hashes, used to query blocks hashes +by a range of timestamps (default: 0) +.HP +\fB\-spentindex\fR +.IP +Maintain a full spent index, used to query the spending txid and input +index for an outpoint (default: 0) .PP Connection options: .HP \fB\-addnode=\fR .IP -Add a node to connect to and attempt to keep the connection open +Add a node to connect to and attempt to keep the connection open (see +the `addnode` RPC command help for more info) .HP \fB\-banscore=\fR .IP @@ -141,7 +191,8 @@ for IPv6 \fB\-connect=\fR .IP Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections +connections (the rules for this peer are the same as for +\fB\-addnode\fR) .HP \fB\-discover\fR .IP @@ -163,7 +214,7 @@ Specify your own public address .HP \fB\-forcednsseed\fR .IP -Always query for peer addresses via DNS lookup (default: 0) +Always query for peer addresses via DNS lookup (default: 1) .HP \fB\-listen\fR .IP @@ -189,7 +240,7 @@ Maximum per\-connection send buffer, *1000 bytes (default: 1000) .IP Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this -amount. (default: 4200 seconds) +amount. (default: 675 seconds) .HP \fB\-onion=\fR .IP @@ -211,7 +262,7 @@ Support filtering of blocks and transaction with bloom filters (default: .HP \fB\-port=\fR .IP -Listen for connections on (default: 8767 or testnet: 18767) +Listen for connections on (default: 7895 or testnet: 18770) .HP \fB\-proxy=\fR .IP @@ -263,31 +314,50 @@ Tries to keep outbound traffic under the given target (in MiB per 24h), .PP Wallet options: .HP -\fB\-disablewallet\fR +\fB\-bip44=\fR .IP -Do not load the wallet and disable wallet RPC calls +Sets the wallet to use/not use bip44 12\-words, non\-bip44=0 or bip44=1 +(default: 1). Note: By default 12\-words will automatically be +generated for you (random word selection). See \fB\-mnemonic\fR and +\fB\-mnemonicpassphrase\fR below to create a wallet using a specific +word list (use an existing bip\-44 wallet word\-list), or use the +RPC/CLI getmywords or dumpwallet to retrieve the auto\-generated +word\-list. This flag is ignored if there is already an existing +non\-bip44 wallet. .HP -\fB\-keypool=\fR +\fB\-discardfee=\fR .IP -Set key pool size to (default: 1000) +The fee rate (in AVN/kB) that indicates your tolerance for discarding +change by adding it to the fee (default: 0.00025). Note: An +output is discarded if it is dust at this rate, but we will +always discard up to the dust relay fee and a discard fee above +that is limited by the fee estimate for the longest target +.HP +\fB\-disablewallet\fR +.IP +Do not load the wallet and disable wallet RPC calls .HP \fB\-fallbackfee=\fR .IP A fee rate (in AVN/kB) that will be used when fee estimation has -insufficient data (default: 0.0002) +insufficient data (default: 0.01025) .HP -\fB\-discardfee=\fR +\fB\-keypool=\fR .IP -The fee rate (in AVN/kB) that indicates your tolerance for discarding -change by adding it to the fee (default: 0.0001). Note: An output -is discarded if it is dust at this rate, but we will always -discard up to the dust relay fee and a discard fee above that is -limited by the fee estimate for the longest target +Set key pool size to (default: 1000) .HP \fB\-mintxfee=\fR .IP Fees (in AVN/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) +transaction creation (default: 0.01) +.HP +\fB\-mnemonic=\fR +.IP +A space separated list of 12\-words used to import a bip44 wallet +.HP +\fB\-mnemonicpassphrase=\fR +.IP +Passphrase securing your 12\-word mnemonic word\-list .HP \fB\-paytxfee=\fR .IP @@ -310,14 +380,14 @@ Spend unconfirmed change when sending transactions (default: 1) If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: 6) .HP -\fB\-walletrbf\fR -.IP -Send transactions with full\-RBF opt\-in enabled (default: 0) -.HP \fB\-upgradewallet\fR .IP Upgrade wallet to latest format on startup .HP +\fB\-walletrbf\fR +.IP +Send transactions with full\-RBF opt\-in enabled (default: 0) +.HP \fB\-wallet=\fR .IP Specify wallet file (within data directory) (default: wallet.dat) @@ -337,6 +407,16 @@ Delete all wallet transactions and only recover those parts of the blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) +.HP +\fB\-miningaddress=\fR
+.IP +When getblocktemplate is called. It will create the coinbase transaction +using this address(default: empty string) +.HP +\fB\-minrewardheight=\fR +.IP +The default height that is required before rewards are allowed to be +sent out (default: 60) .PP ZeroMQ notification options: .HP @@ -355,6 +435,10 @@ Enable publish raw block in
\fB\-zmqpubrawtx=\fR
.IP Enable publish raw transaction in
+.HP +\fB\-zmqpubrawmessage=\fR
+.IP +Enable publish raw asset messages in
.PP Debugging/Testing options: .HP @@ -369,7 +453,7 @@ optional). If is not supplied or if = 1, output all debugging information. can be: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, -libevent, coindb, qt, leveldb. +libevent, coindb, qt, leveldb, rewards, crow. .HP \fB\-debugexclude=\fR .IP @@ -427,7 +511,7 @@ Maximum size of data in data carrier transactions we relay and mine .HP \fB\-mempoolreplacement\fR .IP -Enable transaction replacement in the memory pool (default: 1) +Enable transaction replacement in the memory pool (default: 0) .HP \fB\-minrelaytxfee=\fR .IP @@ -502,7 +586,7 @@ option can be specified multiple times .HP \fB\-rpcport=\fR .IP -Listen for JSON\-RPC connections on (default: 8766 or testnet: +Listen for JSON\-RPC connections on (default: 7896 or testnet: 18766) .HP \fB\-rpcallowip=\fR @@ -520,12 +604,21 @@ non\-verbose mode, non\-segwit(0) or segwit(1) (default: 1) \fB\-rpcthreads=\fR .IP Set the number of threads to service RPC calls (default: 4) +.HP +\fB\-powalgo\fR=\fI\,x16rt\/\fR|minotaurx +.IP +Default pow mining algorithm. Miners who can't easily adjust their +getblocktemplate calls should use this argument to set their +preferred mining algorithm. (default: x16rt) +.HP +\fB\-flightplans\fR +.IP +Enable Avian Flightplans for use via JSON\-RPC .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers -Copyright (c) 2017-2019 The Raven Core developers +Copyright (C) 2009-2022 The Avian Core developers -Please contribute if you find Avian Core useful. Visit - for further information about the software. +Please contribute if you find Avian Core useful. Visit +for further information about the software. The source code is available from . This is experimental software. diff --git a/doc/release-notes/release-notes-0.15.0.1.md b/doc/release-notes/release-notes-0.15.0.1.md deleted file mode 100644 index 663e421b7..000000000 --- a/doc/release-notes/release-notes-0.15.0.1.md +++ /dev/null @@ -1,87 +0,0 @@ -Avian Core version *0.15.0.1* is now available from: - - - -and - - - -This is a minor bug fix for 0.15.0. - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -The first time you run version 0.15.0 or higher, your chainstate database will -be converted to a new format, which will take anywhere from a few minutes to -half an hour, depending on the speed of your machine. - -The file format of `fee_estimates.dat` changed in version 0.15.0. Hence, a -downgrade from version 0.15.0 or upgrade to version 0.15.0 will cause all fee -estimates to be discarded. - -Note that the block database format also changed in version 0.8.0 and there is no -automatic upgrade code from before version 0.8 to version 0.15.0. Upgrading -directly from 0.7.x and earlier without redownloading the blockchain is not supported. -However, as usual, old wallet versions are still supported. - -Downgrading warning -------------------- - -The chainstate database for this release is not compatible with previous -releases, so if you run 0.15 and then decide to switch back to any -older version, you will need to run the old release with the `-reindex-chainstate` -option to rebuild the chainstate data structures in the old format. - -If your node has pruning enabled, this will entail re-downloading and -processing the entire blockchain. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows Vista and later. Windows XP is not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Notable changes -=============== - -GUI startup crash issue -------------------------- - -After upgrade to 0.15.0, some clients would crash at startup because a custom -fee setting was configured that no longer exists in the GUI. This is a minimal -patch to avoid this issue from occuring. - -0.15.0.1 Change log -==================== - -- #11332 `46c8d23` Fix possible crash with invalid nCustomFeeRadio in QSettings (achow101, TheBlueMatt) - -Also the manpages were updated, as this was forgotten for 0.15.0. - -Credits -======= - -Thanks to everyone who directly contributed to this release: - -- Andrew Chow -- Matt Corallo -- Jonas Schnelli -- Wladimir J. van der Laan - -As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/avian/). diff --git a/doc/release-notes/release-notes-0.15.0.md b/doc/release-notes/release-notes-0.15.0.md deleted file mode 100644 index 11c12d727..000000000 --- a/doc/release-notes/release-notes-0.15.0.md +++ /dev/null @@ -1,878 +0,0 @@ -Avian Core version *0.15.0* is now available from: - - - -This is a new major version release, including new features, various bugfixes -and performance improvements, as well as updated translations. - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -The first time you run version 0.15.0, your chainstate database will be converted to a -new format, which will take anywhere from a few minutes to half an hour, -depending on the speed of your machine. - -The file format of `fee_estimates.dat` changed in version 0.15.0. Hence, a -downgrade from version 0.15.0 or upgrade to version 0.15.0 will cause all fee -estimates to be discarded. - -Note that the block database format also changed in version 0.8.0 and there is no -automatic upgrade code from before version 0.8 to version 0.15.0. Upgrading -directly from 0.7.x and earlier without redownloading the blockchain is not supported. -However, as usual, old wallet versions are still supported. - -Downgrading warning -------------------- - -The chainstate database for this release is not compatible with previous -releases, so if you run 0.15 and then decide to switch back to any -older version, you will need to run the old release with the `-reindex-chainstate` -option to rebuild the chainstate data structures in the old format. - -If your node has pruning enabled, this will entail re-downloading and -processing the entire blockchain. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows Vista and later. Windows XP is not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Notes for 0.15.0 -================ - -Current SegWit support ----------------------- - -Version 0.15.0 supports adding a segregated witness address via the `addwitnessaddress` RPC, but -please note that this is a testing/expert RPC, which does not guarantee recovery from backup. Only use -this RPC if you know what you are doing. More complete wallet support for segregated witness is coming -in a next version. - -Rescanning with encrypted wallets ---------------------------------- - -As in previous versions, when using an encrypted HD wallet, the keypool cannot be topped up without unlocking -the wallet. This means that currently, in order to recover from a backup of an encrypted HD wallet, the user -must unlock the wallet with a really long timeout and manually trigger a rescan, otherwise they risk missing -some keys when auto-topup cannot run. Unfortunately there is no `rescan` RPC in this version, that will be -included in a future version, so for now a rescan can be triggered using one of the `import*` commands, using -a dummy address generated by another (trusted) wallet. - -Notable changes -=============== - -Performance Improvements ------------------------- - -Version 0.15 contains a number of significant performance improvements, which make -Initial Block Download, startup, transaction and block validation much faster: - -- The chainstate database (which is used for tracking UTXOs) has been changed - from a per-transaction model to a per-output model (See [PR 10195](https://github.com/bitcoin/bitcoin/pull/10195)). Advantages of this model - are that it: - - avoids the CPU overhead of deserializing and serializing the unused outputs; - - has more predictable memory usage; - - uses simpler code; - - is adaptable to various future cache flushing strategies. - - As a result, validating the blockchain during Initial Block Download (IBD) and reindex - is ~30-40% faster, uses 10-20% less memory, and flushes to disk far less frequently. - The only downside is that the on-disk database is 15% larger. During the conversion from the previous format - a few extra gigabytes may be used. -- Earlier versions experienced a spike in memory usage while flushing UTXO updates to disk. - As a result, only half of the available memory was actually used as cache, and the other half was - reserved to accommodate flushing. This is no longer the case (See [PR 10148](https://github.com/bitcoin/bitcoin/pull/10148)), and the entirety of - the available cache (see `-dbcache`) is now actually used as cache. This reduces the flushing - frequency by a factor 2 or more. -- In previous versions, signature validation for transactions has been cached when the - transaction is accepted to the mempool. Version 0.15 extends this to cache the entire script - validity (See [PR 10192](https://github.com/bitcoin/bitcoin/pull/10192)). This means that if a transaction in a block has already been accepted to the - mempool, the scriptSig does not need to be re-evaluated. Empirical tests show that - this results in new block validation being 40-50% faster. -- LevelDB has been upgraded to version 1.20 (See [PR 10544](https://github.com/bitcoin/bitcoin/pull/10544)). This version contains hardware acceleration for CRC - on architectures supporting SSE 4.2. As a result, synchronization and block validation are now faster. -- SHA256 hashing has been optimized for architectures supporting SSE 4 (See [PR 10821](https://github.com/bitcoin/bitcoin/pull/10821)). SHA256 is around - 50% faster on supported hardware, which results in around 5% faster IBD and block - validation. In version 0.15, SHA256 hardware optimization is disabled in release builds by - default, but can be enabled by using `--enable-experimental-asm` when building. -- Refill of the keypool no longer flushes the wallet between each key which resulted in a ~20x speedup in creating a new wallet. Part of this speedup was used to increase the default keypool to 1000 keys to make recovery more robust. (See [PR 10831](https://github.com/bitcoin/bitcoin/pull/10831)). - -Fee Estimation Improvements ---------------------------- - -Fee estimation has been significantly improved in version 0.15, with more accurate fee estimates used by the wallet and a wider range of options for advanced users of the `estimatesmartfee` and `estimaterawfee` RPCs (See [PR 10199](https://github.com/bitcoin/bitcoin/pull/10199)). - -### Changes to internal logic and wallet behavior - -- Internally, estimates are now tracked on 3 different time horizons. This allows for longer targets and means estimates adjust more quickly to changes in conditions. -- Estimates can now be *conservative* or *economical*. *Conservative* estimates use longer time horizons to produce an estimate which is less susceptible to rapid changes in fee conditions. *Economical* estimates use shorter time horizons and will be more affected by short-term changes in fee conditions. Economical estimates may be considerably lower during periods of low transaction activity (for example over weekends), but may result in transactions being unconfirmed if prevailing fees increase rapidly. -- By default, the wallet will use conservative fee estimates to increase the reliability of transactions being confirmed within the desired target. For transactions that are marked as replaceable, the wallet will use an economical estimate by default, since the fee can be 'bumped' if the fee conditions change rapidly (See [PR 10589](https://github.com/bitcoin/bitcoin/pull/10589)). -- Estimates can now be made for confirmation targets up to 1008 blocks (one week). -- More data on historical fee rates is stored, leading to more precise fee estimates. -- Transactions which leave the mempool due to eviction or other non-confirmed reasons are now taken into account by the fee estimation logic, leading to more accurate fee estimates. -- The fee estimation logic will make sure enough data has been gathered to return a meaningful estimate. If there is insufficient data, a fallback default fee is used. - -### Changes to fee estimate RPCs - -- The `estimatefee` RPC is now deprecated in favor of using only `estimatesmartfee` (which is the implementation used by the GUI) -- The `estimatesmartfee` RPC interface has been changed (See [PR 10707](https://github.com/bitcoin/bitcoin/pull/10707)): - - The `nblocks` argument has been renamed to `conf_target` (to be consistent with other RPC methods). - - An `estimate_mode` argument has been added. This argument takes one of the following strings: `CONSERVATIVE`, `ECONOMICAL` or `UNSET` (which defaults to `CONSERVATIVE`). - - The RPC return object now contains an `errors` member, which returns errors encountered during processing. - - If Avian Core has not been running for long enough and has not seen enough blocks or transactions to produce an accurate fee estimation, an error will be returned (previously a value of -1 was used to indicate an error, which could be confused for a feerate). -- A new `estimaterawfee` RPC is added to provide raw fee data. External clients can query and use this data in their own fee estimation logic. - -Multi-wallet support --------------------- - -Avian Core now supports loading multiple, separate wallets (See [PR 8694](https://github.com/bitcoin/bitcoin/pull/8694), [PR 10849](https://github.com/bitcoin/bitcoin/pull/10849)). The wallets are completely separated, with individual balances, keys and received transactions. - -Multi-wallet is enabled by using more than one `-wallet` argument when starting Avian, either on the command line or in the Avian config file. - -**In Avian-Qt, only the first wallet will be displayed and accessible for creating and signing transactions.** GUI selectable multiple wallets will be supported in a future version. However, even in 0.15 other loaded wallets will remain synchronized to the node's current tip in the background. This can be useful if running a pruned node, since loading a wallet where the most recent sync is beyond the pruned height results in having to download and revalidate the whole blockchain. Continuing to synchronize all wallets in the background avoids this problem. - -Avian Core 0.15.0 contains the following changes to the RPC interface and `avian-cli` for multi-wallet: - -* When running Avian Core with a single wallet, there are **no** changes to the RPC interface or `avian-cli`. All RPC calls and `avian-cli` commands continue to work as before. -* When running Avian Core with multi-wallet, all *node-level* RPC methods continue to work as before. HTTP RPC requests should be send to the normal `:/` endpoint, and `avian-cli` commands should be run as before. A *node-level* RPC method is any method which does not require access to the wallet. -* When running Avian Core with multi-wallet, *wallet-level* RPC methods must specify the wallet for which they're intended in every request. HTTP RPC requests should be send to the `:/wallet//` endpoint, for example `127.0.0.1:8766/wallet/wallet1.dat/`. `avian-cli` commands should be run with a `-rpcwallet` option, for example `avian-cli -rpcwallet=wallet1.dat getbalance`. -* A new *node-level* `listwallets` RPC method is added to display which wallets are currently loaded. The names returned by this method are the same as those used in the HTTP endpoint and for the `rpcwallet` argument. - -Note that while multi-wallet is now fully supported, the RPC multi-wallet interface should be considered unstable for version 0.15.0, and there may backwards-incompatible changes in future versions. - -Replace-by-fee control in the GUI ---------------------------------- - -Avian Core has supported creating opt-in replace-by-fee (RBF) transactions -since version 0.12.0, and since version 0.14.0 has included a `bumpfee` RPC method to -replace unconfirmed opt-in RBF transactions with a new transaction that pays -a higher fee. - -In version 0.15, creating an opt-in RBF transaction and replacing the unconfirmed -transaction with a higher-fee transaction are both supported in the GUI (See [PR 9592](https://github.com/bitcoin/bitcoin/pull/9592)). - -Removal of Coin Age Priority ----------------------------- - -In previous versions of Avian Core, a portion of each block could be reserved for transactions based on the age and value of UTXOs they spent. This concept (Coin Age Priority) is a policy choice by miners, and there are no consensus rules around the inclusion of Coin Age Priority transactions in blocks. In practice, only a few miners continue to use Coin Age Priority for transaction selection in blocks. Avian Core 0.15 removes all remaining support for Coin Age Priority (See [PR 9602](https://github.com/bitcoin/bitcoin/pull/9602)). This has the following implications: - -- The concept of *free transactions* has been removed. High Coin Age Priority transactions would previously be allowed to be relayed even if they didn't attach a miner fee. This is no longer possible since there is no concept of Coin Age Priority. The `-limitfreerelay` and `-relaypriority` options which controlled relay of free transactions have therefore been removed. -- The `-sendfreetransactions` option has been removed, since almost all miners do not include transactions which do not attach a transaction fee. -- The `-blockprioritysize` option has been removed. -- The `estimatepriority` and `estimatesmartpriority` RPCs have been removed. -- The `getmempoolancestors`, `getmempooldescendants`, `getmempoolentry` and `getrawmempool` RPCs no longer return `startingpriority` and `currentpriority`. -- The `prioritisetransaction` RPC no longer takes a `priority_delta` argument, which is replaced by a `dummy` argument for backwards compatibility with clients using positional arguments. The RPC is still used to change the apparent fee-rate of the transaction by using the `fee_delta` argument. -- `-minrelaytxfee` can now be set to 0. If `minrelaytxfee` is set, then fees smaller than `minrelaytxfee` (per kB) are rejected from relaying, mining and transaction creation. This defaults to 1000 satoshi/kB. -- The `-printpriority` option has been updated to only output the fee rate and hash of transactions included in a block by the mining code. - -Mempool Persistence Across Restarts ------------------------------------ - -Version 0.14 introduced mempool persistence across restarts (the mempool is saved to a `mempool.dat` file in the data directory prior to shutdown and restores the mempool when the node is restarted). Version 0.15 allows this feature to be switched on or off using the `-persistmempool` command-line option (See [PR 9966](https://github.com/bitcoin/bitcoin/pull/9966)). By default, the option is set to true, and the mempool is saved on shutdown and reloaded on startup. If set to false, the `mempool.dat` file will not be loaded on startup or saved on shutdown. - -New RPC methods ---------------- - -Version 0.15 introduces several new RPC methods: - -- `abortrescan` stops current wallet rescan, e.g. when triggered by an `importprivkey` call (See [PR 10208](https://github.com/bitcoin/bitcoin/pull/10208)). -- `combinerawtransaction` accepts a JSON array of raw transactions and combines them into a single raw transaction (See [PR 10571](https://github.com/bitcoin/bitcoin/pull/10571)). -- `estimaterawfee` returns raw fee data so that customized logic can be implemented to analyze the data and calculate estimates. See [Fee Estimation Improvements](#fee-estimation-improvements) for full details on changes to the fee estimation logic and interface. -- `getchaintxstats` returns statistics about the total number and rate of transactions - in the chain (See [PR 9733](https://github.com/bitcoin/bitcoin/pull/9733)). -- `listwallets` lists wallets which are currently loaded. See the *Multi-wallet* section - of these release notes for full details (See [Multi-wallet support](#multi-wallet-support)). -- `uptime` returns the total runtime of the `aviand` server since its last start (See [PR 10400](https://github.com/bitcoin/bitcoin/pull/10400)). - -Low-level RPC changes ---------------------- - -- When using Avian Core in multi-wallet mode, RPC requests for wallet methods must specify - the wallet that they're intended for. See [Multi-wallet support](#multi-wallet-support) for full details. - -- The new database model no longer stores information about transaction - versions of unspent outputs (See [Performance improvements](#performance-improvements)). This means that: - - The `gettxout` RPC no longer has a `version` field in the response. - - The `gettxoutsetinfo` RPC reports `hash_serialized_2` instead of `hash_serialized`, - which does not commit to the transaction versions of unspent outputs, but does - commit to the height and coinbase information. - - The `getutxos` REST path no longer reports the `txvers` field in JSON format, - and always reports 0 for transaction versions in the binary format - -- The `estimatefee` RPC is deprecated. Clients should switch to using the `estimatesmartfee` RPC, which returns better fee estimates. See [Fee Estimation Improvements](#fee-estimation-improvements) for full details on changes to the fee estimation logic and interface. - -- The `gettxoutsetinfo` response now contains `disk_size` and `bogosize` instead of - `bytes_serialized`. The first is a more accurate estimate of actual disk usage, but - is not deterministic. The second is unrelated to disk usage, but is a - database-independent metric of UTXO set size: it counts every UTXO entry as 50 + the - length of its scriptPubKey (See [PR 10426](https://github.com/bitcoin/bitcoin/pull/10426)). - -- `signrawtransaction` can no longer be used to combine multiple transactions into a single transaction. Instead, use the new `combinerawtransaction` RPC (See [PR 10571](https://github.com/bitcoin/bitcoin/pull/10571)). - -- `fundrawtransaction` no longer accepts a `reserveChangeKey` option. This option used to allow RPC users to fund a raw transaction using an key from the keypool for the change address without removing it from the available keys in the keypool. The key could then be re-used for a `getnewaddress` call, which could potentially result in confusing or dangerous behaviour (See [PR 10784](https://github.com/bitcoin/bitcoin/pull/10784)). - -- `estimatepriority` and `estimatesmartpriority` have been removed. See [Removal of Coin Age Priority](#removal-of-coin-age-priority). - -- The `listunspent` RPC now takes a `query_options` argument (see [PR 8952](https://github.com/bitcoin/bitcoin/pull/8952)), which is a JSON object - containing one or more of the following members: - - `minimumAmount` - a number specifying the minimum value of each UTXO - - `maximumAmount` - a number specifying the maximum value of each UTXO - - `maximumCount` - a number specifying the minimum number of UTXOs - - `minimumSumAmount` - a number specifying the minimum sum value of all UTXOs - -- The `getmempoolancestors`, `getmempooldescendants`, `getmempoolentry` and `getrawmempool` RPCs no longer return `startingpriority` and `currentpriority`. See [Removal of Coin Age Priority](#removal-of-coin-age-priority). - -- The `dumpwallet` RPC now returns the full absolute path to the dumped wallet. It - used to return no value, even if successful (See [PR 9740](https://github.com/bitcoin/bitcoin/pull/9740)). - -- In the `getpeerinfo` RPC, the return object for each peer now returns an `addrbind` member, which contains the ip address and port of the connection to the peer. This is in addition to the `addrlocal` member which contains the ip address and port of the local node as reported by the peer (See [PR 10478](https://github.com/bitcoin/bitcoin/pull/10478)). - -- The `disconnectnode` RPC can now disconnect a node specified by node ID (as well as by IP address/port). To disconnect a node based on node ID, call the RPC with the new `nodeid` argument (See [PR 10143](https://github.com/bitcoin/bitcoin/pull/10143)). - -- The second argument in `prioritisetransaction` has been renamed from `priority_delta` to `dummy` since Avian Core no longer has a concept of coin age priority. The `dummy` argument has no functional effect, but is retained for positional argument compatibility. See [Removal of Coin Age Priority](#removal-of-coin-age-priority). - -- The `resendwallettransactions` RPC throws an error if the `-walletbroadcast` option is set to false (See [PR 10995](https://github.com/bitcoin/bitcoin/pull/10995)). - -- The second argument in the `submitblock` RPC argument has been renamed from `parameters` to `dummy`. This argument never had any effect, and the renaming is simply to communicate this fact to the user (See [PR 10191](https://github.com/bitcoin/bitcoin/pull/10191)) - (Clients should, however, use positional arguments for `submitblock` in order to be compatible with BIP 22.) - -- The `verbose` argument of `getblock` has been renamed to `verbosity` and now takes an integer from 0 to 2. Verbose level 0 is equivalent to `verbose=false`. Verbose level 1 is equivalent to `verbose=true`. Verbose level 2 will give the full transaction details of each transaction in the output as given by `getrawtransaction`. The old behavior of using the `verbose` named argument and a boolean value is still maintained for compatibility. - -- Error codes have been updated to be more accurate for the following error cases (See [PR 9853](https://github.com/bitcoin/bitcoin/pull/9853)): - - `getblock` now returns RPC_MISC_ERROR if the block can't be found on disk (for - example if the block has been pruned). Previously returned RPC_INTERNAL_ERROR. - - `pruneblockchain` now returns RPC_MISC_ERROR if the blocks cannot be pruned - because the node is not in pruned mode. Previously returned RPC_METHOD_NOT_FOUND. - - `pruneblockchain` now returns RPC_INVALID_PARAMETER if the blocks cannot be pruned - because the supplied timestamp is too late. Previously returned RPC_INTERNAL_ERROR. - - `pruneblockchain` now returns RPC_MISC_ERROR if the blocks cannot be pruned - because the blockchain is too short. Previously returned RPC_INTERNAL_ERROR. - - `setban` now returns RPC_CLIENT_INVALID_IP_OR_SUBNET if the supplied IP address - or subnet is invalid. Previously returned RPC_CLIENT_NODE_ALREADY_ADDED. - - `setban` now returns RPC_CLIENT_INVALID_IP_OR_SUBNET if the user tries to unban - a node that has not previously been banned. Previously returned RPC_MISC_ERROR. - - `removeprunedfunds` now returns RPC_WALLET_ERROR if `aviand` is unable to remove - the transaction. Previously returned RPC_INTERNAL_ERROR. - - `removeprunedfunds` now returns RPC_INVALID_PARAMETER if the transaction does not - exist in the wallet. Previously returned RPC_INTERNAL_ERROR. - - `fundrawtransaction` now returns RPC_INVALID_ADDRESS_OR_KEY if an invalid change - address is provided. Previously returned RPC_INVALID_PARAMETER. - - `fundrawtransaction` now returns RPC_WALLET_ERROR if `aviand` is unable to create - the transaction. The error message provides further details. Previously returned - RPC_INTERNAL_ERROR. - - `bumpfee` now returns RPC_INVALID_PARAMETER if the provided transaction has - descendants in the wallet. Previously returned RPC_MISC_ERROR. - - `bumpfee` now returns RPC_INVALID_PARAMETER if the provided transaction has - descendants in the mempool. Previously returned RPC_MISC_ERROR. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction has - has been mined or conflicts with a mined transaction. Previously returned - RPC_INVALID_ADDRESS_OR_KEY. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction is not - BIP 125 replaceable. Previously returned RPC_INVALID_ADDRESS_OR_KEY. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction has already - been bumped by a different transaction. Previously returned RPC_INVALID_REQUEST. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction contains - inputs which don't belong to this wallet. Previously returned RPC_INVALID_ADDRESS_OR_KEY. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction has multiple change - outputs. Previously returned RPC_MISC_ERROR. - - `bumpfee` now returns RPC_WALLET_ERROR if the provided transaction has no change - output. Previously returned RPC_MISC_ERROR. - - `bumpfee` now returns RPC_WALLET_ERROR if the fee is too high. Previously returned - RPC_MISC_ERROR. - - `bumpfee` now returns RPC_WALLET_ERROR if the fee is too low. Previously returned - RPC_MISC_ERROR. - - `bumpfee` now returns RPC_WALLET_ERROR if the change output is too small to bump the - fee. Previously returned RPC_MISC_ERROR. - -0.15.0 Change log -================= - -### RPC and other APIs -- #9485 `61a640e` ZMQ example using python3 and asyncio (mcelrath) -- #9894 `0496e15` remove 'label' filter for rpc command help (instagibbs) -- #9853 `02bd6e9` Fix error codes from various RPCs (jnewbery) -- #9842 `598ef9c` Fix RPC failure testing (continuation of #9707) (jnewbery) -- #10038 `d34995a` Add mallocinfo mode to `getmemoryinfo` RPC (laanwj) -- #9500 `3568b30` [Qt][RPC] Autocomplete commands for 'help' command in debug console (achow101) -- #10056 `e6156a0` [zmq] Call va_end() on va_start()ed args (kallewoof) -- #10086 `7438cea` Trivial: move rpcserialversion into RPC option group (jlopp) -- #10150 `350b224` [rpc] Add logging rpc (jnewbery) -- #10208 `393160c` [wallet] Rescan abortability (kallewoof) -- #10143 `a987def` [net] Allow disconnectnode RPC to be called with node id (jnewbery) -- #10281 `0e8499c` doc: Add RPC interface guidelines (laanwj) -- #9733 `d4732f3` Add getchaintxstats RPC (sipa) -- #10310 `f4b15e2` [doc] Add hint about getmempoolentry to getrawmempool help (kallewoof) -- #8704 `96c850c` [RPC] Transaction details in getblock (achow101) -- #8952 `9390845` Add query options to listunspent RPC call (pedrobranco) -- #10413 `08ac35a` Fix docs (there's no rpc command setpaytxfee) (RHavar) -- #8384 `e317c0d` Add witness data output to TxInError messages (instagibbs) -- #9571 `4677151` RPC: getblockchaininfo returns BIP signaling statistics (pinheadmz) -- #10450 `ef2d062` Fix bumpfee rpc "errors" return value (ryanofsky) -- #10475 `39039b1` [RPC] getmempoolinfo mempoolminfee is a AVN/KB feerate (instagibbs) -- #10478 `296928e` rpc: Add listen address to incoming connections in `getpeerinfo` (laanwj) -- #10403 `08d0390` Fix importmulti failure to return rescan errors (ryanofsky) -- #9740 `9fec4da` Add friendly output to dumpwallet (aideca) -- #10426 `16f6c98` Replace bytes_serialized with bogosize (sipa) -- #10252 `980deaf` RPC/Mining: Restore API compatibility for prioritisetransaction (luke-jr) -- #9672 `46311e7` Opt-into-RBF for RPC & avian-tx (luke-jr) -- #10481 `9c248e3` Decodehextx scripts sanity check (achow101) -- #10488 `fa1f106` Note that the prioritizetransaction dummy value is deprecated, and has no meaning (TheBlueMatt) -- #9738 `c94b89e` gettxoutproof() should return consistent result (jnewbery) -- #10191 `00350bd` [trivial] Rename unused RPC arguments 'dummy' (jnewbery) -- #10627 `b62b4c8` fixed listunspent rpc convert parameter (tnakagawa) -- #10412 `bef02fb` Improve wallet rescan API (ryanofsky) -- #10400 `1680ee0` [RPC] Add an uptime command that displays the amount of time (in seconds) aviand has been running (rvelhote) -- #10683 `d81bec7` rpc: Move the `generate` RPC call to rpcwallet (laanwj) -- #10710 `30bc0f6` REST/RPC example update (Mirobit) -- #10747 `9edda0c` [rpc] fix verbose argument for getblock in avian-cli (jnewbery) -- #10589 `104f5f2` More economical fee estimates for RBF and RPC options to control (morcos) -- #10543 `b27b004` Change API to estimaterawfee (morcos) -- #10807 `afd2fca` getbalance example covers at least 6 confirms (instagibbs) -- #10707 `75b5643` Better API for estimatesmartfee RPC (morcos) -- #10784 `9e8d6a3` Do not allow users to get keys from keypool without reserving them (TheBlueMatt) -- #10857 `d445a2c` [RPC] Add a deprecation warning to getinfo's output (achow101) -- #10571 `adf170d` [RPC]Move transaction combining from signrawtransaction to new RPC (achow101) -- #10783 `041dad9` [RPC] Various rpc argument fixes (instagibbs) -- #9622 `6ef3c7e` [rpc] listsinceblock should include lost transactions when parameter is a reorg'd block (kallewoof) -- #10799 `8537187` Prevent user from specifying conflicting parameters to fundrawtx (TheBlueMatt) -- #10931 `0b11a07` Fix misleading "Method not found" multiwallet errors (ryanofsky) -- #10788 `f66c596` [RPC] Fix addwitnessaddress by replacing ismine with producesignature (achow101) -- #10999 `627c3c0` Fix amounts formatting in `decoderawtransaction` (laanwj) -- #11002 `4268426` [wallet] return correct error code from resendwallettransaction (jnewbery) -- #11029 `96a63a3` [RPC] trivial: gettxout no longer shows version of tx (FelixWeis) -- #11083 `6c2b008` Fix combinerawtransaction RPC help result section (jonasnick) -- #11027 `07164bb` [RPC] Only return hex field once in getrawtransaction (achow101) -- #10698 `5af6572` Be consistent in calling transactions "replaceable" for Opt-In RBF (TheBlueMatt) - -### Block and transaction handling -- #9801 `a8c5751` Removed redundant parameter from mempool.PrioritiseTransaction (gubatron) -- #9819 `1efc99c` Remove harmless read of unusued priority estimates (morcos) -- #9822 `b7547fa` Remove block file location upgrade code (benma) -- #9602 `30ff3a2` Remove coin age priority and free transactions - implementation (morcos) -- #9548 `47510ad` Remove min reasonable fee (morcos) -- #10249 `c73af54` Switch CCoinsMap from boost to std unordered_map (sipa) -- #9966 `2a183de` Control mempool persistence using a command line parameter (jnewbery) -- #10199 `318ea50` Better fee estimates (morcos) -- #10196 `bee3529` Bugfix: PrioritiseTransaction updates the mempool tx counter (sdaftuar) -- #10195 `1088b02` Switch chainstate db and cache to per-txout model (sipa) -- #10284 `c2ab38b` Always log debug information for fee calculation in CreateTransaction (morcos) -- #10503 `efbcf2b` Use REJECT_DUPLICATE for already known and conflicted txn (sipa) -- #10537 `b3eb0d6` Few Minor per-utxo assert-semantics re-adds and tweak (TheBlueMatt) -- #10626 `8c841a3` doc: Remove outdated minrelaytxfee comment (MarcoFalke) -- #10559 `234ffc6` Change semantics of HaveCoinInCache to match HaveCoin (morcos) -- #10581 `7878353` Simplify return values of GetCoin/HaveCoin(InCache) (sipa) -- #10684 `a381f6a` Remove no longer used mempool.exists(outpoint) (morcos) -- #10148 `d4e551a` Use non-atomic flushing with block replay (sipa) -- #10685 `30c2130` Clarify CCoinsViewMemPool documentation (TheBlueMatt) -- #10558 `90a002e` Address nits from per-utxo change (morcos) -- #10706 `6859ad2` Improve wallet fee logic and fix GUI bugs (morcos) -- #10526 `754aa02` Force on-the-fly compaction during pertxout upgrade (sipa) -- #10985 `d896d5c` Add undocumented -forcecompactdb to force LevelDB compactions (sipa) -- #10292 `e4bbd3d` Improved efficiency in COutPoint constructors (mm-s) -- #10290 `8d6d43e` Add -stopatheight for benchmarking (sipa) - -### P2P protocol and network code -- #9726 `7639d38` netbase: Do not print an error on connection timeouts through proxy (laanwj) -- #9805 `5b583ef` Add seed.btc.petertodd.org to mainnet DNS seeds (petertodd) -- #9861 `22f609f` Trivial: Debug log ambiguity fix for peer addrs (keystrike) -- #9774 `90cb2a2` Enable host lookups for -proxy and -onion parameters (jmcorgan) -- #9558 `7b585cf` Clarify assumptions made about when BlockCheck is called (TheBlueMatt) -- #10135 `e19586a` [p2p] Send the correct error code in reject messages (jnewbery) -- #9665 `eab00d9` Use cached [compact] blocks to respond to getdata messages (TheBlueMatt) -- #10215 `a077a90` Check interruptNet during dnsseed lookups (TheBlueMatt) -- #10234 `faf2dea` [net] listbanned RPC and QT should show correct banned subnets (jnewbery) -- #10134 `314ebdf` [qa] Fixes segwit block relay test after inv-direct-fetch was disabled (sdaftuar) -- #10351 `3f57c55` removed unused code in INV message (Greg-Griffith) -- #10061 `ae78609` [net] Added SetSocketNoDelay() utility function (tjps) -- #10408 `28c6e8d` Net: Improvements to Tor control port parser (str4d) -- #10460 `5c63d66` Broadcast address every day, not 9 hours (sipa) -- #10471 `400fdd0` Denote functions CNode::GetRecvVersion() and CNode::GetRefCount() as const (pavlosantoniou) -- #10345 `67700b3` [P2P] Timeout for headers sync (sdaftuar) -- #10564 `8d9f45e` Return early in IsBanned (gmaxwell) -- #10587 `de8db47` Net: Fix resource leak in ReadBinaryFile(...) (practicalswift) -- #9549 `b33ca14` [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...) (practicalswift) -- #10446 `2772dc9` net: avoid extra dns query per seed (theuni) -- #10824 `9dd6a2b` Avoid unnecessary work in SetNetworkActive (promag) -- #10948 `df3a6f4` p2p: Hardcoded seeds update pre-0.15 branch (laanwj) -- #10977 `02f4c4a` [net] Fix use of uninitialized value in getnetworkinfo(const JSONRPCRequest&) (practicalswift) -- #10982 `c8b62c7` Disconnect network service bits 6 and 8 until Aug 1, 2018 (TheBlueMatt) -- #11012 `0e5cff6` Make sure to clean up mapBlockSource if we've already seen the block (theuni) - -### Validation -- #9725 `67023e9` CValidationInterface Cleanups (TheBlueMatt) -- #10178 `2584925` Remove CValidationInterface::UpdatedTransaction (TheBlueMatt) -- #10201 `a6548a4` pass Consensus::Params& to functions in validation.cpp and make them static (mariodian) -- #10297 `431a548` Simplify DisconnectBlock arguments/return value (sipa) -- #10464 `f94b7d5` Introduce static DoWarning (simplify UpdateTip) (jtimon) -- #10569 `2e7d8f8` Fix stopatheight (achow101) -- #10192 `2935b46` Cache full script execution results in addition to signatures (TheBlueMatt) -- #10179 `21ed30a` Give CValidationInterface Support for calling notifications on the CScheduler Thread (TheBlueMatt) -- #10557 `66270a4` Make check to distinguish between orphan txs and old txs more efficient (morcos) -- #10775 `7c2400c` nCheckDepth chain height fix (romanornr) -- #10821 `16240f4` Add SSE4 optimized SHA256 (sipa) -- #10854 `04d395e` Avoid using sizes on non-fixed-width types to derive protocol constants (gmaxwell) -- #10945 `2a50b11` Update defaultAssumeValid according to release-process.md (gmaxwell) -- #10986 `2361208` Update chain transaction statistics (sipa) -- #11028 `6bdf4b3` Avoid masking of difficulty adjustment errors by checkpoints (sipa) -- #9533 `cb598cf` Allow non-power-of-2 signature cache sizes (sipa) -- #9208 `acd9957` Improve DisconnectTip performance (sdaftuar) -- #10618 `f90603a` Remove confusing MAX_BLOCK_BASE_SIZE (gmaxwell) -- #10758 `bd92424` Fix some chainstate-init-order bugs (TheBlueMatt) -- #10550 `b7296bc` Don't return stale data from CCoinsViewCache::Cursor() (ryanofsky) -- #10998 `2507fd5` Fix upgrade cancel warnings (TheBlueMatt) -- #9868 `cbdb473` Abstract out the command line options for block assembly (sipa) - -### Build system -- #9727 `5f0556d` Remove fallbacks for boost_filesystem < v3 (laanwj) -- #9788 `50a2265` gitian: bump descriptors for master (theuni) -- #9794 `7ca2f54` Minor update to qrencode package builder (mitchellcash) -- #9514 `2cc0df1` release: Windows signing script (theuni) -- #9921 `8b789d8` build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL (laanwj) -- #10011 `32d1b34` build: Fix typo s/HAVE_DONTWAIT/HAVE_MSG_DONTWAIT (laanwj) -- #9946 `90dd9e6` Fix build errors if spaces in path or parent directory (pinheadmz) -- #10136 `81da4c7` build: Disable Wshadow warning (laanwj) -- #10166 `64962ae` Ignore Doxyfile generated from Doxyfile.in template (paveljanik) -- #10239 `0416ea9` Make Boost use std::atomic internally (sipa) -- #10228 `27faa6c` build: regenerate avian-config.h as necessary (theuni) -- #10273 `8979f45` [scripts] Minor improvements to `macdeployqtplus` script (chrisgavin) -- #10325 `a26280b` 0.15.0 Depends Updates (fanquake) -- #10328 `79aeff6` Update contrib/debian to latest Ubuntu PPA upload (TheBlueMatt) -- #7522 `d25449f` Bugfix: Only use git for build info if the repository is actually the right one (luke-jr) -- #10489 `e654d61` build: silence gcc7's implicit fallthrough warning (theuni) -- #10549 `ad1a13e` Avoid printing generic and duplicated "checking for QT" during ./configure (drizzt) -- #10628 `8465b68` [depends] expat 2.2.1 (fanquake) -- #10806 `db825d2` build: verify that the assembler can handle crc32 functions (theuni) -- #10766 `b4d03be` Building Environment: Set ARFLAGS to cr (ReneNyffenegger) -- #10803 `91edda8` Explicitly search for bdb5.3 (pstratem) -- #10855 `81560b0` random: only use getentropy on openbsd (theuni) -- #10508 `1caafa6` Run Qt wallet tests on travis (ryanofsky) -- #10851 `e222618` depends: fix fontconfig with newer glibc (theuni) -- #10971 `88b1e4b` build: fix missing sse42 in depends builds (theuni) -- #11097 `129b03f` gitian: quick hack to fix version string in releases (theuni) -- #10039 `919aaf6` Fix compile errors with Qt 5.3.2 and Boost 1.55.0 (ryanofsky) -- #10168 `7032021` Fix build warning from #error text (jnewbery) -- #10301 `318392c` Check if sys/random.h is required for getentropy (jameshilliard) - -### GUI -- #9724 `1a9fd5c` Qt/Intro: Add explanation of IBD process (luke-jr) -- #9834 `b00ba62` qt: clean up initialize/shutdown signals (benma) -- #9481 `ce01e62` [Qt] Show more significant warning if we fall back to the default fee (jonasschnelli) -- #9974 `b9f930b` Add basic Qt wallet test (ryanofsky) -- #9690 `a387d3a` Change 'Clear' button string to 'Reset' (da2x) -- #9592 `9c7b7cf` [Qt] Add checkbox in the GUI to opt-in to RBF when creating a transaction (ryanofsky) -- #10098 `2b477e6` Make qt wallet test compatible with qt4 (ryanofsky) -- #9890 `1fa4ae6` Add a button to open the config file in a text editor (ericshawlinux) -- #10156 `51833a1` Fix for issues with startup and multiple monitors on windows (AllanDoensen) -- #10177 `de01da7` Changed "Send" button default status from true to false (KibbledJiveElkZoo) -- #10221 `e96486c` Stop treating coinbase outputs differently in GUI: show them at 1conf (TheBlueMatt) -- #10231 `987a6c0` [Qt] Reduce a significant cs_main lock freeze (jonasschnelli) -- #10242 `f6f3b58` [qt] Don't call method on null WalletModel object (ryanofsky) -- #10093 `a3e756b` [Qt] Don't add arguments of sensitive command to console window (jonasschnelli) -- #10362 `95546c8` [GUI] Add OSX keystroke to RPCConsole info (spencerlievens) -- #9697 `962cd3f` [Qt] simple fee bumper with user verification (jonasschnelli) -- #10390 `e477516` [wallet] remove minimum total fee option (instagibbs) -- #10420 `4314544` Add Qt tests for wallet spends & bumpfee (ryanofsky) -- #10454 `c1c9a95` Fix broken q4 test build (ryanofsky) -- #10449 `64beb13` Overhaul Qt fee bumper (jonasschnelli) -- #10582 `7c72fb9` Pass in smart fee slider value to coin control dialog (morcos) -- #10673 `4c72cc3` [qt] Avoid potential null pointer dereference in TransactionView::exportClicked() (practicalswift) -- #10769 `8fdd23a` [Qt] replace fee slider with a Dropdown, extend conf. targets (jonasschnelli) -- #10870 `412b466` [Qt] Use wallet 0 in rpc console if running with multiple wallets (jonasschnelli) -- #10988 `a9dd111` qt: Increase BLOCK_CHAIN_SIZE constants (laanwj) -- #10644 `e292140` Slightly overhaul NSI pixmaps (jonasschnelli) -- #10660 `0c3542e` Allow to cancel the txdb upgrade via splashscreen keypress 'q' (jonasschnelli) - -### Wallet -- #9359 `f7ec7cf` Add test for CWalletTx::GetImmatureCredit() returning stale values (ryanofsky) -- #9576 `56ab672` [wallet] Remove redundant initialization (practicalswift) -- #9333 `fa625b0` Document CWalletTx::mapValue entries and remove erase of nonexistent "version" entry (ryanofsky) -- #9906 `72fb515` Disallow copy constructor CReserveKeys (instagibbs) -- #9369 `3178b2c` Factor out CWallet::nTimeSmart computation into a method (ryanofsky) -- #9830 `afcd7c0` Add safe flag to listunspent result (NicolasDorier) -- #9993 `c49355c` Initialize nRelockTime (pstratem) -- #9818 `3d857f3` Save watch only key timestamps when reimporting keys (ryanofsky) -- #9294 `f34cdcb` Use internal HD chain for change outputs (hd split) (jonasschnelli) -- #10164 `e183ea2` Wallet: reduce excess logic InMempool() (kewde) -- #10186 `c9ff4f8` Remove SYNC_TRANSACTION_NOT_IN_BLOCK magic number (jnewbery) -- #10226 `64c45aa` wallet: Use boost to more portably ensure -wallet specifies only a filename (luke-jr) -- #9827 `c91ca0a` Improve ScanForWalletTransactions return value (ryanofsky) -- #9951 `fa1ac28` Wallet database handling abstractions/simplifications (laanwj) -- #10265 `c29a0d4` [wallet] [moveonly] Check non-null pindex before potentially referencing (kallewoof) -- #10283 `a550f6e` Cleanup: reduce to one GetMinimumFee call signature (morcos) -- #10294 `e2b99b1` [Wallet] unset change position when there is no change (instagibbs) -- #10115 `d3dce0e` Avoid reading the old hd master key during wallet encryption (TheBlueMatt) -- #10341 `18c9deb` rpc/wallet: Workaround older UniValue which returns a std::string temporary for get_str (luke-jr) -- #10308 `94e5227` [wallet] Securely erase potentially sensitive keys/values (tjps) -- #10257 `ea1fd43` [test] Add test for getmemoryinfo (jimmysong) -- #10295 `ce8176d` [qt] Move some WalletModel functions into CWallet (ryanofsky) -- #10506 `7cc2c67` Fix bumpfee test after #10449 (ryanofsky) -- #10500 `098b01d` Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings (ryanofsky) -- #10455 `0747d33` Simplify feebumper minimum fee code slightly (ryanofsky) -- #10522 `2805d60` [wallet] Remove unused variables (practicalswift) -- #8694 `177433a` Basic multiwallet support (luke-jr) -- #10598 `7a74f88` Supress struct/class mismatch warnings introduced in #10284 (paveljanik) -- #9343 `209eef6` Don't create change at dust limit (morcos) -- #10744 `ed88e31` Use method name via __func__ macro (darksh1ne) -- #10712 `e8b9523` Add change output if necessary to reduce excess fee (morcos) -- #10816 `1c011ff` Properly forbid -salvagewallet and -zapwallettxes for multi wallet (morcos) -- #10235 `5cfdda2` Track keypool entries as internal vs external in memory (TheBlueMatt) -- #10330 `bf0a08b` [wallet] fix zapwallettxes interaction with persistent mempool (jnewbery) -- #10831 `0b01935` Batch flushing operations to the walletdb during top up and increase keypool size (gmaxwell) -- #10795 `7b6e8bc` No longer ever reuse keypool indexes (TheBlueMatt) -- #10849 `bde4f93` Multiwallet: simplest endpoint support (jonasschnelli) -- #10817 `9022aa3` Redefine Dust and add a discard_rate (morcos) -- #10883 `bf3b742` Rename -usewallet to -rpcwallet (morcos) -- #10604 `420238d` [wallet] [tests] Add listwallets RPC, include wallet name in `getwalletinfo` and add multiwallet test (jnewbery) -- #10885 `70888a3` Reject invalid wallets (promag) -- #10949 `af56397` Clarify help message for -discardfee (morcos) -- #10942 `2e857bb` Eliminate fee overpaying edge case when subtracting fee from recipients (morcos) -- #10995 `fa64636` Fix resendwallettransactions assert failure if -walletbroadcast=0 (TheBlueMatt) -- #11022 `653a46d` Basic keypool topup (jnewbery) -- #11081 `9fe1f6b` Add length check for CExtKey deserialization (jonasschnelli, guidovranken) -- #11044 `4ef8374` [wallet] Keypool topup cleanups (jnewbery) -- #11145 `e51bb71` Fix rounding bug in calculation of minimum change (morcos) -- #9605 `779f2f9` Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (TheBlueMatt) -- #10108 `4e3efd4` ApproximateBestSubset should take inputs by reference, not value (RHavar) - -### Tests and QA -- #9744 `8efd1c8` Remove unused module from rpc-tests (34ro) -- #9657 `7ff4a53` Improve rpc-tests.py (jnewbery) -- #9766 `7146d96` Add --exclude option to rpc-tests.py (jnewbery) -- #9577 `d6064a8` Fix docstrings in qa tests (jnewbery) -- #9823 `a13a417` qa: Set correct path for binaries in rpc tests (MarcoFalke) -- #9847 `6206252` Extra test vector for BIP32 (sipa) -- #9350 `88c2ae3` [Trivial] Adding label for amount inside of tx_valid/tx_invalid.json (Christewart) -- #9888 `36afd4d` travis: Verify commits only for one target (MarcoFalke) -- #9904 `58861ad` test: Fail if InitBlockIndex fails (laanwj) -- #9828 `67c5cc1` Avoid -Wshadow warnings in wallet_tests (ryanofsky) -- #9832 `48c3429` [qa] assert_start_raises_init_error (NicolasDorier) -- #9739 `9d5fcbf` Fix BIP68 activation test (jnewbery) -- #9547 `d32581c` bench: Assert that division by zero is unreachable (practicalswift) -- #9843 `c78adbf` Fix segwit getblocktemplate test (jnewbery) -- #9929 `d5ce14e` tests: Delete unused function _rpchost_to_args (laanwj) -- #9555 `19be26a` [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (transaction_tests.cpp) (practicalswift) -- #9945 `ac23a7c` Improve logging in bctest.py if there is a formatting mismatch (jnewbery) -- #9768 `8910b47` [qa] Add logging to test_framework.py (jnewbery) -- #9972 `21833f9` Fix extended rpc tests broken by #9768 (jnewbery) -- #9977 `857d1e1` QA: getblocktemplate_longpoll.py should always use >0 fee tx (sdaftuar) -- #9970 `3cc13ea` Improve readability of segwit.py, smartfees.py (sdaftuar) -- #9497 `2c781fb` CCheckQueue Unit Tests (JeremyRubin) -- #10024 `9225de2` [trivial] Use log.info() instead of print() in remaining functional test cases (jnewbery) -- #9956 `3192e52` Reorganise qa directory (jnewbery) -- #10017 `02d64bd` combine_logs.py - aggregates log files from multiple aviands during functional tests (jnewbery) -- #10047 `dfef6b6` [tests] Remove unused variables and imports (practicalswift) -- #9701 `a230b05` Make bumpfee tests less fragile (ryanofsky) -- #10053 `ca20923` [test] Allow functional test cases to be skipped (jnewbery) -- #10052 `a0b1e57` [test] Run extended tests once daily in Travis (jnewbery) -- #10069 `1118493` [QA] Fix typo in fundrawtransaction test (NicolasDorier) -- #10083 `c044f03` [QA] Renaming rawTx into rawtx (NicolasDorier) -- #10073 `b1a4f27` Actually run assumevalid.py (jnewbery) -- #9780 `c412fd8` Suppress noisy output from qa tests in Travis (jnewbery) -- #10096 `79af9fb` Check that all test scripts in test/functional are being run (jnewbery) -- #10076 `5b029aa` [qa] combine_logs: Use ordered list for logfiles (MarcoFalke) -- #10107 `f2734c2` Remove unused variable. Remove accidental trailing semicolons in Python code (practicalswift) -- #10109 `8ac8041` Remove SingleNodeConnCB (jnewbery) -- #10114 `edc62c9` [tests] sync_with_ping should assert that ping hasn't timed out (jnewbery) -- #10128 `427d2fd` Speed Up CuckooCache tests (JeremyRubin) -- #10072 `12af74b` Remove sources of unreliablility in extended functional tests (jnewbery) -- #10077 `ebfd653` [qa] Add setnetworkactive smoke test (MarcoFalke) -- #10152 `080d7c7` [trivial] remove unused line in Travis config (jnewbery) -- #10159 `df1ca9e` [tests] color test results and sort alphabetically (jnewbery) -- #10124 `88799ea` [test] Suppress test logging spam (jnewbery) -- #10142 `ed09dd3` Run avian_test-qt under minimal QPA platform (ryanofsky) -- #9949 `a27dbc5` [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift) -- #10187 `b44adf9` tests: Fix test_runner return value in case of skipped test (laanwj) -- #10197 `d86bb07` [tests] Functional test warnings (jnewbery) -- #10219 `9111df9` Tests: Order Python Tests Differently (jimmysong) -- #10229 `f3db4c6` Tests: Add test for getdifficulty (jimmysong) -- #10224 `2723bcd` [test] Add test for getaddednodeinfo (jimmysong) -- #10023 `c530c15` [tests] remove maxblocksinflight.py (functionality covered by other test) (jnewbery) -- #10097 `1b25b6d` Move zmq test skipping logic into individual test case (jnewbery) -- #10272 `54e2d87` [Tests] Prevent warning: variable 'x' is uninitialized (paveljanik) -- #10225 `e0a7e19` [test] Add aborttrescan tests (kallewoof) -- #10278 `8254a8a` [test] Add Unit Test for GetListenPort (jimmysong) -- #10280 `47535d7` [test] Unit test amount.h/amount.cpp (jimmysong) -- #10256 `80c3a73` [test] Add test for gettxout to wallet.py (jimmysong) -- #10264 `492d22f` [test] Add tests for getconnectioncount, getnettotals and ping (jimmysong) -- #10169 `8f3e384` [tests] Remove func test code duplication (jnewbery) -- #10198 `dc8fc0c` [tests] Remove is_network_split from functional test framework (jnewbery) -- #10255 `3c5e6c9` [test] Add test for listaddressgroupings (jimmysong) -- #10137 `75171f0` Remove unused import. Remove accidental trailing semicolons (practicalswift) -- #10307 `83073de` [tests] allow zmq test to be run in out-of-tree builds (jnewbery) -- #10344 `e927483` [tests] Fix abandonconflict.py intermittency (jnewbery) -- #10318 `170bc2c` [tests] fix wait_for_inv() (jnewbery) -- #10171 `fff72de` [tests] Add node methods to test framework (jnewbery) -- #10352 `23d78c4` test: Add elapsed time to RPC tracing (laanwj) -- #10342 `6a796b2` [tests] Improve mempool_persist test (jnewbery) -- #10287 `776ba23` [tests] Update Unit Test for addrman.h/addrman.cpp (jimmysong) -- #10365 `7ee5236` [tests] increase timeouts in sendheaders test (jnewbery) -- #10361 `f6241b3` qa: disablewallet: Check that wallet is really disabled (MarcoFalke) -- #10371 `4b766fc` [tests] Clean up addrman_tests.cpp (jimmysong) -- #10253 `87abe20` [test] Add test for getnetworkhashps (jimmysong) -- #10376 `8bd16ee` [tests] fix disconnect_ban intermittency (jnewbery) -- #10374 `5411997` qa: Warn when specified test is not found (MarcoFalke) -- #10405 `0542978` tests: Correct testcase in script_tests.json for large number OP_EQUAL (laanwj) -- #10429 `6b99daf` tests: fix spurious addrman test failure (theuni) -- #10433 `8e57256` [tests] improve tmpdir structure (jnewbery) -- #10415 `217b416` [tests] Speed up fuzzing by ~200x when using afl-fuzz (practicalswift) -- #10445 `b4b057a` Add test for empty chain and reorg consistency for gettxoutsetinfo (gmaxwell) -- #10423 `1aefc94` [tests] skipped tests should clean up after themselves (jnewbery) -- #10359 `329fc1d` [tests] functional tests should call AvianTestFramework start/stop node methods (jnewbery) -- #10514 `e103b3f` Bugfix: missing == 0 after randrange (sipa) -- #10515 `c871f32` [test] Add test for getchaintxstats (jimmysong) -- #10509 `bea5b00` Remove xvfb configuration from travis (ryanofsky) -- #10535 `30853e1` [qa] fundrawtx: Fix shutdown race (MarcoFalke) -- #9909 `300f8e7` tests: Add FindEarliestAtLeast test for edge cases (ryanofsky) -- #10331 `75e898c` Share config between util and functional tests (jnewbery) -- #10321 `e801084` Use FastRandomContext for all tests (sipa) -- #10524 `6c2d81f` [tests] Remove printf(...) (practicalswift) -- #10547 `71ab6e5` [tests] Use FastRandomContext instead of boost::random::{mt19937,uniform_int_distribution} (practicalswift) -- #10551 `6702617` [Tests] Wallet encryption functional tests (achow101) -- #10555 `643fa0b` [tests] various improvements to zmq_test.py (jnewbery) -- #10533 `d083bd9` [tests] Use cookie auth instead of rpcuser and rpcpassword (achow101) -- #10632 `c68a9a6` qa: Add stopatheight test (MarcoFalke) -- #10636 `4bc853b` [qa] util: Check return code after closing aviand proc (MarcoFalke) -- #10662 `e0a7801` Initialize randomness in benchmarks (achow101) -- #10612 `7c87a9c` The young person's guide to the test_framework (jnewbery) -- #10659 `acb1153` [qa] blockchain: Pass on closed connection during generate call (MarcoFalke) -- #10690 `416af3e` [qa] Bugfix: allow overriding extra_args in ComparisonTestFramework (sdaftuar) -- #10556 `65cc7aa` Move stop/start functions from utils.py into AvianTestFramework (jnewbery) -- #10704 `dd07f47` [tests] nits in dbcrash.py (jnewbery) -- #10743 `be82498` [test] don't run dbcrash.py on Travis (jnewbery) -- #10761 `d3b5870` [tests] fix replace_by_fee.py (jnewbery) -- #10759 `1d4805c` Fix multi_rpc test for hosts that dont default to utf8 (TheBlueMatt) -- #10190 `e4f226a` [tests] mining functional tests (including regression test for submitblock) (jnewbery) -- #10739 `1fc783f` test: Move variable `state` down where it is used (paveljanik) -- #9980 `fee0d80` Fix mem access violation merkleblock (Christewart) -- #10893 `0c173a1` [QA] Avoid running multiwallet.py twice (jonasschnelli) -- #10927 `9d5e8f9` test: Make sure wallet.backup is created in temp path (laanwj) -- #10899 `f29d5db` [test] Qt: Use _putenv_s instead of setenv on Windows builds (brianmcmichael) -- #10912 `5c8eb79` [tests] Fix incorrect memory_cleanse(…) call in crypto_tests.cpp (practicalswift) -- #11001 `fa8a063` [tests] Test disconnecting unsupported service bits logic (jnewbery) -- #10695 `929fd72` [qa] Rewrite BIP65/BIP66 functional tests (sdaftuar) -- #10963 `ecd2135` [bench] Restore format state of cout after printing with std::fixed/setprecision (practicalswift) -- #11025 `e5d26e4` qa: Fix inv race in example_test (MarcoFalke) -- #10765 `2c811e0` Tests: address placement should be deterministic by default (ReneNyffenegger) -- #11000 `ac016e1` test: Add resendwallettransactions functional tests (promag) -- #11032 `aeb3175` [qa] Fix block message processing error in sendheaders.py (sdaftuar) -- #10105 `0b9fb68` [tests] fixup - make all Travis test runs quiet, non just cron job runs (jnewbery) -- #10222 `6ce7337` [tests] test_runner - check unicode (jnewbery) -- #10327 `35da2ae` [tests] remove import-abort-rescan.py (jnewbery) -- #11023 `bf74d37` [tests] Add option to attach a python debugger if functional test fails (jnewbery) -- #10565 `8c2098a` [coverage] Remove subtrees and benchmarks from coverage report (achow101) - -### Miscellaneous -- #9871 `be8ba2c` Add a tree sha512 hash to merge commits (sipa) -- #9821 `d19d45a` util: Specific GetOSRandom for Linux/FreeBSD/OpenBSD (laanwj) -- #9903 `ba80a68` Docs: add details to -rpcclienttimeout doc (ian-kelling) -- #9910 `53c300f` Docs: correct and elaborate -rpcbind doc (ian-kelling) -- #9905 `01b7cda` [contrib] gh-merge: Move second sha512 check to the end (MarcoFalke) -- #9880 `4df8213` Verify Tree-SHA512s in merge commits, enforce sigs are not SHA1 (TheBlueMatt) -- #9932 `00c13ea` Fix verify-commits on travis and always check top commit's tree (TheBlueMatt) -- #9952 `6996e06` Add historical release notes for 0.14.0 (laanwj) -- #9940 `fa99663` Fix verify-commits on OSX, update for new bad Tree-SHA512, point travis to different keyservers (TheBlueMatt) -- #9963 `8040ae6` util: Properly handle errors during log message formatting (laanwj) -- #9984 `cce056d` devtools: Make github-merge compute SHA512 from git, instead of worktree (laanwj) -- #9995 `8bcf934` [doc] clarify blockchain size and pruning (askmike) -- #9734 `0c17afc` Add updating of chainTxData to release process (sipa) -- #10063 `530fcbd` add missing spaces so that markdown recognizes headline (flack) -- #10085 `db1ae54` Docs: remove 'noconnect' option (jlopp) -- #10090 `8e4f7e7` Update avian.conf with example for pruning (coinables) -- #9424 `1a5aaab` Change LogAcceptCategory to use uint32_t rather than sets of strings (gmaxwell) -- #10036 `fbf36ca` Fix init README format to render correctly on github (jlopp) -- #10058 `a2cd0b0` No need to use OpenSSL malloc/free (tjps) -- #10123 `471ed00` Allow debug logs to be excluded from specified component (jnewbery) -- #10104 `fadf078` linearize script: Option to use RPC cookie (achow101) -- #10162 `a3a2160` [trivial] Log calls to getblocktemplate (jnewbery) -- #10155 `928695b` build: Deduplicate version numbers (laanwj) -- #10211 `a86255b` [doc] Contributor fixes & new "finding reviewers" section (kallewoof) -- #10250 `1428f30` Fix some empty vector references (sipa) -- #10270 `95f5e44` Remove Clang workaround for Boost 1.46 (fanquake) -- #10263 `cb007e4` Trivial: fix fee estimate write error log message (CryptAxe) -- #9670 `bd9ec0e` contrib: github-merge improvements (laanwj) -- #10260 `1d75597` [doc] Minor corrections to osx dependencies (fanquake) -- #10189 `750c5a5` devtools/net: add a verifier for scriptable changes. Use it to make CNode::id private (theuni) -- #10322 `bc64b5a` Use hardware timestamps in RNG seeding (sipa) -- #10381 `7f2b9e0` Shadowing warnings are not enabled by default, update doc accordingly (paveljanik) -- #10380 `b6ee855` [doc] Removing comments about dirty entries on txmempool (madeo) -- #10383 `d0c37ee` [logging] log system time and mock time (jnewbery) -- #10404 `b45a52a` doc: Add logging to FinalizeNode() (sdaftuar) -- #10388 `526e839` Output line to debug.log when IsInitialBlockDownload latches to false (morcos) -- #10372 `15254e9` Add perf counter data to GetStrongRandBytes state in scheduler (TheBlueMatt) -- #10461 `55b72f3` Update style guide (sipa) -- #10486 `10e8c0a` devtools: Retry after signing fails in github-merge (laanwj) -- #10447 `f259263` Make aviand invalid argument error message specific (laanwj) -- #10495 `6a38b79` contrib: Update location of seeds.txt (laanwj) -- #10469 `b6b150b` Fixing typo in rpcdump.cpp help message (keystrike) -- #10451 `27b9931` contrib/init/aviand.openrcconf: Don't disable wallet by default (luke-jr) -- #10323 `00d3692` Update to latest libsecp256k1 master (sipa) -- #10422 `cec9e1e` Fix timestamp in fee estimate debug message (morcos) -- #10566 `5d034ee` [docs] Use the "domain name setup" image (previously unused) in the gitian docs (practicalswift) -- #10534 `a514ac3` Clarify prevector::erase and avoid swap-to-clear (sipa) -- #10575 `22ec768` Header include guideline (sipa) -- #10480 `fbf5d3b` Improve commit-check-script.sh (sipa) -- #10502 `1ad3d4e` scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPE (jtimon) -- #10377 `b63be2c` Use rdrand as entropy source on supported platforms (sipa) -- #9895 `228c319` Turn TryCreateDirectory() into TryCreateDirectories() (benma) -- #10602 `d76e84a` Make clang-format use C++11 features (e.g. A> instead of A >) (practicalswift) -- #10623 `c38f540` doc: Add 0.14.2 release notes (MarcoFalke) -- #10276 `b750b33` contrib/verifybinaries: allow filtering by platform (knocte) -- #10248 `01c4b14` Rewrite addrdb with less duplication using CHashVerifier (sipa) -- #10577 `232508f` Add an explanation of quickly hashing onto a non-power of two range (gmaxwell) -- #10608 `eee398f` Add a comment explaining the use of MAX_BLOCK_BASE_SIZE (gmaxwell) -- #10728 `7397af9` fix typo in help text for removeprunedfunds (AkioNak) -- #10193 `6dbcc74` scripted-diff: Remove #include (jtimon) -- #10676 `379aed0` document script-based return fields for validateaddress (instagibbs) -- #10651 `cef4b5c` Verify binaries from aviancore.org and avn.network (TheBlueMatt) -- #10786 `ca4c545` Add PR description to merge commit in github-merge.py (sipa) -- #10812 `c5904e8` [utils] Allow avian-cli's -rpcconnect option to be used with square brackets (jnewbery) -- #10842 `3895e25` Fix incorrect Doxygen tag (@ince → @since). Doxygen parameter name matching (practicalswift) -- #10681 `df0793f` add gdb attach process to test README (instagibbs) -- #10789 `1124328` Punctuation/grammer fixes in rpcwallet.cpp (stevendlander) -- #10655 `78f307b` Properly document target_confirmations in listsinceblock (RHavar) -- #10917 `5c003cb` developer-notes: add reference to snake_case and PascalCase (benma) -- #11003 `4b5a7ce` Docs: Capitalize bullet points in CONTRIBUTING guide (eklitzke) -- #10968 `98aa3f6` Add instructions for parallel gitian builds (coblee) -- #11076 `1c4b9b3` 0.15 release-notes nits: fix redundancy, remove accidental parenthesis & fix range style (practicalswift) -- #11090 `8f0121c` Update contributor names in release-notes.md (Derek701) -- #11056 `cbdd338` disable jni in builds (instagibbs) -- #11080 `2b59cfb` doc: Update build-openbsd for 6.1 (laanwj) -- #11119 `0a6af47` [doc] build-windows: Mention that only trusty works (MarcoFalke) -- #11108 `e8ad101` Changing -txindex requires -reindex, not -reindex-chainstate (TheBlueMatt) -- #9792 `342b9bc` FastRandomContext improvements and switch to ChaCha20 (sipa) -- #9505 `67ed40e` Prevector Quick Destruct (JeremyRubin) -- #10820 `ef37f20` Use cpuid intrinsics instead of asm code (sipa) -- #9999 `a328904` [LevelDB] Plug leveldb logs to avian logs (NicolasDorier) -- #9693 `c5e9e42` Prevent integer overflow in ReadVarInt (gmaxwell) -- #10129 `351d0ad` scheduler: fix sub-second precision with boost < 1.50 (theuni) -- #10153 `fade788` logging: Fix off-by-one for shrinkdebugfile default (MarcoFalke) -- #10305 `c45da32` Fix potential NPD introduced in b297426c (TheBlueMatt) -- #10338 `daf3e7d` Maintain state across GetStrongRandBytes calls (sipa) -- #10544 `a4fe077` Update to LevelDB 1.20 (sipa) -- #10614 `cafe24f` random: fix crash on some 64bit platforms (theuni) -- #10714 `2a09a38` Avoid printing incorrect block indexing time due to uninitialized variable (practicalswift) -- #10837 `8bc6d1f` Fix resource leak on error in GetDevURandom (corebob) -- #10832 `89bb036` init: Factor out AppInitLockDataDirectory and fix startup core dump issue (laanwj) -- #10914 `b995a37` Add missing lock in CScheduler::AreThreadsServicingQueue() (TheBlueMatt) -- #10958 `659c096` Update to latest Avian patches for LevelDB (sipa) -- #10919 `c1c671f` Fix more init bugs (TheBlueMatt) - -Credits -======= - -Thanks to everyone who directly contributed to this release: - -- ロハン ダル -- Ahmad Kazi -- aideca -- Akio Nakamura -- Alex Morcos -- Allan Doensen -- Andres G. Aragoneses -- Andrew Chow -- Angel Leon -- Awemany -- Bob McElrath -- Brian McMichael -- BtcDrak -- Charlie Lee -- Chris Gavin -- Chris Stewart -- Cory Fields -- CryptAxe -- Dag Robole -- Daniel Aleksandersen -- Daniel Cousens -- darksh1ne -- Dimitris Tsapakidis -- Eric Shaw -- Evan Klitzke -- fanquake -- Felix Weis -- flack -- Guido Vranken -- Greg Griffith -- Gregory Maxwell -- Gregory Sanders -- Ian Kelling -- Jack Grigg -- James Evans -- James Hilliard -- Jameson Lopp -- Jeremy Rubin -- Jimmy Song -- João Barbosa -- Johnathan Corgan -- John Newbery -- Jonas Schnelli -- Jorge Timón -- Karl-Johan Alm -- kewde -- KibbledJiveElkZoo -- Kirit Thadaka -- kobake -- Kyle Honeycutt -- Lawrence Nahum -- Luke Dashjr -- Marco Falke -- Marcos Mayorga -- Marijn Stollenga -- Mario Dian -- Mark Friedenbach -- Marko Bencun -- Masahiko Hyuga -- Matt Corallo -- Matthew Zipkin -- Matthias Grundmann -- Michael Goldstein -- Michael Rotarius -- Mikerah -- Mike van Rossum -- Mitchell Cash -- Nicolas Dorier -- Patrick Strateman -- Pavel Janík -- Pavlos Antoniou -- Pavol Rusnak -- Pedro Branco -- Peter Todd -- Pieter Wuille -- practicalswift -- René Nyffenegger -- Ricardo Velhote -- romanornr -- Russell Yanofsky -- Rusty Russell -- Ryan Havar -- shaolinfry -- Shigeya Suzuki -- Simone Madeo -- Spencer Lievens -- Steven D. Lander -- Suhas Daftuar -- Takashi Mitsuta -- Thomas Snider -- Timothy Redaelli -- tintinweb -- tnaka -- Warren Togami -- Wladimir J. van der Laan - -As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/avian/). diff --git a/doc/release-notes/release-notes-2.0.4.md b/doc/release-notes/release-notes-2.0.4.md deleted file mode 100644 index eb4cf8ba0..000000000 --- a/doc/release-notes/release-notes-2.0.4.md +++ /dev/null @@ -1,87 +0,0 @@ -Avian Core version *2.0.4.0* is now available!! -============== - - - - -This is a major release containing bug fixes for 2.0.3.0. It is highly recommended that users -upgrade to this version. - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -The first time you run version 2.0.4 or higher, your chainstate database may -be converted to a new format, which will take anywhere from a few minutes to -half an hour, depending on the speed of your machine. - -Downgrading warning -============== - -The chainstate database for this release is not compatible with previous -releases, so if you run 2.0.4 and then decide to switch back to any -older version, you will need to run the old release with the `-reindex-chainstate` -option to rebuild the chainstate data structures in the old format. - -If your node has pruning enabled, this will entail re-downloading and -processing the entire blockchain. - -It is not recommended that users downgrade their version. This version contains -changes that *will* fork the chain, users not running 2.0.4 (or later) will be not -be able to participate in this fork process and will be left on the old chain which -will not be valid. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows Vista and later. 32-bit versions of Windows, -and Windows XP are not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Notable changes -============== - -- Fix testnet chain syncing. -- Increase chaining depth. -- Fix for -txindex after immediate BIP activation -- Fix null pointer bug. -- Fix qt amount formatting. -- Python script for bulk issuance in assets/tools. -- Python script for finding signed meta data. - - -2.0.4.0-b175d7350 Change log -============== - -Changelog available here: - -Credits -============== - -Thanks to everyone who directly contributed to this release: - -- Most importantly - The Avian Community! -- Tron Black -- Jesse Empey -- Jeremy Anderson -- Corbin Fox -- Daben Steele -- Cade Call -- @Roshii -- @underdarkskies -- Mark Ney diff --git a/doc/release-notes/release-notes-2.1.0.md b/doc/release-notes/release-notes-2.1.0.md deleted file mode 100644 index 7b3236a19..000000000 --- a/doc/release-notes/release-notes-2.1.0.md +++ /dev/null @@ -1,94 +0,0 @@ -Avian Core version *2.1.0* is now available!! -============== - - - - -This is a major release containing bug fixes for 2.0.4.0/2.0.4.1. It is highly recommended that users -upgrade to this version. This is the final release for the phase 2 development (assets). - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -The first time you run version 2.1.0 or higher, your chainstate database may -be converted to a new format, which will take anywhere from a few minutes to -half an hour, depending on the speed of your machine. - -Downgrading warning -============== - -The chainstate database for this release is not compatible with previous -releases, so if you run 2.1.0 and then decide to switch back to any -older version, you will need to run the old release with the `-reindex-chainstate` -option to rebuild the chainstate data structures in the old format. - -If your node has pruning enabled, this will entail re-downloading and -processing the entire blockchain. - -It is not recommended that users downgrade their version. This version contains -changes that *will* fork the chain, users not running 2.1.0 (or later) will be not -be able to participate in this fork process and will be left on the old chain which -will not be valid. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows Vista and later. 32-bit versions of Windows, -and Windows XP are not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that developers -do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes -the binaries to seg-fault. There is a workaround, but as of this release users should -not update to Mojave (see build-OSX.md for current status of this issue). There are no -known issues running the release binaries on Mojave. - -Notable changes -============== - -- Mainnet asset activation (Voting begins October 31, 2018) -- Double-spend attack mitigation -- Many QT Wallet UI enhancement -- Removed Replace by Fee (RBF) -- Functional test overhaul, added tests for new features -- Reissue with zero amount (with owner token) -- Moved testnet to v6 -- Added asset transaction chaining -- Chain synchronization stability - -2.1.0 Change log -============== - -Changelog available here: - -Credits -============== - -Thanks to everyone who directly contributed to this release: - -- Most importantly - The Avian Community! -- Tron Black -- Jesse Empey -- Jeremy Anderson -- Corbin Fox -- Daben Steele -- Cade Call -- @Roshii -- @underdarkskies -- Mark Ney diff --git a/doc/release-notes/release-notes-2.2.2.md b/doc/release-notes/release-notes-2.2.2.md deleted file mode 100644 index b1eac55f9..000000000 --- a/doc/release-notes/release-notes-2.2.2.md +++ /dev/null @@ -1,98 +0,0 @@ -Avian Core version *2.2.2* is now available!! -============== - - - - -This is a major release containing bug fixes and enhancements for 2.2.0/2.2.1. It is highly recommended that users -upgrade to this version. - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -The first time you run version 2.1.0 or higher, your chainstate database may -be converted to a new format, which will take anywhere from a few minutes to -half an hour, depending on the speed of your machine. - -Downgrading warning -============== - -If you are upgrading to 2.2.2 from a version before 2.1.0 the chainstate database for this release is -not compatible. If you run 2.1.0 or newer and then decide to switch back to any -older version, you will need to run the old release with the `-reindex-chainstate` -option to rebuild the chainstate data structures in the old format. - -If your node has pruning enabled, this will entail re-downloading and -processing the entire blockchain. - -It is not recommended that users downgrade their version. Version 2.1.0 and later contain -changes that *will* fork the chain, users not running 2.1.0 (or later) will be not -be able to participate in this fork process and will be left on the old chain which -will not be valid. - -Note: There are no consensus-rule changes between versions 2.1.0 and 2.2.2 - running versions in this range -will not fork the chain. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows 10(x64) and later. 32-bit versions of Windows, -and Windows XP are not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that *developers* -do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes -the binaries to seg-fault. There is a workaround, but as of this release users should -not update to Mojave (see build-OSX.md for current status of this issue). There are no -known issues running the release binaries on Mojave. - -Notable changes -============== -*This list includes changes from all releases between 2.1.0 and 2.2.2* -- Reduction in memory usage -- Chain synchronization speed -- New QT interface -- QT dark mode (not using OSX Mojave dark mode) -- Chain split attack vector fix -- Better asset caching -- Enhancements for Avian Dev Kit and Mobile Wallet Support -- Limit listaddressesbyasset RPC call to only return 5,000 asset-addresses per call -- Updates and fixes to the functional and unit tests for better asset coverage and stability - - -2.2.2 Change log -============== - -Changelog available here: - -Credits -============== - -Thanks to everyone who directly contributed to this release: - -- Most importantly - The Avian Community! -- Tron Black -- Jesse Empey -- Jeremy Anderson -- Corbin Fox -- Daben Steele -- Cade Call -- @Roshii -- @underdarkskies -- Mark Ney diff --git a/doc/release-notes/release-notes-2.4.0.md b/doc/release-notes/release-notes-2.4.0.md deleted file mode 100644 index f2d121c5b..000000000 --- a/doc/release-notes/release-notes-2.4.0.md +++ /dev/null @@ -1,80 +0,0 @@ -Avian Core version *2.4.0* is now available!! -============== - - - - -This is a major release containing bug fixes and enhancements for all builds before it. It is highly recommended that users -upgrade to this version. - -Please report bugs using the issue tracker at GitHub: - - - -To receive security and update notifications, please subscribe to: - - - -How to Upgrade -============== - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) -or `aviand`/`avian-qt` (on Linux). - -Downgrading warning -============== - -You may downgrade at any time if needed. - -Note: There are no consensus-rule changes between versions v2.2.3/v2.2.2 and 2.4.0 - running versions in this range -will not fork the chain. - -Compatibility -============== - -Avian Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows 10(x64) and later. 32-bit versions of Windows, -and Windows XP are not supported. - -Avian Core should also work on most other Unix-like systems but is not -frequently tested on them. - -Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that *developers* -do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes -the binaries to seg-fault. There is a workaround, but as of this release users should -not update to Mojave (see build-OSX.md for current status of this issue). There are no -known issues running the release binaries on Mojave. - -Avian Core has not been tested with macOS Catalina(beta). Please use at your own risk. - -Notable changes -============== -*This list includes changes from all releases between 2.2.2/2.2.3 and 2.4.0* -- Backport of Bitcoin v0.15.1 networking updates -- Reorganization of pointer access objects in functions - - -2.4.0 Change log -============== - -Changelog available here: - -Credits -============== - -Thanks to everyone who directly contributed to this release: - -- Most importantly - The Avian Community! -- @blondfrogs (Jeremy Anderson) - [77f5a7838082669dbb7c21b4a93ce65e2a447963](https://github.com/AvianNetwork/Avian/pull/608/commits/77f5a7838082669dbb7c21b4a93ce65e2a447963) -- @blondfrogs (Jeremy Anderson) - [fbbc40d22646c31465fa04a8a55f4734c3f75a9c](https://github.com/AvianNetwork/Avian/pull/608/commits/fbbc40d22646c31465fa04a8a55f4734c3f75a9c) -- @practicalswift - [ba4d362a2b4ba814bba2aa2589231ba470f20e3f](https://github.com/AvianNetwork/Avian/pull/608/commits/ba4d362a2b4ba814bba2aa2589231ba470f20e3f) -- @sdaftuar - [3027dd58001624f388dc522ec9c73eb5fc9aee70](https://github.com/AvianNetwork/Avian/pull/608/commits/3027dd58001624f388dc522ec9c73eb5fc9aee70) -- @sdaftuar - [dc5cc1e5980b30a21427f75a7d4085f4755d4085](https://github.com/AvianNetwork/Avian/pull/608/commits/dc5cc1e5980b30a21427f75a7d4085f4755d4085) -- @sdaftuar - [a743e754fd90ce3299b237700082e12c8cbcf3b4](https://github.com/AvianNetwork/Avian/pull/608/commits/a743e754fd90ce3299b237700082e12c8cbcf3b4) -- @sdaftuar - [08efce585df53f86f13ec5d1dff689237c0ce4cc](https://github.com/AvianNetwork/Avian/pull/608/commits/08efce585df53f86f13ec5d1dff689237c0ce4cc) -- @sdaftuar - [2d4826beee72e1a3749c1eb090a37139f3099a22](https://github.com/AvianNetwork/Avian/pull/608/commits/2d4826beee72e1a3749c1eb090a37139f3099a22) -- @TheBlueMatt - [ffeb6ee6b27e778fdee188d12032b6ac7d2d1eb4](https://github.com/AvianNetwork/Avian/pull/608/commits/ffeb6ee6b27e778fdee188d12032b6ac7d2d1eb4) -- @TheBlueMatt - [c27081c79eb6dca48e457d8dd5b09090771a75b7](https://github.com/AvianNetwork/Avian/pull/608/commits/c27081c79eb6dca48e457d8dd5b09090771a75b7) - diff --git a/doc/release-notes/release-notes-2.6.2.md b/doc/release-notes/release-notes-2.6.2.md new file mode 100644 index 000000000..cf4be6748 --- /dev/null +++ b/doc/release-notes/release-notes-2.6.2.md @@ -0,0 +1,35 @@ +Avian Core version *2.6.2* is now available from: + + + +This is a minor stable release. + +Please report bugs using the issue tracker at GitHub: + + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows Vista and later. Windows XP is not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Shafil Alam +- torp-fails diff --git a/doc/release-notes/release-notes-3.1.0.md b/doc/release-notes/release-notes-3.1.0.md new file mode 100644 index 000000000..1a7c2f80e --- /dev/null +++ b/doc/release-notes/release-notes-3.1.0.md @@ -0,0 +1,59 @@ +Avian Core version *3.1.0* is now available from: + + + +This is a major release containing bug fixes and enhancements for 3.0. It is highly recommended that users +upgrade to this version. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. Version 3.0.0 and later contain +changes that *will* fork the chain, users not running 3.1.0 (or later) will be not +be able to participate in this fork process and will be left on the old chain which +will not be valid. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows 10 (x64) and later. Windows XP is not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that *developers* +do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes +the binaries to seg-fault. There is a workaround, but as of this release users should +not update to Mojave (see build-OSX.md for current status of this issue). There are no +known issues running the release binaries on Mojave. + +Notable changes +============== +- Rewrite of block difficulty retargetter algorithm GetNextWorkRequiredLWMA3() +- Rewrite of CheckProofOfWork to include powLimit from multiple algos, if they differ +- Small tweaks here and there to support other changes mentioned +- RPC command output fixes towards industry standards +- Bumped version number and protocol version +- Checkpoint added for block 275972 + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- Shafil Alam +- decentralisedcoder diff --git a/doc/release-notes/release-notes-3.1.1.md b/doc/release-notes/release-notes-3.1.1.md new file mode 100644 index 000000000..b443461e2 --- /dev/null +++ b/doc/release-notes/release-notes-3.1.1.md @@ -0,0 +1,81 @@ +Avian Core version *3.1.1* is now available from: + + + +Our latest maintenance release "Avian Network v3.1.1 - Tom Bombadil" that brings backports for security and performance along with tweaks here and there in the GUI is ready for release. Please can you all update when you can, this is not a mandatory upgrade but we would advise you update to take advantage of fixes and improvements it offers. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. Version 3.1.0 and later contain +changes that *will* fork the chain, users not running 3.1.0 (or later) will be not +be able to participate in this fork process and will be left on the old chain which +will not be valid. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows 10 (x64) and later. Windows XP is not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that *developers* +do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes +the binaries to seg-fault. There is a workaround, but as of this release users should +not update to Mojave (see build-OSX.md for current status of this issue). There are no +known issues running the release binaries on Mojave. + +Notable changes +============== +- GUI: Add out-of-the-box browsers. Can be changed and removed in options by @fdoving in #30 +- set the correct url to the Avian webpage. by @fdoving in #28 +- gui: encrypt wallet dialog, update to AVN by @fdoving in #33 +- [backport] gui, wallet: random abort (segmentation fault) btc#9683 by @fdoving in #14 +- build: Suppress -Wdeprecated-copy warnings by @fdoving in #15 +- Drop buggy TableViewLastColumnResizingFixer class (btc#204) by @fdoving in #16 +- Introduce a Shuffle for FastRandomContext and use it in wallet by @fdoving in #17 +- Backport: Remove useless mapRequest tracking by @fdoving in #19 +- depends: update zeromq to 4.3.4 by @fdoving in #20 +- lockedpool: avoid sensitive data in core files (Linux and FreeBSD) by @fdoving in #21 +- backport: wallet: Fix Char as Bool in Wallet by @fdoving in #23 +- backport: gui: Set CConnman byte counters earlier to avoid uninitialized reads by @fdoving in #24 +- backport: rpc: Fix data race (UB) in InterruptRPC() by @fdoving in #25 +- backport: fix uninitialized read when stringifying an addrLocal by @fdoving in #26 +- backport: Introduce a maximum size for locators. by @fdoving in #27 +- depends: update expat to 2.4.1 by @fdoving in #31 +- depends: libevent update by @fdoving in #32 +- Contrib: Copy install_db4.sh from bitcoin by @fdoving in #37 +- http: Release work queue after event base finish (btc#19033) by @fdoving in #38 +- disable output to stdout by @fdoving in #36 +- disable logging of diff by @fdoving in #39 +- gui: set black text for price and increase to 30s update times. by @fdoving in #41 +- Revert "gui: set black text for price and increase to 30s update times." by @alamshafil in #43 +- gui: set black text for price and increase to 30s update times. by @fdoving in #42 +- gui: text color for price info fixed for dark and light mode. by @fdoving in #44 +- backport: [qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) (bitcoin #10920) by @fdoving in #45 +- translations: search and replace Raven/Avian by @fdoving in #49 +- GUI: Enable High DPI Scaling by @fdoving in #50 + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- Shafil Alam +- decentralisedcoder +- fdov diff --git a/doc/release-notes/release-notes-4.0.1.md b/doc/release-notes/release-notes-4.0.1.md new file mode 100644 index 000000000..831fcbabe --- /dev/null +++ b/doc/release-notes/release-notes-4.0.1.md @@ -0,0 +1,48 @@ +Avian Core version *4.0.1* is now available from: + + + +Our latest maintenance release "Avian Network v4.0.1 - Thorondor Update". Please update when you can, this is not a mandatory upgrade but we would advise you update to take advantage of fixes and improvements it offers. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows Vista and later. Windows XP is not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Notable changes +============== + +- Correct bugs found in 4.0.0 by @cdonnachie in #68 +- Bump version to 4.0.1 +- Disable messaging check in Mainnet +- Speed up indexing +- Add new checkpoints +- Update nMinimumChainWork and defaultAssumeValid + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Craig Donnachie diff --git a/doc/release-notes/release-notes-4.0.2.md b/doc/release-notes/release-notes-4.0.2.md new file mode 100644 index 000000000..6bc56bb84 --- /dev/null +++ b/doc/release-notes/release-notes-4.0.2.md @@ -0,0 +1,56 @@ +Avian Core version *4.0.2* is now available from: + + + +Our latest maintenance release "Avian Network v4.0.2 - Thorondor Update". Please update when you can, this is a mandatory upgrade for people who run Avian 4.x. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows Vista and later. 32-bit versions of Windows, +and Windows XP are not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that developers +do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes +the binaries to seg-fault. There is a workaround, but as of this release users should +not update to Mojave (see build-OSX.md for current status of this issue). There are no +known issues running the release binaries on Mojave. + +Notable changes +============== + +Avian 4.0.2 is a patch release to fix the regressions found in 4.0. + +- Fix ComputeBlockVersion +- Add backward compatibility with ReadAddressUnspentIndex +- Restore FORKID to VerifyScript + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- Shafil Alam +- Craig Donnachie diff --git a/doc/release-notes/release-notes-4.0.3.md b/doc/release-notes/release-notes-4.0.3.md new file mode 100644 index 000000000..14916f571 --- /dev/null +++ b/doc/release-notes/release-notes-4.0.3.md @@ -0,0 +1,55 @@ +Avian Core version *4.0.3* is now available from: + + + +This release includes new checkpoints for safety. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows Vista and later. 32-bit versions of Windows, +and Windows XP are not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that developers +do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes +the binaries to seg-fault. There is a workaround, but as of this release users should +not update to Mojave (see build-OSX.md for current status of this issue). There are no +known issues running the release binaries on Mojave. + +Notable changes +============== + +This release includes new checkpoints for safety: + +- 940202 = 00000000ed69247f7ef177a14e44de41d9c1ba689cb930946ff773ebfe23f64c +- 952399 = 0000000000a11f354eacb65fee963df9818ee8884d8dd926da33921691ec9969 + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- decentralisedcoder +- Craig Donnachie diff --git a/doc/release-notes/release-notes-4.0.md b/doc/release-notes/release-notes-4.0.md new file mode 100644 index 000000000..584af5a5a --- /dev/null +++ b/doc/release-notes/release-notes-4.0.md @@ -0,0 +1,61 @@ +Avian Core version *4.0.0* is now available from: + + + +Our latest release "Avian Network v4.0.0 - Thorondor", this has many updates to the look of the wallet as well as Flight Plans and Assets activated in testnet only Please update when you can, this is not a mandatory upgrade but we would advise you update to take advantage of fixes and improvements it offers. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 10.11+, and Windows Vista and later. 32-bit versions of Windows, +and Windows XP are not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Avian Core has been tested with macOS 10.14 Mojave, but it is recommended that developers +do not update to Mojave. There is an incompatibility with Berkeley-db 4.8.30 that causes +the binaries to seg-fault. There is a workaround, but as of this release users should +not update to Mojave (see build-OSX.md for current status of this issue). There are no +known issues running the release binaries on Mojave. + +Notable changes +============== + +- Bring Avian up to date + Assets +- Add nExtCoinType for BIP44 +- Add Peer Dialog to RPConsole +- Add Paper Wallet +- Add "Get My Words" to UI +- Start work on Avian Flight Plans +- Depends: Add 32-bit ARM support for QT +- UI: Add wrapping window +- CoinGecko API to fetch currency units and price +- Add importPrivateKey to walletview + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- Shafil Alam +- Craig Donnachie diff --git a/doc/release-notes/release-notes-4.1.0.md b/doc/release-notes/release-notes-4.1.0.md new file mode 100644 index 000000000..06697951d --- /dev/null +++ b/doc/release-notes/release-notes-4.1.0.md @@ -0,0 +1,172 @@ +Avian Core version *4.1.0* is now available from: + + + + +Avian 4.1.0 includes the block reward dev fee, important security updates, improved network efficiency, faster loading speeds, and other new features. + +Please report bugs using the issue tracker at GitHub: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over `/Applications/Avian-Qt` (on Mac) +or `aviand`/`avian-qt` (on Linux). + +Downgrading warning +============== + +It is not recommended that users downgrade their version. Version 4.1.0 and later contain +changes that *will* fork the chain, users not running 4.1.0 (or later) will be not +be able to participate in this fork process and will be left on the old chain which +will not be valid. + +Compatibility +============== + +Avian Core is extensively tested on multiple operating systems using +the Linux kernel, macOS 11+, and Windows 10 and later. 32-bit versions of Windows, +and Windows XP are not supported. + +Avian Core should also work on most other Unix-like systems but is not +frequently tested on them. + +Notable changes +============== + +Security Updates +---------------- + +### Peer management +Avian will now tightly manage memory usage during high network traffic or when connected to slow peers. + +### Avian Assets (not on mainnet) +- Avian will enforce asset coinbase checks and enforced values. +- Fix bug with in memory qualifier address checking + +### Avian Flight Plans (testnet) +- Avian Flight Plans (active on testnet) now uses the secure POSIX `mkstemp` instead of the risky `tmpnam`. +- AFP will not include all lua libraries for security purposes +- Removed buggy and risky web3lib + +### Bitcoin backports +This update includes many security backports: +- depends: update zeromq to 4.3.4 (#20) +- depends: update expat to 2.4.1 (#31) +- depends: libevent update (#32) +- lockedpool: avoid sensitive data in core files (Linux and FreeBSD) (#21) +- backport: gui, wallet: random abort (segmentation fault) btc#9683 (#14) +- backport: Remove useless mapRequest tracking (#19) +- backport: wallet: Fix Char as Bool in Wallet (#23) +- backport: gui: Set CConnman byte counters earlier to avoid uninitialized reads (#24) +- backport: rpc: Fix data race (UB) in InterruptRPC() (#25) +- backport: fix uninitialized read when stringifying an addrLocal (#26) +- backport: Introduce a maximum size for locators. (#27) +- http: Release work queue after event base finish (btc#19033) (#38) +- qt: Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) (#45) + +Features +-------- + +### Block reward fee +This update inclues a 5% dev fee that was voted on and approved by the community. + +### PoW cache +Avian will now cache proof-of-work hashes into a file called `powcache.dat` for improved wallet loading speed and faster syncing. + +Before v4.1.0: 526.5 seconds / 8 minutes + +With v4.1.0: 30.61 seconds (second run) + +~ 94.1861% speed up in wallet loading time. + +Inital sync (IBD) done around ~1hr 48 min using 8GB of bandwidth. + +### Add pruning setting to the UI +This new setting allows a user to decrease the total disk space used down to ~1GB, by removing blocks that are no longer needed. + +Features that need the entire blockchain, such as rescanning, or importing keys, will **not** function. + +Reverting this setting will make the wallet **re-download** the whole blockchain. + +### Wallet repair tab +This updates includes a new wallet repair tab in Help -> Debug Window. This tab allows you to rescan the blockchain, recover transactions, upgrade wallet.dat, and reindex without having to use the command line. Backport from Dash PR#342 with changes made for Avian. + +### New RPC to get stuck transactions +A new RPC method has been added to help operators identify if any transactions are stuck (have not been mined and are not in the mempool). + +This method is called: `liststucktransactions` + +### Avian Name System (ANS) (testnet) +This update includes the basis for the Avian Name System based on the draft AIP-04. This feature will **only** be active for testing on testnet and regtest. + +### Working regtest +This update fixes the regtest for Avian, allowing people to locally run a blockchain for testing purposes. + +Minor Changes +------------- +- Print CreateNewBlock() when BENCH debug is set (#171) +- qi: Create CodeQL action to analyze code +- qt: Add direction to peers tab +- Qt: Add "Copy address" to context menu in peers tab +- Qt: Elide long strings in their middle in peers tab +- Qt: Use correct AVN browser URLs +- afp: Add help message for "flightplans" option +- afp: Remove use of marco to get path +- afp: Add list_flightplans RPC method +- afp: Improve RPC method list_flightplans +- Introduce proper AreMessagesDeployed() and AreRestrictedAssetsDeployed() +- qt: Remove unused dev action +- qt: Remove unused pool picker +- qt: Shrink size of tabs by reducing padding +- qt: Fix QComboBox bug +- qt: Restore Restricted Assets +- qt: New icon for restrictedAssetAction +- Add backward compatibility with ReadAddressUnspentIndex +- Disallow the creation of "RVN" asset +- afp: Do not include all lua libraries +- afp+rpc: Rename "call_function" to "call_flightplan" +- Restore FORKID to VerifyScript +- Fix nCoinCacheUsage +- Fix ComputeBlockVersion +- rpc: Restore FORKID to createrawtransaction +- qt: Make RPC console buttons look clickable +- qt: Add dark mode console +- qt: Rework Open URI dialog +- qt: Add rounded corners +- qt: Restore action menu icons +- backport: [qt] Add version to modal overlay +- backport: [qt] macOS darkmode +- backport: [qt] Reissue asset spinboxes; disable if unit is max. +- backport: [qt] Update asset list when qcombobox is shown. +- backport: [qt] Get my words, re-lock wallet if not bip44. +- backport: [qt] Get my words, auto close. +- backport: [qt] Create and reissue asset views add browse IPFS button +- Fix ToolBarSelectedTextColor for dark mode +- validation: Do not check PoW when downloading headers during IBD +- trival: Remove unused IsUAHFForAssetsenabled +- trival: Rename ambiguous UAHF to state FORKID +- ans: Add basic Avian Name System ID +- chain: Use correct BIP44 cointype for mainnet (921) +- qt: Fix menubar styling +- qt: Fix assets frame on overview page +- qt: Fix overview page +- qt: Add QScrollBar styling +- qt: Check wallet model to prevent segfault +- contrib: Fix optimize-pngs.py + +Credits +============== + +Thanks to everyone who directly contributed to this release: + +- Most importantly - The Avian Community! +- Craig Donnachie +- decentralisedcoder +- Shafil Alam +- fdov +- Furcalor diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 7cb369f96..918cb39b8 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -97,6 +97,9 @@ NSHighResolutionCapable True + NSRequiresAquaSystemAppearance + True + LSAppNapIsDisabled True diff --git a/src/Makefile.am b/src/Makefile.am index e6e812d0e..90c3ab498 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -138,7 +138,7 @@ AVIAN_CORE_H = \ algo/crow/hashx13.h \ algo/crow/hashx15.h \ algo/crow/hashx17.h \ - algo/crow/crow.h \ + algo/crow/minotaurx.h \ algo/crow/yespower/yespower.c \ algo/crow/yespower/crypto/sha256.c \ spentindex.h \ @@ -153,6 +153,7 @@ AVIAN_CORE_H = \ assets/snapshotrequestdb.h \ assets/assetsnapshotdb.h \ assets/rewards.h \ + assets/ans.h \ base58.h \ bloom.h \ blockencodings.h \ @@ -174,6 +175,7 @@ AVIAN_CORE_H = \ core_io.h \ core_memusage.h \ cuckoocache.h \ + flat-database.h \ fs.h \ httprpc.h \ httpserver.h \ @@ -229,6 +231,7 @@ AVIAN_CORE_H = \ txmempool.h \ ui_interface.h \ undo.h \ + unordered_lru_cache.h \ util.h \ utilmoneystr.h \ utiltime.h \ @@ -251,12 +254,10 @@ AVIAN_CORE_H = \ zmq/zmqconfig.h\ zmq/zmqnotificationinterface.h \ zmq/zmqpublishnotifier.h \ - flightplans/weblib.h \ flightplans/avianlib.h \ flightplans/flightplans.h \ flightplans/json/strbuf.h \ flightplans/json/fpconv.h \ - flightplans/keccak.h \ lua/lapi.h \ lua/lauxlib.h \ lua/lbaselib.h \ @@ -326,6 +327,7 @@ libavian_server_a_SOURCES = \ assets/snapshotrequestdb.cpp \ assets/assetsnapshotdb.cpp \ assets/rewards.cpp \ + assets/ans.cpp \ policy/fees.cpp \ policy/policy.cpp \ policy/rbf.cpp \ @@ -353,13 +355,11 @@ libavian_server_a_SOURCES = \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ - flightplans/weblib.cpp \ flightplans/avianlib.cpp \ flightplans/flightplans.cpp \ flightplans/json/strbuf.c \ flightplans/json/fpconv.c \ flightplans/json/lua_cjson.c \ - flightplans/keccak.cpp \ lua/lapi.c \ lua/lauxlib.c \ lua/lbaselib.c \ @@ -475,6 +475,7 @@ libavian_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(AVIAN_INCLUDES) libavian_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libavian_consensus_a_SOURCES = \ amount.h \ + founder_payment.h \ arith_uint256.cpp \ arith_uint256.h \ consensus/merkle.cpp \ @@ -486,6 +487,8 @@ libavian_consensus_a_SOURCES = \ prevector.h \ primitives/block.cpp \ primitives/block.h \ + primitives/powcache.cpp \ + primitives/powcache.h \ primitives/transaction.cpp \ primitives/transaction.h \ pubkey.cpp \ @@ -498,6 +501,7 @@ libavian_consensus_a_SOURCES = \ script/script_error.cpp \ script/script_error.h \ serialize.h \ + span.h \ support/cleanse.h \ support/cleanse.cpp \ tinyformat.h \ @@ -515,6 +519,7 @@ libavian_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(AVIAN_INCLUDES) libavian_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libavian_common_a_SOURCES = \ base58.cpp \ + founder_payment.cpp \ chainparams.cpp \ coins.cpp \ compressor.cpp \ diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 5fcd52ba8..6f7344279 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -113,7 +113,6 @@ QT_FORMS_UI = \ qt/forms/debugwindow.ui \ qt/forms/addpeerdialog.ui \ qt/forms/testpeerdialog.ui \ - qt/forms/poolpicker.ui \ qt/forms/wrapping.ui \ qt/forms/sendcoinsdialog.ui \ qt/forms/sendcoinsentry.ui \ @@ -169,7 +168,6 @@ QT_MOC_CPP = \ qt/moc_receiverequestdialog.cpp \ qt/moc_recentrequeststablemodel.cpp \ qt/moc_rpcconsole.cpp \ - qt/moc_poolpicker.cpp \ qt/moc_wrapping.cpp \ qt/moc_sendcoinsdialog.cpp \ qt/moc_sendcoinsentry.cpp \ @@ -269,7 +267,6 @@ AVIAN_QT_H = \ qt/restrictedassignqualifier.h \ qt/restrictedfreezeaddress.h \ qt/rpcconsole.h \ - qt/poolpicker.h \ qt/sendassetsentry.h \ qt/sendcoinsdialog.h \ qt/sendcoinsentry.h \ @@ -447,7 +444,6 @@ AVIAN_QT_BASE_CPP = \ qt/qvalidatedlineedit.cpp \ qt/qvaluecombobox.cpp \ qt/rpcconsole.cpp \ - qt/poolpicker.cpp \ qt/splashscreen.cpp \ qt/trafficgraphwidget.cpp \ qt/utilitydialog.cpp diff --git a/src/algo/crow/crow.h b/src/algo/crow/minotaurx.h similarity index 93% rename from src/algo/crow/crow.h rename to src/algo/crow/minotaurx.h index 4ba6c7477..b3d0654a7 100644 --- a/src/algo/crow/crow.h +++ b/src/algo/crow/minotaurx.h @@ -1,11 +1,10 @@ // Copyright (c) 2019-2021 The Litecoin Cash Core developers -// Copyright (c) 2021 The Avian Core developers -// Copyright (c) 2021 Shafil Alam +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef RVL_ALGO_CROW_H -#define RVL_ALGO_CROW_H +#ifndef AVN_ALGO_MINOTAURX_H +#define AVN_ALGO_MINOTAURX_H #include @@ -14,8 +13,8 @@ #include "yespower/yespower.h" // Config -#define CROW_ALGO_COUNT 16 -//#define CROW_DEBUG +#define MINOTAURX_ALGO_COUNT 16 +//#define MINOTAURX_DEBUG static const yespower_params_t yespower_params = {YESPOWER_1_0, 2048, 8, (const uint8_t*)"et in arcadia ego", 17}; @@ -130,7 +129,7 @@ uint512 GetHash(uint512 inputHash, TortureGarden *garden, unsigned int algo, yes sph_whirlpool(&garden->context_whirlpool, static_cast(&inputHash), 64); sph_whirlpool_close(&garden->context_whirlpool, static_cast(&outputHash)); break; - // NB: The CPU-hard gate must be case CROW_ALGO_COUNT. + // NB: The CPU-hard gate must be case MINOTAURX_ALGO_COUNT. case 16: if (local == NULL) // Self-manage storage on current thread yespower_tls(inputHash.begin(), 64, &yespower_params, (yespower_binary_t*)outputHash.begin()); @@ -150,7 +149,7 @@ uint512 GetHash(uint512 inputHash, TortureGarden *garden, unsigned int algo, yes uint512 TraverseGarden(TortureGarden *garden, uint512 hash, TortureNode *node, yespower_local_t *local) { uint512 partialHash = GetHash(hash, garden, node->algo, local); -#ifdef CROW_DEBUG +#ifdef MINOTAURX_DEBUG printf("* Ran algo %d. Partial hash:\t%s\n", node->algo, partialHash.ToString().c_str()); fflush(0); #endif @@ -172,10 +171,10 @@ void LinkNodes(TortureNode *parent, TortureNode *childLeft, TortureNode *childRi parent->childRight = childRight; } -// Produce a Crow 32-byte hash from variable length data +// Produce a Minotaurx 32-byte hash from variable length data // Optionally, use the MinotaurX hardened hash. // Optionally, use provided thread-local memory for yespower. -template uint256 Crow(const T begin, const T end, bool minotaurX, yespower_local_t *local = NULL) { +template uint256 Minotaurx(const T begin, const T end, bool minotaurX, yespower_local_t *local = NULL) { // Create torture garden nodes. Note that both sides of 19 and 20 lead to 21, and 21 has no children (to make traversal complete). // Every path through the garden stops at 7 nodes. TortureGarden garden; @@ -210,24 +209,24 @@ template uint256 Crow(const T begin, const T end, bool minotaurX, ye sph_sha512(&garden.context_sha2, (begin == end ? empty : static_cast(&begin[0])), (end - begin) * sizeof(begin[0])); sph_sha512_close(&garden.context_sha2, static_cast(&hash)); -#ifdef CROW_DEBUG +#ifdef MINOTAURX_DEBUG printf("** Initial hash:\t\t%s\n", hash.ToString().c_str()); fflush(0); #endif // Assign algos to torture net nodes based on initial hash for (int i = 0; i < 22; i++) - garden.nodes[i].algo = hash.ByteAt(i) % CROW_ALGO_COUNT; + garden.nodes[i].algo = hash.ByteAt(i) % MINOTAURX_ALGO_COUNT; // Hardened garden gates on minotaurX if (minotaurX) - garden.nodes[21].algo = CROW_ALGO_COUNT; + garden.nodes[21].algo = MINOTAURX_ALGO_COUNT; // Send the initial hash through the torture garden hash = TraverseGarden(&garden, hash, &garden.nodes[0], local); -#ifdef CROW_DEBUG - printf("** Crow Final hash:\t\t\t%s\n", uint256(hash).ToString().c_str()); +#ifdef MINOTAURX_DEBUG + printf("** Minotaurx Final hash:\t\t\t%s\n", uint256(hash).ToString().c_str()); fflush(0); #endif @@ -235,4 +234,4 @@ template uint256 Crow(const T begin, const T end, bool minotaurX, ye return uint256(hash); } -#endif // RVL_ALGO_CROW_H +#endif // AVN_ALGO_MINOTAURX_H diff --git a/src/algo/hash_algos.h b/src/algo/hash_algos.h index e7d8e7826..ba56c9563 100644 --- a/src/algo/hash_algos.h +++ b/src/algo/hash_algos.h @@ -1,11 +1,14 @@ - // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers + // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef HASHALGOS_H #define HASHALGOS_H +#include "version.h" +#include "serialize.h" #include "../uint256.h" #include "sph_blake.h" @@ -90,6 +93,49 @@ inline uint256 Hash(const T1 pbegin, const T1 pend) return result; } +/** A writer stream (for serialization) that computes a 256-bit hash. */ +class CHashWriter +{ +private: + CHash256 ctx; + +public: + int nType; + int nVersion; + + CHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {} + + int GetType() const { return nType; } + int GetVersion() const { return nVersion; } + + void write(const char *pch, size_t size) { + ctx.Write((const unsigned char*)pch, size); + } + + // invalidates the object + uint256 GetHash() { + uint256 result; + ctx.Finalize((unsigned char*)&result); + return result; + } + + template + CHashWriter& operator<<(const T& obj) { + // Serialize to this stream + ::Serialize(*this, obj); + return (*this); + } +}; + +/** Compute the 256-bit hash of an object's serialization. */ +template +uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) +{ + CHashWriter ss(nType, nVersion); + ss << obj; + return ss.GetHash(); +} + //x16r template inline uint256 HashX16R(const T1 pbegin, const T1 pend, const uint256 PrevBlockHash) diff --git a/src/algo/sph_sha2.h b/src/algo/sph_sha2.h index 2007fdee2..beb0d2d5c 100644 --- a/src/algo/sph_sha2.h +++ b/src/algo/sph_sha2.h @@ -37,8 +37,8 @@ * @author Thomas Pornin */ -#ifndef RVL_POW_SPH_SHA2_H -#define RVL_POW_SPH_SHA2_H +#ifndef AVN_POW_SPH_SHA2_H +#define AVN_POW_SPH_SHA2_H #include #include "sph_types.h" @@ -375,4 +375,4 @@ void sph_sha512_comp(const sph_u64 msg[16], sph_u64 val[8]); #ifdef __cplusplus } #endif -#endif // RVL_POW_SPH_SHA2_H \ No newline at end of file +#endif // AVN_POW_SPH_SHA2_H diff --git a/src/assets/ans.cpp b/src/assets/ans.cpp new file mode 100644 index 000000000..459c42648 --- /dev/null +++ b/src/assets/ans.cpp @@ -0,0 +1,198 @@ +// Copyright (c) 2022 The Avian Core developers +// Copyright (c) 2022 Shafil Alam +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "ans.h" + +#include +#include +#include + +#include "string.h" + +#include "univalue.h" +#include "util.h" +#include "utilstrencodings.h" +#include "base58.h" +#include "script/standard.h" + +#include "boost/asio.hpp" + +using namespace boost::asio::ip; + +/* Static prefix */ +const std::string CAvianNameSystemID::prefix = "ANS"; + +/* Staic domain */ +const std::string CAvianNameSystemID::domain = ".AVN"; + +static std::string IPToHex(std::string strIP) +{ + boost::system::error_code error; + auto ip = address_v4::from_string(strIP, error); + if (error) return "0"; + + std::stringstream ss; + ss << std::hex << ip.to_ulong(); + return ss.str(); +} + +static std::string HexToIP(std::string hexIP) +{ + if(!IsHexNumber(hexIP)) return "0.0.0.0"; + + unsigned int hex = std::stoul(hexIP, 0, 16); + auto ip = address_v4(hex); + return ip.to_string(); +} + +bool CAvianNameSystemID::CheckIP(std::string rawip, bool isHex) { + std::string ip = rawip; + if (isHex) ip = HexToIP(rawip.c_str()); + + boost::system::error_code error; + address_v4::from_string(ip, error); + + if (error) return false; + else return true; +} + +// TODO: Add error result? +bool CAvianNameSystemID::CheckTypeData(Type type, std::string typeData) { + if (type == Type::ADDR) { + CTxDestination destination = DecodeDestination(typeData); + if (!IsValidDestination(destination)) return false; + } else if (type == Type::IP) { + if (!CheckIP(typeData, true)) return false; + } else { + // Unknown type + return false; + } + return true; +} + +std::string CAvianNameSystemID::FormatTypeData(Type type, std::string typeData, std::string& error) +{ + std::string returnStr = typeData; + + // Check and set type data + if (type == ADDR) { + CTxDestination destination = DecodeDestination(typeData); + if (!IsValidDestination(destination)) { + error = (typeData != "") + ? std::string("Invalid Avian address: ") + typeData + : std::string("Empty Avian address."); + } + } else if (type == IP) { + if (!CheckIP(typeData, false)) { + error = (typeData != "") + ? std::string("Invalid IPv4 address: ") + typeData + : std::string("Empty IPv4 addresss."); + } + returnStr = IPToHex(typeData); + } + + return returnStr; +} + +bool CAvianNameSystemID::IsValidID(std::string ansID) { + // Check for min length + if(ansID.length() <= prefix.size() + 1) return false; + + // Check for prefix + bool hasPrefix = (ansID.substr(0, CAvianNameSystemID::prefix.length()) == CAvianNameSystemID::prefix) && (ansID.size() <= 64); + if (!hasPrefix) return false; + + // Must be valid hex char + std::string hexStr = ansID.substr(prefix.length(), 1); + if (!IsHexNumber(hexStr)) return false; + + // Hex value must be less than 0xf + int hexInt = stoi(hexStr, 0, 16); + if (hexInt > 0xf) return false; + + // Check type + Type type = static_cast(hexInt); + std::string rawData = ansID.substr(prefix.length() + 1); + + if (!CheckTypeData(type, rawData)) return false; + + return true; +} + +CAvianNameSystemID::CAvianNameSystemID(Type type, std::string rawData) : + m_addr(""), + m_ip("") +{ + this->m_type = type; + + if (!CheckTypeData(this->m_type, rawData)) return; + + if (this->m_type == Type::ADDR) { + // Avian address + this->m_addr = rawData; + } + else if (this->m_type == Type::IP) { + // Raw IP (127.0.0.1) + this->m_ip = HexToIP(rawData.c_str()); + } +} + +CAvianNameSystemID::CAvianNameSystemID(std::string ansID) : + m_addr(""), + m_ip("") +{ + // Check if valid ID + if(!IsValidID(ansID)) return; + + // Get type + Type type = static_cast(stoi(ansID.substr(prefix.length(), 1), 0, 16)); + this->m_type = type; + + // Set info based on data + std::string data = ansID.substr(prefix.length() + 1); // prefix + type + + if (this->m_type == Type::ADDR) { + this->m_addr = data; + } else if(this->m_type == Type::IP) { + this->m_ip = HexToIP(data.c_str()); + } +} + +std::string CAvianNameSystemID::to_string() { + std::string id = ""; + + // 1. Add prefix + id += prefix; + + // 2. Add type + std::stringstream ss; + ss << std::hex << this->m_type; + id += ss.str(); + + // 3. Add data + if (this->m_type == Type::ADDR) { + id += m_addr; + } else if (this->m_type == Type::IP) { + id += IPToHex(m_ip); + } + + return id; +} + +UniValue CAvianNameSystemID::to_object() +{ + UniValue ansInfo(UniValue::VOBJ); + + ansInfo.pushKV("ans_id", this->to_string()); + ansInfo.pushKV("type_hex", this->type()); + + if (this->type() == CAvianNameSystemID::ADDR) { + ansInfo.pushKV("ans_addr", this->addr()); + } else if (this->type() == CAvianNameSystemID::IP) { + ansInfo.pushKV("ans_ip", this->ip()); + } + + return ansInfo; +} diff --git a/src/assets/ans.h b/src/assets/ans.h new file mode 100644 index 000000000..dccb14f19 --- /dev/null +++ b/src/assets/ans.h @@ -0,0 +1,64 @@ +// Copyright (c) 2022 The Avian Core developers +// Copyright (c) 2022 Shafil Alam +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef AVIAN_ANS_H +#define AVIAN_ANS_H + +#include +#include + +#include "univalue.h" + +/* Class for ANS (Avian Name System) ID */ +class CAvianNameSystemID { +public: + static const std::string prefix; + static const std::string domain; + + enum Type { + ADDR = 0x0, + IP = 0x1 + }; + + CAvianNameSystemID(Type type, std::string rawData); + CAvianNameSystemID(std::string ansID); + + std::string to_string(); + UniValue to_object(); + + Type type() { return m_type; }; + std::string addr() { return m_addr; }; + std::string ip() { return m_ip; }; + + static bool CheckIP(std::string rawip, bool isHex); + + static bool IsValidID(std::string ansID); + + static bool CheckTypeData(Type type, std::string typeData); + static std::string FormatTypeData(Type type, std::string typeData, std::string& error); + + static std::pair enum_to_string(Type type) { + switch(type) { + case ADDR: + return std::make_pair("Avian address", "Enter an Avian address"); + case IP: + return std::make_pair("IP [DNS A record]", "Enter IP address"); + default: + return std::make_pair("Invalid", "Invalid"); + } + } + +private: + Type m_type; + std::string m_addr; + std::string m_ip; +}; + +constexpr std::array ANSTypes { + CAvianNameSystemID::ADDR, + CAvianNameSystemID::IP +}; + +#endif diff --git a/src/assets/assetdb.cpp b/src/assets/assetdb.cpp index 3ade39ab0..b6f284719 100644 --- a/src/assets/assetdb.cpp +++ b/src/assets/assetdb.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/assets/assetdb.h b/src/assets/assetdb.h index fc73828bc..1407f2708 100644 --- a/src/assets/assetdb.h +++ b/src/assets/assetdb.h @@ -1,4 +1,5 @@ // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,8 +23,10 @@ class CDatabasedAssetData; struct CBlockAssetUndo { bool fChangedIPFS; + bool fChangedANS; bool fChangedUnits; std::string strIPFS; + std::string strANSID; int32_t nUnits; int8_t version; bool fChangedVerifierString; @@ -35,7 +38,9 @@ struct CBlockAssetUndo inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(fChangedUnits); READWRITE(fChangedIPFS); + READWRITE(fChangedANS); READWRITE(strIPFS); + READWRITE(strANSID); READWRITE(nUnits); if (ser_action.ForRead()) { if (!s.empty() and s.size() >= 1) { diff --git a/src/assets/assets.cpp b/src/assets/assets.cpp index 509ac989d..712e7aabc 100644 --- a/src/assets/assets.cpp +++ b/src/assets/assets.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2020 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -23,6 +24,7 @@ #include "assets.h" #include "assetdb.h" #include "assettypes.h" +#include "ans.h" #include "protocol.h" #include "wallet/coincontrol.h" #include "utilmoneystr.h" @@ -76,7 +78,7 @@ static const std::regex QUALIFIER_INDICATOR("^[#][A-Z0-9._]{3,}$"); // Starts wi static const std::regex SUB_QUALIFIER_INDICATOR("^#[A-Z0-9._]+\\/#[A-Z0-9._]+$"); // Starts with # static const std::regex RESTRICTED_INDICATOR("^[\\$][A-Z0-9._]{3,}$"); // Starts with $ -static const std::regex AVIAN_NAMES("^AVN$|^AVIAN$|^AVIAN$|^#AVN$|^#AVIAN$|^#AVIAN$"); +static const std::regex AVIAN_NAMES("^RVN$|^AVN$|^AVIAN$|^AVIAN$|^#AVN$|^#AVIAN$|^#AVIAN$"); bool IsRootNameValid(const std::string& name) { @@ -447,8 +449,10 @@ CNewAsset::CNewAsset(const CNewAsset& asset) this->nAmount = asset.nAmount; this->units = asset.units; this->nHasIPFS = asset.nHasIPFS; - this->nReissuable = asset.nReissuable; this->strIPFSHash = asset.strIPFSHash; + this->nHasANS = asset.nHasANS; + this->strANSID = asset.strANSID; + this->nReissuable = asset.nReissuable; } CNewAsset& CNewAsset::operator=(const CNewAsset& asset) @@ -457,8 +461,10 @@ CNewAsset& CNewAsset::operator=(const CNewAsset& asset) this->nAmount = asset.nAmount; this->units = asset.units; this->nHasIPFS = asset.nHasIPFS; - this->nReissuable = asset.nReissuable; this->strIPFSHash = asset.strIPFSHash; + this->nHasANS = asset.nHasANS; + this->strANSID = asset.strANSID; + this->nReissuable = asset.nReissuable; return *this; } @@ -471,13 +477,18 @@ std::string CNewAsset::ToString() ss << "units : " << std::to_string(units) << "\n"; ss << "reissuable : " << std::to_string(nReissuable) << "\n"; ss << "has_ipfs : " << std::to_string(nHasIPFS) << "\n"; + ss << "has_ans : " << std::to_string(nHasANS) << "\n"; if (nHasIPFS) ss << "ipfs_hash : " << strIPFSHash; + if (nHasANS) + ss << "ans_id : " << strANSID; + return ss.str(); } +// IPFS CNewAsset::CNewAsset(const std::string& strName, const CAmount& nAmount, const int& units, const int& nReissuable, const int& nHasIPFS, const std::string& strIPFSHash) { this->SetNull(); @@ -487,7 +498,24 @@ CNewAsset::CNewAsset(const std::string& strName, const CAmount& nAmount, const i this->nReissuable = int8_t(nReissuable); this->nHasIPFS = int8_t(nHasIPFS); this->strIPFSHash = strIPFSHash; + this->nHasANS = int8_t(DEFAULT_HAS_ANS); + this->strANSID = DEFAULT_ANS; +} + +// IPFS + ANS +CNewAsset::CNewAsset(const std::string& strName, const CAmount& nAmount, const int& units, const int& nReissuable, const int& nHasIPFS, const std::string& strIPFSHash, const int& nHasANS, const std::string& strANSID) +{ + this->SetNull(); + this->strName = strName; + this->nAmount = nAmount; + this->units = int8_t(units); + this->nReissuable = int8_t(nReissuable); + this->nHasIPFS = int8_t(nHasIPFS); + this->strIPFSHash = strIPFSHash; + this->nHasANS = int8_t(nHasANS); + this->strANSID = strANSID; } + CNewAsset::CNewAsset(const std::string& strName, const CAmount& nAmount) { this->SetNull(); @@ -497,6 +525,8 @@ CNewAsset::CNewAsset(const std::string& strName, const CAmount& nAmount) this->nReissuable = int8_t(DEFAULT_REISSUABLE); this->nHasIPFS = int8_t(DEFAULT_HAS_IPFS); this->strIPFSHash = DEFAULT_IPFS; + this->nHasANS = int8_t(DEFAULT_HAS_ANS); + this->strANSID = DEFAULT_ANS; } CDatabasedAssetData::CDatabasedAssetData(const CNewAsset& asset, const int& nHeight, const uint256& blockHash) @@ -674,15 +704,7 @@ bool TransferAssetFromScript(const CScript& scriptPubKey, CAssetTransfer& assetT std::vector vchTransferAsset; - if (AreTransferScriptsSizeDeployed()) { - // Before kawpow activation we used the hardcoded 31 to find the data - // This created a bug where large transfers scripts would fail to serialize. - // This fixes that issue (https://github.com/AvianNetwork/Avian/issues/752) - // TODO, after the kawpow fork goes active, we should be able to remove this if/else statement and just use this line. - vchTransferAsset.insert(vchTransferAsset.end(), scriptPubKey.begin() + nStartingIndex, scriptPubKey.end()); - } else { - vchTransferAsset.insert(vchTransferAsset.end(), scriptPubKey.begin() + 31, scriptPubKey.end()); - } + vchTransferAsset.insert(vchTransferAsset.end(), scriptPubKey.begin() + nStartingIndex, scriptPubKey.end()); CDataStream ssAsset(vchTransferAsset, SER_NETWORK, PROTOCOL_VERSION); @@ -1630,11 +1652,12 @@ void CAssetTransfer::ConstructTransaction(CScript& script) const } CReissueAsset::CReissueAsset(const std::string &strAssetName, const CAmount &nAmount, const int &nUnits, const int &nReissuable, - const std::string &strIPFSHash) + const std::string &strIPFSHash, const std::string &strANSID) { SetNull(); this->strName = strAssetName; this->strIPFSHash = strIPFSHash; + this->strANSID = strANSID; this->nReissuable = int8_t(nReissuable); this->nAmount = nAmount; this->nUnits = nUnits; @@ -1931,6 +1954,7 @@ bool CAssetsCache::AddReissueAsset(const CReissueAsset& reissue, const std::stri if (!mapReissuedAssetData.count(reissue.strName)) { asset.nAmount += reissue.nAmount; asset.nReissuable = reissue.nReissuable; + if (reissue.nUnits != -1) asset.units = reissue.nUnits; @@ -1938,17 +1962,30 @@ bool CAssetsCache::AddReissueAsset(const CReissueAsset& reissue, const std::stri asset.nHasIPFS = 1; asset.strIPFSHash = reissue.strIPFSHash; } + + if (reissue.strANSID != "") { + asset.nHasANS = 1; + asset.strANSID = reissue.strANSID; + } + mapReissuedAssetData.insert(make_pair(reissue.strName, asset)); } else { mapReissuedAssetData.at(reissue.strName).nAmount += reissue.nAmount; mapReissuedAssetData.at(reissue.strName).nReissuable = reissue.nReissuable; + if (reissue.nUnits != -1) { mapReissuedAssetData.at(reissue.strName).units = reissue.nUnits; } + if (reissue.strIPFSHash != "") { mapReissuedAssetData.at(reissue.strName).nHasIPFS = 1; mapReissuedAssetData.at(reissue.strName).strIPFSHash = reissue.strIPFSHash; } + + if (reissue.strANSID != "") { + mapReissuedAssetData.at(reissue.strName).nHasANS = 1; + mapReissuedAssetData.at(reissue.strName).strANSID = reissue.strANSID; + } } CAssetCacheReissueAsset reissueAsset(reissue, address, out, assetHeight, assetBlockHash); @@ -1972,7 +2009,7 @@ bool CAssetsCache::AddReissueAsset(const CReissueAsset& reissue, const std::stri } //! Changes Memory Only -bool CAssetsCache::RemoveReissueAsset(const CReissueAsset& reissue, const std::string address, const COutPoint& out, const std::vector >& vUndoIPFS) +bool CAssetsCache::RemoveReissueAsset(const CReissueAsset& reissue, const std::string address, const COutPoint& out, const std::vector >& vUndoData) { auto pair = std::make_pair(reissue.strName, address); @@ -1989,14 +2026,18 @@ bool CAssetsCache::RemoveReissueAsset(const CReissueAsset& reissue, const std::s bool fVerifierStringChanged = false; std::string verifierString = ""; // Find the ipfs hash in the undoblock data and restore the ipfs hash to its previous hash - for (auto undoItem : vUndoIPFS) { + for (auto undoItem : vUndoData) { if (undoItem.first == reissue.strName) { if (undoItem.second.fChangedIPFS) assetData.strIPFSHash = undoItem.second.strIPFS; + if (undoItem.second.fChangedANS) + assetData.strANSID = undoItem.second.strANSID; if(undoItem.second.fChangedUnits) assetData.units = undoItem.second.nUnits; if (assetData.strIPFSHash == "") assetData.nHasIPFS = 0; + if (assetData.strANSID == "") + assetData.nHasANS = 0; if (undoItem.second.fChangedVerifierString) { fVerifierStringChanged = true; verifierString = undoItem.second.verifierString; @@ -3803,12 +3844,19 @@ bool GetMyAssetBalance(const std::string& name, CAmount& balance, const int& con // 46 char base58 --> 34 char KAW compatible std::string DecodeAssetData(std::string encoded) { - if (encoded.size() == 46) { + // ANS + if (CAvianNameSystemID::IsValidID(encoded)) { + return encoded; + } + + // IPFS + else if (encoded.size() == 46) { std::vector b; DecodeBase58(encoded, b); return std::string(b.begin(), b.end()); } + // TXID else if (encoded.size() == 64 && IsHex(encoded)) { std::vector vec = ParseHex(encoded); return std::string(vec.begin(), vec.end()); @@ -3820,9 +3868,17 @@ std::string DecodeAssetData(std::string encoded) std::string EncodeAssetData(std::string decoded) { - if (decoded.size() == 34) { + // ANS + if (CAvianNameSystemID::IsValidID(decoded)) { + return decoded; + } + + // IPFS + else if (decoded.size() == 34) { return EncodeIPFS(decoded); } + + // TXID else if (decoded.size() == 32){ return HexStr(decoded); } @@ -3839,7 +3895,8 @@ std::string DecodeIPFS(std::string encoded) }; // 34 char KAW compatible --> 46 char base58 -std::string EncodeIPFS(std::string decoded){ +std::string EncodeIPFS(std::string decoded) +{ std::vector charData(decoded.begin(), decoded.end()); std::vector unsignedCharData; for (char c : charData) @@ -4406,6 +4463,13 @@ bool CheckAmountWithUnits(const CAmount& nAmount, const int8_t nUnits) bool CheckEncoded(const std::string& hash, std::string& strError) { std::string encodedStr = EncodeAssetData(hash); + + // ANS + if (IsAvianNameSystemDeployed() && CAvianNameSystemID::IsValidID(encodedStr)) { + return true; + } + + // IPFS if (encodedStr.substr(0, 2) == "Qm" && encodedStr.size() == 46) { return true; } @@ -4416,7 +4480,7 @@ bool CheckEncoded(const std::string& hash, std::string& strError) { } } - strError = _("Invalid parameter: ipfs_hash is not valid, or txid hash is not the right length"); + strError = _("Invalid parameter: ipfs_hash/ans_id is not valid or txid hash is not the right length"); return false; } @@ -4673,19 +4737,36 @@ bool CAssetsCache::CheckForAddressQualifier(const std::string &qualifier_name, c setIterator = passets->setNewQualifierAddressToAdd.find(cachedQualifierAddress); if (setIterator != passets->setNewQualifierAddressToAdd.end()) { - // Return true if we are adding the qualifier, and false if we are removing it - return setIterator->type == QualifierType::ADD_QUALIFIER; + if (setIterator->type == QualifierType::ADD_QUALIFIER) { + return true; + } else { + // BUG FIX: + // This scenario can occur if a tag #TAG is removed from an address in a block, then in a later block + // #TAG/#SECOND is added to the address. + // If a database event hasn't occurred yet the in memory caches will find that #TAG should be removed from the + // address and would normally fail this check. Now we can check for the exact condition where a subqualifier + // was added later. + + auto tempChecker = CAssetCacheRootQualifierChecker(qualifier_name, address); + if (passets->mapRootQualifierAddressesAdd.count(tempChecker)) { + if (passets->mapRootQualifierAddressesAdd.at(tempChecker).size()) { + return true; + } + } + + return false; + } } - auto tempCache = CAssetCacheRootQualifierChecker(qualifier_name, address); - if (!fSkipTempCache && mapRootQualifierAddressesAdd.count(tempCache)){ - if (mapRootQualifierAddressesAdd[tempCache].size()) { + auto tempChecker = CAssetCacheRootQualifierChecker(qualifier_name, address); + if (!fSkipTempCache && mapRootQualifierAddressesAdd.count(tempChecker)){ + if (mapRootQualifierAddressesAdd.at(tempChecker).size()) { return true; } } - if (passets->mapRootQualifierAddressesAdd.count(tempCache)) { - if (passets->mapRootQualifierAddressesAdd[tempCache].size()) { + if (passets->mapRootQualifierAddressesAdd.count(tempChecker)) { + if (passets->mapRootQualifierAddressesAdd.at(tempChecker).size()) { return true; } } @@ -4698,7 +4779,6 @@ bool CAssetsCache::CheckForAddressQualifier(const std::string &qualifier_name, c } if (prestricteddb) { - // Check for exact qualifier, and add to cache if it exists if (prestricteddb->ReadAddressQualifier(address, qualifier_name)) { passetsQualifierCache->Put(cachedQualifierAddress.GetHash().GetHex(), 1); @@ -5349,6 +5429,11 @@ bool CheckNewAsset(const CNewAsset& asset, std::string& strError) return false; } + if (asset.nHasANS != 0 && asset.nHasANS != 1) { + strError = _("Invalid parameter: has_ans must be 0 or 1."); + return false; + } + return true; } @@ -5389,11 +5474,31 @@ bool ContextualCheckNewAsset(CAssetsCache* assetCache, const CNewAsset& asset, s } } + // ANS not allowed when they are not deployed + if (asset.nHasANS && !IsAvianNameSystemDeployed()) { + strError = _("Invalid parameter: ANS IDs not allowed when they are not deployed."); + return false; + } + + // Check asset name for ANS + if (IsAssetNameARoot(asset.strName) && asset.nHasANS) { + bool shortLength = asset.strName.length() <= CAvianNameSystemID::domain.length(); + if (shortLength || asset.strName.substr(asset.strName.length() - CAvianNameSystemID::domain.length()) != CAvianNameSystemID::domain) { + strError = std::string(_("Invalid parameter: asset name needs to end in '")) + CAvianNameSystemID::domain + std::string(_("' since ANS data is attached.")); + return false; + } + } + if (asset.nHasIPFS) { if (!CheckEncoded(asset.strIPFSHash, strError)) return false; } + if (asset.nHasANS) { + if (!CheckEncoded(asset.strANSID, strError)) + return false; + } + return true; } @@ -5492,6 +5597,26 @@ bool ContextualCheckReissueAsset(CAssetsCache* assetCache, const CReissueAsset& return false; } + // ANS not allowed when they are not deployed + if (reissue_asset.strANSID != "" && !IsAvianNameSystemDeployed()) { + strError = _("Invalid parameter: ANS IDs not allowed when they are not deployed."); + return false; + } + + // Check asset name for ANS + if (IsAssetNameARoot(reissue_asset.strName) && reissue_asset.strANSID != "") { + bool shortLength = reissue_asset.strName.length() <= CAvianNameSystemID::domain.length(); + if (shortLength || reissue_asset.strName.substr(reissue_asset.strName.length() - CAvianNameSystemID::domain.length()) != CAvianNameSystemID::domain) { + strError = std::string(_("Invalid parameter: asset name needs to end in '")) + CAvianNameSystemID::domain + std::string(_("' since ANS data is attached.")); + return false; + } + } + + if (reissue_asset.strANSID != "") { + if (!CheckEncoded(reissue_asset.strANSID, strError)) + return false; + } + if (IsAssetNameAnRestricted(reissue_asset.strName)) { CNullAssetTxVerifierString new_verifier; bool fNotFound = false; @@ -5578,6 +5703,26 @@ bool ContextualCheckReissueAsset(CAssetsCache* assetCache, const CReissueAsset& return false; } + // ANS not allowed when they are not deployed + if (reissue_asset.strANSID != "" && !IsAvianNameSystemDeployed()) { + strError = _("Invalid parameter: ANS IDs not allowed when they are not deployed."); + return false; + } + + // Check asset name for ANS + if (IsAssetNameARoot(reissue_asset.strName) && reissue_asset.strANSID != "") { + bool shortLength = reissue_asset.strName.length() <= CAvianNameSystemID::domain.length(); + if (shortLength || reissue_asset.strName.substr(reissue_asset.strName.length() - CAvianNameSystemID::domain.length()) != CAvianNameSystemID::domain) { + strError = std::string(_("Invalid parameter: asset name needs to end in '")) + CAvianNameSystemID::domain + std::string(_("' since ANS data is attached.")); + return false; + } + } + + if (reissue_asset.strANSID != "") { + if (!CheckEncoded(reissue_asset.strANSID, strError)) + return false; + } + return true; } diff --git a/src/assets/assets.h b/src/assets/assets.h index 6189ebc2a..b3f40cc2b 100644 --- a/src/assets/assets.h +++ b/src/assets/assets.h @@ -1,4 +1,5 @@ // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -27,6 +28,8 @@ #define DEFAULT_REISSUABLE 1 #define DEFAULT_HAS_IPFS 0 #define DEFAULT_IPFS "" +#define DEFAULT_HAS_ANS 0 +#define DEFAULT_ANS "" #define MIN_ASSET_LENGTH 3 #define MAX_ASSET_LENGTH 32 #define OWNER_TAG "!" @@ -271,7 +274,7 @@ public : bool RemoveNewAsset(const CNewAsset& asset, const std::string address); bool RemoveTransfer(const CAssetTransfer& transfer, const std::string& address, const COutPoint& out); bool RemoveOwnerAsset(const std::string& assetsName, const std::string address); - bool RemoveReissueAsset(const CReissueAsset& reissue, const std::string address, const COutPoint& out, const std::vector >& vUndoIPFS); + bool RemoveReissueAsset(const CReissueAsset& reissue, const std::string address, const COutPoint& out, const std::vector >& vUndoData); bool UndoAssetCoin(const Coin& coin, const COutPoint& out); bool RemoveQualifierAddress(const std::string& assetName, const std::string& address, const QualifierType type); bool RemoveRestrictedAddress(const std::string& assetName, const std::string& address, const RestrictedType type); @@ -519,7 +522,7 @@ bool GetAssetData(const CScript& script, CAssetOutputEntry& data); bool GetBestAssetAddressAmount(CAssetsCache& cache, const std::string& assetName, const std::string& address); -//! Decode and Encode IPFS hashes, or OIP hashes +//! Decode and Encode IPFS hashes, ANS IDs, or OIP hashes std::string DecodeAssetData(std::string encoded); std::string EncodeAssetData(std::string decoded); std::string DecodeIPFS(std::string encoded); diff --git a/src/assets/assettypes.h b/src/assets/assettypes.h index 90dfdc79e..cec8262af 100644 --- a/src/assets/assettypes.h +++ b/src/assets/assettypes.h @@ -1,4 +1,5 @@ // Copyright (c) 2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -56,7 +57,7 @@ const char TXID_NOTIFIER = 0x54; const char IPFS_SHA2_256_LEN = 0x20; template -bool ReadWriteAssetHash(Stream &s, Operation ser_action, std::string &strIPFSHash) +bool ReadWriteAssetIPFSHash(Stream &s, Operation ser_action, std::string &strIPFSHash) { // assuming 34-byte IPFS SHA2-256 decoded hash (0x12, 0x20, 32 more bytes) if (ser_action.ForRead()) @@ -102,7 +103,9 @@ class CNewAsset int8_t units; // 1 Byte int8_t nReissuable; // 1 Byte int8_t nHasIPFS; // 1 Byte + int8_t nHasANS; // 1 Byte std::string strIPFSHash; // MAX 40 Bytes + std::string strANSID; // MAX 40 Bytes CNewAsset() { @@ -110,6 +113,7 @@ class CNewAsset } CNewAsset(const std::string& strName, const CAmount& nAmount, const int& units, const int& nReissuable, const int& nHasIPFS, const std::string& strIPFSHash); + CNewAsset(const std::string& strName, const CAmount& nAmount, const int& units, const int& nReissuable, const int& nHasIPFS, const std::string& strIPFSHash, const int& nHasANS, const std::string& strANSID); CNewAsset(const std::string& strName, const CAmount& nAmount); CNewAsset(const CNewAsset& asset); @@ -123,6 +127,8 @@ class CNewAsset nReissuable = int8_t(0); nHasIPFS = int8_t(0); strIPFSHash = ""; + nHasANS = int8_t(0); + strANSID = ""; } bool IsNull() const; @@ -142,7 +148,11 @@ class CNewAsset READWRITE(nReissuable); READWRITE(nHasIPFS); if (nHasIPFS == 1) { - ReadWriteAssetHash(s, ser_action, strIPFSHash); + ReadWriteAssetIPFSHash(s, ser_action, strIPFSHash); + } + READWRITE(nHasANS); + if (nHasANS == 1) { + READWRITE(strANSID); } } }; @@ -212,7 +222,7 @@ class CAssetTransfer { READWRITE(strName); READWRITE(nAmount); - bool validIPFS = ReadWriteAssetHash(s, ser_action, message); + bool validIPFS = ReadWriteAssetIPFSHash(s, ser_action, message); if (validIPFS) { if (ser_action.ForRead()) { if (!s.empty() && s.size() >= sizeof(int64_t)) { @@ -241,6 +251,7 @@ class CReissueAsset int8_t nUnits; int8_t nReissuable; std::string strIPFSHash; + std::string strANSID; CReissueAsset() { @@ -254,6 +265,7 @@ class CReissueAsset nUnits = 0; nReissuable = 1; strIPFSHash = ""; + strANSID = ""; } ADD_SERIALIZE_METHODS; @@ -265,10 +277,11 @@ class CReissueAsset READWRITE(nAmount); READWRITE(nUnits); READWRITE(nReissuable); - ReadWriteAssetHash(s, ser_action, strIPFSHash); + ReadWriteAssetIPFSHash(s, ser_action, strIPFSHash); + READWRITE(strANSID); } - CReissueAsset(const std::string& strAssetName, const CAmount& nAmount, const int& nUnits, const int& nReissuable, const std::string& strIPFSHash); + CReissueAsset(const std::string& strAssetName, const CAmount& nAmount, const int& nUnits, const int& nReissuable, const std::string& strIPFSHash, const std::string& strANSID); void ConstructTransaction(CScript& script) const; bool IsNull() const; }; diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 602a545d2..a014bb9e3 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -50,7 +50,7 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state) assert(stream.Rewind(sizeof(block_bench::block566553))); CValidationState validationState; - assert(CheckBlock(block, validationState, chainParams->GetConsensus())); + assert(CheckBlock(block, validationState, chainParams->GetConsensus(), 0)); } } diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index e3c1ee1bc..a2ae3268a 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -199,7 +199,8 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector< return READ_STATUS_INVALID; CValidationState state; - if (!CheckBlock(block, state, Params().GetConsensus())) { + + if (!CheckBlock(block, state, Params().GetConsensus(), 0)) { // TODO: We really want to just check merkle tree manually here, // but that is expensive, and CheckBlock caches a block's // "checked-status" (in the CBlock?). CBlock should be able to diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a896c4656..55300c1e5 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Copyright (c) 2017 The Raven Core developers -// Copyright (c) 2021 The Avian Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -135,14 +135,6 @@ class CMainParams : public CChainParams { consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008 - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].bit = 6; //Assets (RIP2) - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nStartTime = 1540944000; // Oct 31, 2018 - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nTimeout = 1572480000; // Oct 31, 2019 - - // Crow Algo Deployment - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].bit = 7; - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nStartTime = 2208988800; // Jan 1, 2040 - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nTimeout = 2208988800 + 31536000; // Start + 1 year // Crow Algo consensus consensus.powForkTime = 1638847407; // Time of PoW hash method change (Dec 06 2021) @@ -155,18 +147,23 @@ class CMainParams : public CChainParams { consensus.powTypeLimits.emplace_back(uint256S("000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); // Crow limit // x16rt switch - consensus.nX16rtTimestamp = 1638748799; + consensus.nX16rtTimestamp = 1638847406; - // Avian Assets - consensus.nAssetActivationTime = 999999999999ULL; // TODO + // Avian Assets, Messaging, Restricted + consensus.nAssetActivationTime = 1666202400; // TODO + consensus.nMessagingActivationTime = 1666202400; // TODO + consensus.nRestrictedActivationTime = 1666202400; // TODO // Avian Flight Plans consensus.nFlightPlansActivationTime = 999999999999ULL; // TODO + // Avian Name System (ANS) + consensus.nAvianNameSystemTime = 999999999999ULL; // TODO + // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000002518d7bd53a1feec"); //Block 818787 + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000029178e309cb56715"); // Block 1072359 // By default assume that the signatures in ancestors of this block are valid. - consensus.defaultAssumeValid = uint256S("0x0000000247de51f4188fc43316cc5e1f8711cff6210b242d234004aae39163d5"); // Block 818787 + consensus.defaultAssumeValid = uint256S("0x00000000005ab90c287e481b1f2911228d26723ac07bcadd65031158ad733316"); // Block 1072359 // The best chain should have at least this much work. @@ -191,32 +188,32 @@ class CMainParams : public CChainParams { genesis = CreateGenesisBlock(1630067829, 8650489, 0x1e00ffff, 4, 10 * COIN); - consensus.hashGenesisBlock = genesis.GetHash(); + consensus.hashGenesisBlock = genesis.GetX16RHash(); assert(consensus.hashGenesisBlock == uint256S("0x000000cdb10fc01df7fba251f2168ef7cd7854b571049db4902c315694461dd0")); assert(genesis.hashMerkleRoot == uint256S("0x63d9b6b6b549a2d96eb5ac4eb2ab80761e6d7bffa9ae1a647191e08d6416184d")); // Main seeders vSeeds.emplace_back("dnsseed.us.avn.network", true); + vSeeds.emplace_back("dnsseed.ap.avn.network", true); vSeeds.emplace_back("dnsseed.eu.avn.network", true); - // Backup nodes - vSeeds.emplace_back("159.65.178.148:7895", true); - vSeeds.emplace_back("144.91.77.184:7895", true); - vSeeds.emplace_back("51.89.166.31:7895", true); - vSeeds.emplace_back("66.191.202.105:7895", true); - vSeeds.emplace_back("71.202.82.78:7895", true); - base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,60); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,122); base58Prefixes[SECRET_KEY] = std::vector(1,128); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; - // Avian BIP44 cointype in mainnet is '175' - nExtCoinType = 175; + // Avian BIP44 cointype in mainnet is '921' + nExtCoinType = 921; vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); + // Founder reward + vector rewardStructures = { + {INT_MAX, 5} // 5% founder/dev fee forever + }; + consensus.nFounderPayment = FounderPayment(rewardStructures, 1121000); // Block 1121000 + fDefaultConsistencyChecks = false; fRequireStandard = true; fMineBlocksOnDemand = false; @@ -228,18 +225,20 @@ class CMainParams : public CChainParams { { 275972, uint256S("0x0000004ac340f01da45c151990567a90a3c65010511ba7a05f3439a83c878efb")}, { 508245, uint256S("0x00000000006cd2496fb78aedbd6524c8b1993589097fb848740e37eeab651682")}, { 818787, uint256S("0x0000000247de51f4188fc43316cc5e1f8711cff6210b242d234004aae39163d5")}, + { 939610, uint256S("0x00000003cb151bde7f7c91b0dd145fbd8a0d6267873980662819fcddc3c74e24")}, { 940202, uint256S("0x00000000ed69247f7ef177a14e44de41d9c1ba689cb930946ff773ebfe23f64c")}, - { 952399, uint256S("0x0000000000a11f354eacb65fee963df9818ee8884d8dd926da33921691ec9969")} + { 952399, uint256S("0x0000000000a11f354eacb65fee963df9818ee8884d8dd926da33921691ec9969")}, + { 1072359, uint256S("0x00000000005ab90c287e481b1f2911228d26723ac07bcadd65031158ad733316")} } }; chainTxData = ChainTxData{ // Update as we know more about the contents of the Avian chain - // Stats as of 00000001ce6a1f7137c09b2279fdadc7c23249cef47f666e9df4f6c16187598d block 770056 - 1654373937, // * UNIX timestamp of last known number of transactions - 1057391, // * total number of transactions between genesis and that timestamp + // Stats as of 00000001ce6a1f7137c09b2279fdadc7c23249cef47f666e9df4f6c16187598d block 1072359 + 1663533875, // * UNIX timestamp of last known number of transactions + 1451962, // * total number of transactions between genesis and that timestamp // (the tx=... number in the SetBestChain debug.log lines) - 0.022 // * estimated number of transactions per second after that timestamp + 0.04 // * estimated number of transactions per second after that timestamp }; /** AVN Start **/ @@ -277,9 +276,6 @@ class CMainParams : public CChainParams { // TODO: Assets, Messaging, Restricted nAssetActivationHeight = 9999999999; // Asset activated block height - nMessagingActivationBlock = 9999999999; // Messaging activated block height - nRestrictedActivationBlock = 9999999999; // Restricted activated block height - /** AVN End **/ } }; @@ -308,14 +304,6 @@ class CTestNetParams : public CChainParams { consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].bit = 6; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nStartTime = 0; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nTimeout = 999999999999ULL; - - // Crow Algo Deployment (testnet) - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].bit = 7; - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nStartTime = -1; - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nTimeout = std::numeric_limits::max(); // Crow Algo consensus consensus.powForkTime = 1639005225; // Time of PoW hash method change @@ -329,12 +317,17 @@ class CTestNetParams : public CChainParams { // testnet x16rt switch consensus.nX16rtTimestamp = 1634101200; // Oct 13, 2021 - // Avian Assets + // Avian Assets, Messaging, Restricted consensus.nAssetActivationTime = 1645104453; // Feb 17, 2022 + consensus.nMessagingActivationTime = 1645104453; // Feb 17, 2022 + consensus.nRestrictedActivationTime = 1645104453; // Feb 17, 2022 // Avian Flight Plans consensus.nFlightPlansActivationTime = 1645104453; // Feb 17, 2022 + // Avian Name System (ANS) + consensus.nAvianNameSystemTime = 1645104453; // Feb 17, 2022 + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000002"); @@ -351,7 +344,7 @@ class CTestNetParams : public CChainParams { genesis = CreateGenesisBlock(1630065295, 24922064, 0x1e00ffff, 4, 10 * COIN); - consensus.hashGenesisBlock = genesis.GetHash(); + consensus.hashGenesisBlock = genesis.GetX16RHash(); assert(consensus.hashGenesisBlock == uint256S("0x00000084af22998d2aed78cc29f1fa587f854150ccd2991dfc82241c8f049219")); assert(genesis.hashMerkleRoot == uint256S("0x63d9b6b6b549a2d96eb5ac4eb2ab80761e6d7bffa9ae1a647191e08d6416184d")); @@ -369,6 +362,12 @@ class CTestNetParams : public CChainParams { vFixedSeeds = std::vector(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); + // Founder reward + vector rewardStructures = { + {INT_MAX, 5} // 5% founder/dev fee forever + }; + consensus.nFounderPayment = FounderPayment(rewardStructures, 150, "n1BurnXXXXXXXXXXXXXXXXXXXXXXU1qejP"); // Block 150 (burn coins) + fDefaultConsistencyChecks = false; fRequireStandard = false; fMineBlocksOnDemand = false; @@ -381,14 +380,11 @@ class CTestNetParams : public CChainParams { }; chainTxData = ChainTxData{ - // Update as we know more about the contents of the Avian chain - // Stats as of 0000cd2943664b4bda8be6e80351f9ff022475ae6a341a868babc4efd846000d block 42000 - 1654349227, // * UNIX timestamp of last known number of transactions - 66085, // * total number of transactions between genesis and that timestamp - // (the tx=... number in the SetBestChain debug.log lines) - 0.001 // * estimated number of transactions per second after that timestamp + 0, + 0, + 0 }; - + /** AVN Start **/ // Burn Amounts nIssueAssetBurnAmount = 500 * COIN; @@ -422,9 +418,7 @@ class CTestNetParams : public CChainParams { nMinReorganizationPeers = 4; nMinReorganizationAge = 60 * 60 * 12; // 12 hours - nAssetActivationHeight = 0; // Asset activated block height - nMessagingActivationBlock = 0; // Messaging activated block height - nRestrictedActivationBlock = 0; // Restricted activated block height + nAssetActivationHeight = 1; // Asset activated block height /** AVN End **/ } }; @@ -452,29 +446,29 @@ class CRegTestParams : public CChainParams { consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].bit = 6; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nStartTime = 0; - consensus.vDeployments[Consensus::DEPLOYMENT_ASSETS].nTimeout = 999999999999ULL; - - // Crow Algo Deployment (testnet) - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].bit = 7; - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nStartTime = 0; - consensus.vDeployments[Consensus::DEPLOYMENT_CROW].nTimeout = 999999999999ULL; // Crow Algo consensus - consensus.powForkTime = 1; // Time of PoW hash method change + consensus.powForkTime = 1629951212; // Time of PoW hash method change consensus.lwmaAveragingWindow = 45; // Averaging window size for LWMA diff adjust - consensus.diffRetargetFix = 1; // Block of diff algo change - consensus.diffRetargetTake2 = 1; // Third iteration of LWMA retarget activation timestamp + consensus.diffRetargetFix = 0; // Block of diff algo change + consensus.diffRetargetTake2 = 1629951212; // Third iteration of LWMA retarget activation timestamp + + consensus.powTypeLimits.emplace_back(uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); // x16rt limit + consensus.powTypeLimits.emplace_back(uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); // Crow limit // regtest x16rt switch (genesis +1) consensus.nX16rtTimestamp = 1629951212; - // Avian Assets - consensus.nAssetActivationTime = 1; + // Avian Assets, Messaging, Restricted + consensus.nAssetActivationTime = 1629951212; // (genesis +1) + consensus.nMessagingActivationTime = 1629951212; // (genesis +1) + consensus.nRestrictedActivationTime = 1629951212; // (genesis +1) // Avian Flight Plans - consensus.nFlightPlansActivationTime = 1; + consensus.nFlightPlansActivationTime = 1629951212; // (genesis +1) + + // Avian Name System (ANS) + consensus.nAvianNameSystemTime = 1629951212; // (genesis +1) // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00"); @@ -505,7 +499,7 @@ class CRegTestParams : public CChainParams { for (int i=0;i<40000000;i++) { genesis = CreateGenesisBlock(1629951211, i, 0x207fffff, 2, 2500 * COIN); //genesis.hashPrevBlock = TempHashHolding; - consensus.hashGenesisBlock = genesis.GetX16RHash(); + consensus.hashGenesisBlock = genesis.GetHash(); arith_uint256 BestBlockHashArith = UintToArith256(BestBlockHash); if (UintToArith256(consensus.hashGenesisBlock) < BestBlockHashArith) { @@ -550,11 +544,17 @@ class CRegTestParams : public CChainParams { // ///////////////////////////////////////////////////////////////// - genesis = CreateGenesisBlock(1629951211, 1, 0x207fffff, 4, 2500 * COIN); - consensus.hashGenesisBlock = genesis.GetX16RHash(); + genesis = CreateGenesisBlock(1629951211, 1, 0x207fffff, 2, 2500 * COIN); - assert(consensus.hashGenesisBlock == uint256S("0x0d2d32f6d3fa3d0eb49602b7ea50eb684ada6dd5b411b1e5dbf6687c520dd9b1")); - assert(genesis.hashMerkleRoot == uint256S("3f3621f5a83a2697099fea380f24f2854e15c912828a09112942d543033bcbf8")); + consensus.hashGenesisBlock = genesis.GetHash(); + assert(consensus.hashGenesisBlock == uint256S("0x653634d03d27ed84e8aba5dd47903906ad7be4876a1d3677be0db2891dcf787f")); + assert(genesis.hashMerkleRoot == uint256S("63d9b6b6b549a2d96eb5ac4eb2ab80761e6d7bffa9ae1a647191e08d6416184d")); + + // Founder reward + vector rewardStructures = { + {INT_MAX, 5} // 5% founder/dev fee forever + }; + consensus.nFounderPayment = FounderPayment(rewardStructures, 1, "n1BurnXXXXXXXXXXXXXXXXXXXXXXU1qejP"); // Block 1 (burn coins) vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds. vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds. @@ -562,6 +562,7 @@ class CRegTestParams : public CChainParams { fDefaultConsistencyChecks = true; fRequireStandard = false; fMineBlocksOnDemand = true; + fMiningRequiresPeers = false; checkpointData = (CCheckpointData) { { @@ -616,9 +617,7 @@ class CRegTestParams : public CChainParams { nMinReorganizationPeers = 4; nMinReorganizationAge = 60 * 60 * 12; // 12 hours - nAssetActivationHeight = 0; // Asset activated block height - nMessagingActivationBlock = 0; // Messaging activated block height - nRestrictedActivationBlock = 0; // Restricted activated block height + nAssetActivationHeight = 1; // Asset activated block height /** AVN End **/ } }; diff --git a/src/chainparams.h b/src/chainparams.h index ff48154b6..3d19d02f7 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -135,8 +135,6 @@ class CChainParams } unsigned int DGWActivationBlock() const { return nDGWActivationBlock; } - unsigned int MessagingActivationBlock() const { return nMessagingActivationBlock; } - unsigned int RestrictedActivationBlock() const { return nRestrictedActivationBlock; } int MaxReorganizationDepth() const { return nMaxReorganizationDepth; } int MinReorganizationPeers() const { return nMinReorganizationPeers; } @@ -192,8 +190,6 @@ class CChainParams std::string strGlobalBurnAddress; unsigned int nDGWActivationBlock; - unsigned int nMessagingActivationBlock; - unsigned int nRestrictedActivationBlock; uint32_t nX16RV2ActivationTime; int nMaxReorganizationDepth; diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index f898d7920..240bfb77b 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -8,10 +8,77 @@ * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. */ static SeedSpec6 pnSeed6_main[] = { + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x0d,0xc7,0x0e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x57,0x1a,0xac}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x6b,0xae,0xf7}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x47,0x13,0x44}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0x75,0xd4,0xc9}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xc7,0xad,0x62}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0xb9,0x2a,0xfc}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xd8,0xb4,0x34}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xc4,0xbe,0x7e}, 7895}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x41,0xb2,0x94}, 7895}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa1,0x23,0xd4,0x8e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x5b,0x4d,0xb8}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x59,0xa6,0x1f}, 7895}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xbf,0xca,0x69}, 7895}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xca,0x52,0x4e}, 7895} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xca,0x52,0x4e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x42,0x0e,0x2e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xdf,0x1d,0x99}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x1f,0x62,0x21}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x26,0xc6,0x11}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0xf4,0xb3,0x7b}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x80,0x5c,0x61}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7b,0x18,0x53,0xb8}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdc,0xf0,0x0c,0xb0}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0xd3,0xe3,0x5e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xca,0x20,0x6a}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc9,0x8f,0x98,0x5f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8a,0xc5,0x92,0x3c}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xdd,0xd3,0x74}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x41,0xb2,0x94}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x97,0xf2,0x9a}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7d,0xa8,0x5f,0xd9}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xde,0x10,0x72}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x0f,0x84,0x66}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x82,0xb9,0xca,0x9f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x49,0xd6,0x00,0x1c}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0xb4,0xf9,0x8d}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xd4,0x13,0x54}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x15,0x85,0xf2}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0x13,0x12,0x8e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x99,0x9c,0xce}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0x5f,0x92,0x2f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x44,0x1d,0xb3}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x3a,0x1f,0x8f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x84,0x94,0x4c,0xe2}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x49,0xaa,0x3e,0x19}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xc3,0x92,0x0c}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x6d,0x61,0x85}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x15,0x8e,0x20}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x3b,0x34,0x55}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x5b,0x7b,0xba}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x2a,0x69,0xb7}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbc,0x68,0xf5}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xbf,0x25,0x68}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x63,0xe9,0x19,0x1b}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0xea,0x80,0x73}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x22,0x68,0x3f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x09,0x92,0x7a}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x49,0x1a,0x1e,0x0e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa1,0x23,0xd4,0x8e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x19,0xf1,0xe0}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x8d,0xc1,0xf0}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0xf2,0xe6,0x99}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x96,0x54,0x7e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x19,0x11,0x82}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xc1,0x85,0x73}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xa0,0x40,0x0f}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x65,0x5c,0xd6}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7d,0xfd,0x11,0x1e}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0f,0xcc,0x8c,0x97}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x3a,0x45,0xed}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x12,0x1e,0x75}, 7895}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x5b,0x80,0x85}, 7895} }; static SeedSpec6 pnSeed6_test[] = { diff --git a/src/coins.cpp b/src/coins.cpp index ab65f54ee..4727d484f 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -146,6 +146,10 @@ void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, uint2 // Set the old IPFSHash for the blockundo bool fIPFSChanged = !reissue.strIPFSHash.empty(); + + // Set the old ANSID for the blockundo + bool fANSChanged = !reissue.strANSID.empty(); + bool fUnitsChanged = reissue.nUnits != -1; bool fVerifierChanged = false; std::string strOldVerifier = ""; @@ -182,9 +186,9 @@ void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, uint2 } // If any of the following items were changed by reissuing, we need to database the old values so it can be undone correctly - if (fIPFSChanged || fUnitsChanged || fVerifierChanged) { + if (fIPFSChanged || fANSChanged || fUnitsChanged || fVerifierChanged) { undoAssetData->first = reissue.strName; // Asset Name - undoAssetData->second = CBlockAssetUndo {fIPFSChanged, fUnitsChanged, asset.strIPFSHash, asset.units, ASSET_UNDO_INCLUDES_VERIFIER_STRING, fVerifierChanged, strOldVerifier}; // ipfschanged, unitchanged, Old Assets IPFSHash, old units + undoAssetData->second = CBlockAssetUndo {fIPFSChanged, fANSChanged, fUnitsChanged, asset.strIPFSHash, asset.strANSID, asset.units, ASSET_UNDO_INCLUDES_VERIFIER_STRING, fVerifierChanged, strOldVerifier}; // ipfschanged, unitchanged, Old Assets IPFSHash, old units } } else if (tx.IsNewUniqueAsset()) { for (int n = 0; n < (int)tx.vout.size(); n++) { diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index e1829c393..7ff38bf6f 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -26,11 +26,8 @@ static const int64_t MAX_BLOCK_SIGOPS_COST = 80000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100; -/** Timestamp at which the UAHF starts. */ -static const uint64_t DEFAULT_UAHF_START_TIME = 1585828800; - -/** Timestamp at which the UAHF FOR Assets starts. **/ -static const uint64_t DEFAULT_UAHF_FOR_ASSETS_START_TIME = 1601424000; +/** Timestamp at which the FORK ID UAHF starts. */ +static const uint64_t DEFAULT_FORKID_UAHF_START_TIME = 1585828800; static const int WITNESS_SCALE_FACTOR = 4; @@ -42,10 +39,10 @@ static const size_t MIN_SERIALIZABLE_TRANSACTION_WEIGHT = WITNESS_SCALE_FACTOR * //! it causes unused variable warnings when compiling. This UNUSED_VAR removes the unused warnings UNUSED_VAR static bool fAssetsIsActive = false; UNUSED_VAR static bool fFlightPlansIsActive = false; -UNUSED_VAR static bool fRip5IsActive = false; +UNUSED_VAR static bool fAvianNameSystemIsActive = false; UNUSED_VAR static bool fTransferScriptIsActive = false; -UNUSED_VAR static bool fEnforcedValuesIsActive = false; -UNUSED_VAR static bool fCheckCoinbaseAssetsIsActive = false; +UNUSED_VAR static bool fEnforcedValuesIsActive = true; // AVN: Always return true for enforced values. +UNUSED_VAR static bool fCheckCoinbaseAssetsIsActive = true; // AVN: Always return true for coinbase asset checks. unsigned int GetMaxBlockWeight(); unsigned int GetMaxBlockSerializedSize(); diff --git a/src/consensus/params.h b/src/consensus/params.h index 132153c9a..30141641a 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Copyright (c) 2017 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -8,6 +9,8 @@ #define AVIAN_CONSENSUS_PARAMS_H #include "uint256.h" +#include "founder_payment.h" + #include #include #include @@ -17,11 +20,9 @@ namespace Consensus { enum DeploymentPos { DEPLOYMENT_TESTDUMMY, - DEPLOYMENT_ASSETS, // Deployment of RIP2 // DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113. -// DEPLOYMENT_SEGWIT, // Deployment of BIP141, BIP143, and BIP147. + // DEPLOYMENT_SEGWIT, // Deployment of BIP141, BIP143, and BIP147. // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp, - DEPLOYMENT_CROW, MAX_VERSION_BITS_DEPLOYMENTS }; @@ -83,9 +84,21 @@ struct ConsensusParams { // AVN Assets uint32_t nAssetActivationTime; + // Messaging + uint32_t nMessagingActivationTime; + + // Restricted + uint32_t nRestrictedActivationTime; + // AVN Flight Plans uint32_t nFlightPlansActivationTime; + // AVN Founder Payment + FounderPayment nFounderPayment; + + // Avian Name System (ANS) + uint32_t nAvianNameSystemTime; + }; } // namespace Consensus diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index e0a6d4feb..9b4eab752 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2017-2017 The Bitcoin Core developers // Copyright (c) 2017-2020 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -166,7 +167,7 @@ int64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& i return nSigOps; } -bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fCheckDuplicateInputs, bool fMempoolCheck, bool fBlockCheck) +bool CheckTransaction(const CTransaction& tx, CValidationState &state, int nHeight, CAmount blockReward, bool fCheckDuplicateInputs, bool fMempoolCheck, bool fBlockCheck) { // Basic checks that don't depend on any context if (tx.vin.empty()) @@ -383,10 +384,18 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe for (auto vout : tx.vout) { if (vout.scriptPubKey.IsAssetScript() || vout.scriptPubKey.IsNullAsset()) { return state.DoS(0, error("%s: coinbase contains asset transaction", __func__), - REJECT_INVALID, "bad-txns-coinbase-contains-asset-txes"); + REJECT_INVALID, "bad-txns-coinbase-contains-asset-txes"); } } } + + FounderPayment founderPayment = Params().GetConsensus().nFounderPayment; + CAmount founderReward = founderPayment.getFounderPaymentAmount(nHeight, blockReward); + int founderStartHeight = founderPayment.getStartBlock(); + + if(nHeight > founderStartHeight && founderReward && !founderPayment.IsBlockPayeeValid(tx, nHeight, blockReward)) { + return state.DoS(100, false, REJECT_INVALID, "bad-cb-founder-payment-not-found"); + } } else { diff --git a/src/consensus/tx_verify.h b/src/consensus/tx_verify.h index c8d1d1988..3ad1bc4e8 100644 --- a/src/consensus/tx_verify.h +++ b/src/consensus/tx_verify.h @@ -26,7 +26,7 @@ class CNullAssetTxData; /** Transaction validation functions */ /** Context-independent validity checks */ -bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true, bool fMempoolCheck = false, bool fBlockCheck = false); +bool CheckTransaction(const CTransaction& tx, CValidationState& state, int nHeight, CAmount blockReward, bool fCheckDuplicateInputs=true, bool fMempoolCheck = false, bool fBlockCheck = false); namespace Consensus { /** diff --git a/src/core_write.cpp b/src/core_write.cpp index f1499e14a..74e36389c 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -216,6 +216,9 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey, if (asset.nHasIPFS > 0) { assetInfo.pushKV("ipfs_hash", EncodeAssetData(asset.strIPFSHash)); } + if (asset.nHasANS > 0) { + assetInfo.pushKV("ans_id", asset.strANSID); + } } } break; @@ -231,6 +234,9 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey, if (!asset.strIPFSHash.empty()) { assetInfo.pushKV("ipfs_hash", EncodeAssetData(asset.strIPFSHash)); } + if (!asset.strANSID.empty()) { + assetInfo.pushKV("ans_id", asset.strANSID); + } } break; } diff --git a/src/flat-database.h b/src/flat-database.h new file mode 100644 index 000000000..43c3a264d --- /dev/null +++ b/src/flat-database.h @@ -0,0 +1,229 @@ +// Copyright (c) 2014-2020 The Dash Core developers +// Copyright (c) 2022 The Avian Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef AVN_FLAT_DATABASE_H +#define AVN_FLAT_DATABASE_H + +#include "chainparams.h" +#include "clientversion.h" +#include "fs.h" +#include "hash.h" +#include "streams.h" +#include "util.h" + +/** +* Generic Dumping and Loading +* --------------------------- +*/ + +template +class CFlatDB +{ +private: + + enum ReadResult { + Ok, + FileError, + HashReadError, + IncorrectHash, + IncorrectMagicMessage, + IncorrectMagicNumber, + IncorrectFormat + }; + + fs::path pathDB; + std::string strFilename; + std::string strMagicMessage; + + bool Write(const T& objToSave) + { + // LOCK(objToSave.cs); + + int64_t nStart = GetTimeMillis(); + + // serialize, checksum data up to that point, then append checksum + CDataStream ssObj(SER_DISK, CLIENT_VERSION); + ssObj << strMagicMessage; // specific magic message for this type of object + ssObj << Params().MessageStart(); // network specific magic number + ssObj << objToSave; + uint256 hash = Hash(ssObj.begin(), ssObj.end()); + ssObj << hash; + + // open output file, and associate with CAutoFile + FILE *file = fopen(pathDB.string().c_str(), "wb"); + CAutoFile fileout(file, SER_DISK, CLIENT_VERSION); + if (fileout.IsNull()) + return error("%s: Failed to open file %s", __func__, pathDB.string()); + + // Write and commit header, data + try { + fileout << ssObj; + } + catch (std::exception &e) { + return error("%s: Serialize or I/O error - %s", __func__, e.what()); + } + fileout.fclose(); + + LogPrint(BCLog::BENCH, "Written info to %s %dms\n", strFilename, GetTimeMillis() - nStart); + LogPrint(BCLog::BENCH, " %s\n", objToSave.ToString()); + + return true; + } + + ReadResult Read(T& objToLoad, bool fDryRun = false) + { + //LOCK(objToLoad.cs); + + int64_t nStart = GetTimeMillis(); + // open input file, and associate with CAutoFile + FILE *file = fopen(pathDB.string().c_str(), "rb"); + CAutoFile filein(file, SER_DISK, CLIENT_VERSION); + if (filein.IsNull()) + { + error("%s: Failed to open file %s", __func__, pathDB.string()); + return FileError; + } + + // use file size to size memory buffer + int fileSize = fs::file_size(pathDB); + int dataSize = fileSize - sizeof(uint256); + // Don't try to resize to a negative number if file is small + if (dataSize < 0) + dataSize = 0; + std::vector vchData; + vchData.resize(dataSize); + uint256 hashIn; + + // read data and checksum from file + try { + filein.read((char *)vchData.data(), dataSize); + filein >> hashIn; + } + catch (std::exception &e) { + error("%s: Deserialize or I/O error - %s", __func__, e.what()); + return HashReadError; + } + filein.fclose(); + + CDataStream ssObj(vchData, SER_DISK, CLIENT_VERSION); + + // verify stored checksum matches input data + uint256 hashTmp = Hash(ssObj.begin(), ssObj.end()); + if (hashIn != hashTmp) + { + error("%s: Checksum mismatch, data corrupted", __func__); + return IncorrectHash; + } + + + unsigned char pchMsgTmp[4]; + std::string strMagicMessageTmp; + try { + // de-serialize file header (file specific magic message) and .. + ssObj >> strMagicMessageTmp; + + // ... verify the message matches predefined one + if (strMagicMessage != strMagicMessageTmp) + { + error("%s: Invalid magic message", __func__); + return IncorrectMagicMessage; + } + + + // de-serialize file header (network specific magic number) and .. + ssObj >> pchMsgTmp; + + // ... verify the network matches ours + if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) + { + error("%s: Invalid network magic number", __func__); + return IncorrectMagicNumber; + } + + // de-serialize data into T object + ssObj >> objToLoad; + } + catch (std::exception &e) { + objToLoad.Clear(); + error("%s: Deserialize or I/O error - %s", __func__, e.what()); + return IncorrectFormat; + } + + LogPrint(BCLog::BENCH, "Loaded info from %s %dms\n", strFilename, GetTimeMillis() - nStart); + LogPrint(BCLog::BENCH, " %s\n", objToLoad.ToString()); + if(!fDryRun) { + LogPrint(BCLog::BENCH, "%s: Cleaning....\n", __func__); + objToLoad.CheckAndRemove(); + LogPrint(BCLog::BENCH, " %s\n", objToLoad.ToString()); + } + + return Ok; + } + + +public: + CFlatDB(std::string strFilenameIn, std::string strMagicMessageIn) + { + pathDB = GetDataDir() / strFilenameIn; + strFilename = strFilenameIn; + strMagicMessage = strMagicMessageIn; + } + + bool Load(T& objToLoad) + { + LogPrint(BCLog::BENCH, "Reading info from %s...\n", strFilename); + ReadResult readResult = Read(objToLoad); + if (readResult == FileError) + LogPrintf("Missing file %s, will try to recreate\n", strFilename); + else if (readResult != Ok) + { + LogPrintf("Error reading %s: ", strFilename); + if(readResult == IncorrectFormat) + { + LogPrintf("%s: Magic is ok but data has invalid format, will try to recreate\n", __func__); + } + else { + LogPrintf("%s: File format is unknown or invalid, please fix it manually\n", __func__); + // program should exit with an error + return false; + } + } + return true; + } + + bool Dump(T& objToSave) + { + int64_t nStart = GetTimeMillis(); + + LogPrint(BCLog::BENCH, "Verifying %s format...\n", strFilename); + T tmpObjToLoad; + ReadResult readResult = Read(tmpObjToLoad, true); + + // there was an error and it was not an error on file opening => do not proceed + if (readResult == FileError) + LogPrintf("Missing file %s, will try to recreate\n", strFilename); + else if (readResult != Ok) + { + LogPrintf("Error reading %s: ", strFilename); + if(readResult == IncorrectFormat) + LogPrintf("%s: Magic is ok but data has invalid format, will try to recreate\n", __func__); + else + { + LogPrintf("%s: File format is unknown or invalid, please fix it manually\n", __func__); + return false; + } + } + + LogPrint(BCLog::BENCH, "Writing info to %s...\n", strFilename); + Write(objToSave); + LogPrint(BCLog::BENCH, "%s dump finished %dms\n", strFilename, GetTimeMillis() - nStart); + + return true; + } + +}; + + +#endif // AVN_FLAT_DATABASE_H diff --git a/src/flightplans/avianlib.cpp b/src/flightplans/avianlib.cpp index 0fb07aea6..3bce9ab01 100644 --- a/src/flightplans/avianlib.cpp +++ b/src/flightplans/avianlib.cpp @@ -402,6 +402,12 @@ static int getassetdata(lua_State* L) return RPCCall(L, "getassetdata"); } +// getansdata "asset_name" +static int getansdata(lua_State* L) +{ + return RPCCall(L, "getansdata"); +} + // getcacheinfo static int getcacheinfo(lua_State* L) { @@ -480,6 +486,18 @@ static int transferfromaddresses(lua_State* L) return RPCCall(L, "transferfromaddresses"); } +// ansencode +static int ansencode(lua_State* L) +{ + return RPCCall(L, "ansencode"); +} + +// ansdecode +static int ansdecode(lua_State* L) +{ + return RPCCall(L, "ansdecode"); +} + /* Blockchain */ // decodeblock "blockhex" @@ -1009,6 +1027,7 @@ void register_avianlib(lua_State* L) static const struct luaL_Reg avian_assets[] = { {"getassetdata", getassetdata}, + {"getansdata", getansdata}, {"getcacheinfo", getcacheinfo}, {"getsnapshot", getsnapshot}, {"issue", issue}, @@ -1022,6 +1041,8 @@ void register_avianlib(lua_State* L) {"transfer", transfer}, {"transferfromaddress", transferfromaddress}, {"transferfromaddresses", transferfromaddresses}, + {"ansencode", ansencode}, + {"ansdecode", ansdecode}, {NULL, NULL}}; static const struct luaL_Reg avian_blockchain[] = { diff --git a/src/flightplans/flightplans.cpp b/src/flightplans/flightplans.cpp index 52d95ef2d..883901b83 100644 --- a/src/flightplans/flightplans.cpp +++ b/src/flightplans/flightplans.cpp @@ -11,7 +11,6 @@ Please take precautions when using this feature. #include "flightplans.h" #include "avianlib.h" -#include "weblib.h" #include "util.h" #include @@ -33,15 +32,13 @@ FlightPlanResult AvianFlightPlans::run_file(const char* file, const char* func, lua_State* L = luaL_newstate(); // Make standard libraries available in the Lua object - luaL_openlibs(L); + luaopen_base(L); + luaopen_table(L); + luaopen_string(L); + luaopen_math(L); // Register Avian lib register_avianlib(L); - - // Register Web3 lib (only if enabled) - if (gArgs.IsArgSet("-flightplans-web3")) { - register_weblib(L); - } // Load the program status = luaL_dofile(L, file); diff --git a/src/flightplans/keccak.cpp b/src/flightplans/keccak.cpp deleted file mode 100644 index 7f6727f37..000000000 --- a/src/flightplans/keccak.cpp +++ /dev/null @@ -1,294 +0,0 @@ -// ////////////////////////////////////////////////////////// -// keccak.cpp -// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// - -#include "keccak.h" - -#include "compat/endian.h" - -/// same as reset() -Keccak::Keccak(Bits bits) -: m_blockSize(200 - 2 * (bits / 8)), - m_bits(bits) -{ - reset(); -} - - -/// restart -void Keccak::reset() -{ - for (size_t i = 0; i < StateSize; i++) - m_hash[i] = 0; - - m_numBytes = 0; - m_bufferSize = 0; -} - - -/// constants and local helper functions -namespace -{ - const unsigned int KeccakRounds = 24; - const uint64_t XorMasks[KeccakRounds] = - { - 0x0000000000000001ULL, 0x0000000000008082ULL, 0x800000000000808aULL, - 0x8000000080008000ULL, 0x000000000000808bULL, 0x0000000080000001ULL, - 0x8000000080008081ULL, 0x8000000000008009ULL, 0x000000000000008aULL, - 0x0000000000000088ULL, 0x0000000080008009ULL, 0x000000008000000aULL, - 0x000000008000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, - 0x8000000000008003ULL, 0x8000000000008002ULL, 0x8000000000000080ULL, - 0x000000000000800aULL, 0x800000008000000aULL, 0x8000000080008081ULL, - 0x8000000000008080ULL, 0x0000000080000001ULL, 0x8000000080008008ULL - }; - - /// rotate left and wrap around to the right - inline uint64_t rotateLeft(uint64_t x, uint8_t numBits) - { - return (x << numBits) | (x >> (64 - numBits)); - } - - /// convert litte vs big endian - inline uint64_t swap(uint64_t x) - { -#if defined(__GNUC__) || defined(__clang__) - return __builtin_bswap64(x); -#endif -#ifdef _MSC_VER - return _byteswap_uint64(x); -#endif - - return (x >> 56) | - ((x >> 40) & 0x000000000000FF00ULL) | - ((x >> 24) & 0x0000000000FF0000ULL) | - ((x >> 8) & 0x00000000FF000000ULL) | - ((x << 8) & 0x000000FF00000000ULL) | - ((x << 24) & 0x0000FF0000000000ULL) | - ((x << 40) & 0x00FF000000000000ULL) | - (x << 56); - } - - - /// return x % 5 for 0 <= x <= 9 - unsigned int mod5(unsigned int x) - { - if (x < 5) - return x; - - return x - 5; - } -} - - -/// process a full block -void Keccak::processBlock(const void* data) -{ -#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN) -#define LITTLEENDIAN(x) swap(x) -#else -#define LITTLEENDIAN(x) (x) -#endif - - const uint64_t* data64 = (const uint64_t*) data; - // mix data into state - for (unsigned int i = 0; i < m_blockSize / 8; i++) - m_hash[i] ^= LITTLEENDIAN(data64[i]); - - // re-compute state - for (unsigned int round = 0; round < KeccakRounds; round++) - { - // Theta - uint64_t coefficients[5]; - for (unsigned int i = 0; i < 5; i++) - coefficients[i] = m_hash[i] ^ m_hash[i + 5] ^ m_hash[i + 10] ^ m_hash[i + 15] ^ m_hash[i + 20]; - - for (unsigned int i = 0; i < 5; i++) - { - uint64_t one = coefficients[mod5(i + 4)] ^ rotateLeft(coefficients[mod5(i + 1)], 1); - m_hash[i ] ^= one; - m_hash[i + 5] ^= one; - m_hash[i + 10] ^= one; - m_hash[i + 15] ^= one; - m_hash[i + 20] ^= one; - } - - // temporary - uint64_t one; - - // Rho Pi - uint64_t last = m_hash[1]; - one = m_hash[10]; m_hash[10] = rotateLeft(last, 1); last = one; - one = m_hash[ 7]; m_hash[ 7] = rotateLeft(last, 3); last = one; - one = m_hash[11]; m_hash[11] = rotateLeft(last, 6); last = one; - one = m_hash[17]; m_hash[17] = rotateLeft(last, 10); last = one; - one = m_hash[18]; m_hash[18] = rotateLeft(last, 15); last = one; - one = m_hash[ 3]; m_hash[ 3] = rotateLeft(last, 21); last = one; - one = m_hash[ 5]; m_hash[ 5] = rotateLeft(last, 28); last = one; - one = m_hash[16]; m_hash[16] = rotateLeft(last, 36); last = one; - one = m_hash[ 8]; m_hash[ 8] = rotateLeft(last, 45); last = one; - one = m_hash[21]; m_hash[21] = rotateLeft(last, 55); last = one; - one = m_hash[24]; m_hash[24] = rotateLeft(last, 2); last = one; - one = m_hash[ 4]; m_hash[ 4] = rotateLeft(last, 14); last = one; - one = m_hash[15]; m_hash[15] = rotateLeft(last, 27); last = one; - one = m_hash[23]; m_hash[23] = rotateLeft(last, 41); last = one; - one = m_hash[19]; m_hash[19] = rotateLeft(last, 56); last = one; - one = m_hash[13]; m_hash[13] = rotateLeft(last, 8); last = one; - one = m_hash[12]; m_hash[12] = rotateLeft(last, 25); last = one; - one = m_hash[ 2]; m_hash[ 2] = rotateLeft(last, 43); last = one; - one = m_hash[20]; m_hash[20] = rotateLeft(last, 62); last = one; - one = m_hash[14]; m_hash[14] = rotateLeft(last, 18); last = one; - one = m_hash[22]; m_hash[22] = rotateLeft(last, 39); last = one; - one = m_hash[ 9]; m_hash[ 9] = rotateLeft(last, 61); last = one; - one = m_hash[ 6]; m_hash[ 6] = rotateLeft(last, 20); last = one; - m_hash[ 1] = rotateLeft(last, 44); - - // Chi - for (unsigned int j = 0; j < StateSize; j += 5) - { - // temporaries - uint64_t one = m_hash[j]; - uint64_t two = m_hash[j + 1]; - - m_hash[j] ^= m_hash[j + 2] & ~two; - m_hash[j + 1] ^= m_hash[j + 3] & ~m_hash[j + 2]; - m_hash[j + 2] ^= m_hash[j + 4] & ~m_hash[j + 3]; - m_hash[j + 3] ^= one & ~m_hash[j + 4]; - m_hash[j + 4] ^= two & ~one; - } - - // Iota - m_hash[0] ^= XorMasks[round]; - } -} - - -/// add arbitrary number of bytes -void Keccak::add(const void* data, size_t numBytes) -{ - const uint8_t* current = (const uint8_t*) data; - - if (m_bufferSize > 0) - { - while (numBytes > 0 && m_bufferSize < m_blockSize) - { - m_buffer[m_bufferSize++] = *current++; - numBytes--; - } - } - - // full buffer - if (m_bufferSize == m_blockSize) - { - processBlock((void*)m_buffer); - m_numBytes += m_blockSize; - m_bufferSize = 0; - } - - // no more data ? - if (numBytes == 0) - return; - - // process full blocks - while (numBytes >= m_blockSize) - { - processBlock(current); - current += m_blockSize; - m_numBytes += m_blockSize; - numBytes -= m_blockSize; - } - - // keep remaining bytes in buffer - while (numBytes > 0) - { - m_buffer[m_bufferSize++] = *current++; - numBytes--; - } -} - - -/// process everything left in the internal buffer -void Keccak::processBuffer() -{ - unsigned int blockSize = 200 - 2 * (m_bits / 8); - - // add padding - size_t offset = m_bufferSize; - // add a "1" byte - m_buffer[offset++] = 1; - // fill with zeros - while (offset < blockSize) - m_buffer[offset++] = 0; - - // and add a single set bit - m_buffer[blockSize - 1] |= 0x80; - - processBlock(m_buffer); -} - - -/// return latest hash as 16 hex characters -std::string Keccak::getHash() -{ - // save hash state - uint64_t oldHash[StateSize]; - for (unsigned int i = 0; i < StateSize; i++) - oldHash[i] = m_hash[i]; - - // process remaining bytes - processBuffer(); - - // convert hash to string - static const char dec2hex[16 + 1] = "0123456789abcdef"; - - // number of significant elements in hash (uint64_t) - unsigned int hashLength = m_bits / 64; - - std::string result; - for (unsigned int i = 0; i < hashLength; i++) - for (unsigned int j = 0; j < 8; j++) // 64 bits => 8 bytes - { - // convert a byte to hex - unsigned char oneByte = (unsigned char) (m_hash[i] >> (8 * j)); - result += dec2hex[oneByte >> 4]; - result += dec2hex[oneByte & 15]; - } - - // Keccak224's last entry in m_hash provides only 32 bits instead of 64 bits - unsigned int remainder = m_bits - hashLength * 64; - unsigned int processed = 0; - while (processed < remainder) - { - // convert a byte to hex - unsigned char oneByte = (unsigned char) (m_hash[hashLength] >> processed); - result += dec2hex[oneByte >> 4]; - result += dec2hex[oneByte & 15]; - - processed += 8; - } - - // restore state - for (unsigned int i = 0; i < StateSize; i++) - m_hash[i] = oldHash[i]; - - return result; -} - - -/// compute Keccak hash of a memory block -std::string Keccak::operator()(const void* data, size_t numBytes) -{ - reset(); - add(data, numBytes); - return getHash(); -} - - -/// compute Keccak hash of a string, excluding final zero -std::string Keccak::operator()(const std::string& text) -{ - reset(); - add(text.c_str(), text.size()); - return getHash(); -} diff --git a/src/flightplans/keccak.h b/src/flightplans/keccak.h deleted file mode 100644 index 8b87a259d..000000000 --- a/src/flightplans/keccak.h +++ /dev/null @@ -1,81 +0,0 @@ -// ////////////////////////////////////////////////////////// -// keccak.h -// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// - -#pragma once - -//#include "hash.h" -#include - -// define fixed size integer types -#ifdef _MSC_VER -// Windows -typedef unsigned __int8 uint8_t; -typedef unsigned __int64 uint64_t; -#else -// GCC -#include -#endif - - -/// compute Keccak hash (designated SHA3) -/** Usage: - Keccak keccak; - std::string myHash = keccak("Hello World"); // std::string - std::string myHash2 = keccak("How are you", 11); // arbitrary data, 11 bytes - - // or in a streaming fashion: - - Keccak keccak; - while (more data available) - keccak.add(pointer to fresh data, number of new bytes); - std::string myHash3 = keccak.getHash(); - */ -class Keccak //: public Hash -{ -public: - /// algorithm variants - enum Bits { Keccak224 = 224, Keccak256 = 256, Keccak384 = 384, Keccak512 = 512 }; - - /// same as reset() - explicit Keccak(Bits bits = Keccak256); - - /// compute hash of a memory block - std::string operator()(const void* data, size_t numBytes); - /// compute hash of a string, excluding final zero - std::string operator()(const std::string& text); - - /// add arbitrary number of bytes - void add(const void* data, size_t numBytes); - - /// return latest hash as hex characters - std::string getHash(); - - /// restart - void reset(); - -private: - /// process a full block - void processBlock(const void* data); - /// process everything left in the internal buffer - void processBuffer(); - - /// 1600 bits, stored as 25x64 bit, BlockSize is no more than 1152 bits (Keccak224) - enum { StateSize = 1600 / (8 * 8), - MaxBlockSize = 200 - 2 * (224 / 8) }; - - /// hash - uint64_t m_hash[StateSize]; - /// size of processed data in bytes - uint64_t m_numBytes; - /// block size (less or equal to MaxBlockSize) - size_t m_blockSize; - /// valid bytes in m_buffer - size_t m_bufferSize; - /// bytes not processed yet - uint8_t m_buffer[MaxBlockSize]; - /// variant - Bits m_bits; -}; diff --git a/src/flightplans/weblib.cpp b/src/flightplans/weblib.cpp deleted file mode 100644 index ad9126684..000000000 --- a/src/flightplans/weblib.cpp +++ /dev/null @@ -1,214 +0,0 @@ -#include "weblib.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "keccak.h" -#include "lua/lua.hpp" - -namespace beast = boost::beast; // from -namespace http = beast::http; // from -namespace net = boost::asio; // from -using tcp = net::ip::tcp; // from - -/** Static RPCs */ -const static std::string POLYGON_RPC = "polygon-rpc.com"; - -// Performs an HTTP POST and returns the response -std::string http_rpc(std::string host, std::string command, std::string args) -{ - std::string result; - try { - // Set port and target - const char* port = "80"; - const char* target = "/"; - - // Set POST body - std::string body = std::string("{\"jsonrpc\":\"2.0\",\"method\":") + std::string("\"") + command + std::string("\"") + std::string(",\"params\":[" + args + "],\"id\":1}"); - - // The io_context is required for all I/O - net::io_context ioc; - - // These objects perform our I/O - tcp::resolver resolver(ioc); - beast::tcp_stream stream(ioc); - - // Look up the domain name - auto const results = resolver.resolve(host.c_str(), port); - - // Make the connection on the IP address we get from a lookup - stream.connect(results); - - // Set up an HTTP POST request message - http::request request; - request.version(11); - request.method(http::verb::post); - request.target(target); - request.set(http::field::host, host); - request.set(http::field::content_type, "application/x-www-form-urlencoded"); - request.body() = body.c_str(); - request.prepare_payload(); - - http::write(stream, request); - - beast::flat_buffer buffer; - http::response res; - - http::read(stream, buffer, res); - - result = beast::buffers_to_string(res.body().data()); - - // Gracefully close the socket - beast::error_code ec; - stream.socket().shutdown(tcp::socket::shutdown_both, ec); - - // not_connected happens sometimes - // so don't bother reporting it. - if (ec && ec != beast::errc::not_connected) - throw beast::system_error{ec}; - - // If we get here then the connection is closed gracefully - } catch (std::exception const& e) { - result = "Error: " + std::string(e.what()); - } - return result; -} - -/** Polygon Lua RPC */ -static int polygon_rpc(lua_State* L) -{ - if (lua_isstring(L, 1)) { - if (lua_isstring(L, 2)) { - const char* command = lua_tostring(L, 1); - const char* args = lua_tostring(L, 2); - std::string result = http_rpc(POLYGON_RPC, std::string(command), std::string(args)); - lua_pushstring(L, result.c_str()); - - } else { - lua_pushliteral(L, "Missing args. If no args needed then use: \"\""); - lua_error(L); - } - } else { - lua_pushliteral(L, "Missing RPC command"); - lua_error(L); - } - - /* return the number of results */ - return 1; -} - -/** ABI Encoder */ -std::string abi_function(std::string func, std::vector args, std::vector types) -{ - Keccak keccak256(Keccak::Keccak256); - std::stringstream stream; - - // Remove first two elements in vector - args.erase(args.begin()); - args.erase(args.begin()); - - // Get first 8 bytes of Keccak hash from function name - std::string keccakHash(keccak256(func), 0, 8); - stream << "0x" << keccakHash; - - if(types.size() < args.size()) return "ABI Error: No type were given for arugment."; - - // Add argument with padded hex - for (size_t i = 0; i < args.size(); ++i) { - if (types[i] == "address") { - std::string arg_item(args[i]); - std::string arg_item_padded(arg_item, 2, 40); - stream << std::setfill('0') << std::setw(64) << arg_item_padded; - } else { - return "ABI Error: Unknown type: " + types[i]; - } - } - - // Return ABI result - return stream.str(); -} - -/** Helper split function */ -std::vector split(const std::string& s, char delim) -{ - std::vector result; - std::stringstream ss(s); - std::string item; - - if(s == "") return {}; - - while (getline(ss, item, delim)) { - result.push_back(item); - } - - return result; -} - -static int lua_abi_function(lua_State* L) -{ - std::vector args; - - /* get number of arguments */ - int n = lua_gettop(L); - - if(n <= 2) { - lua_pushliteral(L, "Invalid amount of arguments."); - lua_error(L); - } - - /* loop through each argument */ - for (int i = 1; i <= n; i++) { - if (lua_isstring(L, i)) { - std::string arg = std::string(lua_tostring(L, i)); - args.push_back(arg); - } else { - lua_pushliteral(L, "Invalid argument"); - lua_error(L); - } - } - - std::string func_name = args[0] + "(" + args[1] + ")"; - std::string result = abi_function(func_name, args, split(args[1], ',')); - - /* check if result is in hex */ - if(result[0] != '0' && result[1] != 'x') { - lua_pushstring(L, result.c_str()); - lua_error(L); - } else { - lua_pushstring(L, result.c_str()); - } - - return 1; -} - -void register_weblib(lua_State* L) -{ - static const struct luaL_Reg polygon[] = { - {"rpc", polygon_rpc}, - {NULL, NULL}}; - - static const struct luaL_Reg abi[] = { - {"encode", lua_abi_function}, - {NULL, NULL}}; - - lua_newtable(L); - - lua_newtable(L); - luaL_setfuncs(L, polygon, 0); - lua_setfield(L, -2, "polygon"); - - lua_newtable(L); - luaL_setfuncs(L, abi, 0); - lua_setfield(L, -2, "abi"); - - lua_setglobal(L, "web3"); -} diff --git a/src/flightplans/weblib.h b/src/flightplans/weblib.h deleted file mode 100644 index 3feddbc40..000000000 --- a/src/flightplans/weblib.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2022 The Avian Core developers -// Copyright (c) 2022 Shafil Alam -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef AVIAN_FLIGHTPLANS_NETLIB_H -#define AVIAN_FLIGHTPLANS_NETLIB_H - -#include "lua/lua.hpp" -#include - -/* Lua */ -void register_weblib(lua_State* L); - -#endif diff --git a/src/founder_payment.cpp b/src/founder_payment.cpp new file mode 100644 index 000000000..769aea8f1 --- /dev/null +++ b/src/founder_payment.cpp @@ -0,0 +1,53 @@ +#include "founder_payment.h" + +#include "base58.h" +#include "chainparams.h" +#include "util.h" +#include + +CAmount FounderPayment::getFounderPaymentAmount(int blockHeight, CAmount blockReward) +{ + if (blockHeight <= startBlock) { + return 0; + } + + for (int i = 0; i < rewardStructures.size(); i++) { + FounderRewardStructure rewardStructure = rewardStructures[i]; + if (rewardStructure.blockHeight == INT_MAX || blockHeight <= rewardStructure.blockHeight) { + return blockReward * rewardStructure.rewardPercentage / 100; + } + } + return 0; +} + +void FounderPayment::FillFounderPayment(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, CTxOut& txoutFounderRet) +{ + // Make sure it's not filled yet + CAmount founderPayment = getFounderPaymentAmount(nBlockHeight, blockReward); + txoutFounderRet = CTxOut(); + CScript payee; + + // Fill payee with the founder address + CAvianAddress cbAddress(founderAddress); + payee = GetScriptForDestination(cbAddress.Get()); + + // Split reward between miner + txNew.vout[0].nValue -= founderPayment; + txoutFounderRet = CTxOut(founderPayment, payee); + txNew.vout.push_back(txoutFounderRet); +} + +bool FounderPayment::IsBlockPayeeValid(const CTransaction& txNew, const int height, const CAmount blockReward) +{ + CScript payee; + // Fill payee with the founder address + payee = GetScriptForDestination(CAvianAddress(founderAddress).Get()); + const CAmount founderReward = getFounderPaymentAmount(height, blockReward); + BOOST_FOREACH (const CTxOut& out, txNew.vout) { + if (out.scriptPubKey == payee && out.nValue >= founderReward) { + return true; + } + } + + return false; +} diff --git a/src/founder_payment.h b/src/founder_payment.h new file mode 100644 index 000000000..ab8fb3415 --- /dev/null +++ b/src/founder_payment.h @@ -0,0 +1,41 @@ +#ifndef AVN_FOUNDER_PAYMENT_H +#define AVN_FOUNDER_PAYMENT_H + +#include "amount.h" +#include "primitives/transaction.h" +#include "script/standard.h" +#include +#include + +using namespace std; + +static const string DEFAULT_FOUNDER_ADDRESS = "rPC7kPCNPAVnUvQs4fWEvnFwJ4yfKvArXM"; + +struct FounderRewardStructure { + int blockHeight; + int rewardPercentage; +}; + +class FounderPayment +{ +public: + FounderPayment(vector rewardStructures = {}, int startBlock = 0, const string& address = DEFAULT_FOUNDER_ADDRESS) + { + this->founderAddress = address; + this->startBlock = startBlock; + this->rewardStructures = rewardStructures; + } + ~FounderPayment(){}; + CAmount getFounderPaymentAmount(int blockHeight, CAmount blockReward); + void FillFounderPayment(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, CTxOut& txoutFounderRet); + bool IsBlockPayeeValid(const CTransaction& txNew, const int height, const CAmount blockReward); + int getStartBlock() { return this->startBlock; } + +private: + string founderAddress; + int startBlock; + vector rewardStructures; +}; + + +#endif /* AVN_FOUNDER_PAYMENT_H */ diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 590b5c15d..5a0b95b12 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -110,7 +110,7 @@ class WorkQueue bool Enqueue(WorkItem* item) { std::unique_lock lock(cs); - if (queue.size() >= maxDepth) { + if (!running || queue.size() >= maxDepth) { return false; } queue.emplace_back(std::unique_ptr(item)); @@ -127,7 +127,7 @@ class WorkQueue std::unique_lock lock(cs); while (running && queue.empty()) cond.wait(lock); - if (!running) + if (!running && queue.empty()) break; i = std::move(queue.front()); queue.pop_front(); @@ -478,8 +478,6 @@ void StopHTTPServer() if (workQueue) { LogPrint(BCLog::HTTP, "Waiting for HTTP worker threads to exit\n"); workQueue->WaitExit(); - delete workQueue; - workQueue = nullptr; } if (eventBase) { LogPrint(BCLog::HTTP, "Waiting for HTTP event thread to exit\n"); @@ -505,6 +503,10 @@ void StopHTTPServer() event_base_free(eventBase); eventBase = nullptr; } + if (workQueue) { + delete workQueue; + workQueue = nullptr; + } LogPrint(BCLog::HTTP, "Stopped HTTP server\n"); } diff --git a/src/init.cpp b/src/init.cpp index 411cbabd4..73c27e3b0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -58,6 +58,9 @@ #include #include +#include "primitives/powcache.h" +#include "flat-database.h" + #ifndef WIN32 #include #endif @@ -206,12 +209,29 @@ void PrepareShutdown() #endif GenerateAvians(false, 0, Params()); + // fRPCInWarmup should be `false` if we completed the loading sequence + // before a shutdown request was received + std::string statusmessage; + bool fRPCInWarmup = RPCIsInWarmup(&statusmessage); + MapPort(false); // Because these depend on each-other, we make sure that neither can be // using the other before destroying them. UnregisterValidationInterface(peerLogic.get()); if(g_connman) g_connman->Stop(); + + // After there are no more peers/RPC left to give us new data which may generate + // CValidationInterface callbacks, flush them... + GetMainSignals().FlushBackgroundCallbacks(); + + if (!fRPCInWarmup) { + CFlatDB flatdb7("powcache.dat", "powCache"); + flatdb7.Dump(CPowCache::Instance()); + } + + // After the threads that potentially access these pointers have been stopped, + // destruct and reset all to nullptr. peerLogic.reset(); g_connman.reset(); @@ -236,10 +256,6 @@ void PrepareShutdown() FlushStateToDisk(); } - // After there are no more peers/RPC left to give us new data which may generate - // CValidationInterface callbacks, flush them... - GetMainSignals().FlushBackgroundCallbacks(); - // Any future callbacks will be dropped. This should absolutely be safe - if // missing a callback results in an unrecoverable situation, unclean shutdown // would too. The only reason to do the above flushes is to let the wallet catch @@ -624,7 +640,8 @@ std::string HelpMessage(HelpMessageMode mode) } // Crow: Allow switching of default pow algo via conf / command line, for miners that can't easily adjust their getblocktemplate calls strUsage += HelpMessageOpt("-powalgo=x16rt|minotaurx", strprintf(_("Default pow mining algorithm. Miners who can't easily adjust their getblocktemplate calls should use this argument to set their preferred mining algorithm. (default: %s)"), DEFAULT_POW_TYPE)); - + // Flightplan: Show how to enable flightplans + strUsage += HelpMessageOpt("-flightplans", strprintf(_("Enable Avian Flightplans for use via JSON-RPC"))); return strUsage; } @@ -1384,7 +1401,25 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // Generate coins in the background GenerateAvians(fGenerate, gArgs.GetArg("-genproclimit", DEFAULT_GENERATE_THREADS), chainparams); - // ********************************************************* Step 6: network initialization + + // ********************************************************* Step 6: Load cache data + + fs::path pathDB = GetDataDir(); + std::string strDBName = "powcache.dat"; + + // Always load the powcache if available: + uiInterface.InitMessage(_("Loading POW cache...")); + fs::path powCacheFile = pathDB / strDBName; + if (!fs::exists(powCacheFile)) { + uiInterface.InitMessage("Loading POW cache for the first time. This could take a minute..."); + } + + CFlatDB flatdb7(strDBName, "powCache"); + if(!flatdb7.Load(CPowCache::Instance())) { + return InitError(_("Failed to load POW cache from") + "\n" + (pathDB / strDBName).string()); + } + + // ********************************************************* Step 7: network initialization // Note that we absolutely cannot open any actual connections // until the very end ("start node") as the UTXO/block state // is not yet setup and may end up being set up twice if we @@ -1497,7 +1532,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) nMaxOutboundLimit = gArgs.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024; } - // ********************************************************* Step 7: load block chain + // ********************************************************* Step 8: load block chain fReindex = gArgs.GetBoolArg("-reindex", false); bool fReindexChainState = gArgs.GetBoolArg("-reindex-chainstate", false); @@ -1613,12 +1648,11 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) passetsCache->Size()); // Check for changed -disablemessaging state - // TODO: Change to !AreMessagesDeployed() - if (!bNetwork.fOnTestnet || gArgs.GetArg("-disablemessaging", false)) { + if (gArgs.GetBoolArg("-disablemessaging", false)) { LogPrintf("Messaging is disabled\n"); fMessaging = false; } else { - fMessaging = true; + // TODO: This can be misleading. LogPrintf("Messaging is enabled\n"); } } @@ -1804,7 +1838,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) ::feeEstimator.Read(est_filein); fFeeEstimatesInitialized = true; - // ********************************************************* Step 8: load wallet + // ********************************************************* Step 9: load wallet #ifdef ENABLE_WALLET if (!OpenWallets()) return false; @@ -1812,7 +1846,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) LogPrintf("No wallet support compiled in!\n"); #endif - // ********************************************************* Step 9: data directory maintenance + // ********************************************************* Step 10: data directory maintenance // if pruning, unset the service bit and perform the initial blockstore prune // after any wallet rescanning has taken place. @@ -1828,7 +1862,14 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) if(chainparams.GetConsensus().nSegwitEnabled) { nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS); } - // ********************************************************* Step 10: import blocks + + // ********************************************************* Step 11: Schedule PoW cache flush + + // Periodic flush of PoW Cache if cache has grown enough + scheduler.scheduleEvery(std::bind(&CPowCache::DoMaintenance, &CPowCache::Instance()), 60 * 1000); + + + // ********************************************************* Step 12: import blocks if (!CheckDiskSpace()) return false; @@ -1860,7 +1901,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); } - // ********************************************************* Step 11: start node + // ********************************************************* Step 13: start node int chain_active_height; @@ -1947,7 +1988,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) StartWallets(scheduler); - // ********************************************************* Step 12: Init Msg Channel list + // ********************************************************* Step 14: Init Msg Channel list if (!fReindex && fLoaded && fMessaging && pmessagechanneldb && !gArgs.GetBoolArg("-disablewallet", false)) { bool found; if (!pmessagechanneldb->ReadFlag("init", found)) { @@ -1962,7 +2003,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } #endif - // ********************************************************* Step 13: finished + // ********************************************************* Step 15: finished uiInterface.InitMessage(_("Done Loading")); return !fRequestShutdown; diff --git a/src/lua/loslib.c b/src/lua/loslib.c index 3e20d622b..9f812bc28 100644 --- a/src/lua/loslib.c +++ b/src/lua/loslib.c @@ -110,8 +110,6 @@ */ #if !defined(lua_tmpnam) /* { */ -#if defined(LUA_USE_POSIX) /* { */ - #include #define LUA_TMPNAMBUFSIZE 32 @@ -129,12 +127,11 @@ #else /* }{ */ /* ISO C definitions */ -#define LUA_TMPNAMBUFSIZE L_tmpnam -#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } +// #define LUA_TMPNAMBUFSIZE L_tmpnam +// #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } #endif /* } */ -#endif /* } */ /* }================================================================== */ diff --git a/src/miner.cpp b/src/miner.cpp index 54334ed86..5d63fd263 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -189,20 +189,27 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc nLastBlockTx = nBlockTx; nLastBlockWeight = nBlockWeight; + CAmount blockReward = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()); + // Create coinbase transaction. CMutableTransaction coinbaseTx; coinbaseTx.vin.resize(1); coinbaseTx.vin[0].prevout.SetNull(); coinbaseTx.vout.resize(1); coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn; - coinbaseTx.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()); + coinbaseTx.vout[0].nValue = blockReward; coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0; + + // Fill founder payment + FounderPayment founderPayment = chainparams.GetConsensus().nFounderPayment; + founderPayment.FillFounderPayment(coinbaseTx, nHeight, blockReward, pblock->txoutFounder); + pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx)); pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus()); pblocktemplate->vTxFees[0] = -nFees; - LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost); - + LogPrint(BCLog::BENCH, "CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost); + // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev, powType); @@ -223,7 +230,7 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc int64_t nTime2 = GetTimeMicros(); LogPrint(BCLog::BENCH, "CreateNewBlock() packages: %.2fms (%d packages, %d updated descendants), validity: %.2fms (total %.2fms)\n", 0.001 * (nTime1 - nTimeStart), nPackagesSelected, nDescendantsUpdated, 0.001 * (nTime2 - nTime1), 0.001 * (nTime2 - nTimeStart)); - + return std::move(pblocktemplate); } @@ -628,7 +635,7 @@ void static AvianMiner(const CChainParams& chainparams, const POW_TYPE powType) uint256 hash; while (true) { - hash = pblock->GetHash(); + hash = pblock->ComputePoWHash(); if (UintToArith256(hash) <= hashTarget) { // Found a solution diff --git a/src/net.cpp b/src/net.cpp index 58219ee45..c7a24c26a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -703,6 +703,8 @@ void CNode::copyStats(CNodeStats &stats) X(nRecvBytes); } X(fWhitelisted); + X(nProcessedAddrs); + X(nRatelimitedAddrs); // It is common for nodes with good ping times to suddenly become lagged, // due to a new block arriving or other large transfer. @@ -2788,6 +2790,10 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn fGetAddr = false; nNextLocalAddrSend = 0; nNextAddrSend = 0; + nAddrTokenBucket = 1; // initialize to 1 to allow self-announcement + nAddrTokenTimestamp = GetTimeMicros(); + nProcessedAddrs = 0; + nRatelimitedAddrs = 0; nNextInvSend = 0; fRelayTxes = false; fSentAddr = false; diff --git a/src/net.h b/src/net.h index ae3c640b0..5bcb53452 100644 --- a/src/net.h +++ b/src/net.h @@ -50,6 +50,8 @@ static const int TIMEOUT_INTERVAL = 20 * 60; static const int FEELER_INTERVAL = 120; /** The maximum number of entries in an 'inv' protocol message */ static const unsigned int MAX_INV_SZ = 50000; +/** The maximum number of entries in a locator */ +static const unsigned int MAX_LOCATOR_SZ = 101; /** The maximum number of entries in an 'asset inv' protocol message */ static const unsigned int MAX_ASSET_INV_SZ = 1024; /** The maximum number of new addresses to accumulate before announcing. */ @@ -367,8 +369,8 @@ class CConnman // Network usage totals CCriticalSection cs_totalBytesRecv; CCriticalSection cs_totalBytesSent; - uint64_t nTotalBytesRecv; - uint64_t nTotalBytesSent; + uint64_t nTotalBytesRecv {0}; + uint64_t nTotalBytesSent {0}; // outbound limit & stats uint64_t nMaxOutboundTotalBytesSentInCycle; @@ -551,6 +553,8 @@ class CNodeStats CAddress addr; // Bind address of our side of the connection CAddress addrBind; + uint64_t nProcessedAddrs; + uint64_t nRatelimitedAddrs; }; @@ -681,6 +685,14 @@ class CNode int64_t nNextAddrSend; int64_t nNextLocalAddrSend; + /** Number of addresses that can be processed from this peer. */ + double nAddrTokenBucket; + /** When nAddrTokenBucket was last updated, in microseconds */ + int64_t nAddrTokenTimestamp; + + std::atomic nProcessedAddrs; + std::atomic nRatelimitedAddrs; + bool fGetAssetData; std::set setInventoryAssetsSend; diff --git a/src/net_processing.cpp b/src/net_processing.cpp index ced1e2880..75ff8d2f4 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1189,9 +1189,6 @@ void static ProcessGetData(CNode* pfrom, const Consensus::ConsensusParams& conse } } - // Track requests for our stuff. - GetMainSignals().Inventory(inv.hash); - if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) break; } @@ -1715,6 +1712,10 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr { connman->PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR)); pfrom->fGetAddr = true; + + // When requesting a getaddr, accept an additional MAX_ADDR_TO_SEND addresses in response + // (bypassing the MAX_ADDR_PROCESSING_TOKEN_BUCKET limit). + pfrom->nAddrTokenBucket += MAX_ADDR_TO_SEND; } connman->MarkAddressGood(pfrom->addr); } @@ -1818,11 +1819,40 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr std::vector vAddrOk; int64_t nNow = GetAdjustedTime(); int64_t nSince = nNow - 10 * 60; + + // track rate limiting within this message + uint64_t nProcessedAddrs = 0; + uint64_t nRatelimitedAddrs = 0; + + // Update/increment addr rate limiting bucket. + const uint64_t nCurrentTime = GetTimeMicros(); + if (pfrom->nAddrTokenBucket < MAX_ADDR_PROCESSING_TOKEN_BUCKET) { + const uint64_t nTimeElapsed = std::max(nCurrentTime - pfrom->nAddrTokenTimestamp, uint64_t(0)); + const double nIncrement = nTimeElapsed * MAX_ADDR_RATE_PER_SECOND / 1e6; + pfrom->nAddrTokenBucket = std::min(pfrom->nAddrTokenBucket + nIncrement, MAX_ADDR_PROCESSING_TOKEN_BUCKET); + } + pfrom->nAddrTokenTimestamp = nCurrentTime; + + // Randomize entries before processing, to prevent an attacker to + // determine which entries will make it through the rate limit + random_shuffle(vAddr.begin(), vAddr.end(), GetRandInt); + for (CAddress& addr : vAddr) { if (interruptMsgProc) return true; + // apply rate limiting + if (!pfrom->fWhitelisted) { + if (pfrom->nAddrTokenBucket < 1.0) { + nRatelimitedAddrs++; + continue; + } + pfrom->nAddrTokenBucket -= 1.0; + } + + nProcessedAddrs++; + // We only bother storing full nodes, though this may include // things which we would not make an outbound connection to, in // part because we may make feeler connections to them. @@ -1842,6 +1872,13 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr if (fReachable) vAddrOk.push_back(addr); } + + pfrom->nProcessedAddrs += nProcessedAddrs; + pfrom->nRatelimitedAddrs += nRatelimitedAddrs; + + LogPrint(BCLog::NET, "Received addr: %u addresses (%u processed, %u rate-limited) peer=%d\n", + vAddr.size(), nProcessedAddrs, nRatelimitedAddrs, pfrom->GetId()); + connman->AddNewAddresses(vAddrOk, pfrom->addr, 2 * 60 * 60); if (vAddr.size() < 1000) pfrom->fGetAddr = false; @@ -1933,9 +1970,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr pfrom->AskFor(inv); } } - - // Track requests for our stuff - GetMainSignals().Inventory(inv.hash); } } @@ -2001,6 +2035,12 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr uint256 hashStop; vRecv >> locator >> hashStop; + if (locator.vHave.size() > MAX_LOCATOR_SZ) { + LogPrint(BCLog::NET, "getblocks locator size %lld > %d, disconnect peer=%d\n", locator.vHave.size(), MAX_LOCATOR_SZ, pfrom->GetId()); + pfrom->fDisconnect = true; + return true; + } + // We might have announced the currently-being-connected tip using a // compact block, which resulted in the peer sending a getblocks // request, which we would otherwise respond to without the new block. @@ -2112,6 +2152,12 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr uint256 hashStop; vRecv >> locator >> hashStop; + if (locator.vHave.size() > MAX_LOCATOR_SZ) { + LogPrint(BCLog::NET, "getheaders locator size %lld > %d, disconnect peer=%d\n", locator.vHave.size(), MAX_LOCATOR_SZ, pfrom->GetId()); + pfrom->fDisconnect = true; + return true; + } + LOCK(cs_main); if (IsInitialBlockDownload() && !pfrom->fWhitelisted) { LogPrint(BCLog::NET, "Ignoring getheaders from peer=%d because node is in initial block download\n", pfrom->GetId()); diff --git a/src/net_processing.h b/src/net_processing.h index 66c1d1db7..e088d381c 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -36,6 +36,15 @@ static constexpr int64_t EXTRA_PEER_CHECK_INTERVAL = 45; /** Minimum time an outbound-peer-eviction candidate must be connected for, in order to evict, in seconds */ static constexpr int64_t MINIMUM_CONNECT_TIME = 30; +/** The maximum rate of address records we're willing to process on average. + * Is bypassed for whitelisted connections. */ +static constexpr double MAX_ADDR_RATE_PER_SECOND{0.1}; + +/** The soft limit of the address processing token bucket (the regular MAX_ADDR_RATE_PER_SECOND + * based increments won't go above this, but the MAX_ADDR_TO_SEND increment following GETADDR + * is exempt from this limit. */ +static constexpr size_t MAX_ADDR_PROCESSING_TOKEN_BUCKET{MAX_ADDR_TO_SEND}; + class PeerLogicValidation : public CValidationInterface, public NetEventsInterface { private: CConnman* const connman; diff --git a/src/netaddress.cpp b/src/netaddress.cpp index 4d3f9bb43..371459801 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -22,7 +22,6 @@ static const unsigned char g_internal_prefix[] = { 0xFD, 0x6B, 0x88, 0xC0, 0x87, void CNetAddr::Init() { memset(ip, 0, sizeof(ip)); - scopeId = 0; } void CNetAddr::SetIP(const CNetAddr& ipIn) diff --git a/src/netaddress.h b/src/netaddress.h index 21ed7c206..249e1ae72 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -33,7 +33,7 @@ class CNetAddr { protected: unsigned char ip[16]; // in network byte order - uint32_t scopeId; // for scoped/link-local ipv6 addresses + uint32_t scopeId{0}; // for scoped/link-local ipv6 addresses public: CNetAddr(); diff --git a/src/pow.cpp b/src/pow.cpp index 80699764d..447f0dc51 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -128,7 +128,7 @@ bool IsTransitioningToX16rt(const CBlockIndex* pindexLast, const CBlockHeader *p if (pblock->nTime <= params.nX16rtTimestamp) return false; - int64_t dgwWindow = 0; // RVL does not have DGWPastBlocks so no need to check. + int64_t dgwWindow = 0; // AVN does not have DGWPastBlocks so no need to check. const CBlockIndex* pindex = pindexLast; @@ -488,10 +488,14 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Consens return true; } -bool CheckProofOfWork(const CBlockHeader& blockheader, const Consensus::ConsensusParams& params) +bool CheckProofOfWork(const CBlockHeader& blockheader, const Consensus::ConsensusParams& params, bool cache) { - if (blockheader.GetBlockTime() > params.diffRetargetTake2) - return CheckProofOfWorkCrow(blockheader.GetHash(), blockheader.nBits, params, blockheader.GetPoWType()); - else - return CheckProofOfWork(blockheader.GetHash(), blockheader.nBits, params); + if (blockheader.GetBlockTime() > params.diffRetargetTake2) { + if(cache) return CheckProofOfWorkCrow(blockheader.GetHash(), blockheader.nBits, params, blockheader.GetPoWType()); + else if(!cache) return CheckProofOfWorkCrow(blockheader.GetHash(false), blockheader.nBits, params, blockheader.GetPoWType()); + } + else { + if (cache) return CheckProofOfWork(blockheader.GetHash(), blockheader.nBits, params); + else if(!cache) return CheckProofOfWork(blockheader.GetHash(false), blockheader.nBits, params); + } } diff --git a/src/pow.h b/src/pow.h index cef4a035c..6cc9c3bb8 100644 --- a/src/pow.h +++ b/src/pow.h @@ -26,6 +26,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::ConsensusParams&); /** Check whether a block hash satisfies the proof-of-work requirement */ -bool CheckProofOfWork(const CBlockHeader& blockheader, const Consensus::ConsensusParams& params); +bool CheckProofOfWork(const CBlockHeader& blockheader, const Consensus::ConsensusParams& params, bool cache=true); #endif // RAVEN_POW_H diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index ba72745ca..72088bb83 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Copyright (c) 2017 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -10,14 +11,17 @@ #include "chainparams.h" -#include "algo/crow/crow.h" // Crow Algo +#include "algo/crow/minotaurx.h" // Minotaurx Algo #include "primitives/block.h" +#include "primitives/powcache.h" #include "algo/hash_algos.h" #include "tinyformat.h" #include "utilstrencodings.h" #include "crypto/common.h" +#include "util.h" +#include "sync.h" #include "consensus/consensus.h" @@ -29,6 +33,7 @@ static const uint32_t REGTEST_X16RT_ACTIVATIONTIME = 1629951212; static const uint32_t MAINNET_CROW_MULTI_ACTIVATIONTIME = 1638847407; static const uint32_t TESTNET_CROW_MULTI_ACTIVATIONTIME = 1639005225; +static const uint32_t REGTEST_CROW_MULTI_ACTIVATIONTIME = 1629951212; BlockNetwork bNetwork = BlockNetwork(); @@ -47,18 +52,24 @@ void BlockNetwork::SetNetwork(const std::string& net) } } -uint256 CBlockHeader::GetHash() const +uint256 CBlockHeader::GetSHA256Hash() const +{ + return SerializeHash(*this); +} + +uint256 CBlockHeader::ComputePoWHash() const { uint256 thash; unsigned int profile = 0x0; uint32_t nTimeToUse = MAINNET_X16RT_ACTIVATIONTIME; uint32_t nCrowTimeToUse = MAINNET_CROW_MULTI_ACTIVATIONTIME; - if (bNetwork.fOnTestnet){ + if (bNetwork.fOnTestnet) { nTimeToUse = TESTNET_X16RT_ACTIVATIONTIME; nCrowTimeToUse = TESTNET_CROW_MULTI_ACTIVATIONTIME; } else if (bNetwork.fOnRegtest) { nTimeToUse = REGTEST_X16RT_ACTIVATIONTIME; + nCrowTimeToUse = REGTEST_CROW_MULTI_ACTIVATIONTIME; } else { nTimeToUse = MAINNET_X16RT_ACTIVATIONTIME; nCrowTimeToUse = MAINNET_CROW_MULTI_ACTIVATIONTIME; @@ -75,7 +86,7 @@ uint256 CBlockHeader::GetHash() const break; } case POW_TYPE_CROW: { - return Crow(BEGIN(nVersion), END(nNonce), true); + return Minotaurx(BEGIN(nVersion), END(nNonce), true); break; } default: // Don't crash the client on invalid blockType, just return a bad hash @@ -96,9 +107,34 @@ uint256 CBlockHeader::GetHash() const return thash; } -// Crow algo +uint256 CBlockHeader::GetHash(bool readCache) const +{ + LOCK(cs_pow); + CPowCache& cache(CPowCache::Instance()); + + uint256 headerHash = GetSHA256Hash(); + uint256 powHash; + bool found = false; + + if (readCache) { + found = cache.get(headerHash, powHash); + } + + if (!found || cache.IsValidate()) { + uint256 powHash2 = ComputePoWHash(); + if (found && powHash2 != powHash) { + LogPrintf("PowCache failure: headerHash: %s, from cache: %s, computed: %s, correcting\n", headerHash.ToString(), powHash.ToString(), powHash2.ToString()); + } + powHash = powHash2; + cache.erase(headerHash); // If it exists, replace it. + cache.insert(headerHash, powHash2); + } + return powHash; +} + +// Minotaurx algo uint256 CBlockHeader::CrowHashArbitrary(const char* data) { - return Crow(data, data + strlen(data), true); + return Minotaurx(data, data + strlen(data), true); } uint256 CBlockHeader::GetX16RHash() const diff --git a/src/primitives/block.h b/src/primitives/block.h index d3a8b343d..8aedaeaa9 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -12,6 +12,9 @@ #include "uint256.h" #include +#include "unordered_lru_cache.h" +#include "util.h" + // Crow: An impossible pow hash (can't meet any target) const uint256 HIGH_HASH = uint256S("0x0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); @@ -95,7 +98,16 @@ class CBlockHeader return (nBits == 0); } - uint256 GetHash() const; + /// Compute the SHA256 hash from the block + uint256 GetSHA256Hash() const; + + /// Compute the PoW hash + uint256 ComputePoWHash() const; + + /// Caching lookup/computation of POW hash + uint256 GetHash(bool readCache = true) const; + + /// Compute X16R hash uint256 GetX16RHash() const; // Crow: MinotaurX @@ -134,6 +146,9 @@ class CBlock : public CBlockHeader // network and disk std::vector vtx; + // founder payment + mutable CTxOut txoutFounder; + // memory only mutable bool fChecked; @@ -161,6 +176,7 @@ class CBlock : public CBlockHeader CBlockHeader::SetNull(); vtx.clear(); fChecked = false; + txoutFounder = CTxOut(); } CBlockHeader GetBlockHeader() const diff --git a/src/primitives/powcache.cpp b/src/primitives/powcache.cpp new file mode 100644 index 000000000..4d9f6b250 --- /dev/null +++ b/src/primitives/powcache.cpp @@ -0,0 +1,66 @@ +// Copyright (c) 2022 The Raptoreum developers +// Copyright (c) 2022 The Avian developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "primitives/powcache.h" +#include "primitives/block.h" +#include "flat-database.h" +#include "sync.h" +#include "../util.h" + +CCriticalSection cs_pow; + +CPowCache* CPowCache::instance = nullptr; + +CPowCache& CPowCache::Instance() +{ + if (CPowCache::instance == nullptr) + { + int powCacheSize = gArgs.GetArg("-powhashcache", DEFAULT_POW_CACHE_SIZE); + bool powCacheValidate = gArgs.GetArg("-powcachevalidate", 0) > 0 ? true : false; + powCacheSize = powCacheSize == 0 ? DEFAULT_POW_CACHE_SIZE : powCacheSize; + + CPowCache::instance = new CPowCache(powCacheSize, powCacheValidate); + } + return *instance; +} + +void CPowCache::DoMaintenance() +{ + LOCK(cs_pow); + // If cache has grown enough, save it: + if (cacheMap.size() - nLoadedSize > 100) + { + CFlatDB flatDb("powcache.dat", "powCache"); + flatDb.Dump(*this); + } +} + +CPowCache::CPowCache(int maxSize, bool validate) : unordered_lru_cache>(maxSize), + nVersion(CURRENT_VERSION), + nLoadedSize(0), + bValidate(validate) +{ + if (bValidate) LogPrintf("PowCache: Validation and auto correction enabled\n"); +} + +CPowCache::~CPowCache() +{ +} + +void CPowCache::Clear() +{ + cacheMap.clear(); +} + +void CPowCache::CheckAndRemove() +{ +} + +std::string CPowCache::ToString() const +{ + std::ostringstream info; + info << "PowCache: elements: " << (int)cacheMap.size(); + return info.str(); +} diff --git a/src/primitives/powcache.h b/src/primitives/powcache.h new file mode 100644 index 000000000..eb573dffe --- /dev/null +++ b/src/primitives/powcache.h @@ -0,0 +1,81 @@ +// Copyright (c) 2022 The Raptoreum developers +// Copyright (c) 2022 The Avian developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef AVN_POWCACHE_H +#define AVN_POWCACHE_H + +#include "uint256.h" +#include "sync.h" +#include "serialize.h" +#include "unordered_lru_cache.h" +#include "util.h" + +extern CCriticalSection cs_pow; + +class CPowCache : public unordered_lru_cache> +{ + private: + static CPowCache* instance; + static const int CURRENT_VERSION = 1; + + int nVersion; + int nLoadedSize; + bool bValidate; + CCriticalSection cs; + + public: + static CPowCache& Instance(); + + CPowCache(int maxSize = DEFAULT_POW_CACHE_SIZE, bool validate = false); + virtual ~CPowCache(); + + void Clear(); + void CheckAndRemove(); + bool IsValidate() const { return bValidate; } + void DoMaintenance(); + + std::string ToString() const; + + + + ADD_SERIALIZE_METHODS + + template + inline void SerializationOp(Stream& s, Operation ser_action) + { + LOCK(cs); + READWRITE(nVersion); + + uint64_t cacheSize = (uint64_t)cacheMap.size(); + READWRITE(COMPACTSIZE(cacheSize)); + + if (ser_action.ForRead()) + { + uint256 headerHash; + uint256 powHash; + for (int i = 0; i < cacheSize; ++i) + { + READWRITE(headerHash); + READWRITE(powHash); + insert(headerHash, powHash); + } + nVersion = CURRENT_VERSION; + nLoadedSize = cacheMap.size(); + } + else + { + for (auto it = cacheMap.begin(); it != cacheMap.end(); ++it) + { + uint256 headerHash = it->first; + uint256 powHash = it->second.first; + READWRITE(headerHash); + READWRITE(powHash); + }; + nLoadedSize = cacheMap.size(); // The size on disk is current + } + } +}; + +#endif // AVN_POWCACHE_H diff --git a/src/qt/assetrecord.h b/src/qt/assetrecord.h index 5966caea4..10ff51d7e 100644 --- a/src/qt/assetrecord.h +++ b/src/qt/assetrecord.h @@ -1,5 +1,6 @@ // Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Raven Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -18,12 +19,12 @@ class AssetRecord public: AssetRecord(): - name(""), quantity(0), units(0), fIsAdministrator(false), ipfshash("") + name(""), quantity(0), units(0), fIsAdministrator(false), ipfshash(""), ansID("") { } - AssetRecord(const std::string _name, const CAmount& _quantity, const int _units, const bool _fIsAdministrator, const std::string _ipfshash): - name(_name), quantity(_quantity), units(_units), fIsAdministrator(_fIsAdministrator), ipfshash(_ipfshash) + AssetRecord(const std::string _name, const CAmount& _quantity, const int _units, const bool _fIsAdministrator, const std::string _ipfshash, const std::string _ansID): + name(_name), quantity(_quantity), units(_units), fIsAdministrator(_fIsAdministrator), ipfshash(_ipfshash), ansID(_ansID) { } @@ -49,6 +50,7 @@ class AssetRecord int units; bool fIsAdministrator; std::string ipfshash; + std::string ansID; /**@}*/ }; diff --git a/src/qt/assettablemodel.cpp b/src/qt/assettablemodel.cpp index 2b549baea..ece432779 100644 --- a/src/qt/assettablemodel.cpp +++ b/src/qt/assettablemodel.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -56,6 +57,7 @@ class AssetTablePriv { uint8_t units = OWNER_UNITS; bool fIsAdministrator = true; std::string ipfsHash = ""; + std::string ansID = ""; if (setAssetsToSkip.count(bal->first)) continue; @@ -69,7 +71,8 @@ class AssetTablePriv { } units = assetData.units; ipfsHash = assetData.strIPFSHash; - // If we have the administrator asset, add it to the skip listå + ansID = assetData.strANSID; + // If we have the administrator asset, add it to the skip list if (balances.count(bal->first + OWNER_TAG)) { setAssetsToSkip.insert(bal->first + OWNER_TAG); } else { @@ -84,7 +87,7 @@ class AssetTablePriv { continue; } } - cachedBalances.append(AssetRecord(bal->first, bal->second, units, fIsAdministrator, EncodeAssetData(ipfsHash))); + cachedBalances.append(AssetRecord(bal->first, bal->second, units, fIsAdministrator, EncodeAssetData(ipfsHash), ansID)); } } } @@ -180,6 +183,25 @@ QVariant AssetTableModel::data(const QModelIndex &index, int role) const return pixmap; } + case AssetANSRole: + return QString::fromStdString(rec->ansID); + case AssetANSDecorationRole: + { + if (index.column() == Quantity) + return QVariant(); + + if (rec->ansID.size() == 0) + return QVariant(); + + QPixmap pixmap; + + if (darkModeEnabled) + pixmap = QPixmap::fromImage(QImage(":/icons/export")); + else + pixmap = QPixmap::fromImage(QImage(":/icons/export")); + + return pixmap; + } case Qt::DecorationRole: { if (index.column() == Quantity) diff --git a/src/qt/assettablemodel.h b/src/qt/assettablemodel.h index 1c63466db..ddb600039 100644 --- a/src/qt/assettablemodel.h +++ b/src/qt/assettablemodel.h @@ -1,5 +1,6 @@ // Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -47,7 +48,11 @@ class AssetTableModel : public QAbstractTableModel /** AVN or name of an asset */ AssetIPFSHashRole = 104, /** IPFS Decoration Role */ - AssetIPFSHashDecorationRole = 105 + AssetIPFSHashDecorationRole = 105, + /** ANS info */ + AssetANSRole = 106, + /** ANS Decoration Role */ + AssetANSDecorationRole = 107 }; int rowCount(const QModelIndex &parent) const; diff --git a/src/qt/avian-qt.files b/src/qt/avian-qt.files index 2603e6b8b..039460814 100644 --- a/src/qt/avian-qt.files +++ b/src/qt/avian-qt.files @@ -61,7 +61,6 @@ forms/ui_openuridialog.h forms/ui_optionsdialog.h forms/ui_overviewpage.h forms/ui_paperwalletdialog.h -forms/ui_poolpicker.h forms/ui_receivecoinsdialog.h forms/ui_receiverequestdialog.h forms/ui_reissueassetdialog.h @@ -122,7 +121,6 @@ moc_overviewpage.cpp moc_paymentserver.cpp moc_peerdialog.cpp moc_peertablemodel.cpp -moc_poolpicker.cpp moc_qvalidatedlineedit.cpp moc_qvaluecombobox.cpp moc_receivecoinsdialog.cpp @@ -180,8 +178,6 @@ peertablemodel.cpp peertablemodel.h platformstyle.cpp platformstyle.h -poolpicker.cpp -poolpicker.h qrc_avian.cpp qrc_avian_locale.cpp qvalidatedlineedit.cpp diff --git a/src/qt/avian.qrc b/src/qt/avian.qrc index 1d3e90691..4440a92af 100644 --- a/src/qt/avian.qrc +++ b/src/qt/avian.qrc @@ -73,6 +73,8 @@ res/icons/asset_manage_selected.png res/icons/asset_transfer.png res/icons/asset_transfer_selected.png + res/icons/asset_edit.png + res/icons/asset_edit_selected.png res/icons/aviantext.png res/icons/avianlogo.png res/icons/restricted_asset.png diff --git a/src/qt/aviangui.cpp b/src/qt/aviangui.cpp index c5e493f37..44c2b2e8a 100644 --- a/src/qt/aviangui.cpp +++ b/src/qt/aviangui.cpp @@ -22,7 +22,6 @@ #include "optionsmodel.h" #include "platformstyle.h" #include "rpcconsole.h" -#include "poolpicker.h" #include "utilitydialog.h" #include "validation.h" @@ -141,7 +140,6 @@ AvianGUI::AvianGUI(const PlatformStyle *_platformStyle, const NetworkStyle *netw getMyWordsAction(0), aboutQtAction(0), openRPCConsoleAction(0), - openPoolPicker(0), openAction(0), showHelpMessageAction(0), transferAssetAction(0), @@ -149,7 +147,7 @@ AvianGUI::AvianGUI(const PlatformStyle *_platformStyle, const NetworkStyle *netw manageAssetAction(0), messagingAction(0), votingAction(0), - devAction(0), + restrictedAssetAction(0), wrapAction(0), headerWidget(0), labelCurrentMarket(0), @@ -451,17 +449,17 @@ void AvianGUI::createActions() votingAction->setFont(font); tabGroup->addAction(votingAction); - devAction = new QAction(platformStyle->SingleColorIcon(":/icons/external_link"), tr(""), this); - devAction->setStatusTip(tr("Coming Soon")); - devAction->setToolTip(devAction->statusTip()); - devAction->setCheckable(true); - // devAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_9)); - devAction->setFont(font); - tabGroup->addAction(devAction); + restrictedAssetAction = new QAction(platformStyle->SingleColorIconOnOff(":/icons/asset_edit_selected", ":/icons/asset_edit"), tr("&Restricted Assets"), this); + restrictedAssetAction->setStatusTip(tr("Manage restricted assets")); + restrictedAssetAction->setToolTip(restrictedAssetAction->statusTip()); + restrictedAssetAction->setCheckable(true); + restrictedAssetAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_9)); + restrictedAssetAction->setFont(font); + tabGroup->addAction(restrictedAssetAction); wrapAction = new QAction(platformStyle->SingleColorIconOnOff(":/icons/external_link", ":/icons/external_link"), tr(""), this); wrapAction->setStatusTip(tr("Wrapped Avian")); - wrapAction->setToolTip(devAction->statusTip()); + wrapAction->setToolTip(wrapAction->statusTip()); wrapAction->setCheckable(true); // wrapAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_9)); wrapAction->setFont(font); @@ -490,65 +488,65 @@ void AvianGUI::createActions() connect(createAssetAction, SIGNAL(triggered()), this, SLOT(gotoCreateAssetsPage())); connect(manageAssetAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(manageAssetAction, SIGNAL(triggered()), this, SLOT(gotoManageAssetsPage())); + connect(restrictedAssetAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(restrictedAssetAction, SIGNAL(triggered()), this, SLOT(gotoRestrictedAssetsPage())); + connect(wrapAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(wrapAction, SIGNAL(triggered()), this, SLOT(gotoWrapPage())); // TODO add messaging actions to go to messaging page when clicked // TODO add voting actions to go to voting page when clicked #endif // ENABLE_WALLET - quitAction = new QAction(tr("E&xit"), this); + quitAction = new QAction(platformStyle->TextColorIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); - aboutAction = new QAction(tr("&About %1").arg(tr(PACKAGE_NAME)), this); + aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this); aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME))); aboutAction->setMenuRole(QAction::AboutRole); aboutAction->setEnabled(false); - aboutQtAction = new QAction(tr("About &Qt"), this); + aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); - optionsAction = new QAction(tr("&Options..."), this); + optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME))); optionsAction->setMenuRole(QAction::PreferencesRole); optionsAction->setEnabled(false); - toggleHideAction = new QAction(tr("&Show / Hide"), this); + toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); - encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this); + encryptWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); - backupWalletAction = new QAction(tr("&Backup Wallet..."), this); + backupWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); - changePassphraseAction = new QAction(tr("&Change Passphrase..."), this); + changePassphraseAction = new QAction(platformStyle->TextColorIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); - getMyWordsAction = new QAction(tr("&Get my words..."), this); + getMyWordsAction = new QAction(platformStyle->TextColorIcon(":/icons/key"), tr("&Get my words..."), this); getMyWordsAction->setStatusTip(tr("Show the recoverywords for this wallet")); - signMessageAction = new QAction(tr("Sign &message..."), this); + signMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Avian addresses to prove you own them")); - verifyMessageAction = new QAction(tr("&Verify message..."), this); + verifyMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/verify"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Avian addresses")); - paperWalletAction = new QAction(tr("&Print paper wallets"), this); + paperWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/print"), tr("&Print paper wallets"), this); paperWalletAction->setStatusTip(tr("Print paper wallets")); - openRPCConsoleAction = new QAction(tr("&Debug window"), this); + openRPCConsoleAction = new QAction(platformStyle->TextColorIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); // initially disable the debug window menu item openRPCConsoleAction->setEnabled(false); - openPoolPicker = new QAction(tr("&Pool Picker"), this); - openPoolPicker->setStatusTip(tr("Open pool picker")); - - usedSendingAddressesAction = new QAction(tr("&Sending addresses..."), this); + usedSendingAddressesAction = new QAction(platformStyle->TextColorIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); - usedReceivingAddressesAction = new QAction(tr("&Receiving addresses..."), this); + usedReceivingAddressesAction = new QAction(platformStyle->TextColorIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); - openAction = new QAction(tr("Open &URI..."), this); + openAction = new QAction(platformStyle->TextColorIcon(":/icons/open"), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a avian: URI or payment request")); - importPrivateKeyAction = new QAction(tr("&Import Private Key..."), this); + importPrivateKeyAction = new QAction(platformStyle->TextColorIcon(":/icons/key"), tr("&Import Private Key..."), this); importPrivateKeyAction->setStatusTip(tr("Import a Avian private key")); - showHelpMessageAction = new QAction(tr("&Command-line options"), this); + showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Avian command-line options").arg(tr(PACKAGE_NAME))); @@ -559,10 +557,12 @@ void AvianGUI::createActions() connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showDebugWindow())); - connect(openPoolPicker, SIGNAL(triggered()), this, SLOT(showPoolPicker())); // prevents an open debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); + // Get restart command-line parameters and handle restart + connect(rpcConsole, SIGNAL(handleRestart(QStringList)), this, SLOT(handleRestart(QStringList))); + #ifdef ENABLE_WALLET if(walletFrame) { @@ -629,9 +629,6 @@ void AvianGUI::createMenuBar() help->addAction(showHelpMessageAction); help->addSeparator(); - // TODO: pool picker - // help->addAction(openPoolPicker); - //help->addSeparator(); help->addAction(aboutAction); help->addAction(aboutQtAction); } @@ -668,31 +665,21 @@ void AvianGUI::createToolBars() toolbar->addAction(createAssetAction); toolbar->addAction(transferAssetAction); toolbar->addAction(manageAssetAction); + toolbar->addAction(restrictedAssetAction); // toolbar->addAction(messagingAction); // toolbar->addAction(votingAction); - // toolbar->addAction(devAction); // toolbar->addAction(wrapAction); - QString openSansFontString = "font: normal 22pt \"Manrope\";"; - QString normalString = "font: normal 22pt \"Arial\";"; - QString stringToUse = ""; - -#if !defined(Q_OS_MAC) - stringToUse = openSansFontString; -#else - stringToUse = normalString; -#endif - /** AVN START */ - QString tbStyleSheet = ".QToolBar {background-color : transparent; border-color: transparent;} " + QString tbStyleSheet = ".QToolBar {background-color: transparent; border-color: transparent;} " ".QToolButton {background-color: transparent; border-color: transparent; color: %1; border: none;} " - ".QToolButton:checked {background: none; background-color: none; selection-background-color: none; color: %2; border: none; font: %4} " + ".QToolButton:checked {background: none; background-color: none; selection-background-color: none; color: %2; border: none;} " ".QToolButton:hover {background: none; background-color: none; border: none; color: %3;} " ".QToolButton:disabled {color: gray;}"; toolbar->setStyleSheet(tbStyleSheet.arg(platformStyle->ToolBarNotSelectedTextColor().name(), platformStyle->ToolBarSelectedTextColor().name(), - platformStyle->DarkOrangeColor().name(), stringToUse)); + platformStyle->DarkOrangeColor().name())); toolbar->setOrientation(Qt::Vertical); toolbar->setIconSize(QSize(65, 65)); @@ -732,7 +719,6 @@ void AvianGUI::createToolBars() // Set the headers widget options headerWidget->setContentsMargins(0,0,0,50); headerWidget->setStyleSheet(widgetBackgroundSytleSheet); - headerWidget->setGraphicsEffect(GUIUtil::getShadowEffect()); headerWidget->setFixedHeight(75); // Set the pricing information @@ -938,7 +924,6 @@ void AvianGUI::setWalletActionsEnabled(bool enabled) manageAssetAction->setEnabled(false); messagingAction->setEnabled(false); votingAction->setEnabled(false); - devAction->setEnabled(false); wrapAction->setEnabled(false); /** AVN END */ } @@ -1030,12 +1015,6 @@ void AvianGUI::showDebugWindow() rpcConsole->activateWindow(); } -void AvianGUI::showPoolPicker() -{ - PoolPicker poolPicker(this); - poolPicker.exec(); -} - void AvianGUI::showDebugWindowActivateConsole() { rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE); @@ -1050,7 +1029,7 @@ void AvianGUI::showHelpMessageClicked() #ifdef ENABLE_WALLET void AvianGUI::openClicked() { - OpenURIDialog dlg(this); + OpenURIDialog dlg(platformStyle, this); if(dlg.exec()) { Q_EMIT receivedURI(dlg.getURI()); @@ -1110,6 +1089,12 @@ void AvianGUI::gotoManageAssetsPage() if (walletFrame) walletFrame->gotoManageAssetsPage(); }; +void AvianGUI::gotoRestrictedAssetsPage() +{ + restrictedAssetAction->setChecked(true); + if (walletFrame) walletFrame->gotoRestrictedAssetsPage(); +}; + void AvianGUI::gotoWrapPage() { wrapAction->setChecked(true); @@ -1408,7 +1393,7 @@ void AvianGUI::incomingTransaction(const QString& date, int unit, const CAmount& void AvianGUI::checkAssets() { - // Check that status of RIP2 and activate the assets icon if it is active + // Check that status of assets and activate the assets icon if it is active if(AreAssetsDeployed()) { transferAssetAction->setDisabled(false); transferAssetAction->setToolTip(tr("Transfer assets to AVN addresses")); @@ -1425,6 +1410,15 @@ void AvianGUI::checkAssets() manageAssetAction->setDisabled(true); manageAssetAction->setToolTip(tr("Assets not yet active")); } + + if (AreRestrictedAssetsDeployed()) { + restrictedAssetAction->setDisabled(false); + restrictedAssetAction->setToolTip(tr("Manage restricted assets")); + + } else { + restrictedAssetAction->setDisabled(true); + restrictedAssetAction->setToolTip(tr("Restricted Assets not yet active")); + } } #endif // ENABLE_WALLET @@ -1650,6 +1644,13 @@ void AvianGUI::toggleNetworkActive() } } +/** Get restart command-line parameters and request restart */ +void AvianGUI::handleRestart(QStringList args) +{ + if (!ShutdownRequested()) + Q_EMIT requestedRestart(args); +} + UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle) : optionsModel(0), menu(0) diff --git a/src/qt/aviangui.h b/src/qt/aviangui.h index e9292effe..7ead1c7b4 100644 --- a/src/qt/aviangui.h +++ b/src/qt/aviangui.h @@ -32,7 +32,6 @@ class UnitDisplayStatusBarControl; class WalletFrame; class WalletModel; class HelpMessageDialog; -class PoolPicker; class ModalOverlay; QT_BEGIN_NAMESPACE @@ -124,7 +123,6 @@ class AvianGUI : public QMainWindow QAction *changePassphraseAction; QAction *aboutQtAction; QAction *openRPCConsoleAction; - QAction *openPoolPicker; QAction *openAction; QAction *showHelpMessageAction; @@ -135,7 +133,7 @@ class AvianGUI : public QMainWindow QAction *messagingAction; QAction *getMyWordsAction; QAction *votingAction; - QAction *devAction; + QAction *restrictedAssetAction; QAction *wrapAction; QWidget *headerWidget; QLabel *labelCurrentMarket; @@ -187,6 +185,8 @@ class AvianGUI : public QMainWindow Q_SIGNALS: /** Signal raised when a URI was entered or dragged to the GUI */ void receivedURI(const QString &uri); + /** Restart handling */ + void requestedRestart(QStringList args); public Q_SLOTS: /** Set number of connections shown in the UI */ @@ -195,6 +195,8 @@ public Q_SLOTS: void setNetworkActive(bool networkActive); /** Set number of blocks and last block date shown in the UI */ void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers); + /** Get restart command-line parameters and request restart */ + void handleRestart(QStringList args); /** Notify the user of an event from the core network or transaction handling code. @param[in] title the message box / notification title @@ -255,6 +257,7 @@ private Q_SLOTS: void gotoAssetsPage(); void gotoCreateAssetsPage(); void gotoManageAssetsPage(); + void gotoRestrictedAssetsPage(); void gotoWrapPage(); /** AVN END */ @@ -265,8 +268,6 @@ private Q_SLOTS: void aboutClicked(); /** Show debug window */ void showDebugWindow(); - /** Show pool picker window */ - void showPoolPicker(); /** Show debug window and set focus to the console */ void showDebugWindowActivateConsole(); /** Show help message dialog */ diff --git a/src/qt/createassetdialog.cpp b/src/qt/createassetdialog.cpp index 0e5809004..5da8e56ea 100644 --- a/src/qt/createassetdialog.cpp +++ b/src/qt/createassetdialog.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017-2019 The Raven Core developers +// Copyright (c) 2022 The Avian Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,11 +23,13 @@ #include