Skip to content
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,9 @@ endif()
# Find required Boost library dependency
set(Boost_USE_STATIC_LIBS ON)
set(Boost_VERBOSE ON)
# Use the new upstream BoostConfig.cmake for CMake versions starting with 3.30.0
if(CMAKE_VERSION VERSION_LESS "3.30.0")
else()
cmake_policy(SET CMP0167 NEW)
endif()
find_package(Boost COMPONENTS system filesystem chrono thread unit_test_framework REQUIRED)
# Use FindBoost module for compatibility with Boost 1.85+
cmake_policy(SET CMP0167 OLD)
find_package(Boost COMPONENTS filesystem chrono thread unit_test_framework REQUIRED)

# Other required library dependencies
find_package(GMP REQUIRED)
Expand Down Expand Up @@ -679,7 +676,7 @@ endif()

target_link_libraries(pivxd ${sodium_LIBRARY_RELEASE} -ldl -lpthread)

if(NOT DEFINED ENV{NO_QT})
if(NOT DEFINED ENV{NO_QT} AND NOT NO_QT)
add_subdirectory(src/qt)
endif()

Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/hexdump_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export LC_ALL=C
INFILE="$1"
OUTFILE="$2"

hexdump -v -e '8/1 "0x%02x, "' -e '"\n"' $INFILE | sed -e 's/0x ,//g' >> $OUTFILE
hexdump -v -e '8/1 "0x%02x, "' -e '"\n"' "$INFILE" | sed -e 's/0x ,//g' >> "$OUTFILE"
9 changes: 5 additions & 4 deletions src/bls/bls_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#ifndef PIVX_BLS_BLS_WRAPPER_H
#define PIVX_BLS_BLS_WRAPPER_H

#include "hash.h"
#include "serialize.h"
#include "uint256.h"
#include "utilstrencodings.h"
#include "../hash.h"
#include "../serialize.h"
#include "../uint256.h"
#include "../utilstrencodings.h"

// chiabls uses relic, which may define DEBUG and ERROR, which leads to many warnings in some build setups
#undef ERROR
#undef DEBUG
#undef err_get_code
#include <bls.hpp>
#include <privatekey.hpp>
#include <elements.hpp>
Expand Down
57 changes: 28 additions & 29 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ static const CCheckpointData data = {
};

static MapCheckpoints mapCheckpointsTestnet = {
{0, uint256S("0x001")},
//{ 201, uint256S("6ae7d52092fd918c8ac8d9b1334400387d3057997e6e927a88e57186dc395231")}, // v5 activation (PoS/Sapling)
{0, uint256S("0x00000f254358fe046377c224341c794b7faf942a6311a7ece773d3c378239c54")},
};

static const CCheckpointData dataTestnet = {
&mapCheckpointsTestnet,
1454124731,
0,
3000};
1777507200, // * UNIX timestamp of testnet6 genesis block (April 30, 2026)
0, // * total number of transactions between genesis and last checkpoint (fresh start)
250}; // * estimated number of transactions per day after checkpoint

static MapCheckpoints mapCheckpointsRegtest = {{0, uint256S("0x001")}};
static const CCheckpointData dataRegtest = {
Expand Down Expand Up @@ -372,7 +371,7 @@ class CMainParams : public CChainParams
};

/**
* Testnet (v5)
* Testnet (v6)
*/
class CTestNetParams : public CChainParams
{
Expand All @@ -381,9 +380,10 @@ class CTestNetParams : public CChainParams
{
strNetworkID = "test";

genesis = CreateGenesisBlock(1454124731, 2402015, 0x1e0ffff0, 1, 250 * COIN);
// Testnet6 genesis - April 30, 2026.
genesis = CreateGenesisBlock(1777507200, 498658, 0x1e0ffff0, 1, 250 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(consensus.hashGenesisBlock == uint256S("0x00000f254358fe046377c224341c794b7faf942a6311a7ece773d3c378239c54"));
assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));

consensus.fPowAllowMinDifficultyBlocks = true;
Expand Down Expand Up @@ -411,7 +411,7 @@ class CTestNetParams : public CChainParams
consensus.nMaxProposalPayments = 20;

// spork keys
consensus.strSporkPubKey = "04677c34726c491117265f4b1c83cef085684f36c8df5a97a3a42fc499316d0c4e63959c9eca0dba239d9aaaf72011afffeb3ef9f51b9017811dec686e412eb504";
consensus.strSporkPubKey = "04b6f3a15c8c465ac1c799e04fe79e351db3c7815aa33d70656f0bc5e3688da22bc13886ead5d2ad2307a93590ee04ad176e95c336ab179a21faf064255d79cb39";
consensus.strSporkPubKeyOld = "04E88BB455E2A04E65FCC41D88CD367E9CCE1F5A409BE94D8C2B4B35D223DED9C8E2F4E061349BA3A38839282508066B6DC4DB72DD432AC4067991E6BF20176127";
consensus.nTime_EnforceNewSporkKey = 1608512400; //!> December 21, 2020 01:00:00 AM GMT
consensus.nTime_RejectOldSporkKey = 1614560400; //!> March 1, 2021 01:00:00 AM GMT
Expand Down Expand Up @@ -442,30 +442,29 @@ class CTestNetParams : public CChainParams
consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_POS].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_ZC].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_ZC_V2].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_BIP65].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_ZC_PUBLIC].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 201;
consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 262525;
consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 332300;
consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 925056;
consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 1624280; // Estimate Feb 23 Midnight UTC
consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 225;
consensus.vUpgrades[Consensus::UPGRADE_ZC].nActivationHeight = 250;
consensus.vUpgrades[Consensus::UPGRADE_ZC_V2].nActivationHeight = 275;
consensus.vUpgrades[Consensus::UPGRADE_BIP65].nActivationHeight = 300;
consensus.vUpgrades[Consensus::UPGRADE_ZC_PUBLIC].nActivationHeight = 350;
consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 400;
consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight = 450;
consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 500;
consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 550;
consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 600;
consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 650;
consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 700;
consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = 5000;

/**
* The message start string is designed to be unlikely to occur in normal data.
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
* a large 4-byte int at any alignment.
*/
pchMessageStart[0] = 0xf5;
pchMessageStart[1] = 0xe6;
pchMessageStart[2] = 0xd5;
pchMessageStart[3] = 0xca;
pchMessageStart[0] = 0xf6;
pchMessageStart[1] = 0xe7;
pchMessageStart[2] = 0xd6;
pchMessageStart[3] = 0xcb;
nDefaultPort = 51474;

// nodes with support for servicebits filtering should be at the top
Expand All @@ -484,7 +483,7 @@ class CTestNetParams : public CChainParams
// Testnet pivx BIP44 coin type is '1' (All coin's testnet default)
base58Prefixes[EXT_COIN_TYPE] = {0x80, 0x00, 0x00, 0x01};

vFixedSeeds = std::vector<uint8_t>(std::begin(chainparams_seed_test), std::end(chainparams_seed_test));
vFixedSeeds.clear(); // Testnet6 - no fixed seeds yet

fRequireStandard = false;

Expand All @@ -505,7 +504,7 @@ class CTestNetParams : public CChainParams

nLLMQConnectionRetryTimeout = 60;

consensus.llmqTypeChainLocks = Consensus::LLMQ_400_60;
consensus.llmqTypeChainLocks = Consensus::LLMQ_50_60;

// Tier two
nFulfilledRequestExpireTime = 60 * 60; // fulfilled requests expire in 1 hour
Expand Down
2 changes: 1 addition & 1 deletion src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain
if (chain == CBaseChainParams::MAIN)
return std::make_unique<CBaseChainParams>("", 51473);
else if (chain == CBaseChainParams::TESTNET)
return std::make_unique<CBaseChainParams>("testnet5", 51475);
return std::make_unique<CBaseChainParams>("testnet6", 51475);
else if (chain == CBaseChainParams::REGTEST)
return std::make_unique<CBaseChainParams>("regtest", 51477);
else
Expand Down
17 changes: 1 addition & 16 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,22 +331,7 @@ static const uint8_t chainparams_seed_main[] = {
0x04,0x20,0x2d,0x23,0x2c,0xe0,0x43,0xb2,0x64,0x62,0x12,0xaa,0xb4,0x86,0x6e,0x9e,0x40,0x9c,0xe5,0x50,0x5b,0x88,0xf6,0x37,0x75,0x64,0x75,0x0f,0xf2,0x4c,0xeb,0x94,0xb1,0xd2,0xc9,0x10,
};

// Testnet6 - no fixed seeds yet (fresh network)
static const uint8_t chainparams_seed_test[] = {
0x01,0x04,0x2d,0x23,0xfb,0x45,0xc9,0x12,
0x01,0x04,0x50,0xd0,0xe2,0xa7,0xc9,0x12,
0x01,0x04,0x8c,0x52,0x26,0x3f,0xc9,0x12,
0x01,0x04,0xb0,0xdf,0x80,0x83,0xc9,0x12,
0x01,0x04,0xb9,0x51,0xa6,0x3c,0xc9,0x12,
0x01,0x04,0xc2,0x87,0x59,0x3f,0xc9,0x12,
0x04,0x20,0xda,0xdd,0x12,0xcc,0x6e,0x0b,0xb0,0x79,0x11,0x2c,0xfd,0x67,0x6f,0xdf,0xba,0xd0,0xfd,0x60,0x51,0x51,0xb9,0xe1,0xa9,0x90,0xda,0xc3,0x14,0x84,0x0d,0x72,0xb8,0x56,0xc9,0x12,
0x04,0x20,0xf1,0xaf,0x92,0x10,0x55,0x94,0x9c,0xc8,0x6e,0x2f,0x9b,0xc8,0xbd,0xf8,0xee,0x4d,0xe6,0x4f,0x16,0x85,0x44,0xd8,0x4a,0x17,0x47,0x74,0x8c,0x0a,0xdd,0xb0,0x39,0x44,0xc9,0x12,
0x04,0x20,0x0d,0x7a,0xcd,0x2c,0x2d,0xeb,0x87,0x28,0x64,0x7d,0xf8,0x63,0xab,0xc3,0x1f,0x20,0x5b,0xa8,0x9b,0x18,0xa0,0x13,0xb3,0xad,0xdf,0x0c,0x85,0x72,0x31,0x07,0x66,0xe0,0xc9,0x12,
0x04,0x20,0x24,0xfa,0xa6,0x75,0xf1,0xfa,0x73,0x50,0xe1,0x7a,0xf7,0xe1,0x26,0x81,0x62,0x82,0x75,0x80,0x00,0x67,0x76,0xb7,0x28,0x81,0xb4,0x56,0x5a,0x75,0x76,0xcf,0xf4,0x2c,0xc9,0x12,
0x04,0x20,0x3d,0x42,0x3f,0x28,0x5e,0xc2,0x64,0x6f,0xdb,0xd3,0x1d,0x08,0x6f,0xf8,0x99,0x7c,0x73,0x8f,0xbc,0xc2,0xbd,0x60,0x43,0x6d,0xdd,0x07,0xaa,0xb7,0x3a,0xe2,0xb8,0xd9,0xc9,0x12,
0x04,0x20,0x63,0xe0,0x30,0x01,0xca,0x4a,0x4d,0x8d,0xb1,0x19,0x9b,0x96,0xed,0x39,0xfb,0xd4,0x81,0x5d,0x22,0x05,0x20,0xc6,0xaf,0x3d,0x87,0xbb,0xd2,0xcd,0xa7,0x7c,0x05,0x10,0xc9,0x12,
0x04,0x20,0x6f,0xfb,0xf9,0x4d,0xdb,0xb2,0x90,0xef,0x45,0x60,0x36,0x68,0x1d,0xd9,0xc8,0xe2,0x59,0xf9,0x16,0x54,0x61,0x77,0x64,0x02,0x9e,0xf4,0x28,0x20,0xe5,0x4a,0x1f,0x72,0xc9,0x12,
0x04,0x20,0x97,0x60,0xd9,0x46,0x4c,0x7b,0x7b,0x85,0x8b,0x55,0x84,0xdd,0x53,0x51,0xdb,0x64,0xfe,0x3f,0x69,0x5f,0xbd,0xe7,0xdb,0xc2,0x3f,0x81,0x49,0xd5,0x23,0x90,0x97,0x21,0xc9,0x12,
0x04,0x20,0xa0,0x57,0x5a,0x42,0xfd,0xad,0x78,0x23,0x67,0x15,0xd1,0x69,0x52,0x24,0xc1,0xdf,0x2b,0x32,0x6a,0xd4,0x64,0xf2,0xbc,0xed,0xf9,0x7f,0x36,0xc6,0x26,0x02,0xe2,0xf4,0xc9,0x12,
0x04,0x20,0xbf,0x31,0x2d,0xcd,0x4b,0x8e,0x06,0x84,0xef,0xae,0xfb,0x3f,0x7e,0x17,0x41,0x03,0x9c,0xb6,0x12,0xdb,0x87,0x3b,0x1f,0x8e,0xab,0x78,0xd5,0x9a,0x39,0xc6,0x28,0x76,0xc9,0x12,
};
#endif // PIVX_CHAINPARAMSSEEDS_H
7 changes: 7 additions & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ void CDeterministicMNState::ToJson(UniValue& obj) const
obj.pushKV("PoSePenalty", nPoSePenalty);
obj.pushKV("PoSeRevivedHeight", nPoSeRevivedHeight);
obj.pushKV("PoSeBanHeight", nPoSeBanHeight);
std::string strPoSeStatus = "OK_HEALTHY";
if (nPoSeBanHeight != -1) {
strPoSeStatus = "BANNED";
} else if (nPoSePenalty > 0) {
strPoSeStatus = "WARNING_PENALIZED";
}
obj.pushKV("PoSeStatus", strPoSeStatus);
obj.pushKV("revocationReason", nRevocationReason);
obj.pushKV("ownerAddress", EncodeDestination(keyIDOwner));
obj.pushKV("operatorPubKey", bls::EncodePublic(Params(), pubKeyOperator.Get()));
Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void BitcoinMiner(CWallet* pwallet, bool fProofOfStake)
// Search
//
int64_t nStart = GetTime();
arith_uint256& hashTarget = arith_uint256().SetCompact(pblock->nBits);
arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits);
while (true) {
unsigned int nHashesDone = 0;

Expand Down
15 changes: 11 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,12 +851,19 @@ CAmount GetBlockValue(int nHeight)

int64_t GetMasternodePayment(int nHeight)
{
if (nHeight > Params().GetConsensus().vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight) {
return Params().GetConsensus().nNewMNBlockReward;
int64_t baseReward = (nHeight > Params().GetConsensus().vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight) ?
Params().GetConsensus().nNewMNBlockReward : Params().GetConsensus().nMNBlockReward;

// Adaptive Masternode Incentive Boost:
// If active Masternodes drop below 1,200, scale reward by +25% (up to 50% block reward) to incentivize new node launches
if (deterministicMNManager != nullptr) {
size_t activeMNs = deterministicMNManager->GetListAtChainTip().GetValidMNsCount();
if (activeMNs > 0 && activeMNs < 1200) {
baseReward = (baseReward * 125) / 100; // 25% reward boost
}
}

// Future: refactor function callers to use this line directly.
return Params().GetConsensus().nMNBlockReward;
return baseReward;
}

bool IsInitialBlockDownload()
Expand Down
Loading