Commit Graph

32916 Commits

Author SHA1 Message Date
fanquake
cc70f65d21
Merge bitcoin/bitcoin#24460: build: update ax_cxx_compile_stdcxx to serial 14
fa7dada1fc build: update ax_cxx_compile_stdcxx to serial 14 (MarcoFalke)

Pull request description:

  No strong reason for the bump, but this makes it easier to experiment with cpp20, see https://github.com/bitcoin/bitcoin/pull/24169#issuecomment-1048702236

ACKs for top commit:
  Empact:
    Code Review ACK fa7dada1fc
  fanquake:
    ACK fa7dada1fc

Tree-SHA512: bd3e884bae5319d434520a2947608913c3884de89aa563aa46ef17ba4e5b41ba209bd4780c8eaf81648297b2dc9534803be88d1b214ad05a93ee5992bee887c0
2022-03-04 15:39:34 +00:00
Andrew Chow
bada9636d7
Merge bitcoin/bitcoin#24043: Add (sorted)multi_a descriptor for k-of-n multisig inside tr
4828d53ecc Add (sorted)multi_a descriptors to doc/descriptors.md (Pieter Wuille)
b5f33ac1f8 Simplify wallet_taproot.py functional test (Pieter Wuille)
eb0667ea96 Add tests for (sorted)multi_a derivation/signing (Pieter Wuille)
c17c6aa08d Add signing support for (sorted)multi_a scripts (Pieter Wuille)
3eed6fca57 Add multi_a descriptor inference (Pieter Wuille)
79728c4a3d Add (sorted)multi_a descriptor and script derivation (Pieter Wuille)
25e95f9ff8 Merge/generalize IsValidMultisigKeyCount/GetMultisigKeyCount (Pieter Wuille)

Pull request description:

  This adds a new `multi_a(k,key_1,key_2,...,key_n)` (and corresponding `sortedmulti_a`) descriptor for k-of-n policies inside `tr()`. Semantically it is very similar to the existing `multi()` descriptor, but with the following changes:
  * The corresponding script is `<key1> OP_CHECKSIG <key2> OP_CHECKSIGADD <key3> OP_CHECKSIGADD ... <key_n> OP_CHECKSIGADD <k> OP_NUMEQUAL`, rather than the traditional `OP_CHECKMULTISIG`-based script, making it usable inside the `tr()` descriptor.
  * The keys can optionally be specified in x-only notation.
  * Both the number of keys and the threshold can be as high as 999; this is the limit due to the consensus stacksize=1000 limit

  I expect that this functionality will later be replaced with a miniscript-based implementation, but I don't think it's necessary to wait for that.

  Limitations:
  * The wallet code will for not estimate witness size incorrectly for script path spends, which may result in a (dramatic) fee underpayment with large multi_a scripts.
  * The multi_a script construction is (slightly) suboptimal for n-of-n (where a `<key1> OP_CHECKSIGVERIFY ... <key_n-1> OP_CHECKSIGVERIFY <key_n> OP_CHECKSIG` would be better). Such a construction is not included here.

ACKs for top commit:
  achow101:
    ACK 4828d53ecc
  gruve-p:
    ACK 4828d53ecc
  sanket1729:
    code review ACK 4828d53ecc
  darosior:
    Code review ACK 4828d53ecc

Tree-SHA512: 5dcd434b79585f0ff830f7d501d27df5e346f5749f47a3109ec309ebf2cbbad0e1da541eec654026d911ab67fd7cf7793fab0f765628d68d81b96ef2a4d234ce
2022-03-04 07:28:23 -05:00
fanquake
4fae737f4b
Merge bitcoin/bitcoin#24441: fuzz: Limit script_format to 100kB
bbbbeaf9c8 fuzz: Limit script_format to 100kB (MarcoFalke)

Pull request description:

  The target is still one of the slowest ones, but doesn't seem incredibly important. Especially for sizes larger than the standard tx size.

  Fix that by limiting the script size.

ACKs for top commit:
  fanquake:
    ACK bbbbeaf9c8

Tree-SHA512: b6cf7248753909ef2f21d8824f187e7c05732dd3b99619c0067f862f3c2b0f9a87779d4ddbbd3a7a4bae5c794280e2f0a223bf835d6bc6ccaba01817d69479a2
2022-03-04 09:33:24 +00:00
MarcoFalke
619f8a27ad
Merge bitcoin/bitcoin#24304: [kernel 0/n] Introduce bitcoin-chainstate
2c03cec2ff ci: Build bitcoin-chainstate (Carl Dong)
095aa6ca37 build: Add example bitcoin-chainstate executable (Carl Dong)

Pull request description:

  Part of: #24303

  This PR introduces an example/demo `bitcoin-chainstate` executable using said library which can print out information about a datadir and take in new blocks on stdin.

  Please read the commit messages for more details.

  -----

  #### You may ask: WTF?! Why is `index/*.cpp`, etc. being linked in?

  This PR is meant only to capture the state of dependencies in our consensus engine as of right now. There are many things to decouple from consensus, which will be done in subsequent PRs. Listing the files out right now in `bitcoin_chainstate_SOURCES` is purely to give us a clear picture of the task at hand, it is **not** to say that these dependencies _belongs_ there in any way.

  ### TODO

  1. Clean up `bitcoin-chainstate.cpp`
     It is quite ugly, with a lot of comments I've left for myself, I should clean it up to the best of my abilities (the ugliness of our init/shutdown might be the upper bound on cleanliness here...)

ACKs for top commit:
  ajtowns:
    ACK 2c03cec2ff
  ryanofsky:
    Code review ACK 2c03cec2ff. Just rebase, comments, formatting change since last review
  MarcoFalke:
    re-ACK 2c03cec2ff 🏔

Tree-SHA512: 86e7fb5718caa577df8abc8288c754f4a590650d974df9d2f6476c87ed25c70f923c4db651c6963f33498fc7a3a31f6692b9a75cbc996bf4888c5dac2f34a13b
2022-03-03 19:31:36 +00:00
Ryan Ofsky
2f5fd3cf92 test: Correctly decode UTF-8 literal string paths
Call fs::u8path to convert some UTF-8 string literals to paths, instead
of relying on implicit conversions. The implicit conversions incorrectly
decode const char* paths using the current windows codepage, instead of
treating them as UTF-8. This could cause test failures depending what
environment windows tests are run in.

Issue was reported by MarcoFalke <falke.marco@gmail.com> in
https://github.com/bitcoin/bitcoin/pull/24306#discussion_r818566106
2022-03-03 14:12:07 -05:00
laanwj
727b0cb592
doc: Clean out release notes
23.x was forked off, release notes on master should be empty.

Tree-SHA512: 0b48006073302b7b1c7602b4843d3a3048e88f357fb7049e478ec946f12eb16ca813272e719e47de5fb9713984ccf59551372a7ccd7ced7afaac6b5f5687d78b
2022-03-03 19:05:37 +01:00
laanwj
e0cb7b371f
build: Bump version to 23.99
On the master branch, bump to 23.99 (pre-24.0).

Tree-SHA512: 1e3b0cee8a2b5080170b59a4c445a3c1b69b99152e8eec7eba7080ab447cc6f9c6bd8f69df2b18ee9416de44a6ed88009a200ad26e89275f6230339330d12314
2022-03-03 18:56:45 +01:00
Jon Atack
a1db99adea
init, doc: improve -onlynet help and tor/i2p documentation
and harmonize them as follows

- s/outgoing/automatic outbound/
- s/Incoming/Inbound and manual/ (are not affected by this option.)
- s/only through network/only to network/
- s/this option. This option/this option. It/
- s/network types/networks/

and also pick up a few nits in doc/p2p-bad-ports.md
2022-03-03 16:14:01 +01:00
laanwj
30308cc380
Merge bitcoin/bitcoin#20196: net: fix GetListenPort() to derive the proper port
7d64ea4a01 net: only assume all local addresses if listening on any (Vasil Dimov)
0cfc0cd322 net: fix GetListenPort() to derive the proper port (Vasil Dimov)
f98cdcb357 net: pass Span by value to CaptureMessage() (Vasil Dimov)
3cb9d9c861 net: make CaptureMessage() mockable (Vasil Dimov)
43868ba416 timedata: rename variables to match the coding style (Vasil Dimov)
60da1eaa11 timedata: make it possible to reset the state (Vasil Dimov)

Pull request description:

  `GetListenPort()` uses a simple logic: "if `-port=P` is given, then we
  must be listening on `P`, otherwise we must be listening on `8333`".
  This is however not true if `-bind=` has been provided with `:port` part
  or if `-whitebind=` has been provided. Thus, extend `GetListenPort()` to
  return the port from `-bind=` or `-whitebind=`, if any.

  Also, if `-bind=` is provided then we would bind only to a particular address
  and should not add all the other addresses of the machine to the list of
  local addresses.

  Fixes https://github.com/bitcoin/bitcoin/issues/20184

ACKs for top commit:
  sipa:
    utACK 7d64ea4a01. I didn't review the tests in detail.
  jonatack:
    re-ACK 7d64ea4a01 per `git range-diff 08bcfa27 35ec977 7d64ea4`, changes are rebase-only, light re-review, re-ran the new tests locally

Tree-SHA512: 45135ab9c0ec3cc8c83e3b3e58a1c1f77eaeaba00618d54f1010db1d23d6db7d9c0dc7807e72ebc34e8b2d0e91f1e0d0e9239d13b90f1bdce8be84459e7837f0
2022-03-03 13:49:01 +01:00
Vasil Dimov
7d64ea4a01
net: only assume all local addresses if listening on any
If `-bind=` is provided then we would bind only to a particular address
and should not add all the other addresses of the machine to the list of
local addresses.

Fixes https://github.com/bitcoin/bitcoin/issues/20184 (case 4.)
2022-03-02 15:42:40 +01:00
Vasil Dimov
0cfc0cd322
net: fix GetListenPort() to derive the proper port
`GetListenPort()` uses a simple logic: "if `-port=P` is given, then we
must be listening on `P`, otherwise we must be listening on `8333`".
This is however not true if `-bind=` has been provided with `:port` part
or if `-whitebind=` has been provided. Thus, extend `GetListenPort()` to
return the port from `-bind=` or `-whitebind=`, if any.

Fixes https://github.com/bitcoin/bitcoin/issues/20184 (cases 1. 2. 3. 5.)
2022-03-02 15:42:37 +01:00
Vasil Dimov
f98cdcb357
net: pass Span by value to CaptureMessage()
Span is lightweight and need not be passed by const reference.
2022-03-02 15:40:36 +01:00
Vasil Dimov
3cb9d9c861
net: make CaptureMessage() mockable
Rename `CaptureMessage()` to `CaptureMessageToFile()` and introduce a
`std::function` variable called `CaptureMessage` whose value can be
changed by unit tests, should they need to inspect message contents.
2022-03-02 15:40:36 +01:00
Vasil Dimov
43868ba416
timedata: rename variables to match the coding style
Rename the local variables in `src/timedata.cpp`:
`setKnown` -> `g_sources`
`vTimeOffsets` -> `g_time_offsets`
`fDone` -> `g_warning_emitted`
2022-03-02 15:40:35 +01:00
Vasil Dimov
60da1eaa11
timedata: make it possible to reset the state
Add a new function `TestOnlyResetTimeData()` which would reset the
internal state used by `GetTimeOffset()`, `GetAdjustedTime()` and
`AddTimeData()`.

This is needed so that unit tests that call `AddTimeData()` can restore
the state in order not to confuse other tests that rely on it.

Currently `timedata_tests/addtimedata` is the only test that modifies
the state (via `AddTimeData()`) and also the only test that relies on
that state.
2022-03-02 15:40:30 +01:00
MarcoFalke
fa0c32eb74
build: Minor leveldb subtree update 2022-03-02 15:25:48 +01:00
MarcoFalke
1b20109b04 Squashed 'src/leveldb/' changes from f8ae182c1e..330dd6235f
330dd6235f Merge bitcoin-core/leveldb-subtree#31: Use memory_order symbols consistently
93ee8d875e Merge pull request #965 from ShawnZhong:cpp20

git-subtree-dir: src/leveldb
git-subtree-split: 330dd6235f50c01e49b4cfadf6df9e026dc61f0d
2022-03-02 15:24:44 +01:00
MarcoFalke
fa7dada1fc
build: update ax_cxx_compile_stdcxx to serial 14 2022-03-02 13:18:47 +01:00
Pavol Rusnak
60aa179d8f Use GetPathArg where possible
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-03-02 12:09:27 +01:00
MarcoFalke
08bcfa2767
Merge bitcoin/bitcoin#24375: Do not use LocalTestingSetup in getarg_tests test file.
5d7f22595f Do not use `LocalTestingSetup` in getarg_tests test file. (Kiminuo)

Pull request description:

  Avoid using a test fixture in getarg_tests for better readability. Change was implemented by _kiminuo_ and posted https://github.com/bitcoin/bitcoin/pull/24306#issuecomment-1036643216

ACKs for top commit:
  kiminuo:
    ACK 5d7f22595f

Tree-SHA512: 0fd98622010e6923e91c66447a1d0861bf344a65d86a313dff7d428c089b1740a25f699327f6ed4c163255f270bcbd4f7be962bb551862214f9b9e395d40df04
2022-03-02 12:09:27 +01:00
Ryan Ofsky
5b946edd73 util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
2022-03-02 06:09:27 -05:00
Ryan Ofsky
687e655ae2 util: Add GetPathArg default path argument
Let GetPathArg method be used more places for path arguments that have
default values, like "-settings" and BITCOIN_SETTINGS_FILENAME in the
next commit.

Also:

- Fix negated argument handling. Return path{} not path{"0"} when path
  argument is negated.

- Add new tests for default and negated cases

- Move GetPathArg() method declaration next to GetArg() declarations.
  The two methods are close substitutes for each other, so this should
  help keep them consistent and make them more discoverable.
2022-03-02 06:09:27 -05:00
laanwj
8b6cd42c62
Merge bitcoin/bitcoin#24165: p2p: extend inbound eviction protection by network to CJDNS peers
b7be28cac5 test: add combined CJDNS/I2P/localhost/onion eviction protection tests (Jon Atack)
0a1bb84770 test: add tests for inbound eviction protection of CJDNS peers (Jon Atack)
0c00c0c981 test: fix off-by-one logic in an eviction protection test (Jon Atack)
f7b8094d61 p2p: extend inbound eviction protection by network to CJDNS peers (Jon Atack)

Pull request description:

  Extend inbound eviction protection for peers connected over CJDNS, as is the case for peers connected via onion, localhost, and I2P since #21261 and #20197.  CJDNS peers seem to have better min ping latency than onion and I2P peers but still higher than that of unencrypted IPv4/6 peers and can be disadvantaged under our eviction criteria. They are also very few in number, which is a further reason to protect them, as the goal of this logic is to favorise the diversity of our peer connections.  CJDNS support was added in #23077 for the upcoming v23 release.

ACKs for top commit:
  laanwj:
    Concept and code review ACK b7be28cac5
  w0xlt:
    tACK b7be28c

Tree-SHA512: 89ebdd217602e16ae14b9bd0d5a25fc09f9b2384c951f820bc0f5a6d8452bbc9042065db817d5d5296c0ad22988491a83fc5b9a611e660c40ebd4f03448c4061
2022-03-02 12:00:58 +01:00
laanwj
267917f563
Merge bitcoin/bitcoin#23304: wallet: Derive inactive HD chains in additional places
c4d76c6faa tests: Tests for inactive HD chains (Andrew Chow)
8077862c5e wallet: Refactor TopUp to be able to top up inactive chains too (Andrew Chow)
70134eb34f wallet: Properly set hd chain counters when loading (Andrew Chow)
961b9e4e40 wallet: Parse hdKeypath if key_origin is not available (Andrew Chow)
0652ee73ec Add size check on meta.key_origin.path (Rob Fielding)

Pull request description:

  Currently inactive HD chains are only derived from at the time a key in that chain is found to have been used. However, at that time, the wallet may not be able to derive keys (e.g. it is locked). Currently we would just move on and not derive any new keys, however this could result in missing funds.

  This PR resolves this problem by adding memory only variables to `CHDChain` which track the highest known index. `TopUp` is modified to always try to top up the inactive HD chains, and this process will use the new variables to determine how much to top up. In this way, after an encrypted wallet is unlocked, the inactive HD chains will be topped up and hopefully funds will not be missed.

  Note that because these variables are not persisted to disk (because `CHDChain`s for inactive HD chains are not written to disk), if an encrypted wallet is not unlocked in the same session as a key from an inactive chain is found to be used, then it will not be topped up later unless more keys are found.

  Additionally, wallets which do not have upgraded key metadata will not derive any keys from inactive HD chains. This is resolved by using the derivation path string in `CKeyMetadata.hdKeypath` to determine what indexes to derive.

ACKs for top commit:
  laanwj:
    Code review ACK c4d76c6faa

Tree-SHA512: b2b572ad7f1b1b2847edece09f7583543d63997e18ae32764e5a27ad608dd64b9bdb2d84ea27137894e986a8e82f047a3dba9c8015b74f5f179961911f0c4095
2022-03-02 09:35:07 +01:00
laanwj
ba11eb354b
Merge bitcoin/bitcoin#23542: net: open p2p connections to nodes that listen on non-default ports
36ee76d1af net: remove unused CNetAddr::GetHash() (Vasil Dimov)
d0abce9a50 net: include the port when deciding a relay destination (Vasil Dimov)
2e38a0e686 net: add CServiceHash constructor so the caller can provide the salts (Vasil Dimov)
97208634b9 net: open p2p connections to nodes that listen on non-default ports (Vasil Dimov)

Pull request description:

  By default, for mainnet, the p2p listening port is 8333. Bitcoin Core
  has a strong preference for only connecting to nodes that listen on that
  port.

  Remove that preference because connections over clearnet that involve
  port 8333 make it easy to detect, analyze, block or divert Bitcoin p2p
  traffic before the connection is even established (at TCP SYN time).

  For further justification see the OP of:
  https://github.com/bitcoin/bitcoin/pull/23306

ACKs for top commit:
  laanwj:
    Concept and light code review ACK 36ee76d1af
  prayank23:
    ACK 36ee76d1af
  stickies-v:
    tACK 36ee76d1a
  jonatack:
    ACK 36ee76d1af
  glozow:
    utACK 36ee76d1af

Tree-SHA512: 7f45ab7567c51c19fc50fabbaf84f0cc8883a8eef84272b76435c014c31d89144271d70dd387212cc1114213165d76b4d20a5ddb8dbc958fe7e74e6ddbd56d11
2022-03-02 09:33:03 +01:00
laanwj
848b11615b
Merge bitcoin/bitcoin#22834: net: respect -onlynet= when making outbound connections
0eea83a85e scripted-diff: rename `proxyType` to `Proxy` (Vasil Dimov)
e53a8505db net: respect -onlynet= when making outbound connections (Vasil Dimov)

Pull request description:

  Do not make outbound connections to hosts which belong to a network
  which is restricted by `-onlynet`.

  This applies to hosts that are automatically chosen to connect to and to
  anchors.

  This does not apply to hosts given to `-connect`, `-addnode`,
  `addnode` RPC, dns seeds, `-seednode`.

  Fixes https://github.com/bitcoin/bitcoin/issues/13378
  Fixes https://github.com/bitcoin/bitcoin/issues/22647
  Supersedes https://github.com/bitcoin/bitcoin/pull/22651

ACKs for top commit:
  naumenkogs:
    utACK 0eea83a85e
  prayank23:
    reACK 0eea83a85e
  jonatack:
    ACK 0eea83a85e code review, rebased to master, debug built, and did some manual testing with various config options on signet

Tree-SHA512: 37d68b449dd6d2715843fc84d85f48fa2508be40ea105a7f4a28443b318d0b6bd39e3b2ca2a6186f2913836adf08d91038a8b142928e1282130f39ac81aa741b
2022-03-01 18:32:01 +01:00
fanquake
024b8e12a5
Merge bitcoin/bitcoin#24451: qt: Pre-branch translation updates for 23.x
b67ef6d59b qt: Pre-branch translation updates for 23.x (laanwj)

Pull request description:

  Pull the translations from transifex once before the 23.x branch-off, so that master has at least somewhat-relevant translations.

ACKs for top commit:
  fanquake:
    ACK b67ef6d59b

Tree-SHA512: 1e7b759b4ed211584fe4ee7d9057621e858573b616802db21748f91d077ad51466edf4cf1f4f3f4e53d9afb24712f69f716ab08380fd0358a4beabe3f3c6d5dc
2022-03-01 13:48:24 +00:00
laanwj
b67ef6d59b qt: Pre-branch translation updates for 23.x
Pull the translations from transifex once before the 23.x branch-off, so
that master has at least somewhat-relevant translations.
2022-02-28 16:59:56 +01:00
laanwj
25290071c4
Merge bitcoin/bitcoin#24397: build: Fix Boost.Process check for Boost 1.73 and older
774323e378 ci: Force `--enable-external-signer` to prevent future regressions (Hennadii Stepanov)
69978858a4 build: Fix Boost.Process check for Boost 1.73 and older (Hennadii Stepanov)
2199ef79cb build: Fix a non-portable use of `test` (Hennadii Stepanov)
d436c488d4 build, refactor: Replace tabs with spaces (Hennadii Stepanov)

Pull request description:

  On master (5f44c5c428) Boost.Process check false fails without the `-lpthread` flag.

  ```
  $ grep -C 2 pthread_detach config.log
  /usr/bin/ld: /tmp/cczCQfQv.o: in function `boost::asio::detail::posix_global_impl<boost::asio::system_context>::~posix_global_impl()':
  conftest.cpp:(.text._ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED2Ev[_ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED5Ev]+0xa3): undefined reference to `pthread_join'
  /usr/bin/ld: conftest.cpp:(.text._ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED2Ev[_ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED5Ev]+0xc4): undefined reference to `pthread_detach'
  collect2: error: ld returned 1 exit status
  configure:26674: $? = 1
  ```

  Not required for Boost 1.74+.

ACKs for top commit:
  laanwj:
    Code review ACK 774323e378, is a bugfix/workaround, seems fine to merge last minute for 23.0.

Tree-SHA512: 2a9d4b67fd8910e107af972d8c223286b7c933bc310616f86c8b6d8c903438916980fc76bd7e37f2698f6ce5361dc706cbf2933d1ac2c081bcabe1b83ca7d6b6
2022-02-28 14:06:16 +01:00
laanwj
159f89c118
Merge bitcoin/bitcoin#24365: wallet: Don't generate keys for wallets with private keys disabled during upgradewallet
c7376cc8d7 tests: Test upgrading wallet with privkeys disabled (Andrew Chow)
3d985d4f43 wallet: Don't generate keys when privkeys disabled when upgrading (Andrew Chow)

Pull request description:

  When we're upgrading a wallet, we shouldn't be trying to generate new keys for wallets where private keys are disabled.

  Fixes #23610

ACKs for top commit:
  laanwj:
    Code review ACK c7376cc8d7
  benthecarman:
    tACK c7376cc8d7 this fixed the issue for me

Tree-SHA512: fa07cf37df9196ff98671bb1ce5c9aa0bab46495066b4dab796d7e8e5d5c7adb414ff56adae4fd3e15658a610995bd19a9e1edb00c46144b0df635c5b343f3a6
2022-02-28 13:15:11 +01:00
MarcoFalke
c7da61dcc3
Merge bitcoin/bitcoin#24403: Avoid implicit-integer-sign-change in VerifyLoadedChainstate
fa7991601c Fixup style of VerifyDB (MarcoFalke)
fa462ea787 Avoid implicit-integer-sign-change in VerifyLoadedChainstate (MarcoFalke)

Pull request description:

  This happens when checking all blocks (`-1`).

  To test:

  ```
  ./configure CC=clang CXX=clang++ --with-sanitizers=undefined,integer
  make
  UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./test/functional/rpc_blockchain.py

ACKs for top commit:
  theStack:
    Code-review ACK fa7991601c
  brunoerg:
    crACK fa7991601c

Tree-SHA512: bcbe6becf2fbedd21bbde83a544122e79465937346802039532143b2e4165784905a8852c0ccb088b964874df5e5550931fdde3629cbcee3ae237f2f63c43a8e
2022-02-28 12:33:32 +01:00
fanquake
b71a07778f
Merge bitcoin/bitcoin#24417: net: Update hardcoded seeds for 23.x
d80dc12097 net: Update hardcoded seeds for 23.x (laanwj)
9f27157894 contrib: make-seeds updates for 23.x (laanwj)

Pull request description:

  Update hardcoded P2P network seeds for 23.x, and update the generation script and documentation as necessary

  Tool output:
  ```
    IPv4   IPv6  Onion Pass
  469910  72944      0 Initial
  469910  72944      0 Skip entries with invalid address
  469910  72944      0 After removing duplicates
  469909  72944      0 Skip entries from suspicious hosts
  165760  65113      0 Enforce minimal number of blocks
  160668  63183      0 Require service bit 1
    4951   1376      0 Require minimum uptime
    4406   1051      0 Require a known and recent user agent
    4307   1031      0 Filter out hosts with multiple bitcoin ports
  ERR: Could not resolve ASN for "2001:678:7dc:8::2": The DNS query name does not exist: 8.0.0.0.c.d.7.0.8.7.6.0.1.0.0.2.origin6.asn.cymru.com.
     512    134      0 Look up ASNs and limit results per ASN and per net
  ```.

ACKs for top commit:
  achow101:
    ACK d80dc12097
  jonatack:
    ACK d80dc12097 reviewed the changes and ran the README steps

Tree-SHA512: c651b0501cc28d397cc0778eff6aed4273669082d6ef207ce58ce198b443be66532bf1e8d618ccae3ba671ae4cccfd9b4dd2dfebacc97f3c3bd4e9fa58a3d7a3
2022-02-28 11:20:51 +00:00
MarcoFalke
40ab879f11
Merge bitcoin/bitcoin#24418: Chainparams update for 23.x
dca693e08e Update nMinimumChainWork, defaultAssumeValid for 23.x (laanwj)
85e71a3baa Update chainTxData for 23.x (laanwj)
37282dcf78 Update m_assumed_* chain parameters for 23.x (laanwj)

Pull request description:

  Update chain parameters for upcoming major release. See [doc/release-process.md](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md) for review instructions.

  - `m_assumed_blockchain_size`, `m_assumed_chain_state_size`:

  ```
  bitcoin$ du -h .
  105M    ./blocks/index
  415G    ./blocks
  4.5G    ./chainstate
  420G    .
  bitcoin$ python3
  Python 3.9.10 (main, Jan 16 2022, 17:12:18)
  [GCC 11.2.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 420 * 1.1
  462.00000000000006
  >>> 5 * 1.1
  5.5
  ```

  - `chainTxData`:
  ```
  cli getchaintxstats 4096 000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091
  {
    "time": 1645542140,
    "txcount": 712531200,
    "window_final_block_hash": "000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091",
    "window_final_block_height": 724466,
    "window_block_count": 4096,
    "window_tx_count": 6950257,
    "window_interval": 2404071,
    "txrate": 2.891036496010309
  }
  ```

  - `nMinimumChainWork`, `defaultAssumeValid`:

  ```
  $ cli getblockhash 724466 # was two from the tip at the time
  000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091
  $ cli getblockheader 000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091
  {
    "hash": "000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091",
    "confirmations": 3,
    "height": 724466,
    "version": 939515908,
    "versionHex": "37ffe004",
    "merkleroot": "35a08d9647972e7c3ec39ee7f4ab434f03445de7c446a4d1acc1254b4546bbbe",
    "time": 1645542140,
    "mediantime": 1645539567,
    "nonce": 188699556,
    "bits": "170a1078",
    "difficulty": 27967152532434.23,
    "chainwork": "00000000000000000000000000000000000000002927cdceccbd5209e81e80db",
    "nTx": 1948,
    "previousblockhash": "000000000000000000075e26c23c2ecec4e34699411ccd712ff6f2d252f65a78",
    "nextblockhash": "0000000000000000000905369cd69f68323e3e8da2933a78bea0b2cdb8baa89f"
  }
  ```

ACKs for top commit:
  Sjors:
    ACK dca693e08e
  achow101:
    ACK dca693e08e
  prayank23:
    ACK dca693e08e
  darosior:
    ACK dca693e08e -- only checked mainnet (on muliple nodes). Didn't do a reindex.

Tree-SHA512: 6d5d59f00717fce5f7ce10ec8d59f806ef11b0af21440cec112f70c8e13ebb884ba6c70e744e691fcc31fe7aec7aae968268c9207ccc820d64fdf7e7f98f0cff
2022-02-28 12:09:41 +01:00
MarcoFalke
292a841553
Merge bitcoin/bitcoin#24449: fuzz: FuzzedFileProvider::write should not return negative value
fc471814dc fuzz: FuzzedFileProvider::write should not return negative value (eugene)

Pull request description:

  Doing so can lead to a glibc crash (from 2005 but I think it's relevant https://sourceware.org/bugzilla/show_bug.cgi?id=2074). Also the manpage for fopencookie warns against this: https://man7.org/linux/man-pages/man3/fopencookie.3.html. This would invalidate the autofile seeds (and maybe others?) in qa-assets.

  On another note, I noticed that FuzzedFileProvider::seek has some confusing behavior with SEEK_END. It seems to me that if these handlers are supposed to mimic the real functions, that SEEK_END would use the offset from the end of the stream, rather than changing the offset with a random value between 0 and 4096. I could also open a PR to fix SEEK_END, but it would invalidate the seeds.

ACKs for top commit:
  MarcoFalke:
    cr ACK fc471814dc

Tree-SHA512: 9db41637f0df7f2b2407b82531cbc34f4ba9393063b63ec6786372e808fe991f7f24df45936c203fe0f9fc49686180c65ad57c2ce7d49e0c5402240616bcfede
2022-02-28 08:34:30 +01:00
eugene
fc471814dc
fuzz: FuzzedFileProvider::write should not return negative value
Doing so can lead to a glibc crash. Also the manpage for fopencookie
warns against this: https://man7.org/linux/man-pages/man3/fopencookie.3.html
2022-02-27 17:03:35 -05:00
Ryan Ofsky
691d45fdc8 Add coinstatsindex_unclean_shutdown test 2022-02-25 16:06:27 -05:00
MarcoFalke
bbbbeaf9c8
fuzz: Limit script_format to 100kB 2022-02-25 17:09:37 +01:00
MarcoFalke
fa097d074b
addrman: Log too low compat value
Also remove uint8_t{} casts from values that are already of the same
type.
2022-02-25 14:16:32 +01:00
fanquake
ee8c997125
Merge bitcoin/bitcoin#24402: refactor: Avoid implicit-integer-sign-change in bech32.cpp
aaaa4dbab4 Avoid implicit-integer-sign-change in bech32.cpp (MarcoFalke)
fae6b26758 test: Remove no longer needed suppressions (MarcoFalke)

Pull request description:

  Clarifies sign conversion and allows to remove a file-wide suppression.

  Also, includes an unrelated commit to remove unused suppressions.

ACKs for top commit:
  fanquake:
    ACK aaaa4dbab4

Tree-SHA512: f06181494ea8a2890b510b0e840679635633146d27568adaa0f0216a52637068d32a880316e1608e08314e032565f67b6b980cc9143f420d5c15e51ef760e7e0
2022-02-25 13:08:29 +00:00
MarcoFalke
07e1464fc9
Merge bitcoin/bitcoin#24440: doc: update maintainer list in REVIEWERS
3fadafd0db doc: update maintainer list in REVIEWERS (fanquake)

Pull request description:

ACKs for top commit:
  michaelfolkson:
    ACK 3fadafd0db

Tree-SHA512: 1be6da2017449b97a4031cb2644d8a993e91d5b7ea14c0ee1e42243caa5ef9d2f3fcdb90e2f9524e976ec0e7f3c2c354967a6a09fb2b8719ec76fddb951525a4
2022-02-25 13:31:37 +01:00
fanquake
0dc1002c30
Merge bitcoin/bitcoin#24433: doc: Explain that feedback needs to be addressed
fa694f61ab doc: Explain that feedback needs to be addressed (MarcoFalke)
fa0819eea3 doc: Move peer-review paragraph to right section (MarcoFalke)
fa2b65b358 doc: Add link to release-process.md in CONTRIBUTING.md (MarcoFalke)

Pull request description:

  Generally, the pull request author is expected to reply to all comments or iterate the code before merge. Of course, it is allowed to reject feedback, but it should not be done by silently ignoring it.

  Clarify this in the docs.

  Also, some minor copy edits.

ACKs for top commit:
  michaelfolkson:
    ACK fa694f61ab
  Sjors:
    ACK fa694f61ab
  jamesob:
    ACK fa694f61ab
  prayank23:
    ACK fa694f61ab
  brunoerg:
    ACK fa694f61ab
  w0xlt:
    ACK fa694f6

Tree-SHA512: 339d6f252395664442f4bfb73d839314de8c9b0fdc8900a1c4a67b1cef9c73ecb98c7587a842dd5a36a4a3efbd8270d2162962013893706313f7ef34491db18c
2022-02-25 11:50:10 +00:00
fanquake
3fadafd0db
doc: update maintainer list in REVIEWERS 2022-02-25 11:46:26 +00:00
MarcoFalke
aaaa4dbab4
Avoid implicit-integer-sign-change in bech32.cpp 2022-02-25 09:43:54 +01:00
MarcoFalke
fae6b26758
test: Remove no longer needed suppressions 2022-02-25 09:41:05 +01:00
MarcoFalke
b00b60ed4f
Merge bitcoin/bitcoin#24201: p2p: Avoid InitError when downgrading peers.dat
d41ed32153 p2p: Avoid InitError when downgrading peers.dat (junderw)

Pull request description:

  fixes #24188 (also see https://github.com/bitcoin/bitcoin/pull/22762#issuecomment-951063826)
  When downgrading, a peers.dat with a future version that has a minimum
  required version larger than the downgraded Bitcoin Core version would cause an InitError.

  This commit changes this behavior to overwrite the existing peers.dat with
  a new empty one.

ACKs for top commit:
  prayank23:
    reACK d41ed32153
  kallewoof:
    reACK d41ed32153

Tree-SHA512: c8e625fe36ce0b1aab6c8ef7241c8954038bb856f2de27bdc4814dc9a60e51be28815c7d77d0f96eace49687a0cea02deb713978bbd3a5add742f50a675f2a40
2022-02-25 08:45:11 +01:00
junderw
d41ed32153
p2p: Avoid InitError when downgrading peers.dat
fixes #24188
When downgrading, a peers.dat with a future version that has a minimum
required version larger than the downgraded version would cause an InitError.

This commit changes this behavior to overwrite the existing peers.dat with
a new empty one, while creating a backup in peers.dat.bak.
2022-02-25 09:53:10 +09:00
MarcoFalke
f1ce67f09f
Merge bitcoin/bitcoin#19013: test: add v0.20.1, v0.21.0 and v22.0 to backwards compatibility test
24cec4b5c0 test: Fix intermittent test failure in feature_backwards_compatibility (MarcoFalke)
d8b705f1ca test: previous releases: add v22.0 (Sjors Provoost)
40849eebd9 test: bump sandbox argument minimum version (Sjors Provoost)
8a57a06a50 test: previous releases: add v0.21.0 (Sjors Provoost)
8cba75f5fd test: v0.20.1 backwards compatibility (Sjors Provoost)
0e4b695b6a test: backwards compatibility: misc fixes (Sjors Provoost)
76557cbe4c test: Remove i686 from test/get_previous_releases.py (MarcoFalke)

Pull request description:

  This also simplifies the tests a bit.

ACKs for top commit:
  ryanofsky:
    Code review ACK 24cec4b5c0. Only change since last review is rebasing and adding comment and whitelist args.

Tree-SHA512: 85a603ddd70fd8f0180d00fb84eb2ad2f92d6199b7d3f7c1abd660bfba53f869faf40f1a4183a8ce15dbd496ee3132d879c1258651c9d443ece69e5fe328bd26
2022-02-24 17:42:28 +01:00
laanwj
dca693e08e Update nMinimumChainWork, defaultAssumeValid for 23.x
Co-authored-by: Suhas Daftuar <sdaftuar@gmail.com>
2022-02-24 16:19:09 +01:00
laanwj
85e71a3baa Update chainTxData for 23.x
Co-authored-by: Suhas Daftuar <sdaftuar@gmail.com>
2022-02-24 16:19:09 +01:00
fanquake
c07287d34c
Merge bitcoin/bitcoin#24438: qt: English (source) translations update
38020c4f2e qt: English (source) translations update (laanwj)

Pull request description:

  Last-minute update for bitcoin/bitcoin#24434 and bitcoin/bitcoin#24401.

ACKs for top commit:
  jonatack:
    Light review ACK 38020c4f2e
  fanquake:
    ACK 38020c4f2e

Tree-SHA512: 6729700316364cbe78d5b026b0dde7e46fa0df811d7a7ae55d480cc9d2187e9173f3edcc2d7d643022beb6292d9aa6e10b05e6c07a80c95f3814bf23820d272f
2022-02-24 14:33:05 +00:00