Skip to content

Sync with the main repo #72

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

Merged
merged 150 commits into from
Oct 28, 2021
Merged

Sync with the main repo #72

merged 150 commits into from
Oct 28, 2021

Conversation

jarolrod
Copy link
Member

@jarolrod jarolrod commented Oct 27, 2021

Sync with the main repo up to bitcoin/bitcoin@ab25ef8

Additionally, 749470f contains a patch to fix a conflict with d5f985e. The conflict is fixed by incorporating the new init implementation into the qml-gui.

Steps taken to sync:

git fetch https://github.com/bitcoin/bitcoin
git merge ab25ef8c7f767258d5fe44f53b35ad8bd51ed5cd

Parent commits:

git rev-parse 9dda9c059f04499cef594162697802734e57a3a4^@

fff306ef88cef6fcc36a057b9ff6a9aa628a6e95
ab25ef8c7f767258d5fe44f53b35ad8bd51ed5cd

GUIX hashes

e500c407b1410837bbfb6f28d1d66ba3b6d33b01f58b5140bb113a498cb393b5  guix-build-749470f8922b/output/aarch64-linux-gnu/SHA256SUMS.part
f1b19d896a20486ad04f9b18f7a82ff7889769e575aaa1b407d2a43f93a6a9c9  guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu-debug.tar.gz
23892dc54a0770585591003e0ffba2818a6aec072c4ccf2caa315f16f65c35a3  guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu.tar.gz
12f5f78e848aa15122b044184bc2695d80daa3631f7ee65750447258234271d0  guix-build-749470f8922b/output/arm-linux-gnueabihf/SHA256SUMS.part
bd51f782bb5878227a5f26292192d9f692ae3a9587ac7ea64c9a16daf1ec01d3  guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf-debug.tar.gz
acff596e1da4363bd0ae05903226671ea0185ab6a16c82cbcfd0528646ded544  guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf.tar.gz
c7add933db2c40298148cbfa32a20d8fe906126961464e667eb4edc3b9e69dfa  guix-build-749470f8922b/output/dist-archive/bitcoin-749470f8922b.tar.gz
4e019a40fb2b35d53d1659e52336e0c9252782a599353875b739acbc3623e1d1  guix-build-749470f8922b/output/powerpc64-linux-gnu/SHA256SUMS.part
951691c4407bdd7c1dd8cc33412c7fff5a22a03ae641bc38b5fd38d39955e647  guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu-debug.tar.gz
49b4b698f44daa9172e960c2fe50129a7f509440440840616ba9045674f9c988  guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu.tar.gz
b3217a6c6bc8e59a131f284c47c382acb22f0200711b1c03e9037aa92a770e75  guix-build-749470f8922b/output/powerpc64le-linux-gnu/SHA256SUMS.part
ddbf6e06b6327f975c8965b891b02395b024d071b9ddadfe9f3e55fc63398181  guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu-debug.tar.gz
6f6ba5bb233be11bff1f72ec22d6e4638944a1cea4fee30c955d7690c538092a  guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu.tar.gz
78eb5129a9bb5d420d627d63bec215c100f78a58fedde606254beb9b96a76fa2  guix-build-749470f8922b/output/riscv64-linux-gnu/SHA256SUMS.part
747a5a0c004b4667e5ef104c0f4bee0961b78eafb255bddd47857342ec07c03d  guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu-debug.tar.gz
ae5986254b5dc4767059e2d848b5fc20491d7edaf6e4e522128c27e6b6e432ff  guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu.tar.gz
fbed54369be2ef728681d56c5fedd0ae79e07aa883ef400b620cd068ec042c45  guix-build-749470f8922b/output/x86_64-apple-darwin19/SHA256SUMS.part
d902c9d8154ea94dc50cf8f1f04d721200fc3f27125ec060be77542e744b33e6  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.dmg
576a781bc79ff5d89976b452d8200b2771866e367c177c857662359eb429e867  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.tar.gz
9c66ded51b36995eeea3bd3b43117df734e65bf79815dbcf907f9e1c0d545a3d  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx64.tar.gz
64310924d2c9acf132855fb0e8a424a38012decd0942c87f0ad6b78e4f399a82  guix-build-749470f8922b/output/x86_64-linux-gnu/SHA256SUMS.part
29c8afef6b7339808dc33a79eb9405698481883a71c14a941035c2bc47d01e74  guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu-debug.tar.gz
b7a3c50491e614533af013140cc4e0a0c11875222ce5cc04b835289e0e209eb0  guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu.tar.gz
811e4d00f6910a7e10cf80a7d76db67d01bcad348bbee985d6d3544ffa35a5b4  guix-build-749470f8922b/output/x86_64-w64-mingw32/SHA256SUMS.part
409c7364ac642bde57cf524d4f2658f37285613863ec267e2eabb2f7174eeffc  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win-unsigned.tar.gz
d6ac5661c645b9ca1cb90b8c1665c9652387b608bd0f6525a5cf137678b51f7c  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-debug.zip
c064c750ce63ad3b0089743337843b122880714bc06e0a2bcb664c0ec90ba764  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-setup-unsigned.exe
12c2b54ec444c223a943728cc8e0923a1df0fda0f222c9a4fbe17d35e9622db2  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64.zip

Sjors and others added 30 commits February 17, 2021 16:35
wallet_multisig_descriptor_psbt.py is refactored in this commit. While
behavior doesn't change we do cleanup the way wallets are accessed
throughout the test as this is done a lot for the various signers
and their multisigs. We also get rid of some shallow methods and
instead inline them for improved readability.

descriptors.md is improved to be more explicit about which wallet
(ie the signer or multisig) is required for each step.
…plementations

Add separate init implementations instead of sharing existing bitcoind
and bitcoin-node ones, so they can start to be differentiated in
upcoming commits with node and wallet code no longer linked into the
bitcoin-gui binary and wallet code no longer linked into the
bitcoin-node binary.
Can be reviewed with --color-moved=dimmed-zebra
The block test was renamed from `p2p-fullblocks.py` to
`feature_block.py` in commit ca6523d (PR #11774).
This commit adds specific expected reject reasons for segwit blocks
sent to the node, that are independent of whether multiple script threads
are activated or not.
This commit adds specific expected reject reasons for segwit blocks
sent to the node, that are only showing up if one script threads
is used. For this reason, the node is started with the parameter
`-par=1`.
The helps for RPCs gettransaction, listtransactions, and
listsinceblock returned by TransactionDescriptionString()
state that the "trusted" boolean field is only present if the
transaction is trusted and safe to spend from.

The "trusted" boolean field is in fact returned by
WalletTxToJSON() when the transaction has 0 confirmations,
or negative confirmations, if conflicted, and it can be
true or false.

This commit updates TransactionDescriptionString() to a
more accurate description for "trusted" and updates the
existing line of test coverage to fail more helpfully.
… order

No behavior changes.

Before, we're always adding transactions to the "check later" queue if
they have any parents in the mempool. But there's no reason to do this
if all of its inputs are already available from mempoolDuplicate.
Instead, check for inputs, and only mark fDependsWait=true if the
parents haven't been processed yet.

Reduce the amount of "check later" transactions by looking at
ancestors before descendants. Do this by iterating through them in
ascending order by ancestor count. This works because a child will
always have more in-mempool ancestors than its parent.

We should never have any entries in the "check later" queue
after this commit.
Remove variables used for keeping track of mempool transactions for
which we haven't processed the parents yet. Since we're iterating in
topological order now, they're always unused.
UpdateCoins is an unnecessary dependency on validation. All we need to
do is add and remove coins to check inputs. We don't need the extra
logic for checking coinbases and handling TxUndos.

Also remove the wrapper function in validation.h which constructs a
throwaway TxUndo object before calling UpdateCoins because it is now
unused.
No transaction in the mempool should ever be a coinbase.

Since mempoolDuplicate's backend is the chainstate coins view, it should
always contain the coins available.
Removes check's dependency on validation.h
Co-authored-by: Luke Dashjr <luke_github1@dashjr.org>
Co-authored-by: 0xB10C <19157360+0xB10C@users.noreply.github.com>
Display the prevout in transaction inputs when calling getblock level 3
verbosity.

Co-authored-by: Luke Dashjr <luke_github1@dashjr.org>
Co-authored-by: 0xB10C <19157360+0xB10C@users.noreply.github.com>
laanwj and others added 19 commits October 22, 2021 16:12
…ching logic (stop on first match)

d047ed7 external_signer: improve fingerprint matching logic (stop on first match) (Sebastian Falbesoner)

Pull request description:

  The fingerprint matching logic in `ExternalSigner::SignTransaction` currently always iterates all inputs of a PSBT, even after a match has already been found. I guess the reason for that is not that it was not thought of, but rather the fact that breaking out of a nested loop is simply not possible (at least not without adding ugly constructs like gotos or extra state variables).
  This PR fixes this by using `std::any_of` from C++'s standard library, see http://www.cplusplus.com/reference/algorithm/any_of/

ACKs for top commit:
  lsilva01:
    Code Review ACK bitcoin/bitcoin@d047ed7
  Sjors:
    utACK d047ed7
  Zero-1729:
    crACK d047ed7
  mjdietzx:
    Code review ACK d047ed7
  hebasto:
    ACK d047ed7, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 447e7c0c6a5b5549a2c09d52e55ba4146302c1a06e4d96de11f6945d09f98c89129cba221202dff7e0718e01a83dd173b9f19b1f02b6be228978f3f6e35d8096
…escriptionString(), add coverage

66f6efc rpc: improve TransactionDescriptionString() "generated" help (Jon Atack)
296cfa3 test: add listtransactions/listsinceblock "trusted" coverage (Jon Atack)
d95913f rpc: fix "trusted" description in TransactionDescriptionString (Jon Atack)

Pull request description:

  The RPC gettransaction, listtransactions, and listsinceblock helps returned by `TransactionDescriptionString()` inform the user that the `trusted` boolean field is only present if the transaction is trusted and safe to spend from.

  The field is in fact returned by `WalletTxToJSON()` when the transaction has 0 confirmations (or negative confirmations, if conflicted), and it can be true or false.

  This patch fixes the help, adds test coverage, and touches up the help for the neighboring `generate` field.

ACKs for top commit:
  rajarshimaitra:
    tACK bitcoin/bitcoin@66f6efc
  theStack:
    Tested ACK 66f6efc

Tree-SHA512: 4c2127765b82780e07bbdbf519d27163d414d9f15598e01e02210f210e6009be344c84951d7274e747b1386991d4c3b082cd25aebe885fb8cf0b92d57178f68e
…or private

fa4ec1c Make GenTxid boolean constructor private (MarcoFalke)
faeb9a5 remove unused CTxMemPool::info(const uint256& txid) (MarcoFalke)

Pull request description:

  This boolean argument is either verbose (when used with a named arg) or unintuitive and dangerous (when used as a plain bool).

  Fix that by making the constructor private.

ACKs for top commit:
  laanwj:
    Code review ACK fa4ec1c
  jnewbery:
    Code review ACK fa4ec1c
  glozow:
    code review ACK fa4ec1c

Tree-SHA512: bf08ee09168885cfda71e5a01ec412b93964662a90dd9d91e75f7fdf2eaff7c21a95204d0e90b00438bfeab564d0aea66bdb9c0394ee7a05743e65a817159446
… code

58765a4 qt: Use only Qt translation primitives in GUI code (W. J. van der Laan)

Pull request description:

  Use `Object::tr`, `QT_TRANSLATE_NOOP`, and `QCoreApplication::translate` as appropriate instead of using `_()` which doesn't get picked up.

  Replaces bitcoin/bitcoin#22764

  Edit: I checked that the strings end up in the appropriate context in `bitcoin_en.ts` after `make translate`:
  - "Settings file could not be read" "Settings file could not be written" end up in `bitcoin-core`
  - "(press q to shutdown and continue later)" and "press q to shutdown" end up in `SplashScreen`

ACKs for top commit:
  hebasto:
    ACK 58765a4

Tree-SHA512: d0cc5901426c47d411d0fe75aac195b9684b51385f74c161da772dbf9f0977f7ad7a0976e17366f49b40718e9b6eb87c3e93306dc845f97adddbc47d00731742
Instead of using AddToWallet so that making a COutput will work,
directly add the transaction into wallet.mapWallet. This bypasses many
checks that AddToWallet will do which are pointless and just slow down
this test.
Default to SQLiteDatabase instead of BerkeleyDatabase for
CreateDummyWalletDatabase. Most tests already use descriptor wallets and
the mock db doesn't really matter for tests. The tests where it does
matter will make the db directly.
f778845 ci: Add vcpkg tools cache (Hennadii Stepanov)

Pull request description:

  On master (02feae5) vcpkg downloads some tools that are used internally:
  ```
  ...
    A suitable version of cmake was not found (required v3.20.0). Downloading portable cmake v3.20.0...
    Downloading cmake...
      https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-i386.zip -> C:\Users\ContainerAdministrator\AppData\Local\Temp\vcpkg\downloads\cmake-3.20.2-windows-i386.zip
    Extracting cmake...
    A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
    Downloading 7zip...
      https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\Users\ContainerAdministrator\AppData\Local\Temp\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg
    Extracting 7zip...
    A suitable version of nuget was not found (required v5.5.0). Downloading portable nuget v5.5.0...
    Downloading nuget...
      https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> C:\Users\ContainerAdministrator\AppData\Local\Temp\vcpkg\downloads\22ea847d-nuget.exe
    Detecting compiler hash for triplet x64-windows-static...
    A suitable version of powershell-core was not found (required v7.1.0). Downloading portable powershell-core v7.1.0...
    Downloading powershell-core...
      https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x86.zip -> C:\Users\ContainerAdministrator\AppData\Local\Temp\vcpkg\downloads\PowerShell-7.1.3-win-x86.zip
    Extracting powershell-core...
  ...
  ```

  If any of downloads above fails the whole CI task fails (see #23107). The most recent failure examples in the master branch:
  - bitcoin/bitcoin@c001da3, [log](https://api.cirrus-ci.com/v1/task/5182966176415744/logs/build.log)
  - bitcoin/bitcoin@12ff899, [log](https://api.cirrus-ci.com/v1/task/5367684129882112/logs/build.log)

  This PR adds vcpkg tools cache.

  Closes #23107.

  ---

  Note for reviewers. Some patches from the initial PR were split into separated PRs: #23310 and #23329. Therefore, a discussion here could be outdated or irrelevant until the recent [push](bitcoin/bitcoin#23215 (comment)).

ACKs for top commit:
  sipsorcery:
    ACK f778845.

Tree-SHA512: 201f4e4d38c00cbec6aaeca4f3e1b60f1c65289fb68b82cead47f37f6af5ac42dd539cf8ed3566f5bd9afe4a7762d42bbabb316d58f47352d4e7bfc2214806fe
a52f1d1 walletdb: Use SQLiteDatabase for mock wallet databases (Andrew Chow)
a78c229 tests: Place into mapWallet in coinselector_tests (Andrew Chow)

Pull request description:

  #23288 changed coinselector_tests to use `DescriptorScriptPubKeyMan`, but it also ended up significantly slowing down the test, from 4 seconds to over 1 minute. It appears that the source of this slow down is with `CWallet::AddToWallet`, and primarily due to writing data to the mock wallet database. Because the only thing that is actually needed is for the created transaction to be placed into `CWallet::mapWallet`, this PR removes the call to `AddToWallet` and just places the transaction into `mapWallet` directly. This reduces the test time to 5 seconds.

  To speed things up further, `CreateMockWalletDatabase` is changed to make a `SQLiteDatabase` instead of a `BerkeleyDatabase`. This is safe because there are no tests that require a specific mock database type.

ACKs for top commit:
  brunoerg:
    tACK a52f1d1
  lsilva01:
    tACK a52f1d1. Performed 74.36% better on Ubuntu 20.04 (VM, 12 MB, 8vCPU).
  glozow:
    utACK a52f1d1

Tree-SHA512: da77936bfd2e816d2e71703567b9389d0ee79f3a4a690802ffe3469df5bed371b296cb822b897f625654dab9436d91fd6bc02364a518a47d746e487d70a72595
…asons in p2p_segwit.py

45827fd test: check for block reject reasons in p2p_segwit.py [2/2] (Sebastian Falbesoner)
4eb532f test: check for block reject reasons in p2p_segwit.py [1/2] (Sebastian Falbesoner)
b1488c4 test: fix reference to block processing test in p2p_segwit.py (Sebastian Falbesoner)

Pull request description:

  In the test `p2p_segwit.py`, there are many instances where we send a segwit block to a node with the expectation that it is rejected. For this purpose, the helper function `test_witness_block` exists which allows also to check for a specific reject `reason` that is asserted in the debug log:
  https://github.com/bitcoin/bitcoin/blob/502d22ceed1f90ed41336260f8eb428d3acaf514/test/functional/p2p_segwit.py#L119-L120

  This PR aims to increase the precision of the tests by adding the expected reject reasons to all `test_witness_block` call instances (found via `grep`ing after `test_witness_block(.*accepted=False`). For some blocks that are rejected due to failed script verification, the exact reason is only shown in the debug log if parallel script verification is disabled. For this reason, the addition of the reasons is split up in two commits:
  * first, all instances are tackled that are not subject to script verification, i.e. it doesn't matter whether parallel script verification is enabled or not (e.g. `bad-blk-weight`, `bad-witness-merkle-match`...)
  * then, we explicitely set `-par=1` to only use one script thread, and add the remaining reasons (`non-mandatory-script-verify-flag` with the more specific reason in parantheses)

ACKs for top commit:
  stratospher:
    tested ACK 45827fd.

Tree-SHA512: 00f31867f11d48b38a42b1e79a1303bda1c797ccf3d8c73e6107d70b062604d51ee2a3f2251e7f068dfafdaf09469d27dfee438d9bc9ebaef7febc4b6ef90a95
…erformance of check() and remove dependency on validation

082c5bf [refactor] pass coinsview and height to check() (glozow)
ed6115f [mempool] simplify some check() logic (glozow)
9e8d7ad [validation/mempool] use Spend/AddCoin instead of UpdateCoins (glozow)
09d1891 MOVEONLY: remove single-use helper func CheckInputsAndUpdateCoins (glozow)
e8639ec [mempool] remove now-unnecessary code (glozow)
54c6f3c [mempool] speed up check() by using coins cache and iterating in topo order (glozow)
30e240f [bench] Benchmark CTxMemPool::check() (glozow)
cb14071 [refactor/bench] make mempool_stress bench reusable and parameterizable (glozow)

Pull request description:

  Remove the txmempool <-> validation circular dependency by removing txmempool's dependency on validation. There are two functions in txmempool that need validation right now: `check()` and `removeForReorg()`. This PR removes the dependencies in `check()`.

  This PR also improves the performance of `CTxMemPool::check()` by walking through the entries exactly once, in ascending ancestorcount order, which guarantees that we see parents before children.

ACKs for top commit:
  jnewbery:
    reACK 082c5bf
  GeneFerneau:
    tACK [082c5bf](bitcoin/bitcoin@082c5bf)
  rajarshimaitra:
    tACK bitcoin/bitcoin@082c5bf
  theStack:
    Code-review ACK 082c5bf

Tree-SHA512: 40ac622af1627b5c3e6abb4f0f035d833265a8c5e8dc88faf5354875dfb5137f137825e54bbd2a2668ed37b145c5d02285f776402629f58596e51853a9a79d29
…software

da791c7 wallet: Use PACKAGE_NAME to mention our software (Hennadii Stepanov)

Pull request description:

  This PR replaces "bitcoin" and "bitcoind" with `PACKAGE_NAME` in wallet log and error messages.

ACKs for top commit:
  jonatack:
    ACK da791c7
  lsilva01:
    Tested ACK da791c7 on Ubuntu 20.04.
  brunoerg:
    tACK da791c7
  stratospher:
    Tested ACK da791c7
  shaavan:
    ACK da791c7

Tree-SHA512: c613446d9c8c3f85e6f5fec77382c9bc17746a853c89e72e1a3a79bf355d7bd9e455bbde8f9e02a894d225a67029c732cdc68ec8c58ac8237dde27d39dae8be7
… the legacy wallet

e9ade03 tests: Add feature_segwit.py --descriptors to test_runner.py (Andrew Chow)
ae6cbcc tests: restrict feature_segwit legacy wallet import tests (Andrew Chow)
1d13c44 tests: Use descriptors for feature_segwit multisig setup (Andrew Chow)

Pull request description:

  `feature_segwit.py` has tests for some legacy wallet behavior, but otherwise does not really need the legacy wallet. Those parts now require `--legacy-wallet` to be provided (as with other legacy wallet tests). Other parts of the test are changed to work with descriptor wallets as well.

ACKs for top commit:
  lsilva01:
    tACK e9ade03

Tree-SHA512: 4ae76a4d2a8d318e7f8ad4c984748e3cdd67ed00359fcd798a08492ed9399b1d01be88c9ebea3d6c996fbe190cf41708a15c98f088f0cb5c47d6d00fff258944
92617b7 Make AddrMan support multiple ports per IP (Pieter Wuille)

Pull request description:

  For a long part of Bitcoin's history, this codebase has aggressively avoided making automatic connections to anything but nodes running on port 8333. I'd like to propose changing that, and this is a first PR necessary for that.

  The folklore justification (eventually actually added as a comment to the codebase in #20668) is that this is to prevent the Bitcoin P2P network from being leveraged to perform a DoS attack on other services, if their IP/port would get rumoured. It appears, at least the current network scale - and probably significantly larger - that the impact is very low at best (see calculations by vasild in bitcoin/bitcoin#5150 (comment) e.g.). Another possible justification would be a risk that treating different IP:port combinations separately would help perform Eclipse attacks (by an attacker rumouring their own IP with many ports). This concern is (a) no different than what is possible with IPv6 (where large ranges of IP addresses are very cheaply available), and (b) already hopefully sufficiently addressed by addrman's design (which limits access through based selected based on network groups).

  And this policy has downsides too; in particular, a fixed port is easy to detect, and a very obvious sign a Bitcoin node is running there.

  One obstacle in moving away from a default port that is the fact that addrman is currently restricted to a single entry per IP address. If ports are no longer expected to be generally always the default one, we need to deal with the case where conflicting information is relayed. It turns out there is a very natural solution to this: treat (IP,port) combination exactly as we're treating IPs now; this automatically means that the same IP may appear with multiple ports, simply because those would be distinct entries. Given that indexing into addrman's bucket _already_ uses the port number, the only change required is making all addrman lookup be (IP,port) (aka `CService`) based, rather than IP (aka `CNetAddr`) based.

  This PR doesn't include any change to the actual outbound connection preference logic, as perhaps that's something that we want to phase in more gradually.

ACKs for top commit:
  jnewbery:
    Code review ACK 92617b7
  naumenkogs:
    ACK 92617b7
  ajtowns:
    ACK 92617b7
  vasild:
    ACK 92617b7

Tree-SHA512: 9eef06ce97a8b54a3f05fb8acf6941f253a9a5e0be8ce383dd05c44bb567cea243b74ee5667178e7497f6df2db93adab97ac66edbc37c883fd8ec840ee69a33f
fa8fef6 doc: Fix CWalletTx::Confirmation doc (MarcoFalke)

Pull request description:

  Follow-up to:
  * commit 700c42b, which replaced pIndex
    with block_hash in AddToWalletIfInvolvingMe.

  * commit 9700fcb, which replaced
    posInBlock with confirm.nIndex.

ACKs for top commit:
  laanwj:
    Code review ACK fa8fef6
  ryanofsky:
    Code review ACK fa8fef6

Tree-SHA512: e7643b8e9200b8ebab3eda30435ad77006568a03476006013c9ac42c826c84e42e29bcdefc6f443fe4d55e76e903bfed5aa7a51f831665001c204634b6f06508
…in-qt, bitcoin-wallet init implementations

d5f985e multiprocess: Add new bitcoin-gui, bitcoin-qt, bitcoin-wallet init implementations (Russell Yanofsky)

Pull request description:

  Add separate `interfaces::Init` subclasses for `bitcoin-wallet`,  `bitcoin-gui`, and `bitcoin-qt` binaries instead of sharing `bitcoind` and `bitcoin-node` init subclasses in different binaries. After this, the new init subclasses can be customized in #10102, so node and wallet code is dropped from the `bitcoin-gui` binary and wallet code is dropped from into the `bitcoin-node` binary.

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

ACKs for top commit:
  lsilva01:
    reACK d5f985e
  hebasto:
    re-ACK d5f985e, only suggested changes since my [previous](bitcoin/bitcoin#23006 (review)) review.

Tree-SHA512: 6784210bd9ce3a6fbc66852680d0e9bc513c072dc538aeb7f48cb6a41580d3f567ccef04f975ee767a714a4b05d4d87273e94a79abda1b9c25d5ac4bbe752006
… for creating bare multisig scripts

4718897 test: add script_util helper for creating bare multisig scripts (Sebastian Falbesoner)

Pull request description:

  This PR is a follow-up to #22363 and #23118 and introduces a helper `keys_to_multisig_script` for creating bare multisig outputs in the form of
  ```
  OP_K PubKey1 PubKey2 ... PubKeyN OP_N OP_CHECKMULTISIG
  ```
  The function takes a list of pubkeys (both hex- and byte-strings are accepted due to the `script_util.check_key` helper being used internally) and optionally a threshold _k_. If no threshold is passed, a n-of-n multisig output is created, with _n_ being the number of passed pubkeys.

ACKs for top commit:
  shaavan:
    utACK 4718897
  rajarshimaitra:
    tACK bitcoin/bitcoin@4718897

Tree-SHA512: b452d8a75b0d17316b66ac4ed4c6893fe59c7c417719931d4cd3955161f59afca43503cd09b83a35b5a252a122eb3f0fbb9da9f0e7c944cf8da572a02219ed9d
@hebasto
Copy link
Member

hebasto commented Oct 27, 2021

Suggesting to add another commit:

--- a/src/qml/bitcoin.cpp
+++ b/src/qml/bitcoin.cpp
@@ -9,7 +9,6 @@
 #include <interfaces/init.h>
 #include <interfaces/node.h>
 #include <logging.h>
-#include <node/context.h>
 #include <node/ui_interface.h>
 #include <noui.h>
 #include <qml/imageprovider.h>
@@ -102,15 +101,12 @@ int QmlGuiMain(int argc, char* argv[])
 
     auto handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect(InitErrorMessageBox);
 
-    NodeContext node_context;
-    int unused_exit_status;
-    std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node_context, argc, argv, unused_exit_status);
+    std::unique_ptr<interfaces::Init> init = interfaces::MakeGuiInit(argc, argv);
 
     SetupEnvironment();
     util::ThreadSetInternalName("main");
 
     /// Parse command-line options. We do this after qt in order to show an error if there are problems parsing these.
-    node_context.args = &gArgs;
     SetupServerArgs(gArgs);
     SetupUIArgs(gArgs);
     std::string error;

to adjust changes from bitcoin/bitcoin@d5f985e

@jarolrod
Copy link
Member Author

updated from 9dda9c0 -> 52a5e3f

Changes:

@hebasto
Copy link
Member

hebasto commented Oct 27, 2021

updated from 9dda9c0 -> 52a5e3f

Changes:

* apply @hebasto [patch](https://github.com/bitcoin-core/gui-qml/pull/72#issuecomment-953184272) to fix sync conflict, thanks!

nit: #include <node/context.h> is really not required now 🐅

This incorporates the new bitcoin-qt init implementation into the
qml-gui.
@jarolrod
Copy link
Member Author

updated from 52a5e3f -> 749470f

changes:

@hebasto
Copy link
Member

hebasto commented Oct 27, 2021

Guix builds:

$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
e500c407b1410837bbfb6f28d1d66ba3b6d33b01f58b5140bb113a498cb393b5  guix-build-749470f8922b/output/aarch64-linux-gnu/SHA256SUMS.part
f1b19d896a20486ad04f9b18f7a82ff7889769e575aaa1b407d2a43f93a6a9c9  guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu-debug.tar.gz
23892dc54a0770585591003e0ffba2818a6aec072c4ccf2caa315f16f65c35a3  guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu.tar.gz
12f5f78e848aa15122b044184bc2695d80daa3631f7ee65750447258234271d0  guix-build-749470f8922b/output/arm-linux-gnueabihf/SHA256SUMS.part
bd51f782bb5878227a5f26292192d9f692ae3a9587ac7ea64c9a16daf1ec01d3  guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf-debug.tar.gz
acff596e1da4363bd0ae05903226671ea0185ab6a16c82cbcfd0528646ded544  guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf.tar.gz
c7add933db2c40298148cbfa32a20d8fe906126961464e667eb4edc3b9e69dfa  guix-build-749470f8922b/output/dist-archive/bitcoin-749470f8922b.tar.gz
4e019a40fb2b35d53d1659e52336e0c9252782a599353875b739acbc3623e1d1  guix-build-749470f8922b/output/powerpc64-linux-gnu/SHA256SUMS.part
951691c4407bdd7c1dd8cc33412c7fff5a22a03ae641bc38b5fd38d39955e647  guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu-debug.tar.gz
49b4b698f44daa9172e960c2fe50129a7f509440440840616ba9045674f9c988  guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu.tar.gz
b3217a6c6bc8e59a131f284c47c382acb22f0200711b1c03e9037aa92a770e75  guix-build-749470f8922b/output/powerpc64le-linux-gnu/SHA256SUMS.part
ddbf6e06b6327f975c8965b891b02395b024d071b9ddadfe9f3e55fc63398181  guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu-debug.tar.gz
6f6ba5bb233be11bff1f72ec22d6e4638944a1cea4fee30c955d7690c538092a  guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu.tar.gz
78eb5129a9bb5d420d627d63bec215c100f78a58fedde606254beb9b96a76fa2  guix-build-749470f8922b/output/riscv64-linux-gnu/SHA256SUMS.part
747a5a0c004b4667e5ef104c0f4bee0961b78eafb255bddd47857342ec07c03d  guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu-debug.tar.gz
ae5986254b5dc4767059e2d848b5fc20491d7edaf6e4e522128c27e6b6e432ff  guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu.tar.gz
fbed54369be2ef728681d56c5fedd0ae79e07aa883ef400b620cd068ec042c45  guix-build-749470f8922b/output/x86_64-apple-darwin19/SHA256SUMS.part
d902c9d8154ea94dc50cf8f1f04d721200fc3f27125ec060be77542e744b33e6  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.dmg
576a781bc79ff5d89976b452d8200b2771866e367c177c857662359eb429e867  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.tar.gz
9c66ded51b36995eeea3bd3b43117df734e65bf79815dbcf907f9e1c0d545a3d  guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx64.tar.gz
64310924d2c9acf132855fb0e8a424a38012decd0942c87f0ad6b78e4f399a82  guix-build-749470f8922b/output/x86_64-linux-gnu/SHA256SUMS.part
29c8afef6b7339808dc33a79eb9405698481883a71c14a941035c2bc47d01e74  guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu-debug.tar.gz
b7a3c50491e614533af013140cc4e0a0c11875222ce5cc04b835289e0e209eb0  guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu.tar.gz
811e4d00f6910a7e10cf80a7d76db67d01bcad348bbee985d6d3544ffa35a5b4  guix-build-749470f8922b/output/x86_64-w64-mingw32/SHA256SUMS.part
409c7364ac642bde57cf524d4f2658f37285613863ec267e2eabb2f7174eeffc  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win-unsigned.tar.gz
d6ac5661c645b9ca1cb90b8c1665c9652387b608bd0f6525a5cf137678b51f7c  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-debug.zip
c064c750ce63ad3b0089743337843b122880714bc06e0a2bcb664c0ec90ba764  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-setup-unsigned.exe
12c2b54ec444c223a943728cc8e0923a1df0fda0f222c9a4fbe17d35e9622db2  guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64.zip

@hebasto
Copy link
Member

hebasto commented Oct 28, 2021

ACK 749470f

@hebasto hebasto merged commit 72d82c7 into bitcoin-core:main Oct 28, 2021
@jarolrod jarolrod deleted the upstream-sync branch October 28, 2021 22:24
hebasto added a commit that referenced this pull request Dec 2, 2021
Pull request description:

  Sync with the main repo up to bitcoin/bitcoin@c9d7d0a

  To reproduce:

  1) There are merge conflicts. To remedy this, the following commits from the following PR's must be reverted. They have been reverted from newest to oldest as listed:

  ```
  - PR #82 (Nov 12)
    - 83f1893
    - 0f5d210
  - PR #79 (Nov 5)
    - 011fcff
  - PR #69 (Nov 4)
    - 1bf3d5d
  - PR #77 (Nov 3)
    - 7dc95a0
    - 48fb724
  - PR #67 (Nov 3)
    - 61668e9
    - 37cfe4e
    - 5b00612
  - PR #65 (Oct 30)
    - 500a6d2
  - PR #74 (Oct 29)
    - 319db69
  - PR #72 (Oct 27)
    - 749470f
  - PR #55 (Oct 10)
    - a13a868
  - PR #45 (Oct 3)
    - 5ce77ad
  - PR #44 (Oct 3)
    - 6521cb8
  - PR #30 (Aug 30)
    - 3a0f948
    - f17a32a
  - PR #19 (Aug 19)
    - 8793ae7
    - 3ddb9b3
    - e61d42d
  ```

  2) Fetch the upstream commit
  ```
  git fetch https://github.com/bitcoin/bitcoin
  git merge c9d7d0a
  ```

  3) Cherry-pick back the reverted commits from oldest to newest. Note that I have left out 48fb724 and 3ddb9b3 from cherry-picking back in as it is unnecessary and leads to a cleaner commit history.

  ## GUIX HASHES
  ```
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

  6a9def1ba270b4e987c44194bf2704899da603fb25860063fc5ff22ee3b2168b  guix-build-ef99bc925033/output/aarch64-linux-gnu/SHA256SUMS.part
  a5750927e2d5a9086ae70b0279e6d06a48602b1b7b535fe2d1f743d0d320c1b6  guix-build-ef99bc925033/output/aarch64-linux-gnu/bitcoin-ef99bc925033-aarch64-linux-gnu-debug.tar.gz
  ec1a7e9750df2d00dbb420842ef17813e6f825d06e2122be031c6daf977a9714  guix-build-ef99bc925033/output/aarch64-linux-gnu/bitcoin-ef99bc925033-aarch64-linux-gnu.tar.gz
  74aa6e3330956e0d4445c2989056fa807e3dba9a35ec2b38b84c48c0f9bd3efb  guix-build-ef99bc925033/output/arm-linux-gnueabihf/SHA256SUMS.part
  1c1db52f0bcf91e8c27b150e4c9de3cd235d565e3cdb499dfec8433b4da2119a  guix-build-ef99bc925033/output/arm-linux-gnueabihf/bitcoin-ef99bc925033-arm-linux-gnueabihf-debug.tar.gz
  9bb58c56527c28b1730dadbf9b169527e056161e30a7cf758b53fdb565f98cdb  guix-build-ef99bc925033/output/arm-linux-gnueabihf/bitcoin-ef99bc925033-arm-linux-gnueabihf.tar.gz
  325a29527468d7a5686dbcd31602cbae01a41f6cd324680df311815d976f9ca2  guix-build-ef99bc925033/output/dist-archive/bitcoin-ef99bc925033.tar.gz
  6e2adbd2a9298f335332b1661e813c9a208a76ad45a37244791756d3296b278d  guix-build-ef99bc925033/output/powerpc64-linux-gnu/SHA256SUMS.part
  e1402abb77216fe1325625404ca8c909b8229f96f58154828c04bb7f699eb9e9  guix-build-ef99bc925033/output/powerpc64-linux-gnu/bitcoin-ef99bc925033-powerpc64-linux-gnu-debug.tar.gz
  080ef0d1b1361fbb2354e24d100a49f63ed914afccc69792edd4674ba7d02bb0  guix-build-ef99bc925033/output/powerpc64-linux-gnu/bitcoin-ef99bc925033-powerpc64-linux-gnu.tar.gz
  e6fb710af41df7be3ae6029ef1114707e0516d551beae0a9928c9de84a025563  guix-build-ef99bc925033/output/powerpc64le-linux-gnu/SHA256SUMS.part
  3bb370f79e6fb55ff50ea8db3b49ed7303fce2b9e49af6d0722821b049bfcee4  guix-build-ef99bc925033/output/powerpc64le-linux-gnu/bitcoin-ef99bc925033-powerpc64le-linux-gnu-debug.tar.gz
  1ed30ff64eacab08f724e521266784ae21c6ff879cbde7baad21a4b6ceb8ef82  guix-build-ef99bc925033/output/powerpc64le-linux-gnu/bitcoin-ef99bc925033-powerpc64le-linux-gnu.tar.gz
  dadebd336d5a359105bc4f757f60eba7651ed068a0a8d196ca7a18fa22e692c7  guix-build-ef99bc925033/output/riscv64-linux-gnu/SHA256SUMS.part
  208082743c43c37cb6907fe60ddea1909271204188763ee7b214673558f3c18e  guix-build-ef99bc925033/output/riscv64-linux-gnu/bitcoin-ef99bc925033-riscv64-linux-gnu-debug.tar.gz
  a28abc53c3a6cf7ddbd7177e3aae5a4636301c2fb18a0a361cb05d98ef23ea68  guix-build-ef99bc925033/output/riscv64-linux-gnu/bitcoin-ef99bc925033-riscv64-linux-gnu.tar.gz
  6f3c8b2fc3fa4638d8adf08f53dce07a9d96a2ef01db1df74ef53799f804ddb2  guix-build-ef99bc925033/output/x86_64-apple-darwin19/SHA256SUMS.part
  46160e6460bd1dfd8943f48199daacf58f8e8249edc3757ab681978d72490db9  guix-build-ef99bc925033/output/x86_64-apple-darwin19/bitcoin-ef99bc925033-osx-unsigned.dmg
  75f45e27858931ee91201962d1ffa8cf7998da3c962c672403ac8f8888bda7f2  guix-build-ef99bc925033/output/x86_64-apple-darwin19/bitcoin-ef99bc925033-osx-unsigned.tar.gz
  ee466fca21a6353d2aa6e85be5ac14192ce71430f87c54e8c406398fdeedd73f  guix-build-ef99bc925033/output/x86_64-apple-darwin19/bitcoin-ef99bc925033-osx64.tar.gz
  44de818d70a295fcd8488142b76a893cd94126ee3aa69d0bfc02096231cfac8c  guix-build-ef99bc925033/output/x86_64-linux-gnu/SHA256SUMS.part
  bb2bc967836cf11bf0412ecc64c1cfbd4076199ac1c1a828919a11802bbd9a4c  guix-build-ef99bc925033/output/x86_64-linux-gnu/bitcoin-ef99bc925033-x86_64-linux-gnu-debug.tar.gz
  52942d2ba01535b645c6d0460f074a6d683896082fe81b2f31addfc425a631a6  guix-build-ef99bc925033/output/x86_64-linux-gnu/bitcoin-ef99bc925033-x86_64-linux-gnu.tar.gz
  e437ff82adb1ac30ca9a27bd1732d14f9b17bfa2c9f017aeccadd19685daaf95  guix-build-ef99bc925033/output/x86_64-w64-mingw32/SHA256SUMS.part
  c4d2ed7580949cc6d4207b57429651a46cc023381b81408adfe4337f360c2be6  guix-build-ef99bc925033/output/x86_64-w64-mingw32/bitcoin-ef99bc925033-win-unsigned.tar.gz
  e5116106e634d0e1d6a7f509c645de81d19bd7b91243d94a6f90d893ca141016  guix-build-ef99bc925033/output/x86_64-w64-mingw32/bitcoin-ef99bc925033-win64-debug.zip
  005710c9e3032dfdc6117a77c38f85a2a5fa723b32772bc33c907298fe91ebfa  guix-build-ef99bc925033/output/x86_64-w64-mingw32/bitcoin-ef99bc925033-win64-setup-unsigned.exe
  c85bb2671820715a97273cc57b81de73f50f95fd8c8909020b08a6be02eb4797  guix-build-ef99bc925033/output/x86_64-w64-mingw32/bitcoin-ef99bc925033-win64.zip
  ```

  [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/87)
  [![macOS](https://img.shields.io/badge/OS-macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/87)
  [![Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/87)

ACKs for top commit:
  hebasto:
    ACK ef99bc9

Tree-SHA512: abefdfb363d5ec51c0e4eb079b14e8befd1e921fc19beea210f34f70e80de84c33e4e2e68145eff6cb7e516e73ca2efb0f07fdeafaf440488950170be03ee3a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.