Skip to content

Commit adc9f79

Browse files
committed
Merge branch 'auxpow'
2 parents e720687 + 7488eda commit adc9f79

File tree

128 files changed

+1657
-651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1657
-651
lines changed

.travis.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ os: linux
1818
language: minimal
1919
arch: amd64
2020
cache:
21-
ccache: true
2221
directories:
2322
- $TRAVIS_BUILD_DIR/depends/built
2423
- $TRAVIS_BUILD_DIR/depends/sdk-sources
2524
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
2625
- $TRAVIS_BUILD_DIR/releases/$HOST
27-
before_cache:
28-
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
2926
stages:
3027
- lint
3128
- test
@@ -47,7 +44,7 @@ script:
4744
- if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long
4845
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
4946
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
50-
- if [ $SECONDS -gt 2000 ]; then export CONTINUE=0; fi # Likely the build took very long; The tests take about 1000s, so we should abort if we have less than 50*60-1000=2000s left
47+
- if [[ $SECONDS -gt 50*60-$EXPECTED_TESTS_DURATION_IN_SECONDS ]]; then export CONTINUE=0; fi
5148
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
5249
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
5350
after_script:
@@ -136,22 +133,12 @@ jobs:
136133
# Xcode 11.3.1, macOS 10.14, SDK 10.15
137134
# https://docs.travis-ci.com/user/reference/osx/#macos-version
138135
osx_image: xcode11.3
139-
cache:
140-
directories:
141-
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
142-
- $TRAVIS_BUILD_DIR/releases/$HOST
143-
- $HOME/Library/Caches/Homebrew
144-
- /usr/local/Homebrew
145136
addons:
146137
homebrew:
147138
packages:
148-
- libtool
149139
- berkeley-db4
150-
- boost
151140
- miniupnpc
152-
- qt
153141
- qrencode
154-
- python3
155142
- ccache
156143
- zeromq
157144
env: >-

CONTRIBUTING.md

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,28 @@ welcome to contribute towards development in the form of peer review, testing
66
and patches. This document explains the practical process and guidelines for
77
contributing.
88

9-
Firstly in terms of structure, there is no particular concept of "Core
9+
First, in terms of structure, there is no particular concept of "Bitcoin Core
1010
developers" in the sense of privileged people. Open source often naturally
11-
revolves around meritocracy where longer term contributors gain more trust from
12-
the developer community. However, some hierarchy is necessary for practical
13-
purposes. As such there are repository "maintainers" who are responsible for
14-
merging pull requests as well as a "lead maintainer" who is responsible for the
15-
release cycle, overall merging, moderation and appointment of maintainers.
11+
revolves around a meritocracy where contributors earn trust from the developer
12+
community over time. Nevertheless, some hierarchy is necessary for practical
13+
purposes. As such, there are repository "maintainers" who are responsible for
14+
merging pull requests, as well as a "lead maintainer" who is responsible for the
15+
release cycle as well as overall merging, moderation and appointment of
16+
maintainers.
1617

1718
Getting Started
1819
---------------
1920

2021
New contributors are very welcome and needed.
2122

22-
Reviewing and testing is the most effective way you can contribute as a new
23-
contributor, and it also will teach you much more about the code and process
24-
than opening PRs. Please refer to the section [peer review](#peer-review) later
25-
in this document.
23+
Reviewing and testing is highly valued and the most effective way you can contribute
24+
as a new contributor. It also will teach you much more about the code and
25+
process than opening pull requests. Please refer to the [peer review](#peer-review)
26+
section below.
2627

2728
Before you start contributing, familiarize yourself with the Bitcoin Core build
2829
system and tests. Refer to the documentation in the repository on how to build
29-
Bitcoin Core and how to run the unit and functional tests.
30+
Bitcoin Core and how to run the unit tests, functional tests, and fuzz tests.
3031

3132
There are many open issues of varying difficulty waiting to be fixed.
3233
If you're looking for somewhere to start contributing, check out the
@@ -62,7 +63,7 @@ history logs can be found
6263
on [http://www.erisian.com.au/bitcoin-core-dev/](http://www.erisian.com.au/bitcoin-core-dev/)
6364
and [http://gnusha.org/bitcoin-core-dev/](http://gnusha.org/bitcoin-core-dev/).
6465

65-
Discussion about code base improvements happens in GitHub issues and on pull
66+
Discussion about codebase improvements happens in GitHub issues and pull
6667
requests.
6768

6869
The developer
@@ -75,7 +76,7 @@ Contributor Workflow
7576
--------------------
7677

7778
The codebase is maintained using the "contributor workflow" where everyone
78-
without exception contributes patch proposals using "pull requests". This
79+
without exception contributes patch proposals using "pull requests" (PRs). This
7980
facilitates social contribution, easy testing and peer review.
8081

8182
To contribute a patch, the workflow is as follows:
@@ -113,6 +114,9 @@ In general, [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_comm
113114
and diffs should be easy to read. For this reason, do not mix any formatting
114115
fixes or code moves with actual code changes.
115116

117+
Make sure each individual commit is hygienic: that it builds successfully on its
118+
own without warnings, errors, regressions, or test failures.
119+
116120
Commit messages should be verbose by default consisting of a short subject line
117121
(50 chars max), a blank line and detailed explanatory text as separate
118122
paragraph(s), unless the title alone is self-explanatory (like "Corrected typo
@@ -124,7 +128,7 @@ If a particular commit references another issue, please add the reference. For
124128
example: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords
125129
will cause the corresponding issue to be closed when the pull request is merged.
126130

127-
Commit messages should never contain any `@` mentions.
131+
Commit messages should never contain any `@` mentions (usernames prefixed with "@").
128132

129133
Please refer to the [Git manual](https://git-scm.com/doc) for more information
130134
about Git.
@@ -158,10 +162,16 @@ Examples:
158162
qt: Add feed bump button
159163
log: Fix typo in log message
160164

161-
The body of the pull request should contain enough description about what the
162-
patch does together with any justification/reasoning. You should include
163-
references to any discussions (for example other tickets or mailing list
164-
discussions).
165+
The body of the pull request should contain sufficient description of *what* the
166+
patch does, and even more importantly, *why*, with justification and reasoning.
167+
You should include references to any discussions (for example, other issues or
168+
mailing list discussions).
169+
170+
The description for a new pull request should not contain any `@` mentions. The
171+
PR description will be included in the commit message when the PR is merged and
172+
any users mentioned in the description will be annoyingly notified each time a
173+
fork of Bitcoin Core copies the merge. Instead, make any username mentions in a
174+
subsequent comment to the PR.
165175

166176
### Translation changes
167177

@@ -197,13 +207,13 @@ before it will be merged. The basic squashing workflow is shown below.
197207
# Save and quit.
198208
git push -f # (force push to GitHub)
199209

200-
Please update the resulting commit message if needed. It should read as a
201-
coherent message. In most cases, this means that you should not just list the
202-
interim commits.
210+
Please update the resulting commit message, if needed. It should read as a
211+
coherent message. In most cases, this means not just listing the interim
212+
commits.
203213

204-
If you have problems with squashing (or other workflows with `git`), you can
205-
alternatively enable "Allow edits from maintainers" in the right GitHub
206-
sidebar and ask for help in the pull request.
214+
If you have problems with squashing or other git workflows, you can enable
215+
"Allow edits from maintainers" in the right-hand sidebar of the GitHub web
216+
interface and ask for help in the pull request.
207217

208218
Please refrain from creating several pull requests for the same change.
209219
Use the pull request that is already open (or was created earlier) to amend
@@ -287,8 +297,8 @@ In general, all pull requests must:
287297

288298
- Have a clear use case, fix a demonstrable bug or serve the greater good of
289299
the project (for example refactoring for modularisation);
290-
- Be well peer reviewed;
291-
- Have unit tests and functional tests where appropriate;
300+
- Be well peer-reviewed;
301+
- Have unit tests, functional tests, and fuzz tests, where appropriate;
292302
- Follow code style guidelines ([C++](doc/developer-notes.md), [functional tests](test/functional/README.md));
293303
- Not break the existing test suite;
294304
- Where bugs are fixed, where possible, there should be unit tests
@@ -315,7 +325,7 @@ spread out over GitHub, mailing list and IRC discussions).
315325
#### Conceptual Review
316326

317327
A review can be a conceptual review, where the reviewer leaves a comment
318-
* `Concept (N)ACK`, meaning "I do (not) agree in the general goal of this pull
328+
* `Concept (N)ACK`, meaning "I do (not) agree with the general goal of this pull
319329
request",
320330
* `Approach (N)ACK`, meaning `Concept ACK`, but "I do (not) agree with the
321331
approach of this change".
@@ -325,30 +335,28 @@ NACKs without accompanying reasoning may be disregarded.
325335

326336
#### Code Review
327337

328-
After conceptual agreement on the change, code review can be provided. It is
329-
starting with `ACK BRANCH_COMMIT`, where `BRANCH_COMMIT` is the top of the
330-
topic branch. The review is followed by a description of how the reviewer did
331-
the review. The following
332-
language is used within pull-request comments:
338+
After conceptual agreement on the change, code review can be provided. A review
339+
begins with `ACK BRANCH_COMMIT`, where `BRANCH_COMMIT` is the top of the PR
340+
branch, followed by a description of how the reviewer did the review. The
341+
following language is used within pull request comments:
333342

334-
- "I have tested the code", involving
335-
change-specific manual testing in addition to running the unit and functional
336-
tests, and in case it is not obvious how the manual testing was done, it should
337-
be described;
343+
- "I have tested the code", involving change-specific manual testing in
344+
addition to running the unit, functional, or fuzz tests, and in case it is
345+
not obvious how the manual testing was done, it should be described;
338346
- "I have not tested the code, but I have reviewed it and it looks
339347
OK, I agree it can be merged";
340-
- Nit refers to trivial, often non-blocking issues.
348+
- A "nit" refers to a trivial, often non-blocking issue.
341349

342350
Project maintainers reserve the right to weigh the opinions of peer reviewers
343-
using common sense judgement and also may weight based on meritocracy: Those
344-
that have demonstrated a deeper commitment and understanding towards the project
345-
(over time) or have clear domain expertise may naturally have more weight, as
346-
one would expect in all walks of life.
351+
using common sense judgement and may also weigh based on merit. Reviewers that
352+
have demonstrated a deeper commitment and understanding of the project over time
353+
or who have clear domain expertise may naturally have more weight, as one would
354+
expect in all walks of life.
347355

348-
Where a patch set affects consensus critical code, the bar will be set much
356+
Where a patch set affects consensus-critical code, the bar will be much
349357
higher in terms of discussion and peer review requirements, keeping in mind that
350358
mistakes could be very costly to the wider community. This includes refactoring
351-
of consensus critical code.
359+
of consensus-critical code.
352360

353361
Where a patch set proposes to change the Bitcoin consensus, it must have been
354362
discussed extensively on the mailing list and IRC, be accompanied by a widely
@@ -365,7 +373,7 @@ about:
365373

366374
- It may be because of a feature freeze due to an upcoming release. During this time,
367375
only bug fixes are taken into consideration. If your pull request is a new feature,
368-
it will not be prioritized until the release is over. Wait for release.
376+
it will not be prioritized until after the release. Wait for the release.
369377
- It may be because the changes you are suggesting do not appeal to people. Rather than
370378
nits and critique, which require effort and means they care enough to spend time on your
371379
contribution, thundering silence is a good sign of widespread (mild) dislike of a given change
@@ -375,16 +383,18 @@ about:
375383
[developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc.
376384
Identify and address any of the issues you find. Then ask e.g. on IRC if someone could give
377385
their opinion on the concept itself.
378-
- It may be because your code is too complex for all but a few people. And those people
386+
- It may be because your code is too complex for all but a few people, and those people
379387
may not have realized your pull request even exists. A great way to find people who
380388
are qualified and care about the code you are touching is the
381389
[Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply
382-
find the person touching the code you are touching before you and see if you can find
383-
them and give them a nudge. Don't be incessant about the nudging though.
390+
look up who last modified the code you are changing and see if you can find
391+
them and give them a nudge. Don't be incessant about the nudging, though.
384392
- Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request
385-
a look. If you think you've been waiting an unreasonably long amount of time (month+) for
386-
no particular reason (few lines changed, etc), this is totally fine. Try to return the favor
387-
when someone else is asking for feedback on their code, and universe balances out.
393+
a look. If you think you've been waiting for an unreasonably long time (say,
394+
more than a month) for no particular reason (a few lines changed, etc.),
395+
this is totally fine. Try to return the favor when someone else is asking
396+
for feedback on their code, and the universe balances out.
397+
- Remember that the best thing you can do while waiting is give review to others!
388398

389399

390400
Backporting
@@ -393,11 +403,11 @@ Backporting
393403
Security and bug fixes can be backported from `master` to release
394404
branches.
395405
If the backport is non-trivial, it may be appropriate to open an
396-
additional PR, to backport the change, only after the original PR
406+
additional PR to backport the change, but only after the original PR
397407
has been merged.
398408
Otherwise, backports will be done in batches and
399409
the maintainers will use the proper `Needs backport (...)` labels
400-
when needed (the original author does not need to worry).
410+
when needed (the original author does not need to worry about it).
401411

402412
A backport should contain the following metadata in the commit body:
403413

ci/test/00_setup_env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch}
3131
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
3232
# Whether to prefer BusyBox over GNU utilities
3333
export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
34+
3435
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
3536
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
3637
export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
3738
export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-}
3839
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
40+
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}
41+
3942
export CONTAINER_NAME=${CONTAINER_NAME:-ci_unnamed}
4043
export DOCKER_NAME_TAG=${DOCKER_NAME_TAG:-ubuntu:18.04}
4144
# Randomize test order.

ci/test/00_setup_env_mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export XCODE_BUILD_ID=11C505
1414
export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false
1616
export GOAL="deploy"
17-
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror"
17+
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-werror"

ci/test/00_setup_env_mac_host.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ export HOST=x86_64-apple-darwin16
1010
export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well)
1111
export PIP_PACKAGES="zmq"
1212
export GOAL="install"
13-
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror"
14-
export RUN_SECURITY_TESTS="true"
15-
# Run without depends
13+
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-werror"
1614
export NO_DEPENDS=1
1715
export OSX_SDK=""
16+
export CCACHE_SIZE=300M
17+
18+
export RUN_SECURITY_TESTS="true"
19+
if [ "$TRAVIS_REPO_SLUG" != "bitcoin/bitcoin" ]; then
20+
export RUN_FUNCTIONAL_TESTS="false"
21+
export EXPECTED_TESTS_DURATION_IN_SECONDS=200
22+
fi

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export PACKAGES="clang llvm libc++abi-dev libc++-dev python3-zmq"
1212
export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'"
1313
export TEST_RUNNER_EXTRA="--exclude feature_block --timeout-factor=4" # Increase timeout because sanitizers slow down. Low memory on Travis machines, exclude feature_block.
1414
export GOAL="install"
15-
export BITCOIN_CONFIG="--enable-zmq --with-gui=no CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=thread CC=clang CXX='clang++ -stdlib=libc++'"
15+
export BITCOIN_CONFIG="--enable-zmq --with-gui=no CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' CXXFLAGS='-g' --with-sanitizers=thread CC=clang CXX='clang++ -stdlib=libc++'"

ci/test/04_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then
1414
fi
1515

1616
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
17-
export PATH="/usr/local/opt/ccache/libexec:$PATH"
1817
${CI_RETRY_EXE} pip3 install $PIP_PACKAGES
1918
fi
2019

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,11 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
392392
AX_CHECK_COMPILE_FLAG([-Wall],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])
393393
AX_CHECK_COMPILE_FLAG([-Wextra],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"],,[[$CXXFLAG_WERROR]])
394394
AX_CHECK_COMPILE_FLAG([-Wgnu],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"],,[[$CXXFLAG_WERROR]])
395-
AX_CHECK_COMPILE_FLAG([-Wformat],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]])
395+
dnl some compilers will ignore -Wformat-security without -Wformat, so just combine the two here.
396+
AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"],,[[$CXXFLAG_WERROR]])
396397
AX_CHECK_COMPILE_FLAG([-Wvla],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
397398
AX_CHECK_COMPILE_FLAG([-Wshadow-field],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"],,[[$CXXFLAG_WERROR]])
398399
AX_CHECK_COMPILE_FLAG([-Wswitch],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wswitch"],,[[$CXXFLAG_WERROR]])
399-
AX_CHECK_COMPILE_FLAG([-Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]])
400400
AX_CHECK_COMPILE_FLAG([-Wthread-safety],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"],,[[$CXXFLAG_WERROR]])
401401
AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]])
402402
AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"],,[[$CXXFLAG_WERROR]])

0 commit comments

Comments
 (0)