Commit graph

31631 commits

Author SHA1 Message Date
MarcoFalke
9469ffcb17
Merge bitcoin/bitcoin#23323: doc: Add note on deleting past-EOL release branches
fa38d98aa9 doc: Add note on deleting past-EOL release branches (MarcoFalke)

Pull request description:

  This is being done for years now, but wasn't documented.

  Some reasons to do it:
  * Backports to those branches are unlikely to be tested both on CI (since it is often fragile and broken for stale branches) and by users (since those users likely don't exist). If a user exists, they are better off backporting any fixes they need from the last still-supported branch and test them on their own infrastructure.
  * Community support of those branches is still possible, though this will need to be done in another project to relieve the burden on this project.
  * All release tags will remain, so no historic code is lost.

ACKs for top commit:
  hebasto:
    ACK fa38d98aa9
  fanquake:
    ACK fa38d98aa9 - I think this is fine as-is.

Tree-SHA512: caa714af541a6902925c89cc6a896b125f61bd77e901c5d384d84b34def2ee654bdae9f3e995001154c29672f60d2b689d0ff92d345666564fd5aa321a5b3fe7
2021-10-22 09:02:03 +02:00
fanquake
81cdbecd75
Merge bitcoin/bitcoin#23329: ci: Define cases when invalidate vcpkg binary cache
e8692cf2c1 ci: Improve vcpkg binary cache settings (Hennadii Stepanov)
b00646bc77 ci, refactor: Rename VCPKG_TAG variable and vcpkg_cache script (Hennadii Stepanov)

Pull request description:

  On master (c8bae2be34), the size of the vcpkg binary cache is potentially unbounded.

  The reason of such behavior is the internal caching logic, following which, any change in the [set of parameters](https://vcpkg.io/en/docs/users/binarycaching.html#implementation-notes-internal-details-subject-to-change-without-notice) defined by the vcpkg implementation will cause compiling of a new binaries following by adding them to the current cache.

  This PR defines two obvious cases when the vcpkg binary cache will be invalidated.

ACKs for top commit:
  sipsorcery:
    ACK e8692cf2c1.

Tree-SHA512: 125312b9b90a9f932702ae3a8c0ed9939fca73feb92b5cdd2ebff181ae7ac50a17f8956ff11dc115da05f79030a1b56decfa25b26e37faf3505a1f30ddd8a80f
2021-10-22 09:11:46 +08:00
Joan Karadimov
077a875d94 refactor: include a missing <limits> header in fs.cpp
... needed for std::numeric_limits<T>::max on WIN32
2021-10-22 04:03:45 +03:00
MarcoFalke
fa8fef6ef2
doc: Fix CWalletTx::Confirmation doc
Follow-up to:
* commit 700c42b85d, which replaced pIndex
  with block_hash in AddToWalletIfInvolvingMe.

* commit 9700fcb47f, which replaced
  posInBlock with confirm.nIndex.
2021-10-21 22:13:35 +02:00
MarcoFalke
12ff8993bc
Merge bitcoin/bitcoin#23331: test: Replace log with assert_equal in wallet_abandonconflict
fa6c62f34b test: Replace log with assert_equal in wallet_abandonconflict (MarcoFalke)

Pull request description:

  This will make the test fail as soon as the bug is fixed, forcing it to
  be updated. Otherwise, the bug might be fixed (or made worse)
  accidentally, leaving the test in an inconsistent state.

ACKs for top commit:
  theStack:
    Concept and code-review ACK fa6c62f34b
  brunoerg:
    tACK fa6c62f34b

Tree-SHA512: 416f72380164bf3f93332a5cfa81a8e61d8ada3714ef6815889ed3cf2d16c09411760dee4acf19629227e565b765b3dea491a0b23efd38eb370254cfadf7c441
2021-10-21 22:00:49 +02:00
W. J. van der Laan
179ce09833
Merge bitcoin/bitcoin#23293: doc: Add comment to COIN constant.
1946af2c45 Add comment to COIN constant. (Kennan Mell)

Pull request description:

  The COIN constant is critical in understanding Bitcoin's supply, but what it represents isn't clear from the name of the constant. Adding a comment clarifies the meaning of the constant for future readers.

ACKs for top commit:
  lsilva01:
    ACK 1946af2
  shaavan:
    ACK 1946af2c45

Tree-SHA512: ba27c6bd4a4c92664a71ef081104e9e50e47022d68eb955c247b7c49a0046a42bf64bf23a14563c646411b7be6027fea918cc62baa01bbf319b82d14d368f280
2021-10-21 19:58:44 +02:00
W. J. van der Laan
8a083bc5b5
Merge bitcoin/bitcoin#23218: p2p: Use mocktime for ping timeout
fadf1186c8 p2p: Use mocktime for ping timeout (MarcoFalke)

Pull request description:

  It is slightly confusing to use mocktime for some times, but not others.

  Start fixing that by making the ping timeout use mocktime.

  The only downside would be that tests that use mocktime disconnect peers after this patch. However, I don't think this is an issue, as the inactivity check is already disabled for all functional tests after commit 6d76b57ca0. Only one unit test needed the inactivity check disabled as part of this patch.

  A nice side effect of this patch is that the `p2p_ping` functional test now runs 4 seconds faster.

ACKs for top commit:
  laanwj:
    Code review ACK fadf1186c8

Tree-SHA512: e9e7b21040a89d9d574b3038f85a67e6336de6cd6e41aa286769cd03cada6e75a94ec01700e052e56d822ef85d7813cc06bf7e67b81543eff8917a16cdccf942
2021-10-21 19:44:38 +02:00
W. J. van der Laan
f41aa81c99
Merge bitcoin/bitcoin#23271: crypto: Fix K1/K2 use in the comments in ChaCha20-Poly1305 AEAD
be7f4130f9 Fix K1/K2 use in the comments in ChaCha20-Poly1305 AEAD (=)

Pull request description:

  As per [#22331](https://github.com/bitcoin/bitcoin/pull/22331) and the [Detailed Construction of the ChaCha20Forward4064-Poly1305@Bitcoin cipher suite](https://gist.github.com/jonasschnelli/c530ea8421b8d0e80c51486325587c52#detailed-construction) mentioned in BIP 324, K1 is used for encrypting the associated data(message length) and instantiating the Poly1305 MAC while K2 is used for encrypting the payload. This PR fixes the comments which need to be updated in:

  1. The test vector in `src/test/crypto_tests.cpp`
  2. In `src/crypto/chacha_poly_aead.h`,  `m_chacha_main` is a K2 ChaCha20 cipher instance and should be used for encrypting the payload. Also,  `m_chacha_header` is a K1 ChaCha20 cipher instance and is used for encrypting the length and instantiating the Poly1305 MAC.

ACKs for top commit:
  siv2r:
    ACK be7f413
  jonatack:
    ACK be7f4130f9
  Zero-1729:
    ACK be7f413
  shaavan:
    reACK be7f4130f9

Tree-SHA512: 9d3d0f45cf95d0a87b9f04c26f04b9ea78b2f2fa578d3722146a79dd0d377b9867532fc62e02b8e1487420df7702a1f033d15db562327535940c2049cbde401f
2021-10-21 19:30:09 +02:00
W. J. van der Laan
ee1294f155
Merge bitcoin/bitcoin#23324: Print peer counts for all reachable networks in -netinfo
96f469f91b netinfo: print peer counts for all reachable networks (Jon Atack)

Pull request description:

  instead of only for networks we have peer connections to.

  Users reported the previous behavior caused confusion, as no column was printed when a network was reachable but no peers were connected. Users expected a column to be printed with 0 peers. This commit aligns behavior with that expectation.

  In addition, the ipv4, ipv6, and onion columns were always printed whether or not they were reachable. With this change, only the reachable ones will be returned.

  Example with CJDNS reachable but no CJDNS peers (built on #23077 and #23175):

  before
  ```
          ipv4    ipv6   onion     i2p   total   block  manual
  in         0       0      12       5      17
  out        8       1       6       4      19       2       8
  total      8       1      18       9      36
  ```
  after
  ```
           ipv4    ipv6   onion     i2p   cjdns   total   block  manual
  in          0       0      12       5       0      17
  out         8       1       6       4       0      19       2       8
  total       8       1      18       9       0      36
  ```

  There is one additional space between the in/out/total row headers and the network counts.

ACKs for top commit:
  jsarenik:
    Tested ACK 96f469f91
  prayank23:
    utACK 96f469f91b
  laanwj:
    Code review and lightly tested ACK 96f469f91b
  naumenkogs:
    ACK 96f469f91b.
  hebasto:
    ACK 96f469f91b, tested by comparing the output of `watch src/bitcoin-cli -netinfo` with the Peer tab of the Node window in the GUI 🐅

Tree-SHA512: 3489f40148a2bd0afc9eef1e1577d44150c1fccec8dbf2a675bc23aa9343bfcae6c4039f5b96e54730668c83f40bc932fb6808f5540e86ff7249fde8dc0fff67
2021-10-21 17:42:03 +02:00
glozow
4307849256 [mempool] delete exists(uint256) function
Allowing callers to pass in a uint256 (which could be txid or wtxid)
but then always assuming that it's a txid is a footgunny interface.
2021-10-21 16:26:59 +01:00
glozow
d50fbd4c5b create explicit GenTxid::{Txid, Wtxid} ctors 2021-10-21 16:26:59 +01:00
Sebastian Falbesoner
6911ab95f1 wallet: fix segfault by avoiding invalid default-ctored external_spk_managers entry
In the method `CWallet::LoadActiveScriptPubKeyMan`, the map
`external_spk_managers` (or `internal_spk_managers`, if parameter
`internal` is false) is accessed via std::map::operator[], which means
that a default-ctored entry is created with a null-pointer as value, if
the key doesn't exist.  As soon as this value is dereferenced, a
segmentation fault occurs, e.g. in `CWallet::KeypoolCountExternalKeys`.

The bevaviour can be reproduced by the following steps (starting with empty regtest datadir):

$ ./src/bitcoind -regtest -daemon
$ ./src/bitcoin-cli -regtest -named createwallet_name=wallet descriptors=true blank=true
$ cat regtest-descriptors.txt
[
  {
    "desc": "tr([e4445899/49'/1'/0']tprv8ZgxMBicQKsPd8jCeBWsYLEoWxbVgzJDatJ7XkwQ6G3uF4FsHuaziHQ5JZAW4K515nj6kVVwPaNWZSMEcR7aFCwL4tQqTcaoprMKTTtm6Zg/1/*)#mr3llm7f",
    "timestamp": 1634652324,
    "active": true,
    "internal": true,
    "range": [
      0,
      999
    ],
    "next": 0
  }
]
$ ./src/bitcoin-cli -regtest importdescriptors "$(cat regtest-descriptors.txt)"
[
  {
    "success": true
  }
]
$ ./src/bitcoin-cli -regtest getwalletinfo
error: timeout on transient error: Could not connect to the server 127.0.0.1:18443 (error code 1 - "EOF reached")

Bug reported by Josef Vondrlik (josef-v).
2021-10-21 16:26:50 +02:00
MarcoFalke
fadb44606f
build: Inline FUZZ_SUITE_LDFLAGS_COMMON
This is a refactor
2021-10-21 13:57:09 +02:00
MarcoFalke
fa6c62f34b
test: Replace log with assert_equal in wallet_abandonconflict
This will make the test fail as soon as the bug is fixed, forcing it to
be updated. Otherwise, the bug might be fixed (or made worse)
accidentally, leaving the test in an inconsistent state.
2021-10-21 11:15:15 +02:00
MarcoFalke
88fc7950f8
Merge bitcoin/bitcoin#23267: test: bip125-replaceable in listsinceblock
b7884dd1b6 test: bip125-replaceable in listsinceblock (brunoerg)

Pull request description:

  This PR adds test coverage for bip125-replaceable in listsinceblock. I added this test into wallet_listtransactions.py instead of putting it into wallet_listsinceblock.py to utilize the scenario already created in wallet_listtransactions.py and avoid repetition.

ACKs for top commit:
  theStack:
    ACK b7884dd1b6
  promag:
    ACK b7884dd1b6.
  stratospher:
    tested ACK b7884dd. Verified the bip125-replaceable status of some transactions with listsinceblock.
  lsilva01:
    tACK b7884dd  on Ubuntu 20.04

Tree-SHA512: 510dfe5a6f9d68e5a656514d356dc8fe99324296ed8caa78f0eb4b6c6906cf70b1fb50bde80aa6f61d726b2fa1d4ce1fe48c635ce24285588e56ceff92291617
2021-10-21 10:21:30 +02:00
MarcoFalke
548ad5ef7f
Merge bitcoin/bitcoin#23281: test: check that bumpfee RPC fails for txs with descendants in mempool
4ac8c89ad9 test: check that bumpfee RPC fails for txs with descendants in mempool (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the bumpfee RPC error _"Transaction has descendants in the mempool"_,

  6419bdfeb1/src/wallet/feebumper.cpp (L29-L32)

  which is thrown if the bumped tx has descendants in the mempool and is _not_ connected to the bitcoin wallet (for those, the error "Transaction has descendants in the Wallet" is thrown a few lines above). To achieve that, the test framework's MiniWallet is used.

ACKs for top commit:
  brunoerg:
    tACK 4ac8c89ad9
  promag:
    Code review ACK 4ac8c89ad9. Nice stuff!
  lsilva01:
    Tested ACK 4ac8c89 cad756b10c9dee2d9e1405 on Ubuntu 20.04.
  stratospher:
    tested ACK 4ac8c89.

Tree-SHA512: 83e99f9dd2b140c0c0597c0c36c9c948fa334871be40e58a5e004440698d9685661c69bb83ab937d30f692545a3799705f991b31904f2ef31a2fbc3ae1179fa8
2021-10-21 10:14:47 +02:00
MarcoFalke
9aa4ddb410
Merge bitcoin/bitcoin#23287: test: get and decode tx with a single gettransaction RPC call
130ee48108 test: get and decode tx with a single `gettransaction` RPC call (Sebastian Falbesoner)

Pull request description:

  Rather than subsequently calling `gettransaction` and `decoderawtransaction` to get the decoded information  for a specific tx-id, we can simply use the verbose version of `gettransaction`, which returns this in a 'decoded' key. I.e.

  ```
  node.decoderawtransaction(node.gettransaction(txid)['hex'])
  ```

  can simply be replaced by:

  ```
  node.gettransaction(txid=txid, verbose=True)['decoded']
  ```

  Rationale: shorter code, shorter test logs, less RPC calls.

ACKs for top commit:
  stratospher:
    tested ACK 130ee48
  amadeuszpawlik:
    tACK 130ee48108
  lsilva01:
    Tested ACK 130ee48 on Ubuntu 20.04.
  shaavan:
    ACK 130ee48108

Tree-SHA512: cf0bd26e1e21b8022fb8062857906e0706f0ee32d3277f985c461e2519405afe445ab005f5f763fb268c7b4d6e48b2d47eda7af8621b3bce67cece8dfc9bc153
2021-10-21 10:07:06 +02:00
MarcoFalke
3e3f53c77e
Merge bitcoin/bitcoin#23328: ci: Disable syscall sandbox in valgrind functional tests
fa44406ffd ci: Disable syscall sandbox in valgrind functional tests (MarcoFalke)

Pull request description:

  Otherwise this will fail:

  ```
  $ valgrind ./src/bitcoind -regtest -datadir=/tmp -sandbox=log-and-abort
  ==204660== Memcheck, a memory error detector
  ==204660== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
  ==204660== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
  ==204660== Command: ./src/bitcoind -regtest -datadir=/tmp -sandbox=log-and-abort
  ==204660==
  Bad system call (core dumped)

ACKs for top commit:
  practicalswift:
    cr ACK fa44406ffd

Tree-SHA512: 41853e6d5697d99bd5775a9b9017859290b3119e83726036d7e58856fcbb3459ef794b129bfaba6eca54b9bc034e2baf74cc2c177767ad5d5af3f3be2a45507f
2021-10-21 09:59:24 +02:00
fanquake
c53e95f22c
Merge bitcoin/bitcoin#23137: Move-only: bloom to src/common
fa2d611bed style: Sort (MarcoFalke)
fa1e5de2db scripted-diff: Move bloom to src/common (MarcoFalke)
fac303c504 refactor: Remove unused MakeUCharSpan (MarcoFalke)

Pull request description:

  To avoid having all files at the top level `./src` directory, start moving them to their respective sub directory according to https://github.com/bitcoin/bitcoin/issues/15732.

  `bloom` currently depends on libconsensus (`CTransaction`, `CScript`, ...) and it is currently located in the libcommon. Thus, move it to `src/common/`. (libutil in `src/util/` is for stuff that doesn't depend on libconsensus).

ACKs for top commit:
  theStack:
    Code-review ACK fa2d611bed
  ryanofsky:
    Code review ACK fa2d611bed
  fanquake:
    ACK fa2d611bed - source shuffle starts now.

Tree-SHA512: d2fbc31b81741e9f0be539e1149542c9ca39958c240e12e8e757d882beccd0f0debdc10dcce146a05f03ef9f5c6247900a461a7a4799b515e8716dfb9af1fde2
2021-10-21 10:30:04 +08:00
Cory Fields
29173d6c6c
ubsan: add minisketch exceptions 2021-10-21 09:39:26 +08:00
Pieter Wuille
54b5e1aeab
Add thin Minisketch wrapper to pick best implementation 2021-10-21 09:39:16 +08:00
Pieter Wuille
ee9dc71c1b
Add basic minisketch tests 2021-10-21 09:39:04 +08:00
Gleb Naumenko
0659f12b13
Add minisketch dependency 2021-10-21 09:38:55 +08:00
Pieter Wuille
0eb7928ab8
Add MSVC build configuration for libminisketch 2021-10-21 09:38:45 +08:00
Cory Fields
8bc166d5b1
build: add minisketch build file and include it 2021-10-21 09:37:30 +08:00
Cory Fields
b2904ceb85
build: add configure checks for minisketch
AC_DEFINE'd values won't be passed down to minisketch because it does not
use bitcoin-config.h. Thus we need a way to know if we should manually add
defines for minisketch files.
2021-10-21 09:36:20 +08:00
fanquake
07f0a61ef7 Merge commit 'b6487dc4ef47ec9ea894eceac25f37d0b806f8aa' as 'src/minisketch' 2021-10-21 09:36:07 +08:00
fanquake
b6487dc4ef Squashed 'src/minisketch/' content from commit 89629eb2c7
git-subtree-dir: src/minisketch
git-subtree-split: 89629eb2c7e262b39ba489b93b111760baded4b3
2021-10-21 09:36:07 +08:00
fanquake
4229f71bf8
Merge bitcoin/bitcoin#23282: build: remove build stubs for external leveldb
17ae2601c7 build: remove build stubs for external leveldb (Cory Fields)

Pull request description:

  Presumably these stubs indicate to packagers that external leveldb is meant to be supported in some way. It is not. Remove the stubs to avoid sending any mixed messages.

  For context, this was reported on IRC:

  > \<Talkless> bitcoind fails to start with undefined symbol: _ZTIN7leveldb6LoggerE in Debian Sid after leveldb upgraded from 1.22 to 1.23: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996486

ACKs for top commit:
  fanquake:
    ACK 17ae2601c7
  hebasto:
    ACK 17ae2601c7. I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 2f1ac2cb30dac64791933a245a2b66ce237bde3955e6f4a6b7ec181248f77a9b1b10597d865d3e2c2b6def696af70de40e905ec274e4ae7cccd1daf461473957
2021-10-21 09:31:20 +08:00
fanquake
69986de383
Merge bitcoin/bitcoin#22839: log: improve addrman logging
b65a25a846 log: improve addrman logging (Martin Zumsande)

Pull request description:

  The addrman helper functions `GetNewBucket()` and `GetTriedBucket()`
  1) log into the wrong category (`BCLog::NET` instead of `BCLog::ADDRMAN`)
  2)  log too unspecifically - especially `GetTriedBucket()` gets called from many  different places (e.g. `Check_()`, `Serialize()`), it seems sufficient to me logging these when moving an address from new to tried. Running a node with `-checkaddrman=1`and net logging currently results in a lot of repetitive log entries.

  This PR moves these log entries to `Add_()` and `Good_()` and also adds logging for `Select_()` (allowing statistics about New/Tried success probabilities), `GetAddr_()`, `ClearNew()` and `MakeTried()`.

ACKs for top commit:
  jnewbery:
    ACK b65a25a846
  vasild:
    ACK b65a25a846

Tree-SHA512: 90ab0f64eb44b7388a198efccb613577b74989fea73194bda7de8bfbd50bdb19127cb12f5ec645c7859afdb89290614a79e255f3af0a63a58d4f21aa8fe7b696
2021-10-21 08:35:30 +08:00
Pasta
ea4b61a157 refactor: remove references to deprecated values under std::allocator
Includes allocator::pointer, allocator::const_pointer, allocator::reference and allocator::const_reference which are deprecated in c++17 and removed in c++20. See https://en.cppreference.com/w/cpp/memory/allocator

Also prefer `using` over `typedef` see: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using
2021-10-20 18:36:40 -04:00
Hennadii Stepanov
e8692cf2c1
ci: Improve vcpkg binary cache settings
This change comes with two improvements:
1) using the VCPKG_DEFAULT_BINARY_CACHE variable drops dependency on
vcpkg default cached archives location, and improves readability
2) two obvious cases when binary cache is invalidated are defined, that
guaranties it won't grow boundlessly when, for example, vcpkg has being
updated.
2021-10-20 22:16:12 +03:00
Hennadii Stepanov
b00646bc77
ci, refactor: Rename VCPKG_TAG variable and vcpkg_cache script
The VCPKG_TAG variable renamed to CI_VCPKG_TAG to prevent any possible
name clash with vcpkg-specific variables.

The vcpkg_cache script renamed into more meaningful one.
2021-10-20 22:16:12 +03:00
MarcoFalke
fa44406ffd
ci: Disable syscall sandbox in valgrind functional tests 2021-10-20 21:06:10 +02:00
Hennadii Stepanov
da791c7f66
wallet: Use PACKAGE_NAME to mention our software 2021-10-20 21:09:14 +03:00
MarcoFalke
fa38d98aa9
doc: Add note on deleting past-EOL release branches 2021-10-20 18:45:03 +02:00
MarcoFalke
c8bae2be34
Merge bitcoin/bitcoin#23299: util: Add missing gettimeofday to syscall sandbox
faf13e272c Add missing gettimeofday to syscall sandbox (MarcoFalke)

Pull request description:

  Fixes:

  ```
  2021-10-18T09:12:31Z [init] [httpserver.cpp:181] [InitHTTPAllowList] Allowing HTTP connections from: 127.0.0.0/8 ::1/128
  2021-10-18T09:12:31Z [init] [util/syscall_sandbox.cpp:487] [SyscallSandboxDebugSignalHandler] ERROR: The syscall "gettimeofday" (syscall number 96) is not allowed by the syscall sandbox in thread "init". Please report.

ACKs for top commit:
  practicalswift:
    cr ACK faf13e272c

Tree-SHA512: fb7b56124e3c9b04fc03224e421f54e9b3a28992e03500a23c465819d5f7c0700b1c04eb0e4cf8e2378ef69694d9f068f4356a85245289b04cb02e08c58b7c9b
2021-10-20 18:40:47 +02:00
MarcoFalke
1435161f64
Merge bitcoin/bitcoin#23316: test: make the node param explicit in init_wallet()
7b3c9e4ee8 Make explicit the node param in init_wallet() (lsilva01)

Pull request description:

  This PR changes the definition of `def init_wallet(self, i)` to `def init_wallet(self, *, node)` to make the node parameter explicit, as suggested in https://github.com/bitcoin/bitcoin/pull/22794#discussion_r713287448 .

ACKs for top commit:
  stratospher:
    tested ACK 7b3c9e4.

Tree-SHA512: 2ef036f4c2110b2f7dc893dc6eea8faa0a18edd7f8f59b25460a6c544df7238175ddd6a0d766e2bb206326b1c9afc84238c75613a0f01eeda89a8ccb7d86a4f1
2021-10-20 17:44:01 +02:00
James O'Beirne
23f85616a8
test: add node.chain_path and node.debug_log_path
To allow easier access to the node's datadir and debug logs.
2021-10-20 11:24:56 -04:00
W. J. van der Laan
d807aceeab
Merge bitcoin/bitcoin#23314: build: explicitly disable libsecp256k1 openssl based tests
d7524546ab build: explicitly disable libsecp256k1 openssl based tests (fanquake)

Pull request description:

  These tests are failing when run against OpenSSL 3, and have been
  removed upstream, bitcoin-core/secp256k1#983, so
  disabled them for now to avoid `make check` failures.

  Note that this will also remove warning output from our build, due to
  the use of deprecated OpenSSL API functions. See bitcoin#23048.

ACKs for top commit:
  MarcoFalke:
    cr ACK d7524546ab
  elichai:
    Code review ACK d7524546ab

Tree-SHA512: a3805b4123ec49aaf21378066d86be382d11a022a7530682c2d8c0e756e785f32f18bea6fe73b1eca73f70bc3aee9166c391a9bf6adc0e450ebb0ce0bcf5a45e
2021-10-20 16:33:02 +02:00
Jon Atack
96f469f91b
netinfo: print peer counts for all reachable networks
instead of only for networks we have peer connections to.

Users reported the previous behavior caused confusion,
as no column was printed when a network was reachable
but no peers were connected. Users expected a column
to be printed with 0 peers. This commit aligns
behavior with that expectation.
2021-10-20 15:52:54 +02:00
W. J. van der Laan
c8e68b418f
Merge bitcoin/bitcoin#13875: [doc] nChainTx needs to become a 64-bit earlier due to SegWit
ef72e9bd41 doc: nChainTx needs to become a 64-bit earlier due to SegWit (Sjors Provoost)

Pull request description:

  As of block 597,379 txcount is 460,596,047 (see `chainparams.cpp`), while `uint32` can handle up to 4,294,967,296.

  Pre segwit the [minimum transaction size](https://en.bitcoin.it/wiki/Maximum_transaction_rate) was 166 bytes, so the worst case number of transactions per block was ~6000. As the original source comment for `unsigned int  nChainTx` says, that should last until the year 2030.

  With SegWit the smallest possible transaction is 60 bytes (potentially increased to 65 with a future soft fork, see #15482), without a witness:

  ```
  4 bytes version
      1 byte input count
          36 bytes outpoint
          1 byte scriptSigLen (0x00)
          0 bytes scriptSig
          4 bytes sequence
      1 byte output count
          8 bytes value
          1 byte scriptPubKeyLen
          1 byte scriptPubKey (OP_TRUE)
      4 bytes locktime
  ```

  That puts the maximum number of transactions per block at 16,666 so we might have to deal with this as early as a block 827,450 in early 2024.

  Given that it's a memory-only thing and we want to allow users many years to upgrade, I would suggest fixing this in v0.20 and back-porting it.

ACKs for top commit:
  practicalswift:
    re-ACK ef72e9bd41
  jarolrod:
    ACK ef72e9bd41
  theStack:
    ACK ef72e9bd41

Tree-SHA512: d8509ba7641796cd82af156354ff3a12ff7ec0f7b11215edff6696e95f8ca0e3596f719f3492ac3acb4b0884ac4e5bddc76f107b656bc2ed95a8ef1b2b5d4f71
2021-10-20 15:52:08 +02:00
fanquake
d7524546ab
build: explicitly disable libsecp256k1 openssl based tests
These tests are failing when run against OpenSSL 3, and have been
removed upstream, https://github.com/bitcoin-core/secp256k1/pull/983, so
disabled them for now to avoid `make check` failures.

Note that this will also remove warning output from our build, due to
the use of deprecated OpenSSL API functions. See #23048.
2021-10-20 16:16:34 +08:00
MarcoFalke
f9ad4d51e3
Merge bitcoin/bitcoin#23317: build: fix python detection post #23182
a78137ec33 build: fix python detection post #23182 (fanquake)

Pull request description:

  #23182 was broken. Fixup the changes, and add python3.11 as suggested. Was going to include this in other changes, but no point leaving this broken any longer.

ACKs for top commit:
  MarcoFalke:
    cr ACK a78137ec33
  hebasto:
    ACK a78137ec33, tested on Ubuntu Impish 21.10 running `./configure`:

Tree-SHA512: f77cbea76710617eaea85787351a707cc2dcfb7e5962fc6d63ea11e737ee96cb2a496a2a4bb5a147b37ba87b0428977d9295ea053e25417ea13f43137c959919
2021-10-20 09:37:47 +02:00
=
be7f4130f9 Fix K1/K2 use in the comments in ChaCha20-Poly1305 AEAD
This is done for the ChaCha20-Poly1305 AEAD test vector
and for the K1/K2 ChaCha20 cipher instances in chacha_poly_aead.h
2021-10-20 11:54:03 +05:30
fanquake
0ccf9b2e55
Merge bitcoin/bitcoin#23258: doc: Fix outdated comments referring to ::ChainActive()
a0efe529e4 Fix outdated comments referring to ::ChainActive() (Samuel Dobson)

Pull request description:

  After #21866 there are a few outdated comments referring to `::ChainActive()`, which should instead refer to `ChainstateManager::ActiveChain()`.

ACKs for top commit:
  jamesob:
    ACK a0efe529e4

Tree-SHA512: 80da19c105ed29ac247e6df4c8e916c3bf3f37230b63f07302114eef9c115add673e9649f0bbe237295be0c6da7b1030b5b93e14daf6768f17ce5de7cf2c9ff2
2021-10-20 13:28:28 +08:00
fanquake
a78137ec33
build: fix python detection post #23182
23182 was broken. Fix up the changes, and add python3.11 as suggested.
2021-10-20 12:28:04 +08:00
lsilva01
7b3c9e4ee8 Make explicit the node param in init_wallet() 2021-10-20 00:30:28 -03:00
fanquake
a7f28af437
Merge bitcoin/bitcoin#22646: build: tighter Univalue integration, remove --with-system-univalue
0f95247246 Integrate univalue into our buildsystem (Cory Fields)
9b49ed656f Squashed 'src/univalue/' changes from 98fadc0909..a44caf65fe (fanquake)

Pull request description:

  This PR more tightly integrates building Univalue into our build system. This follows the same approach we use for [LevelDB](https://github.com/bitcoin-core/leveldb/), ([`Makefile.leveldb.include`](https://github.com/bitcoin/bitcoin/blob/master/src/Makefile.leveldb.include)), and [CRC32C](https://github.com/bitcoin-core/crc32c) ([`Makefile.crc32c.include`](https://github.com/bitcoin/bitcoin/blob/master/src/Makefile.crc32c.include)), and will be the same approach we use for [minisketch](https://github.com/sipa/minisketch); see #23114.

  This approach yields a number of benefits, including:
  * Faster configuration due to one less subconfigure being run during `./configure` i.e 22s with this PR vs 26s
  * Faster autoconf i.e 13s with this PR vs 17s
  * Improved caching
  * No more issues with compiler flags i.e https://github.com/bitcoin/bitcoin/pull/12467
  * More direct control means we can build exactly the objects we want

  There might be one argument against making this change, which is that builders should have the option to use "proper shared/system libraries". However, I think that falls down for a few reasons. The first being that we already don't support building with a number of system libraries (secp256k1, leveldb, crc32c); some for good reason. Univalue is really the odd one out at the moment.

  Note that the only fork of Core I'm aware of, that actively patches in support for using system libs, also explicitly marks them as ["DANGEROUS"](a886811721/configure.ac (L1430)) and ["NOT SUPPORTED"](a886811721/configure.ac (L1312)). So it would seem they exist more to satisfy a distro requirement, as opposed to something that anyone should, or would actually use in practice.

  PRs like #22412 highlight the "issue" with us operating with our own Univalue fork, where we actively fix bugs, and make improvements, when upstream (https://github.com/jgarzik/univalue) may not be taking those improvements, and by all accounts, is not currently actively maintained. Bitcoin Core should not be hamstrung into not being able to fix bugs in a library, and/or have to litter our source with "workarounds", i.e #22412, for bugs we've already fixed, based on the fact that an upstream project is not actively being maintained. Allowing builders to use system libs is really only exacerbating this problem, with little benefit to our project. Bitcoin Core is not quite like your average piece of distro packaged software.

  There is the potential for us to give the same treatment to libsecp256k1, however it seems doing that is currently less straightforward.

ACKs for top commit:
  dongcarl:
    ACK 0f95247246 less my comment above, always nice to have an include-able `sources.mk` which makes integration easier.
  theuni:
    ACK 0f95247246. Thanks fanquake for keeping this going.

Tree-SHA512: a7f2e41ee7cba06ae72388638e86b264eca1b9a8b81c15d1d7b45df960c88c3b91578b4ade020f8cc61d75cf8d16914575f9a78fa4cef9c12be63504ed804b99
2021-10-20 11:01:38 +08:00
fanquake
16df28c3e3
Merge bitcoin/bitcoin#23310: ci: Bump vcpkg release tag
13ae56864e ci: Bump vcpkg release tag (Hennadii Stepanov)

Pull request description:

  In the new vcpkg release the "Binary Caching" and "Manifest Mode" features are [available by default](https://devblogs.microsoft.com/cppblog/all-vcpkg-enterprise-features-now-generally-available-versioning-binary-caching-manifests-and-registries/).

  Suggested in https://github.com/bitcoin/bitcoin/pull/23215#issuecomment-946968130 and https://github.com/bitcoin/bitcoin/pull/23215#issuecomment-946998547.

ACKs for top commit:
  sipsorcery:
    tACK 13ae56864e.

Tree-SHA512: 55558f2a2d395a3ad168eb1b36ffe3b0e6a3336b9a7c764d841345d8bb696b231d697dad36cc723d922d07be65c1b77a05cc9604a09e05e8f13ca8090ecb966d
2021-10-20 10:52:46 +08:00