Skip to content

Commit f72fd9c

Browse files
2 parents be750ef + ddb14fe commit f72fd9c

18 files changed

+88
-58
lines changed

.travis.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,9 @@
22
# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
33
# IPv6 support
44

5-
# The test build matrix (stage: test) is constructed to test a wide range of
6-
# configurations, rather than a single pass/fail. This helps to catch build
7-
# failures and logic errors that present on platforms other than the ones the
8-
# author has tested.
9-
#
10-
# Some builders use the dependency-generator in `./depends`, rather than using
11-
# apt-get to install build dependencies. This guarantees that the tester is
12-
# using the same versions as Gitian, so the build results are nearly identical
13-
# to what would be found in a final release.
14-
#
15-
# In order to avoid rebuilding all dependencies for each build, the binaries
16-
# are cached and re-used when possible. Changes in the dependency-generator
17-
# will trigger cache-invalidation and rebuilds as necessary.
18-
#
19-
205
version: ~> 1.0
216

22-
dist: xenial
7+
dist: bionic
238

249
os: linux
2510
language: minimal

ci/README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
## ci scripts
1+
## CI Scripts
22

33
This directory contains scripts for each build step in each build stage.
44

5-
Currently three stages `lint`, `extended_lint` and `test` are defined. Each stage has its own lifecycle, similar to the
6-
[Travis CI lifecycle](https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle). Every script in here is named
7-
and numbered according to which stage and lifecycle step it belongs to.
8-
9-
### Running a stage locally
5+
### Running a Stage Locally
106

117
Be aware that the tests will be built and run in-place, so please run at your own risk.
128
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
@@ -36,3 +32,34 @@ To run the test stage with a specific configuration,
3632
```
3733
FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
3834
```
35+
36+
### Configurations
37+
38+
The test files (`FILE_ENV`) are constructed to test a wide range of
39+
configurations, rather than a single pass/fail. This helps to catch build
40+
failures and logic errors that present on platforms other than the ones the
41+
author has tested.
42+
43+
Some builders use the dependency-generator in `./depends`, rather than using
44+
the system package manager to install build dependencies. This guarantees that
45+
the tester is using the same versions as the release builds, which also use
46+
`./depends`.
47+
48+
If no `FILE_ENV` has been specified or values are left out, `00_setup_env.sh`
49+
is used as the default configuration with fallback values.
50+
51+
It is also possible to force a specific configuration without modifying the
52+
file. For example,
53+
54+
```
55+
MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
56+
```
57+
58+
The files starting with `0n` (`n` greater than 0) are the scripts that are run
59+
in order.
60+
61+
### Cache
62+
63+
In order to avoid rebuilding all dependencies for each build, the binaries are
64+
cached and re-used when possible. Changes in the dependency-generator will
65+
trigger cache-invalidation and rebuilds as necessary.

ci/test/00_setup_env_arm.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ if [ -n "$QEMU_USER_CMD" ]; then
1818
fi
1919
export CONTAINER_NAME=ci_arm_linux
2020
# Use debian to avoid 404 apt errors when cross compiling
21-
export DOCKER_NAME_TAG="debian:focal"
2221
export CHECK_DOC=1
2322
export USE_BUSY_BOX=true
2423
export RUN_UNIT_TESTS=false

ci/test/00_setup_env_native_fuzz.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
export LC_ALL=C.UTF-8
88

9-
export DOCKER_NAME_TAG="ubuntu:20.04"
109
export CONTAINER_NAME=ci_native_fuzz
1110
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev"
1211
export DEP_OPTS="NO_UPNP=1 DEBUG=1"

ci/test/00_setup_env_native_fuzz_with_valgrind.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
export LC_ALL=C.UTF-8
88

9-
export DOCKER_NAME_TAG="ubuntu:20.04"
109
export CONTAINER_NAME=ci_native_fuzz_valgrind
1110
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev valgrind"
1211
export NO_DEPENDS=1

ci/test/00_setup_env_s390x.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ if [ -n "$QEMU_USER_CMD" ]; then
1818
fi
1919
# Use debian to avoid 404 apt errors
2020
export CONTAINER_NAME=ci_s390x
21-
export DOCKER_NAME_TAG="debian:focal"
2221
export RUN_UNIT_TESTS=true
2322
export RUN_FUNCTIONAL_TESTS=true
2423
export GOAL="install"

doc/bips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BIPs that are implemented by Bitcoin Core, some of them are relevant for Dash Core, some are just mentioned as a reference.
2-
Specified versions, PRs are relevant to Bitcoin's core.
2+
Versions and PRs are relevant to Bitcoin's core if not mentioned other.
33

44
* [`BIP 9`](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1** ([PR #7575](https://github.com/bitcoin/bitcoin/pull/7575))
55
* [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)).
@@ -38,7 +38,7 @@ Specified versions, PRs are relevant to Bitcoin's core.
3838
* [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
3939
* [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)).
4040
* [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): The 'addrv2' and 'sendaddrv2' messages which enable relay of Tor V3 addresses (and other networks) are supported as of **v18.0** ([PR 19954](https://github.com/bitcoin/bitcoin/pull/19954)).
41-
- [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **v18.0** ([PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)).
41+
* [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **Dash Core v18.0** ([PR dash#4314](https://github.com/dashpay/dash/pull/4314), [PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)).
4242
* [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): The `NODE_NETWORK_LIMITED` service bit is signalled as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)), and such nodes are connected to as of **v0.17.0** ([PR 10387](https://github.com/bitcoin/bitcoin/pull/10387)).
4343
* [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v18.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)).
4444
* [`BIP 339`](https://github.com/bitcoin/bips/blob/master/bip-0339.mediawiki): Relay of transactions by wtxid is supported as of **v0.21.0** ([PR 18044](https://github.com/bitcoin/bitcoin/pull/18044)).

doc/release-process.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Before every minor and major release:
2525
Before every major release:
2626

2727
* [ ] Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/dashpay/dash/pull/5692) for an example.
28-
* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `m_assumed_blockchain_size` and `m_assumed_chain_state_size` with the current size plus some overhead (see [this](#how-to-calculate-m_assumed_blockchain_size-and-m_assumed_chain_state_size) for information on how to calculate them).
29-
* [ ] Update `src/chainparams.cpp` `chainTxData` with statistics about the transaction count and rate. Use the output of the RPC `getchaintxstats`, see
28+
* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `m_assumed_blockchain_size` and `m_assumed_chain_state_size` with the current size plus some overhead (see [this](#how-to-calculate-assumed-blockchain-and-chain-state-size) for information on how to calculate them).
29+
* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `chainTxData` with statistics about the transaction count and rate. Use the output of the `getchaintxstats` RPC, see
3030
[this pull request](https://github.com/dashpay/dash/pull/5692) for an example. Reviewers can verify the results by running `getchaintxstats <window_block_count> <window_last_block_hash>` with the `window_block_count` and `window_last_block_hash` from your output.
3131

3232
### First time / New builders
@@ -269,13 +269,13 @@ checks. If the app is successfully notarized, the command line will include a li
269269
270270
### Additional information
271271
272-
#### How to calculate `m_assumed_blockchain_size` and `m_assumed_chain_state_size`
272+
#### <a name="how-to-calculate-assumed-blockchain-and-chain-state-size"></a>How to calculate `m_assumed_blockchain_size` and `m_assumed_chain_state_size`
273273
274274
Both variables are used as a guideline for how much space the user needs on their drive in total, not just strictly for the blockchain.
275275
Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value.
276276
277277
To calculate `m_assumed_blockchain_size`:
278-
- For `mainnet` -> Take the size of the Dash Core data directory, excluding `/regtest` and `/testnet3` directories.
278+
- For `mainnet` -> Take the size of the data directory, excluding `/regtest` and `/testnet3` directories.
279279
- For `testnet` -> Take the size of the `/testnet3` directory.
280280
281281

src/net_processing.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class PeerManagerImpl final : public PeerManager
240240
bool SendMessages(CNode* pto) override EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing);
241241

242242
/** Implement PeerManager */
243-
void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams) override;
243+
void CheckForStaleTipAndEvictPeers() override;
244244
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) override;
245245
bool IgnoresIncomingTxs() override { return m_ignore_incoming_txs; }
246246
void RelayTransaction(const uint256& txid) override;
@@ -1582,13 +1582,12 @@ PeerManagerImpl::PeerManagerImpl(const CChainParams& chainparams, CConnman& conn
15821582
m_ignore_incoming_txs(ignore_incoming_txs)
15831583
{
15841584
assert(std::addressof(g_chainman) == std::addressof(m_chainman));
1585-
const Consensus::Params& consensusParams = Params().GetConsensus();
15861585
// Stale tip checking and peer eviction are on two different timers, but we
15871586
// don't want them to get out of sync due to drift in the scheduler, so we
15881587
// combine them in one function and schedule at the quicker (peer-eviction)
15891588
// timer.
15901589
static_assert(EXTRA_PEER_CHECK_INTERVAL < STALE_CHECK_INTERVAL, "peer eviction timer should be less than stale tip check timer");
1591-
scheduler.scheduleEvery([this, consensusParams] { this->CheckForStaleTipAndEvictPeers(consensusParams); }, std::chrono::seconds{EXTRA_PEER_CHECK_INTERVAL});
1590+
scheduler.scheduleEvery([this] { this->CheckForStaleTipAndEvictPeers(); }, std::chrono::seconds{EXTRA_PEER_CHECK_INTERVAL});
15921591

15931592
// schedule next run for 10-15 minutes in the future
15941593
const std::chrono::milliseconds delta = std::chrono::minutes{10} + GetRandMillis(std::chrono::minutes{5});
@@ -1897,6 +1896,8 @@ void PeerManagerImpl::RelayTransaction(const uint256& txid)
18971896

18981897
static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman& connman)
18991898
{
1899+
if (!fReachable && !addr.IsRelayable()) return;
1900+
19001901
// Relay to a limited number of other nodes
19011902
// Use deterministic randomness to send to the same nodes for 24 hours
19021903
// at a time so the m_addr_knowns of the chosen nodes prevent repeats
@@ -4611,7 +4612,7 @@ void PeerManagerImpl::EvictExtraOutboundPeers(int64_t time_in_seconds)
46114612
}
46124613
}
46134614

4614-
void PeerManagerImpl::CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams)
4615+
void PeerManagerImpl::CheckForStaleTipAndEvictPeers()
46154616
{
46164617
LOCK(cs_main);
46174618

@@ -4655,7 +4656,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
46554656
{
46564657
assert(m_llmq_ctx);
46574658

4658-
const Consensus::Params& consensusParams = Params().GetConsensus();
4659+
const Consensus::Params& consensusParams = m_chainparams.GetConsensus();
46594660

46604661
// We must call MaybeDiscourageAndDisconnect first, to ensure that we'll
46614662
// disconnect misbehaving peers even before the version handshake is complete.

src/net_processing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PeerManager : public CValidationInterface, public NetEventsInterface
6868
* Evict extra outbound peers. If we think our tip may be stale, connect to an extra outbound.
6969
* Public for unit testing.
7070
*/
71-
virtual void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams) = 0;
71+
virtual void CheckForStaleTipAndEvictPeers() = 0;
7272

7373
/** Process a single message from a peer. Public for fuzz testing */
7474
virtual void ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv,

0 commit comments

Comments
 (0)