Commit graph

28540 commits

Author SHA1 Message Date
MarcoFalke
fad4167871
test: Check that no versionbits are re-used
This allows to remove check that windows for the same bit are disjoint

This addresses https://github.com/bitcoin/bitcoin/pull/21377#discussion_r611492633
2021-04-17 10:40:43 +02:00
MarcoFalke
8e69370b15
Merge #21712: qa: Test default include_mempool value of gettxout
44dab423eb qa: Test default include_mempool value of gettxout (João Barbosa)

Pull request description:

  With the following diff the functional test would pass. Fix by testing the default value.

  ```diff
  --- a/src/rpc/blockchain.cpp
  +++ b/src/rpc/blockchain.cpp
  @@ -1142,7 +1142,7 @@ static RPCHelpMan gettxout()
       uint256 hash(ParseHashV(request.params[0], "txid"));
       int n = request.params[1].get_int();
       COutPoint out(hash, n);
  -    bool fMempool = true;
  +    bool fMempool = false;
       if (!request.params[2].isNull())
           fMempool = request.params[2].get_bool();
  ```

ACKs for top commit:
  MarcoFalke:
    cr ACK 44dab423eb

Tree-SHA512: 14db21b29d6b2c01d1d1278e18a0cf35d6ae566e33e45515d1fe2983dda94ad1ff6065c217601d283f9515cae39b57e981b62ac71ec2002de5359bd8a9e3efa9
2021-04-17 07:50:51 +02:00
João Barbosa
44dab423eb qa: Test default include_mempool value of gettxout 2021-04-16 23:44:49 +01:00
fanquake
585cbe2257
Merge #21695: Remove no longer used contrib/bitcoin-qt.pro from the repo
5f2be6e71e Remove no longer used contrib/bitcoin-qt.pro from the repo (Hennadii Stepanov)

Pull request description:

  From [IRC](http://www.erisian.com.au/bitcoin-core-dev/log-2021-04-15.html#l-209):
  > \<hebasto> wumpus: I cannot see any way how the `contrib/bitcoin-qt.pro` is used in the  translation process, neither in the main repo nor in https://github.com/bitcoin-core/bitcoin-maintainer-tools. Besides it looks outdated and unmaintained. May I ask you to confirm/deny my assumption?
  > \<wumpus> hebasto: it is not used for anything, it exists to be able to edit the qt forms in qt designer nothing more
  > \<wumpus> i'm not sure if it is even *necessary* for that, but it is why it is there
  > \<hebasto> wumpus: thanks, qt designer does not need *.pro file at all
  > \<hebasto> maybe qt creator does
  > \<wumpus> feel free to create a PR to remove it, best way to find out if someone wants to keep it, you are right it hasn't been updated in a long time
  > \<hebasto> ok
  > \<wumpus> fwiw, the only question i get about it ever is why it exists
  > \<hebasto> it was in use with `qmake` years ago (what I found digging into the repo history)
  > \<wumpus> yes, that was the original reason, but when we switched to automake it was kept around for use w/ qt's GUI tools
  > \<hebasto> I've noticed it in https://github.com/bitcoin/bitcoin/blame/master/doc/translation_process.md#L25
  > \<wumpus> what it says there is definitely not true anymore

ACKs for top commit:
  laanwj:
    ACK 5f2be6e71e
  jarolrod:
    ACK 5f2be6e71e

Tree-SHA512: 7c105612f28185097fee9e4108b162b4c8b07cc527f4438bdf5bcab08c65421ea301de8584d58770cd113fa871f6781daa8145bd6463278523449e28bfc49d06
2021-04-16 11:08:32 +08:00
Hennadii Stepanov
5f2be6e71e
Remove no longer used contrib/bitcoin-qt.pro from the repo 2021-04-15 15:39:42 +03:00
MarcoFalke
c6b30ccb2e
Merge #21630: fuzz: split FuzzedSock interface and implementation
549c82ad3a fuzz: use ConsumeBool() instead of !ConsumeBool() (Vasil Dimov)
29ae1c13a5 fuzz: split FuzzedSock interface and implementation (Vasil Dimov)
9668e43d8e fuzz: make FuzzedSock::Wait() sometimes simulate an occurred event (Vasil Dimov)
0c90ff1429 fuzz: set errno from FuzzedSock::Wait() if it simulates a failure (Vasil Dimov)
5198a02de4 style: remove extra white space (Vasil Dimov)

Pull request description:

  * split FuzzedSock interface and implementation
  * make FuzzedSock::Wait() sometimes simulate an occurred event
  * set errno from FuzzedSock::Wait() if it simulates a failure

  (this is a followup from https://github.com/bitcoin/bitcoin/pull/21617)

ACKs for top commit:
  practicalswift:
    cr ACK 549c82ad3a: patch looks correct and touches only `src/test/fuzz/`
  MarcoFalke:
    re-ACK 549c82ad3a only change is rebase 🎬

Tree-SHA512: 8ba965a8319074ad2ef840219c35c77e37cc79f00fb3926f20ccbf5f58e9616f5a3ac96434ad33996b47d292fa760d5d00a529001ac0d1d254262e5df93f616f
2021-04-15 10:48:39 +02:00
MarcoFalke
7cb0bcb681
Merge #21686: Speedy trial activation parameters for Taproot
f979b3237f Add mainnet and testnet taproot activation params (Andrew Chow)

Pull request description:

  Adds the activation parameters for taproot as specified in https://github.com/bitcoin/bips/pull/1104

ACKs for top commit:
  gmaxwell:
    utACK f979b3237f
  ajtowns:
    ACK f979b3237f
  instagibbs:
    ACK f979b32
  clarkmoody:
    ACK f979b32
  Sjors:
    ACK f979b3237f
  jonatack:
    utACK f979b3237f verified with the BIP draft

Tree-SHA512: f95538bcec46c36f9532a99fcf697b143083c25b2427dd578b88514add0a807371530c18f0a8ed040dc885ad6eca8234235e1d762f6f837eafc5daed856a9dcf
2021-04-15 10:19:02 +02:00
MarcoFalke
a5e756b74e
Merge #21676: test: Use mocktime to avoid intermittent failure in rpc_tests
fa40d6a1c4 test: Reset mocktime in the common setup (MarcoFalke)
fa78590a8f test: Use mocktime to avoid intermittent failure (MarcoFalke)

Pull request description:

  See https://github.com/bitcoin/bitcoin/pull/21602#discussion_r611176103

ACKs for top commit:
  jonatack:
    Code review ACK fa40d6a1c4
  jarolrod:
    ACK fa40d6a1c4

Tree-SHA512: 4967e006f3d2c4eb92f03c9086a6abe3190ad54755d251c30d20422c574bb1a154c06f3d5bcb0d4deaa3c4abfd3864d743b71d84897edd358e829bb42233ad12
2021-04-15 10:05:21 +02:00
Vasil Dimov
549c82ad3a
fuzz: use ConsumeBool() instead of !ConsumeBool()
The former is shorter and ends up with a "random" bool anyway.
2021-04-15 08:51:39 +02:00
Vasil Dimov
29ae1c13a5
fuzz: split FuzzedSock interface and implementation
Move the `FuzzedSock`'s implementation from `src/test/fuzz/util.h` to
`src/test/fuzz/util.cpp`.

A separate interface and implementation make the code more readable for
consumers who don't need to (better not) know the implementation
details.
2021-04-15 08:51:36 +02:00
Vasil Dimov
9668e43d8e
fuzz: make FuzzedSock::Wait() sometimes simulate an occurred event 2021-04-15 08:19:49 +02:00
Vasil Dimov
0c90ff1429
fuzz: set errno from FuzzedSock::Wait() if it simulates a failure 2021-04-15 08:19:48 +02:00
Vasil Dimov
5198a02de4
style: remove extra white space 2021-04-15 08:19:44 +02:00
MarcoFalke
9712f75746
Merge #21677: fuzz: Avoid use of low file descriptor ids (which may be in use) in FuzzedSock
6262182b3f Avoid use of low file descriptor ids (which may be in use) in FuzzedSock and StaticContentsSock (practicalswift)

Pull request description:

  Avoid use of low file descriptor ids (which may be in use) in `FuzzedSock`.

  Context: https://github.com/bitcoin/bitcoin/pull/21630/files#r610694541

ACKs for top commit:
  vasild:
    ACK 6262182b3f

Tree-SHA512: e622acb4d01446c3db01adbbbb779038be7247e13f3f4e72c614bc2880c3efd710fd3b189f87abb00f236fa5ddf91f4c215f420ca4eb08a97aaba31593254c3d
2021-04-15 08:02:22 +02:00
Andrew Chow
f979b3237f Add mainnet and testnet taproot activation params 2021-04-14 22:53:54 -04:00
fanquake
2cd834e6c0
Merge #21377: Speedy trial support for versionbits
ffe33dfbd4 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns)
f054f6bcd2 versionbits: simplify state transitions (Anthony Towns)
55ac5f568a versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns)
dd07e6da48 fuzz: test versionbits delayed activation (Anthony Towns)
dd85d5411c tests: test versionbits delayed activation (Anthony Towns)
73d4a70639 versionbits: Add support for delayed activation (Anthony Towns)
9e6b65f6fa tests: clean up versionbits test (Anthony Towns)
5932744450 tests: test ComputeBlockVersion for all deployments (Anthony Towns)
63879f0a47 tests: pull ComputeBlockVersion test into its own function (Anthony Towns)

Pull request description:

  BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html

  Edge cases are tested by fuzzing added in #21380.

ACKs for top commit:
  instagibbs:
    tACK ffe33dfbd4
  jnewbery:
    utACK ffe33dfbd4
  MarcoFalke:
    review ACK ffe33dfbd4 💈
  achow101:
    re-ACK ffe33dfbd4
  gmaxwell:
    ACK ffe33dfbd4
  benthecarman:
    ACK ffe33dfbd4
  Sjors:
    ACK ffe33dfbd4
  jonatack:
    Initial approach ACK ffe33dfbd4 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore.
  ariard:
    Code Review ACK ffe33df

Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 10:04:14 +08:00
fanquake
7fcf53f7b4
Merge #21672: doc: remove boostrap info from GUIX_COMMON_FLAGS doc
09b3e46848 doc: remove boostrap info from GUIX_COMMON_FLAGS doc (fanquake)

Pull request description:

  Passing `ADDITIONAL_GUIX_COMMON_FLAGS="--no-substitutes --bootstrap"` as suggested doesn't work:
  ```bash
        ...outputting in: '/bitcoin/guix-build-a1f0b8b62eb8/output/x86_64-linux-gnu'
            ...bind-mounted in container to: '/outdir-base/x86_64-linux-gnu'
  guix time-machine: error: bootstrap: unrecognized option
  ```

  and I think bootstrapping is more than covered in the preceding "Choose your security model" section.

ACKs for top commit:
  dongcarl:
    ACK 09b3e46848
  jarolrod:
    ACK 09b3e46848
  laanwj:
    Documentation review ACK 09b3e46848

Tree-SHA512: e533a0b925a2ec091884ec04313f56376b4e85f615c8853dd51840181493d61bd01fee1c019e34880c32d7896e4871ea77e63398ba02b022f614c03bb16531aa
2021-04-15 08:51:14 +08:00
practicalswift
6262182b3f Avoid use of low file descriptor ids (which may be in use) in FuzzedSock and StaticContentsSock 2021-04-14 22:21:17 +00:00
MarcoFalke
fa40d6a1c4
test: Reset mocktime in the common setup
Doing it there will reduce code bloat and also ensure no test can "forget" to reset it
2021-04-14 17:38:07 +02:00
MarcoFalke
773f8c1a7d
Merge #21678: test: Fix TestPotentialDeadLockDetected suppression
f2ef5a8afd test: Fix TSan suppression (Hennadii Stepanov)

Pull request description:

  This PR is a #21669 follow up, and fixes [locally running `make check`](https://github.com/bitcoin/bitcoin/pull/21669#issuecomment-819403540).

ACKs for top commit:
  MarcoFalke:
    cr ACK f2ef5a8afd

Tree-SHA512: bb0c4d1707c6194358d2e9abfed5aa8dd487e014199025fb89f6e5a66d774af041b46a03358a9a5412e1683675c05c42a3b719217d940412ee3fe1ed18a5274c
2021-04-14 16:51:30 +02:00
MarcoFalke
8c867ed4ec
Merge #21675: ci: Only cache depends/sdk-sources for macos/apk task in cirrus
11115c8ee5 ci: Only cache depends/sdk-sources for macos/apk task in cirrus (MarcoFalke)

Pull request description:

  Only macos needs the sdk-sources, so move it there (and remove it from showing up in the other tasks)

ACKs for top commit:
  hebasto:
    ACK 11115c8ee5

Tree-SHA512: 9e80e74016052e7b00314e191acc84c5e400bbf2e0d93ee7b1494b6be99e671cc326ddaa1fbded82f0912a9e338ad1891019dce78199b08c5180af42cb59729a
2021-04-14 16:43:00 +02:00
MarcoFalke
a12962ca89
Merge #21585: Fix assumeutxo crash due to truncated file
fa73ce6e65 Fix assumeutxo crash due to truncated file (MarcoFalke)

Pull request description:

ACKs for top commit:
  jamesob:
    ACK fa73ce6e65
  ryanofsky:
    Code review ACK fa73ce6e65. Easy fix. It seems like this could have been caught in review, though.

Tree-SHA512: 3a98687c386e3995114ddf0ad7194fadd9520989290681ef703b578e3ca21aee51eadfb83aa38a489bac13d12709ea137b9b184b08e5bfa2919cca177aab90be
2021-04-14 15:12:14 +02:00
W. J. van der Laan
03ecceedf6
Merge #260: Handle exceptions instead of crash
b8e5d0d3fe qt: Handle exceptions in SendCoinsDialog::sendButtonClicked slot (Hennadii Stepanov)
1ac2bc7ac0 qt: Handle exceptions in TransactionView::bumpFee slot (Hennadii Stepanov)
bc00e13bc8 qt: Handle exceptions in WalletModel::pollBalanceChanged slot (Hennadii Stepanov)
eb6156ba1b qt: Handle exceptions in BitcoinGUI::addWallet slot (Hennadii Stepanov)
f7e260a471 qt: Add GUIUtil::ExceptionSafeConnect function (Hennadii Stepanov)
64a8755af3 qt: Add BitcoinApplication::handleNonFatalException function (Hennadii Stepanov)
af7e365b15 qt: Make PACKAGE_BUGREPORT link clickable (Hennadii Stepanov)

Pull request description:

  This PR is an alternative to https://github.com/bitcoin/bitcoin/pull/18897, and is based on Russ' [idea](https://github.com/bitcoin/bitcoin/pull/18897#pullrequestreview-418703664):
  > IMO it would be nice to have a followup PR that eliminated the one-line forwarding methods ...

  Related issues
  - #91
  - https://github.com/bitcoin/bitcoin/issues/18643

  Qt docs: https://doc.qt.io/qt-5.12/exceptionsafety.html#exceptions-in-client-code

  With this PR the GUI handles the wallet-related exception, and:
  - display it to a user:

  ![Screenshot from 2021-04-01 02-55-59](https://user-images.githubusercontent.com/32963518/113226183-33ff8480-9298-11eb-8fe6-2168834ab09a.png)

  - prints a message to `stderr`:
  ```

  ************************
  EXCEPTION: 18NonFatalCheckError
  wallet/wallet.cpp:2677 (IsCurrentForAntiFeeSniping)
  Internal bug detected: '!chain.findBlock(block_hash, FoundBlock().time(block_time))'
  You may report this issue here: https://github.com/bitcoin/bitcoin/issues

  bitcoin in QPushButton->SendCoinsDialog

  ```

  - writes a message to the `debug.log`
  - and, if the exception is a non-fatal error, leaves the main window running.

ACKs for top commit:
  laanwj:
    Code review ACK b8e5d0d3fe
  ryanofsky:
    Code review ACK b8e5d0d3fe. This is great! I think more improvements are possible but implementation is very clean and I love how targeted each commit is. Changes since last review: adding more explanatory text, making links clickable, reorganizing.

Tree-SHA512: a9f2a2ee8e64b993b0dbc454edcbc39c68c8852abb5dc1feb58f601c0e0e8014dca81c72733aa3fb07b619c6f49b823ed20c7d79cc92088a3abe040ed2149727
2021-04-14 14:17:30 +02:00
Hennadii Stepanov
f2ef5a8afd
test: Fix TSan suppression
This change fixes locally running tests.
2021-04-14 13:27:48 +03:00
MarcoFalke
fa78590a8f
test: Use mocktime to avoid intermittent failure 2021-04-14 10:05:09 +02:00
MarcoFalke
b8e5bbdf93
Merge #21669: test: Remove spurious double lock tsan suppressions by bumping to clang-12
fadea0bf37 Revert "test: Add tsan supp for leveldb::DBImpl::DeleteObsoleteFiles" (MarcoFalke)
fadbd99885 test: Remove spurious double lock tsan suppressions by bumping to clang-12 (MarcoFalke)

Pull request description:

  The double lock warnings appeared in #19041, but they didn't make any sense. Also, our sync module would detect double locks, if there were any.

  Bumping to clang-12 allows us to remove the spurious suppressions needed to run the tests, so do that.

ACKs for top commit:
  practicalswift:
    cr ACK fadea0bf37 assuming CI passes and more specifically that newer Clang agrees that these TSan suppressions are no longer needed.

Tree-SHA512: c411221a4b74d0af6ca8d686639b4f40b41c15906ccbb6647e8d569d6ab088264faafe075e1ac9523d5c0024b85f15a597bb3eedc7f07d4f5816245f75cfc08b
2021-04-14 09:20:53 +02:00
MarcoFalke
11115c8ee5
ci: Only cache depends/sdk-sources for macos/apk task in cirrus 2021-04-14 09:15:42 +02:00
MarcoFalke
fadea0bf37
Revert "test: Add tsan supp for leveldb::DBImpl::DeleteObsoleteFiles"
I can no longer observe the need for this suppression.

This reverts commit fa1fc536bb.
2021-04-14 06:56:59 +02:00
fanquake
e7af2f35af
Merge #21666: Miscellaneous external signer changes
c8f469c6d5 external_signer: remove ExternalSignerException (fanquake)
9e0b199b97 external_signer: use const where appropriate (fanquake)
aaa4e5a45b wallet: remove CWallet::GetExternalSigner() (fanquake)
06a0673351 external_signer: remove ignore_errors from Enumerate() (fanquake)
8fdbb899b8 refactor: unify external wallet runtime errors (fanquake)
f4652bf125 refactor: add missing includes to external signer code (fanquake)
54569cc6d6 refactor: move all signer code inside ENABLE_EXTERNAL_SIGNER #ifdefs (fanquake)

Pull request description:

  These are a few followups after #21467.

ACKs for top commit:
  Sjors:
    tACK c8f469c6d5
  instagibbs:
    utACK c8f469c6d5

Tree-SHA512: 3d5ac5df81680075e71e0e4a7595c520d746c3e37f016cf168c1e10da15541ebb1595aecaf2c08575636e9ff77d499644cae53180232b7049cfae0b923106e4e
2021-04-14 10:08:26 +08:00
fanquake
09b3e46848
doc: remove boostrap info from GUIX_COMMON_FLAGS doc
Passing ADDITIONAL_GUIX_COMMON_FLAGS="--no-substitutes --bootstrap" as
suggested doesn't work:
```bash
      ...outputting in: '/bitcoin/guix-build-a1f0b8b62eb8/output/x86_64-linux-gnu'
          ...bind-mounted in container to: '/outdir-base/x86_64-linux-gnu'
guix time-machine: error: bootstrap: unrecognized option
```

and I think bootstrapping is more than covered in the preceding "Choose
your security model" section.
2021-04-14 09:08:38 +08:00
MarcoFalke
fadbd99885
test: Remove spurious double lock tsan suppressions by bumping to clang-12 2021-04-13 19:54:39 +02:00
MarcoFalke
a1f0b8b62e
Merge #21634: tests: Skip SQLite fsyncs while testing
41f891da50 tests: Skip SQLite fsyncs while testing (Andrew Chow)

Pull request description:

  Since we want tests to run quickly, and since tests do a lot more db operations than expected we expect to see in actual usage, we disable sqlite's syncing behavior to make db operations run much faster. This syncing behavior is necessary for normal operation as it helps guarantee that data won't become lost or corrupted, but in tests, we don't care about that.

  Fixes #21628

ACKs for top commit:
  vasild:
    ACK 41f891da50

Tree-SHA512: f36f969a182c622691ae5113573a3250e8d367437e83a1a9d3d2b55dd3a9cdf3c6474169a7bd271007bb9ce47f585aa7a6aeae6eebbaeb02d79409b02f47fd8b
2021-04-13 16:31:12 +02:00
fanquake
1f14130cb0
Merge #21575: refactor: Create blockstorage module
fadcd3f78e doc: Remove irrelevant link to GitHub (MarcoFalke)
fa121b628d blockstorage: [refactor] Use chainman reference where possible (MarcoFalke)
fa0c7d9ad2 move-only: Move *Disk functions to blockstorage (MarcoFalke)
fa91b2b2b3 move-only: Move AbortNode to shutdown (MarcoFalke)
fa413f07a1 move-only: Move ThreadImport to blockstorage (MarcoFalke)
faf843c07f refactor: Move load block thread into ChainstateManager (MarcoFalke)

Pull request description:

  This picks up the closed pull request #21030 and is the first step toward fixing #21220.

  The basic idea is to move all disk access into a separate module with benefits:
  * Breaking down the massive files init.cpp and validation.cpp into logical units
  * Creating a standalone-module to reduce the mental complexity
  * Pave the way to fix validation related circular dependencies
  * Pave the way to mock disk access for testing, especially where it is performance critical (like fuzzing)

ACKs for top commit:
  promag:
    Code review ACK fadcd3f78e, checked (almost) moved only changes. This is a nice tidy up change and doesn't change behavior. Easily reviewed commit by commit.
  jamesob:
    ACK fadcd3f78e ([`jamesob/ackr/21575.1.MarcoFalke.refactor_create_blocksto`](https://github.com/jamesob/bitcoin/tree/ackr/21575.1.MarcoFalke.refactor_create_blocksto))
  ryanofsky:
    Code review ACK fadcd3f78e. New organization makes sense, moves extraneous things outside of validation.cpp. PR is also easy to review with helpfully split up moveonly commits.

Tree-SHA512: 917996592b6d8f9998289d8cb2b1b78b23d1fdb3b07216c9caec1380df33baa09dc2c1e706da669d440b497e79c9c62a01ca20dc202df5ad974a75f3ef7a143b
2021-04-13 22:00:28 +08:00
fanquake
88331aa8a7
Merge #21633: refactor: add [[noreturn]] attribute where applicable
003929c0d5 refactor: add [[noreturn]] attribute where applicable (fanquake)

Pull request description:

  Similar to #10843. We could build with `-Wmissing-noreturn`, however that would also mean modifying something like `--suppress-external-warnings` to suppress warnings for leveldb, which I don't think we want to do. In any case, the functions where this is applicable are only added/removed very rarely.

ACKs for top commit:
  vasild:
    ACK 003929c0d5

Tree-SHA512: 33dfa6547d6b84f38a941f24d4c2effe8fde7b93dbc0b27a9309716420e4a879fdbe689d789fa5439d65f5f78292f89fd9dc1b61c97acf69316dfed954086705
2021-04-13 21:17:20 +08:00
fanquake
3aa4935db7
Merge #17934: doc: Use CONFIG_SITE variable instead of --prefix option
223b1ba7d9 doc: Use CONFIG_SITE instead of --prefix (Hennadii Stepanov)

Pull request description:

  The current examples of `--prefix=...` option usage to point `configure` script to appropriate `depends` directory is not [standard](https://www.gnu.org/prep/standards/html_node/Directory-Variables.html). This causes some [confusion](https://github.com/bitcoin/bitcoin/pull/16691) and a bit of inconvenience.

  Consider a CentOS 7 32 bit system. Packages `libdb4-devel`, `libdb4-cxx-devel`, `miniupnpc-devel` and `zeromq-devel` are unavailable from repos. After recommended build with depends:
  ```
  cd depends
  make
  cd ..
  ./autogen.sh
  ./configure --prefix=$PWD/depends/i686-pc-linux-gnu
  make
  ```
  a user is unable to `make install` compiled binaries neither locally (to `~/.local`) nor system-wide (to `/usr/local`) as `--prefix` is set already.

  Meanwhile, the standard approach with using [`config.site`](https://www.gnu.org/software/automake/manual/html_node/config_002esite.html) files allows both possibilities:

  ```
  cd depends
  make
  cd ..
  ./autogen.sh
  CONFIG_SITE=$PWD/depends/i686-pc-linux-gnu/share/config.site ./configure --prefix ~/.local
  make
  make install
  ```

  or

  ```
  CONFIG_SITE=$PWD/depends/i686-pc-linux-gnu/share/config.site ./configure
  make
  sudo make install  # install to /usr/local
  ```

  Moreover, this approach is used in [Gitian descriptors](https://github.com/bitcoin/bitcoin/tree/master/contrib/gitian-descriptors) already.

ACKs for top commit:
  practicalswift:
    ACK 223b1ba7d9: patch looks correct
  fanquake:
    ACK 223b1ba7d9

Tree-SHA512: 46d97924f0fc7e95ee4566737cf7c2ae805ca500e5c49af9aa99ecc3acede4b00329bc727a110aa1b62618dfbf5d1ca2234e736f16fbdf96d6ece5f821712f54
2021-04-13 21:16:04 +08:00
fanquake
c8f469c6d5
external_signer: remove ExternalSignerException
It's not clear why this need it's own exception class, as opposed to just
throwing std::runtime_error().
2021-04-13 20:09:34 +08:00
fanquake
9e0b199b97
external_signer: use const where appropriate 2021-04-13 20:09:34 +08:00
fanquake
aaa4e5a45b
wallet: remove CWallet::GetExternalSigner() 2021-04-13 20:09:33 +08:00
fanquake
06a0673351
external_signer: remove ignore_errors from Enumerate()
This is undocumented and unused.
2021-04-13 20:09:33 +08:00
fanquake
8fdbb899b8
refactor: unify external wallet runtime errors
Rather than 3 different messages that are confusing / leak
implementation details, use a single message, that is similar to other
wallet related messages. i.e:
"Compiled without sqlite support (required for descriptor wallets)".
2021-04-13 20:09:33 +08:00
fanquake
f4652bf125
refactor: add missing includes to external signer code 2021-04-13 20:09:33 +08:00
fanquake
54569cc6d6
refactor: move all signer code inside ENABLE_EXTERNAL_SIGNER #ifdefs 2021-04-13 20:09:33 +08:00
MarcoFalke
c1f480fb23
Merge #21653: ci: Fix previous releases cache order
fa4f0b301b ci: Fix previous releases cache order (MarcoFalke)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK fa4f0b301b

Tree-SHA512: 997e46e5432abb1f24c0762dab6366e173a8afd13a02d655691dbe8d6f532f4c5748e0874a7d158d7e171b2991ed2ce9cfc1982a5d9cd30d1dbb30f43452025d
2021-04-13 13:18:48 +02:00
fanquake
f0b457212f
Merge #21467: Move external signer out of wallet module
88d4d5ff2f rpc: add help for enumeratesigners and walletdisplayaddress (Sjors Provoost)
b0db187e5b ci: use --enable-external-signer instead of --with-boost-process (Sjors Provoost)
b54b2e7b1a Move external signer out of wallet module (Sjors Provoost)

Pull request description:

  In addition, this PR enables external signer testing on CI.

  This PR moves the ExternalSigner class and RPC methods out of the wallet module.

  The `enumeratesigners` RPC can be used without a wallet since #21417. With additional modifications external signers could be used without a wallet in general, e.g. via `signrawtransaction`.

  The `signerdisplayaddress` RPC is ranamed to `walletdisplayaddress` because it requires wallet context. A future `displayaddress` RPC call without wallet context could take a descriptor argument.

  This commit fixes a `rpc_help.py` failure when configured with `--disable-wallet`.

ACKs for top commit:
  ryanofsky:
    Code review ACK 88d4d5ff2f
  fanquake:
    ACK 88d4d5ff2f

Tree-SHA512: 3242a24e22313aed97eee32a520bfcb1c17495ba32a2b8e06a5e151e2611320e2da5ef35b572d84623af0a49a210d2f9377a2531250868d1a0ccf3e144352a97
2021-04-13 14:35:16 +08:00
MarcoFalke
1f50f0bb38
Merge #21631: i2p: always check the return value of Sock::Wait()
1c1467f51b i2p: cancel the Accept() method if waiting on the socket errors (Vasil Dimov)

Pull request description:

  If `Sock::Wait()` fails, then cancel the `Accept()` method.

  Not checking the return value may cause an uninitialized read a few lines below when we read the `occurred` variable.

  [Spotted](https://github.com/bitcoin/bitcoin/pull/21630#issuecomment-814765659) by MarcoFalke, thanks!

ACKs for top commit:
  laanwj:
    Code review ACK 1c1467f51b
  practicalswift:
    cr ACK 1c1467f51b: patch looks correct and agree with laanwj that `[[nodiscard]]` can be taken in a follow-up PR :)

Tree-SHA512: 57fa8a03a4e055999e23121cd9ed1566a585ece0cf68b74223d8c902804cb6890218c9356d60e0560ccacc6c8542a526356c226ebd48e7b299b4572be312d49b
2021-04-13 06:16:12 +02:00
fanquake
bd65a76b9d
Merge #21330: Deal with missing data in signature hashes more consistently
725d7ae049 Use PrecomputedTransactionData in signet check (Pieter Wuille)
497718b467 Treat amount<0 also as missing data for P2WPKH/P2WSH (Pieter Wuille)
3820090bd6 Make all SignatureChecker explicit about missing data (Pieter Wuille)
b77b0cc507 Add MissingDataBehavior and make TransactionSignatureChecker handle it (Pieter Wuille)

Pull request description:

  Currently we have 2 levels of potentially-missing data in the transaction signature hashes:
  * P2WPKH/P2WSH hashes need the spent amount
  * P2TR hashes need all spent outputs (amount + scriptPubKey)

  Missing amounts are treated as -1 (thus leading to unexpected signature failures), while missing outputs in P2TR validation cause assertion failure. This is hard to extend for signing support, and also quite ugly in general.

  In this PR, an explicit configuration option to {Mutable,}TransactionSignatureChecker is added (MissingDataBehavior enum class) to either select ASSERT_FAIL or FAIL. Validation code passes ASSERT_FAIL (as at validation time all data should always be passed, and anything else is a serious bug in the code), while signing code uses FAIL.

  The existence of the ASSERT_FAIL option is really just an abundance of caution. Always using FAIL should be just fine, but if there were for some reason a code path in consensus code was introduced that misses certain data, I think we prefer as assertion failure over silently introducing a consensus change.

  Potentially useful follow-ups (not for this PR, in my preference):
  * Having an explicit script validation error code for missing data.
  * Having a MissingDataBehavior::SUCCEED option as well, for use in script/sign.cpp DataFromTransaction (if a signature is present in a witness, and we don't have enough data to fully validate it, we should probably treat it as valid and not touch it).

ACKs for top commit:
  sanket1729:
    reACK 725d7ae049
  Sjors:
    ACK 725d7ae049
  achow101:
    re-ACK 725d7ae049
  benthecarman:
    ACK 725d7ae049
  fjahr:
    Code review ACK 725d7ae049

Tree-SHA512: d67dc51bae9ca7ef6eb9acccefd682529f397830f77d74cd305500a081ef55aede0e9fa380648c3a8dd4857aa7eeb1ab54fe808979d79db0784ac94ceb31b657
2021-04-13 10:24:31 +08:00
fanquake
003929c0d5
refactor: add [[noreturn]] attribute where applicable 2021-04-13 08:59:21 +08:00
fanquake
89b72ce045
Merge #21661: doc: Fix name of script guix-build
08151e19d9 doc: Fix name of script guix-build (Stephan Oeste)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK 08151e19d9
  jarolrod:
    ACK 08151e19d9

Tree-SHA512: 50e52f91b489db6616b5c9a993474bc1b8c196c3cac4fd5ded7c8fece5a7d72f85d9f566ee6a3df56a132a22a91dd72801ce849ec5e430a7850ff05abcab6b37
2021-04-13 08:16:14 +08:00
Andrew Chow
41f891da50 tests: Skip SQLite fsyncs while testing
Since we want tests to run quickly, and since tests do a lot more db
operations than expected we expect to see in actual usage, we disable
sqlite's syncing behavior to make db operations run much faster. This
syncing behavior is necessary for normal operation as it helps guarantee
that data won't become lost or corrupted, but in tests, we don't care
about that.
2021-04-12 19:29:03 -04:00
W. J. van der Laan
708517b2dd
Merge #21663: ci: Fix macOS brew install command
b7381552cd ci: Fix macOS brew install command (Hennadii Stepanov)

Pull request description:

  A solution for https://bintray.com shutdown.

  Details: https://github.com/Homebrew/discussions/discussions/691.

ACKs for top commit:
  jamesob:
    ACK b7381552cd

Tree-SHA512: 4570c297421ae66043348acbe2f1e50b000e700406b38bc813c80714d4f109c6cadecff571ecbd8c2f0094ebdc959486fc55022ba6545bd592683a421e9c0655
2021-04-12 23:32:03 +02:00