Skip to content

Commit 257f601

Browse files
authored
Merge pull request #8 from ElectraProtocol/dev
Release v1.0.2.0
2 parents a0cca7a + f9f9fb3 commit 257f601

34 files changed

+161
-60
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
2121
global_task_template: &GLOBAL_TASK_TEMPLATE
22-
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
22+
skip: $CIRRUS_REPO_FULL_NAME == "xep-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
2323
ccache_cache:
2424
folder: "/tmp/ccache_dir"
2525
depends_built_cache:

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Travis caches can be manually removed if necessary. This is one of the very
22
# few manual operations that is possible with Travis, and it can be done by a
3-
# Bitcoin Core GitHub member via the Travis web interface [0].
3+
# XEP Core GitHub member via the Travis web interface [0].
44
#
55
# Travis CI uploads the cache after the script phase of the build [1].
66
# However, the build is terminated without saving the cache if it takes over
77
# 50 minutes [2]. Thus, if we spent too much time in early build stages, fail
88
# with an error and save the cache.
99
#
10-
# [0] https://travis-ci.org/bitcoin/bitcoin/caches
10+
# [0] https://travis-ci.org/xep/xep/caches
1111
# [1] https://docs.travis-ci.com/user/caching/#build-phases
1212
# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts
1313

@@ -42,10 +42,10 @@ before_script:
4242
script:
4343
- export CONTINUE=1
4444
- if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long
45-
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
45+
- if [ $TRAVIS_REPO_SLUG = "xep/xep" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
4646
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
4747
- if [[ $SECONDS -gt 50*60-$EXPECTED_TESTS_DURATION_IN_SECONDS ]]; then export CONTINUE=0; fi
48-
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
48+
- if [ $TRAVIS_REPO_SLUG = "xep/xep" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
4949
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
5050
after_script:
5151
- echo $TRAVIS_COMMIT_RANGE

build_msvc/.gitignore

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ packages/*
1010
*.vcxproj.user
1111

1212
# .vcxproj files that are auto-generated by the msvc-autogen.py script.
13-
libbitcoin_cli/libbitcoin_cli.vcxproj
14-
libbitcoin_common/libbitcoin_common.vcxproj
15-
libbitcoin_crypto/libbitcoin_crypto.vcxproj
16-
libbitcoin_server/libbitcoin_server.vcxproj
17-
libbitcoin_util/libbitcoin_util.vcxproj
18-
libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj
19-
libbitcoin_wallet/libbitcoin_wallet.vcxproj
20-
libbitcoin_zmq/libbitcoin_zmq.vcxproj
21-
bench_bitcoin/bench_bitcoin.vcxproj
13+
libxep_cli/libxep_cli.vcxproj
14+
libxep_common/libxep_common.vcxproj
15+
libxep_crypto/libxep_crypto.vcxproj
16+
libxep_server/libxep_server.vcxproj
17+
libxep_util/libxep_util.vcxproj
18+
libxep_wallet_tool/libxep_wallet_tool.vcxproj
19+
libxep_wallet/libxep_wallet.vcxproj
20+
libxep_zmq/libxep_zmq.vcxproj
21+
bench_xep/bench_xep.vcxproj
2222
libtest_util/libtest_util.vcxproj
2323

2424
*/Win32
25-
libbitcoin_qt/QtGeneratedFiles/*
26-
test_bitcoin-qt/QtGeneratedFiles/*
25+
libxep_qt/QtGeneratedFiles/*
26+
test_xep-qt/QtGeneratedFiles/*
2727
vcpkg_installed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
AC_PREREQ([2.69])
22
define(_CLIENT_VERSION_MAJOR, 1)
33
define(_CLIENT_VERSION_MINOR, 0)
4-
define(_CLIENT_VERSION_REVISION, 1)
5-
define(_CLIENT_VERSION_BUILD, 1)
4+
define(_CLIENT_VERSION_REVISION, 2)
5+
define(_CLIENT_VERSION_BUILD, 0)
66
define(_CLIENT_VERSION_RC, 0)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2021)

src/chainparams.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class CMainParams : public CChainParams {
9191
consensus.nSubsidyHalvingInterval = 210000;
9292
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
9393
consensus.nPoSStartBlock = 0;
94-
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
94+
consensus.nLastPoWBlock = 150000;
95+
consensus.nMandatoryUpgradeBlock = 150000;
9596
consensus.nTreasuryPaymentsStartBlock = std::numeric_limits<int>::max();
9697
consensus.BIP16Exception = uint256{};
9798
consensus.BIP34Height = 0;
@@ -125,9 +126,10 @@ class CMainParams : public CChainParams {
125126
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
126127

127128
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
129+
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
128130

129-
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
130-
consensus.defaultAssumeValid = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); // 654683
131+
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000035a7e986160b3cac");
132+
consensus.defaultAssumeValid = uint256S("0x505286a87781aabbb6cfc7a9b735ffacd8ce73bc06ed17dae546cafe4ca3e7a3"); // 50000
131133

132134
/**
133135
* The message start string is designed to be unlikely to occur in normal data.
@@ -187,7 +189,8 @@ class CMainParams : public CChainParams {
187189

188190
checkpointData = {
189191
{
190-
{0, uint256S("000000954c02f260a6db02c712557adcb5a7a8a0a9acfd3d3c2b3a427376c56f")},
192+
{ 0, uint256S("000000954c02f260a6db02c712557adcb5a7a8a0a9acfd3d3c2b3a427376c56f")},
193+
{ 50000, uint256S("505286a87781aabbb6cfc7a9b735ffacd8ce73bc06ed17dae546cafe4ca3e7a3")},
191194
}
192195
};
193196

@@ -213,6 +216,7 @@ class CTestNetParams : public CChainParams {
213216
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
214217
consensus.nPoSStartBlock = 0;
215218
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
219+
consensus.nMandatoryUpgradeBlock = 0;
216220
consensus.nTreasuryPaymentsStartBlock = 200;
217221
consensus.BIP16Exception = uint256{};
218222
consensus.BIP34Height = 0;
@@ -246,6 +250,7 @@ class CTestNetParams : public CChainParams {
246250
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
247251

248252
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
253+
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
249254

250255
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
251256
consensus.defaultAssumeValid = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); // 1864000
@@ -375,6 +380,7 @@ class SigNetParams : public CChainParams {
375380
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
376381
consensus.nPoSStartBlock = 0;
377382
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
383+
consensus.nMandatoryUpgradeBlock = 0;
378384
consensus.nTreasuryPaymentsStartBlock = 200;
379385
consensus.BIP16Exception = uint256{};
380386
consensus.BIP34Height = 1;
@@ -408,6 +414,7 @@ class SigNetParams : public CChainParams {
408414
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
409415

410416
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
417+
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
411418

412419
// message start is defined as the first 4 bytes of the sha256d of the block script
413420
CHashWriter h(SER_DISK, 0);
@@ -461,6 +468,7 @@ class CRegTestParams : public CChainParams {
461468
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
462469
consensus.nPoSStartBlock = 0;
463470
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
471+
consensus.nMandatoryUpgradeBlock = 0;
464472
consensus.nTreasuryPaymentsStartBlock = 30;
465473
consensus.BIP16Exception = uint256{};
466474
consensus.BIP34Height = 500; // BIP34 activated on regtest (Used in functional tests)
@@ -492,6 +500,7 @@ class CRegTestParams : public CChainParams {
492500
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
493501

494502
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
503+
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
495504

496505
consensus.nMinimumChainWork = uint256{};
497506
consensus.defaultAssumeValid = uint256{};

src/coins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bool CCoinsViewCache::GetCoin(const COutPoint &outpoint, Coin &coin) const {
6767

6868
void CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possible_overwrite) {
6969
assert(!coin.IsSpent());
70-
if (coin.out.scriptPubKey.IsUnspendable()) return;
70+
if (coin.out.scriptPubKey.IsUnspendable() || coin.out.nValue == 0 || coin.out.scriptPubKey.empty()) return;
7171
CCoinsMap::iterator it;
7272
bool inserted;
7373
std::tie(it, inserted) = cacheCoins.emplace(std::piecewise_construct, std::forward_as_tuple(outpoint), std::tuple<>());

src/consensus/params.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ struct Params {
5252
int nBudgetPaymentsStartBlock;
5353
int nPoSStartBlock;
5454
int nLastPoWBlock;
55+
int nMandatoryUpgradeBlock;
5556
int nTreasuryPaymentsStartBlock;
5657
int nTreasuryPaymentsCycleBlocks;
57-
std::map<CScript, int> mTreasuryPayees;
58+
std::map<CScript, unsigned int> mTreasuryPayees;
59+
unsigned int nTreasuryRewardPercentage;
5860
/* Block hash that is excepted from BIP16 enforcement */
5961
uint256 BIP16Exception;
6062
/** Block height and hash at which BIP34 becomes active */

src/kernel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ uint256 ComputeStakeModifierV2(const CBlockIndex* pindexPrev, const uint256& ker
262262
{
263263
if (!pindexPrev)
264264
return uint256(); // genesis block's modifier is 0
265-
if (pindexPrev->nHeight == 1029999)
265+
if (pindexPrev->nHeight == 0 || /*pindexPrev->nHeight == 1029999 ||*/ Params().NetworkIDString() == CBaseChainParams::REGTEST) {
266+
// Give a stake modifier to the first block - fixed stake modifier only for regtest
266267
return uint256S("0x61106044818e45706b1694a6a28dfe23d58a2c7d4adcff81fb1aeb6d74ea6f9e");
268+
}
267269

268270
CHashWriter ss(SER_GETHASH, 0);
269271
ss << kernel;

src/miner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ static inline void FillTreasuryPayee(CMutableTransaction& txNew, const int nHeig
114114
const CAmount nTreasuryPayment = GetTreasuryPayment(nHeight, consensusParams);
115115

116116
if (nTreasuryPayment > 0) {
117-
const std::map<CScript, int>& treasuryPayees = consensusParams.mTreasuryPayees;
117+
const std::map<CScript, unsigned int>& treasuryPayees = consensusParams.mTreasuryPayees;
118118

119-
for (const std::pair<CScript, int>& payee : treasuryPayees)
119+
for (const std::pair<CScript, unsigned int>& payee : treasuryPayees)
120120
txNew.vout.emplace_back(nTreasuryPayment * payee.second / 100, payee.first);
121121
}
122122
}
@@ -597,7 +597,7 @@ bool CreateCoinStake(CMutableTransaction& coinstakeTx, CBlock* pblock, std::shar
597597
LogPrintf("%s : parsed kernel type=%s\n", __func__, GetTxnOutputType(whichType));
598598

599599
if (whichType == TxoutType::PUBKEY || whichType == TxoutType::PUBKEYHASH || whichType == TxoutType::WITNESS_V0_KEYHASH || whichType == TxoutType::SCRIPTHASH || whichType == TxoutType::WITNESS_V0_SCRIPTHASH) { // we support p2pkh, p2wpkh, p2sh-p2wpkh, and p2sh/p2wsh-multisig inputs
600-
const bool fNewStakingCodeActive = Params().NetworkIDString() != CBaseChainParams::MAIN;
600+
const bool fNewStakingCodeActive = nHeight >= consensusParams.nMandatoryUpgradeBlock;
601601
if (whichType == TxoutType::SCRIPTHASH || whichType == TxoutType::WITNESS_V0_SCRIPTHASH) { // a p2sh/p2wsh input could be many things, but we only support p2sh-p2wpkh and multisig for now
602602
CScript subscript;
603603
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKeyKernel);

src/net_processing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern RecursiveMutex g_cs_orphans;
2727
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
2828
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
2929
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
30-
static const bool DEFAULT_PEERBLOOMFILTERS = false;
30+
static const bool DEFAULT_PEERBLOOMFILTERS = true; // See https://github.com/bitcoin/bitcoin/pull/16152 for reasons why we may want to disable this in the future
3131
static const bool DEFAULT_PEERBLOCKFILTERS = false;
3232
/** Threshold for marking a node to be discouraged, e.g. disconnected and added to the discouragement filter. */
3333
static const int DISCOURAGEMENT_THRESHOLD{100};

0 commit comments

Comments
 (0)