Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
npq7721 committed Jul 23, 2023
2 parents e49c9b8 + ccbb3c7 commit fbb9aa8
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 92 deletions.
137 changes: 71 additions & 66 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
jobs:
checking-build-version:
name: Checking Build Versioning
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Trigger by
run: |
Expand Down Expand Up @@ -52,66 +52,66 @@ jobs:
name: version
path: version.txt

build-ubuntu18:
name: Ubuntu18 build
needs: checking-build-version
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Getting Version
uses: actions/download-artifact@v1
with:
name: version
- name: Extract version
run: |
cat version/version.txt >> $GITHUB_ENV
- name: Install Required Packages
run: |
echo "building $BUILD_VERSION version"
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install curl build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake
- name: build depends
run: |
echo "building with $(nproc) threads"
make -C depends -j$(nproc)
- name: configure
run: |
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
- name: build binary
run: |
make -j$(nproc)
mkdir -p $BUILD_DIR
mv src/{pigeon-cli,pigeon-tx,pigeond,qt/pigeon-qt} $BUILD_DIR/
strip $BUILD_DIR/*
- name: generate checksum and compress
run: |
echo "buildng $BUILD_VERSION version"
cd $BUILD_DIR
echo "sha256:" >> checksums.txt
echo "------------------------------------" >> checksums.txt
shasum * >> checksums.txt
echo "------------------------------------" >> checksums.txt
echo "openssl-sha256:" >> checksums.txt
echo "------------------------------------" >> checksums.txt
sha256sum * >> checksums.txt
cat checksums.txt
cd ..
tar -cvzf ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz $BUILD_DIR/*
mkdir -p ${COMPRESS_DIR}
mv ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz ${COMPRESS_DIR}/
cd ${COMPRESS_DIR}
echo "sha256: `shasum ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz`" >> checksums.txt
echo "openssl-sha256: `sha256sum ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz`" >> checksums.txt
cd ..
cat ${COMPRESS_DIR}/checksums.txt
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.COIN_NAME }}-ubuntu18-${{ env.BUILD_VERSION }}
path: ${{ env.COMPRESS_DIR }}
# build-ubuntu18:
# name: Ubuntu18 build
# needs: checking-build-version
# runs-on: ubuntu-18.04
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Getting Version
# uses: actions/download-artifact@v1
# with:
# name: version
# - name: Extract version
# run: |
# cat version/version.txt >> $GITHUB_ENV
# - name: Install Required Packages
# run: |
# echo "building $BUILD_VERSION version"
# sudo apt-get update -y
# sudo apt-get upgrade -y
# sudo apt-get install curl build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake
# - name: build depends
# run: |
# echo "building with $(nproc) threads"
# make -C depends -j$(nproc)
# - name: configure
# run: |
# ./autogen.sh
# ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
# - name: build binary
# run: |
# make -j$(nproc)
# mkdir -p $BUILD_DIR
# mv src/{pigeon-cli,pigeon-tx,pigeond,qt/pigeon-qt} $BUILD_DIR/
# strip $BUILD_DIR/*
# - name: generate checksum and compress
# run: |
# echo "buildng $BUILD_VERSION version"
# cd $BUILD_DIR
# echo "sha256:" >> checksums.txt
# echo "------------------------------------" >> checksums.txt
# shasum * >> checksums.txt
# echo "------------------------------------" >> checksums.txt
# echo "openssl-sha256:" >> checksums.txt
# echo "------------------------------------" >> checksums.txt
# sha256sum * >> checksums.txt
# cat checksums.txt
# cd ..
# tar -cvzf ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz $BUILD_DIR/*
# mkdir -p ${COMPRESS_DIR}
# mv ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz ${COMPRESS_DIR}/
# cd ${COMPRESS_DIR}
# echo "sha256: `shasum ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz`" >> checksums.txt
# echo "openssl-sha256: `sha256sum ${COIN_NAME}-ubuntu18-${BUILD_VERSION}.tar.gz`" >> checksums.txt
# cd ..
# cat ${COMPRESS_DIR}/checksums.txt
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.COIN_NAME }}-ubuntu18-${{ env.BUILD_VERSION }}
# path: ${{ env.COMPRESS_DIR }}
build-ubuntu20:
name: Ubuntu20 build
needs: checking-build-version
Expand All @@ -134,6 +134,7 @@ jobs:
- name: build depends
run: |
echo "building with $(nproc) threads"
export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/
make -C depends -j$(nproc)
- name: configure
run: |
Expand Down Expand Up @@ -174,7 +175,7 @@ jobs:
build-macos:
name: macos build
needs: checking-build-version
runs-on: macos-10.15
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -192,11 +193,12 @@ jobs:
- name: build depends
run: |
echo "building with $(nproc) threads"
make -C depends -j8
export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/
make -C depends -j8 HOST=x86_64-apple-darwin20.6.0
- name: configure
run: |
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-apple-darwin19.6.0
./configure --prefix=`pwd`/depends/x86_64-apple-darwin20.6.0
- name: build binary
run: |
make -j8
Expand Down Expand Up @@ -246,7 +248,7 @@ jobs:
build-arm-32:
name: arm 32 bit build
needs: checking-build-version
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -265,6 +267,7 @@ jobs:
- name: build depends
run: |
echo "building with $(nproc) threads"
export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/
make -C depends -j$(nproc) HOST=arm-linux-gnueabihf
- name: configure
run: |
Expand Down Expand Up @@ -304,7 +307,7 @@ jobs:
build-arm-64:
name: arm 64 bit build
needs: checking-build-version
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -323,6 +326,7 @@ jobs:
- name: build depends
run: |
echo "building with $(nproc) threads"
export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/
make -C depends -j$(nproc) HOST=aarch64-linux-gnu
- name: configure
run: |
Expand Down Expand Up @@ -384,6 +388,7 @@ jobs:
- name: build depends
run: |
echo "building with $(nproc) threads"
export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/
make -C depends -j$(nproc) HOST=x86_64-w64-mingw32
- name: configure
run: |
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
snapshot-version=1.18.2.0-SNAPSHOT
release-version=1.18.2.0
snapshot-version=1.19.2.0-SNAPSHOT
release-version=1.19.2.0
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 19)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2022)
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=boost
$(package)_version=1_64_0
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332

Expand Down
2 changes: 1 addition & 1 deletion depends/packages/expat.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=expat
$(package)_version=2.2.1
$(package)_download_path=https://downloads.sourceforge.net/project/expat/expat/$($(package)_version)
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_1/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=1868cadae4c82a018e361e2b2091de103cd820aaacb0d6cfa49bd2cd83978885

Expand Down
2 changes: 1 addition & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PACKAGE=qt
$(package)_version=5.7.1
$(package)_download_path=https://download.qt.io/archive/qt/5.7/$($(package)_version)/submodules
$(package)_download_path=https://download.qt.io/new_archive/qt/5.7/$($(package)_version)/submodules
$(package)_suffix=opensource-src-$($(package)_version).tar.gz
$(package)_file_name=qtbase-$($(package)_suffix)
$(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410
Expand Down
7 changes: 5 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class CMainParams : public CChainParams {
consensus.zawyLWMAHeight = 111222;
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.nEnforceMinFeeHeight = 2722924;
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
Expand Down Expand Up @@ -390,12 +391,13 @@ class CMainParams : public CChainParams {
{
{1480000, uint256S("0x0000000000081d8baa7fb0ddfcedc9f9eaacd8241a47d787756cf4e0ea831f25")},
{2039126, uint256S("0x00000000016d6a716bf6cc8c718b20a273d1c1a106efe6d92c64653ba4295322")},
{2715986, uint256S("0x0000000008100a82b63e1448961d5fce936fa348f13377b910d9a6db7af89ec8")}
}
};

chainTxData = ChainTxData{
1649271949, // * UNIX timestamp of last known number of transactions (Block 2039126)
3604057, // * total number of transactions between genesis and that timestamp
1689966277, // * UNIX timestamp of last known number of transactions (Block 2039126)
2609477, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
0.028 // * estimated number of transactions per second after that timestamp
};
Expand Down Expand Up @@ -442,6 +444,7 @@ class CTestNetParams : public CChainParams {
consensus.nPowDifficultyRetargetHeight = 10; // blockheight to switch to 360 block retarget rules
consensus.nPowTargetTimespanShort = 360 * 60; //~6 hours
consensus.zawyLWMAHeight = 222; // blockheight to switch to LWMA retarget rules
consensus.nEnforceMinFeeHeight = 3000000;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 15; // 75% for testchains
Expand Down
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct Params {
int DIP0008Height;
// Block height at which LWMA difficulty adjustment method becomes active
int zawyLWMAHeight;
int nEnforceMinFeeHeight;
/**
* Minimum blocks including miner confirmation of the total of nMinerConfirmationWindow blocks in a retargeting period,
* (nPowTargetTimespan / nPowTargetSpacing) which is also used for BIP9 deployments.
Expand Down
10 changes: 8 additions & 2 deletions src/consensus/tx_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "chain.h"
#include "coins.h"
#include "utilmoneystr.h"
#include "../validation.h"

bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
{
Expand Down Expand Up @@ -208,7 +209,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
return true;
}

bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee)
bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee, bool enforceMinRelayFee)
{
// are the actual inputs available?
if (!inputs.HaveInputs(tx)) {
Expand All @@ -221,7 +222,6 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, c
const COutPoint &prevout = tx.vin[i].prevout;
const Coin& coin = inputs.AccessCoin(prevout);
assert(!coin.IsSpent());

// If prev is coinbase, check that it's matured
if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY) {
return state.Invalid(false,
Expand Down Expand Up @@ -249,5 +249,11 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, c
}

txfee = txfee_aux;
if(tx.vin.size() > 0 && enforceMinRelayFee) {
size_t nSize = GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if(txfee < enforcedMinRelayTxFee.GetFee(nSize)) {
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "min relay fee not met");
}
}
return true;
}
2 changes: 1 addition & 1 deletion src/consensus/tx_verify.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Consensus {
* @param[out] txfee Set to the transaction fee if successful.
* Preconditions: tx.IsCoinBase() is false.
*/
bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee);
bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee, bool enforceMinRelayFee);
} // namespace Consensus

/** Auxiliary functions for transaction validation (ideally should not be exposed) */
Expand Down
2 changes: 1 addition & 1 deletion src/policy/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 1000;
* standard and should be done with care and ideally rarely. It makes sense to
* only increase the dust limit after prior releases were already not creating
* outputs below the new threshold */
static const unsigned int DUST_RELAY_TX_FEE = 3000;
static const unsigned int DUST_RELAY_TX_FEE = 0.3 * COIN;
/**
* Standard script verification flags that standard transactions will comply
* with. However scripts violating these flags may still be present in valid
Expand Down
5 changes: 4 additions & 1 deletion src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ UniValue getinfo(const JSONRPCRequest& request)
}
obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK())));
#endif
obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK())));
int nHeight = chainActive.Height();
bool enforceHeightFee = nHeight > Params().GetConsensus().nEnforceMinFeeHeight;
UniValue minRelayFeeAmount = enforceHeightFee ? ValueFromAmount(::enforcedMinRelayTxFee.GetFeePerK()) : ValueFromAmount(::minRelayTxFee.GetFeePerK());
obj.push_back(Pair("relayfee", minRelayFeeAmount));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
Expand Down
5 changes: 4 additions & 1 deletion src/rpc/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ UniValue getnetworkinfo(const JSONRPCRequest& request)
obj.push_back(Pair("connections", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)));
}
obj.push_back(Pair("networks", GetNetworksInfo()));
obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK())));
int nHeight = chainActive.Height();
bool enforceHeightFee = nHeight > Params().GetConsensus().nEnforceMinFeeHeight;
UniValue minRelayFeeAmount = enforceHeightFee ? ValueFromAmount(::enforcedMinRelayTxFee.GetFeePerK()) : ValueFromAmount(::minRelayTxFee.GetFeePerK());
obj.push_back(Pair("relayfee", minRelayFeeAmount));
obj.push_back(Pair("incrementalfee", ValueFromAmount(::incrementalRelayFee.GetFeePerK())));
UniValue localAddresses(UniValue::VARR);
{
Expand Down
3 changes: 2 additions & 1 deletion src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,8 @@ static void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& m
{
CValidationState state;
CAmount txfee = 0;
bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, state, mempoolDuplicate, spendheight, txfee);
bool enforceHeightFee = spendheight > Params().GetConsensus().nEnforceMinFeeHeight;
bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, state, mempoolDuplicate, spendheight, txfee, enforceHeightFee);
assert(fCheckResult);
UpdateCoins(tx, mempoolDuplicate, 1000000);
}
Expand Down
Loading

0 comments on commit fbb9aa8

Please sign in to comment.