Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.8 to develop #481

Merged
merged 52 commits into from Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6434190
qt: add tx update events to minting table
EvgenijM86 May 3, 2019
618cf11
fix conflicting struct name
EvgenijM86 May 13, 2019
4492446
fixes for regtest
backpacker69 May 2, 2019
7058fa5
fix rpc raw transaction tests
backpacker69 May 28, 2019
03b5eda
allow for block generation before 0.8 activates
backpacker69 May 28, 2019
ba71fb7
peercoin changes for functional tests
backpacker69 May 28, 2019
0f0ce06
allow regtest to retain same difficulty for tests to work properly
backpacker69 May 31, 2019
1e4c2c7
add nTime and vchBlockSig
backpacker69 May 31, 2019
85d0598
add signing of blocks and some fixes to feature block test
backpacker69 May 31, 2019
6a2476c
fix another PoS spam vulnerability
EvgenijM86 Jun 3, 2019
3de25c3
do not penalize peer for his first batch of headers
EvgenijM86 Jun 3, 2019
5592bf2
fixing signing of blocks
backpacker69 Jun 4, 2019
7af4d6f
initial fixing of compact blocks tests
backpacker69 Jun 4, 2019
feffbc1
reduce the penalty for disjointed PoS header chain, because a single …
EvgenijM86 Jun 4, 2019
8cb8a23
output peercoin specific information to rpc output
backpacker69 Jun 4, 2019
3175dca
Revert "add multisig to toolbar"
backpacker69 Jun 10, 2019
0ab619e
removing multisig for now
backpacker69 Jun 10, 2019
25627b5
display warnings correctly
backpacker69 Jun 10, 2019
6952050
correct width for unit selection combobox
backpacker69 Jun 11, 2019
2b137f3
fix amount spinbox and send coins entry
backpacker69 Jun 11, 2019
ce13895
remove unit selector from status bar
backpacker69 Jun 12, 2019
490aa2e
Additional dnsseed
sunnyking Jun 25, 2019
94091b5
Merge pull request #479 from peercoin/sunny-dnsseed
peerchemist Jun 25, 2019
2afa1c0
tweaking intro text
peerchemist Jul 7, 2019
ffae4ca
more fixes to functional tests
backpacker69 Jun 14, 2019
7c0f926
prune won't allow pos block validation
backpacker69 Jul 8, 2019
4175f3d
fix intro text
backpacker69 Jul 8, 2019
75aa708
removing more bitcoin residue
backpacker69 Jul 8, 2019
9a9c6de
do not connect updateSmartFeeLabel
backpacker69 Jul 8, 2019
842a1e8
fix wallet help
backpacker69 Jul 8, 2019
6199814
remove spent transactions from minting view
backpacker69 Jul 9, 2019
d2333c8
store PoS temperature in a separate map
EvgenijM86 Jun 18, 2019
3837893
fix ProcessHeadersMessage to work with mapPoSTemperature
backpacker69 Jul 11, 2019
2152b00
Update build-unix.md
peerchemist Jul 11, 2019
af4aa41
fill nFlags of header
backpacker69 Jul 14, 2019
615d0b4
let's not enforce low_s just yet
backpacker69 Jul 14, 2019
854b7a5
copy actual nFlags to header
backpacker69 Jul 15, 2019
772e2b6
we should abandon orphan mints
backpacker69 Jul 18, 2019
5f49368
log abandoned transactions
backpacker69 Jul 19, 2019
6459c12
lock before clearing
backpacker69 Jul 22, 2019
3648642
extra safety during mintingtable update
backpacker69 Jul 22, 2019
4d91225
don't reduce colours when option is disabled
backpacker69 Jul 25, 2019
9093fb8
do not mark stakemints as watch addresses
backpacker69 Jul 25, 2019
95f4362
the right place to set peercoin logo
backpacker69 Jul 26, 2019
ff86379
fix debuild part 1
backpacker69 Jul 26, 2019
2322a63
peercoin started in 2012
backpacker69 Jul 26, 2019
70e8634
new hardened checkpoints
backpacker69 Jul 26, 2019
7d7da27
Params is struct, our chainstate is 0 gb
backpacker69 Jul 26, 2019
e75f6fb
release is upon us
backpacker69 Jul 26, 2019
e50fa2e
new splashscreen
backpacker69 Jul 27, 2019
9c0f73f
explain disable-checkpoints configure flag
peerchemist Jul 27, 2019
b600872
extra align for linux
backpacker69 Jul 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -8,7 +8,7 @@ define(_PEERCOIN_VERSION_MAJOR, 0)
define(_PEERCOIN_VERSION_MINOR, 8)
define(_PEERCOIN_VERSION_REVISION, 0)
define(_PEERCOIN_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Peercoin]])
Expand Down
15 changes: 12 additions & 3 deletions doc/build-unix.md
Expand Up @@ -78,8 +78,10 @@ install necessary parts of boost:
2. If that doesn't work, you can install all boost development packages with:

sudo apt-get install libboost-all-dev

BerkeleyDB is required for the wallet.

BerkeleyDB is required for the wallet functionality.
Historically Bitcoin was first deployed with now deprecated BerkeleyDB-4.8, which has resulted in the need to upkeep the compatibility with those ancient deployments to this day. BerkeleyDB-4.8 is not compatible with more modern BerkeleyDB-5.1 and BerkeleyDB-5.3. Peercoin has inherited this in the first versions and this is why Peercoin is still officially shipped out with BerkeleyDB-4.8.
However if you running a new wallet on a new installation there is absolutely no need to run old and deprecated BerkeleyDB-4.8. Just use the one avaliable in the repository of your distribution.

**For Ubuntu only:** db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin).
You can add the repository and install using the following commands:
Expand Down Expand Up @@ -242,11 +244,18 @@ disable-wallet mode with:

./configure --disable-wallet

In this case there is no dependency on Berkeley DB 4.8.
In this case there is no dependency on Berkeley DB.

Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC
call not `getwork`.

Disable checkpoints
-------------------
It is possible to compile the node without the support for centrally issued checkpoints:

./configure --disable-checkpoints


Additional Configure Flags
--------------------------
A list of additional configure flags can be displayed with:
Expand Down
2 changes: 1 addition & 1 deletion doc/man/peercoind.1
Expand Up @@ -470,7 +470,7 @@ Disable minting of POS blocks
.SH COPYRIGHT
Copyright \(co 2009\-2012 The Bitcoin Core developers
.br
Copyright \(co 20012\-2019 The Peercoin developers
Copyright \(co 2012\-2019 The Peercoin developers
.PP
Please contribute if you find Peercoin useful. Visit
<https://peercoin.net/> for further information about the software.
Expand Down
3 changes: 2 additions & 1 deletion scripts/dependencies-ubuntu.sh
Expand Up @@ -7,4 +7,5 @@ sudo apt-get install -y -qq miniupnpc libminiupnpc-dev gettext libevent-dev prot
#for gui
sudo apt-get install -y -qq qtbase5-dev qttools5-dev-tools
sudo apt-get install -y -qq libdb++-dev

#for debuild
sudo apt-get install -y -qq libfakeroot fakeroot
4 changes: 1 addition & 3 deletions src/Makefile.qt.include
Expand Up @@ -343,16 +343,14 @@ RES_ICONS = \
qt/res/icons/tx_mined.png \
qt/res/icons/warning.png \
qt/res/icons/verify.png \
qt/res/images/logo.png \
qt/res/images/logomask.png \
qt/res/images/splash.png \
qt/res/images/about.png \
qt/res/images/controls/caret-down.png \
qt/res/images/controls/caret-up.png \
qt/res/images/controls/scroll-down.png \
qt/res/images/controls/scroll-up.png \
qt/res/images/logo.png \
qt/res/images/logomask.png \
qt/res/images/mantis.png \
qt/res/images/splash.png \
qt/res/images/splash_testnet.png \
qt/res/images/transparent-background.png \
Expand Down
9 changes: 9 additions & 0 deletions src/chainparams.cpp
Expand Up @@ -123,6 +123,7 @@ class CMainParams : public CChainParams {
vSeeds.emplace_back("seed2.peercoin.net");
vSeeds.emplace_back("seed.peercoin-library.org");
vSeeds.emplace_back("ppcseed.ns.7server.net");
vSeeds.emplace_back("seed.ppcoin.info");

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,55); // peercoin: addresses begin with 'P'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,117); // peercoin: addresses begin with 'p'
Expand Down Expand Up @@ -150,6 +151,7 @@ class CMainParams : public CChainParams {
{336000, uint256S("0x4d261cef6e61a5ed8325e560f1d6e36f4698853a4c7134677f47a1d1d842bdf6")},
{371850, uint256S("0x6b18adcb0a6e080dae85b74eee2b83fabb157bbea64fab0ed2192b2f6d5b89f3")},
{407813, uint256S("0x00000000000000012730b0f48bed8afbeb08164c9d63597afb082e82ea05cec9")},
{443561, uint256S("0xf81cea8e4e40b2cfcc13a8bd82436399c35a55df951b95e7128601c1838029ed")},
}
};

Expand Down Expand Up @@ -216,6 +218,7 @@ class CTestNetParams : public CChainParams {
vSeeds.emplace_back("tseed.peercoin.net");
vSeeds.emplace_back("tseed2.peercoin.net");
vSeeds.emplace_back("tseed.peercoin-library.org");
vSeeds.emplace_back("testseed.ppcoin.info");

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
Expand Down Expand Up @@ -244,6 +247,7 @@ class CTestNetParams : public CChainParams {
{336000, uint256S("0xf07adf61615c529f7c282b858d13d3e037b197324cb12e0669c461947494c4e3")},
{372751, uint256S("0x000000000000148db599b217c117b5104f5043c55f6ca2a8a065d9fab9f9bba1")},
{382019, uint256S("0x3ab75769d7957d9bf0857b5019d0a0e41044fa9ecf30b2f9c32aa457b0864ce5")},
{412691, uint256S("0x0e20318be88f07f521453435b37cfc516c3de07264a78ed7170985a1126126ab")},
}
};

Expand Down Expand Up @@ -276,6 +280,11 @@ class CRegTestParams : public CChainParams {
consensus.nTargetSpacingWorkMax = 12 * consensus.nStakeTargetSpacing; // 2-hour
consensus.nPowTargetSpacing = consensus.nStakeTargetSpacing;

consensus.nStakeMinAge = 60 * 60 * 24; // test net min age is 1 day
consensus.nStakeMaxAge = 60 * 60 * 24 * 90;
consensus.nModifierInterval = 60 * 20; // Modifier interval: time to elapse before new modifier is computed
consensus.nCoinbaseMaturity = 60;

consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/tx_verify.h
Expand Up @@ -21,7 +21,7 @@ class CValidationState;
bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true);

namespace Consensus {
class Params;
struct Params;
/**
* Check whether all inputs of this transaction are valid (no double spends and amounts)
* This does not modify the UTXO set. This does not check scripts and sigs.
Expand Down
1 change: 1 addition & 0 deletions src/core_write.cpp
Expand Up @@ -159,6 +159,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
entry.pushKV("txid", tx.GetHash().GetHex());
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
entry.pushKV("version", tx.nVersion);
entry.pushKV("time", (int64_t)tx.nTime);
entry.pushKV("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));
entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);
entry.pushKV("locktime", (int64_t)tx.nLockTime);
Expand Down
5 changes: 3 additions & 2 deletions src/init.cpp
Expand Up @@ -508,7 +508,7 @@ std::string LicenseInfo()
const std::string URL_SOURCE_CODE = "<https://github.com/peercoin/peercoin>";
const std::string URL_WEBSITE = "<https://peercoin.net/>";

return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2012, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
strprintf(_("Please contribute if you find %s useful. "
"Visit %s for further information about the software."),
Expand Down Expand Up @@ -1003,6 +1003,7 @@ bool AppInitParameterInteraction()
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;

// block pruning; get the amount of disk space (in MiB) to allot for block & undo files
/*
int64_t nPruneArg = gArgs.GetArg("-prune", 0);
if (nPruneArg < 0) {
return InitError(_("Prune cannot be configured with a negative value."));
Expand All @@ -1019,7 +1020,7 @@ bool AppInitParameterInteraction()
LogPrintf("Prune configured to target %uMiB on disk for block and undo files.\n", nPruneTarget / 1024 / 1024);
fPruneMode = true;
}

*/
nConnectTimeout = gArgs.GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT);
if (nConnectTimeout <= 0)
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
Expand Down
20 changes: 11 additions & 9 deletions src/kernel.cpp
Expand Up @@ -36,7 +36,7 @@ const unsigned int nProtocolV07SwitchTime = 1552392000; // Tue 12 Mar 12:00:
const unsigned int nProtocolV07TestSwitchTime = 1541505600; // Tue 06 Nov 12:00:00 UTC 2018

// Switch time for new BIPs from bitcoin 0.16.x
const uint32_t nBTC16BIPsSwitchTime = 32548219200; // Fri 31 May 12:00:00 UTC 3001
const uint32_t nBTC16BIPsSwitchTime = 1569931200; // Tue 01 Oct 12:00:00 UTC 2019
const uint32_t nBTC16BIPsTestSwitchTime = 1554811200; // Tue 09 Apr 12:00:00 UTC 2019

// Hard checkpoints of stake modifiers to ensure they are deterministic
Expand All @@ -50,6 +50,7 @@ static std::map<int, unsigned int> mapStakeModifierCheckpoints =
(336000, 0x6c3c8048u )
(371850, 0x9b850bdfu )
(407813, 0x46fe50b5u )
(443561, 0x114a6e38u )
;

static std::map<int, unsigned int> mapStakeModifierTestnetCheckpoints =
Expand All @@ -62,39 +63,40 @@ static std::map<int, unsigned int> mapStakeModifierTestnetCheckpoints =
(336000, 0x8330dc09u )
(372751, 0xafb94e2fu )
(382019, 0x7f5cf5ebu )
(412691, 0x93138e67u )
;

// Whether the given coinstake is subject to new v0.3 protocol
bool IsProtocolV03(unsigned int nTimeCoinStake)
{
return (nTimeCoinStake >= (Params().NetworkIDString() == CBaseChainParams::TESTNET ? nProtocolV03TestSwitchTime : nProtocolV03SwitchTime));
return (nTimeCoinStake >= (Params().NetworkIDString() != CBaseChainParams::MAIN ? nProtocolV03TestSwitchTime : nProtocolV03SwitchTime));
}

// Whether the given block is subject to new v0.4 protocol
bool IsProtocolV04(unsigned int nTimeBlock)
{
return (nTimeBlock >= (Params().NetworkIDString() == CBaseChainParams::TESTNET ? nProtocolV04TestSwitchTime : nProtocolV04SwitchTime));
return (nTimeBlock >= (Params().NetworkIDString() != CBaseChainParams::MAIN ? nProtocolV04TestSwitchTime : nProtocolV04SwitchTime));
}

// Whether the given transaction is subject to new v0.5 protocol
bool IsProtocolV05(unsigned int nTimeTx)
{
return (nTimeTx >= (Params().NetworkIDString() == CBaseChainParams::TESTNET ? nProtocolV05TestSwitchTime : nProtocolV05SwitchTime));
return (nTimeTx >= (Params().NetworkIDString() != CBaseChainParams::MAIN ? nProtocolV05TestSwitchTime : nProtocolV05SwitchTime));
}

// Whether a given block is subject to new v0.6 protocol
// Test against previous block index! (always available)
bool IsProtocolV06(const CBlockIndex* pindexPrev)
{
if (pindexPrev->nTime < (Params().NetworkIDString() == CBaseChainParams::TESTNET ? nProtocolV06TestSwitchTime : nProtocolV06SwitchTime))
if (pindexPrev->nTime < (Params().NetworkIDString() != CBaseChainParams::MAIN ? nProtocolV06TestSwitchTime : nProtocolV06SwitchTime))
return false;

// if 900 of the last 1,000 blocks are version 2 or greater (90/100 if testnet):
// Soft-forking PoS can be dangerous if the super majority is too low
// The stake majority will decrease after the fork
// since only coindays of updated nodes will get destroyed.
if ((Params().NetworkIDString() != CBaseChainParams::TESTNET && IsSuperMajority(2, pindexPrev, 900, 1000)) ||
(Params().NetworkIDString() == CBaseChainParams::TESTNET && IsSuperMajority(2, pindexPrev, 90, 100)))
if ((Params().NetworkIDString() == CBaseChainParams::MAIN && IsSuperMajority(2, pindexPrev, 900, 1000)) ||
(Params().NetworkIDString() != CBaseChainParams::MAIN && IsSuperMajority(2, pindexPrev, 90, 100)))
return true;

return false;
Expand All @@ -103,13 +105,13 @@ bool IsProtocolV06(const CBlockIndex* pindexPrev)
// Whether a given transaction is subject to new v0.7 protocol
bool IsProtocolV07(unsigned int nTimeTx)
{
bool fTestNet = Params().NetworkIDString() == CBaseChainParams::TESTNET;
bool fTestNet = Params().NetworkIDString() != CBaseChainParams::MAIN;
return (nTimeTx >= (fTestNet? nProtocolV07TestSwitchTime : nProtocolV07SwitchTime));
}

bool IsBTC16BIPsEnabled(uint32_t nTimeTx)
{
bool fTestNet = Params().NetworkIDString() == CBaseChainParams::TESTNET;
bool fTestNet = Params().NetworkIDString() != CBaseChainParams::MAIN;
return (nTimeTx >= (fTestNet? nBTC16BIPsTestSwitchTime : nBTC16BIPsSwitchTime));
}

Expand Down
4 changes: 3 additions & 1 deletion src/net.cpp
Expand Up @@ -88,6 +88,9 @@ std::string strSubVersion;

limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);

// peercoin: temperature to measure how many PoS headers have been sent by this client
std::map<CNetAddr, int32_t> mapPoSTemperature;

void CConnman::AddOneShot(const std::string& strDest)
{
LOCK(cs_vOneShots);
Expand Down Expand Up @@ -2743,7 +2746,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
fPauseRecv = false;
fPauseSend = false;
nProcessQueueSize = 0;
nPoSTemperature = MAX_CONSECUTIVE_POS_HEADERS/4;
lastAcceptedHeader = uint256();

for (const std::string &msg : getAllNetMessageTypes())
Expand Down
8 changes: 4 additions & 4 deletions src/net.h
Expand Up @@ -87,8 +87,9 @@ static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban

/** peercoin: Number of consecutive PoS headers are allowed from a single peer. Used to prevent out of memory attack. */
static const unsigned int MAX_CONSECUTIVE_POS_HEADERS = 1000;
// const unsigned int POW_HEADER_COOLING - defined in protocol.cpp, so that it is visible to other files
static const int32_t MAX_CONSECUTIVE_POS_HEADERS = 1000;

// const unsigned int POW_HEADER_COOLING = 70; - defined in protocol.cpp, so that it is visible to other files

typedef int64_t NodeId;

Expand Down Expand Up @@ -519,6 +520,7 @@ struct LocalServiceInfo {

extern CCriticalSection cs_mapLocalHost;
extern std::map<CNetAddr, LocalServiceInfo> mapLocalHost;
extern std::map<CNetAddr, int32_t> mapPoSTemperature;
typedef std::map<std::string, uint64_t> mapMsgCmdSize; //command, total bytes

class CNodeStats
Expand Down Expand Up @@ -723,8 +725,6 @@ class CNode
CCriticalSection cs_feeFilter;
CAmount lastSentFeeFilter;
int64_t nextSendTimeFeeFilter;
// peercoin: temperature to measure how many PoS headers have been sent by this client
uint32_t nPoSTemperature;
// peercoin: used to detect branch switches
uint256 lastAcceptedHeader;

Expand Down