Commit Graph

39136 Commits

Author SHA1 Message Date
MarcoFalke
fae379b6b1
build: Bump minimum supported Clang to clang-13 2023-10-24 18:52:00 +02:00
MarcoFalke
fab1ef9512
Bump .python-version from 3.9.17 to 3.9.18
Requested in https://github.com/bitcoin/bitcoin/pull/28211/files#r1309945635
2023-10-24 18:51:24 +02:00
fanquake
43704827b4
Merge bitcoin/bitcoin#28211: Bump python minimum supported version to 3.9
fa25e8b0a1 doc: Recommend lint image build on every call (MarcoFalke)
faf70c1f33 Bump python minimum version to 3.9 (MarcoFalke)
fa8996b930 ci: Bump i686_multiprocess.sh to latest Ubuntu LTS (MarcoFalke)

Pull request description:

  All supported operating systems ship with python 3.9 (or later), so bumping the minimum should not cause any issues. A bump will allow new code to use new python 3.9 features.

  For reference:
  * https://packages.debian.org/bullseye/python3
  * https://packages.ubuntu.com/focal/python3.9
  * FreeBSD 12/13 also ships with 3.9
  * CentOS-like 8/9 also ships with 3.9 (and 3.11)
  * OpenSuse Leap also ships with 3.9 (and 3.11) https://software.opensuse.org/package/python311-base

  This is for Bitcoin Core 27.0 in 2024 (next year), not the soon upcoming 26.0 next month.

ACKs for top commit:
  Sjors:
    ACK fa25e8b0a1
  jamesob:
    ACK fa25e8b0a1 ([`jamesob/ackr/28211.1.MarcoFalke.bump_python_minimum_supp`](https://github.com/jamesob/bitcoin/tree/ackr/28211.1.MarcoFalke.bump_python_minimum_supp))

Tree-SHA512: 86c9f6ac4b5ba94a62ee6a6062dd48a8295d8611a39cdb5829f4f0dbc77aaa1a51edccc7a99275bf699143ad3a6fe826de426d413e5a465e3b0e82b86d10c32e
2023-10-24 17:24:30 +01:00
fanquake
004367dba8
Merge bitcoin/bitcoin#28714: doc: remove release note fragments for 26.x branch
1ac5584f80 doc: remove release note fragments for 26.x branch (fanquake)
799ce4d050 build: bump version to 26.99 (fanquake)

Pull request description:

  26.x has been branched. Delete all release note fragments from this branch.
  Bump master version to 26.99.

ACKs for top commit:
  stickies-v:
    ACK 1ac5584f80

Tree-SHA512: d7d0c26333ed026460fb648ff5cb8f2f3abe150b47dcf011a563b8fcaad6efe59688f3aa2f23c246e003e37d9b612bb9b9f017ad17cf575455e3f73c6948cff8
2023-10-24 11:40:16 +01:00
fanquake
1ac5584f80
doc: remove release note fragments for 26.x branch 2023-10-24 11:13:44 +01:00
fanquake
799ce4d050
build: bump version to 26.99 2023-10-24 11:13:44 +01:00
fanquake
96ec3b67a7
Merge bitcoin/bitcoin#28707: doc: add historical release notes for 24.2
3f482ac231 doc: add historical release notes for 24.2 (fanquake)

Pull request description:

  v24.2 has [been tagged](https://github.com/bitcoin/bitcoin/releases/tag/v24.2).

ACKs for top commit:
  stickies-v:
    ACK 3f482ac231

Tree-SHA512: 71773832910ecda7ed34c6545d184ecbc743d9a36aadd8e4bd367ff60ef5b8048d39335b2347878c4a1a076cc691f12f0e36e8db542757c883d7f83d1161625d
2023-10-24 10:33:26 +01:00
fanquake
ab61087a7e
Merge bitcoin/bitcoin#28660: test: enable reindex readonly test on *BSD
5a0688a20d test: enable reindex readonly test on *BSD and macOS as root (Matthew Zipkin)

Pull request description:

  see https://github.com/bitcoin/bitcoin/pull/27850#discussion_r1349505585

  OpenBSD and FreeBSD don't have `chattr` but they do have `chflags`, use that method to make the block file immutable for the reindex_readonly test.

  Written and tested on a VPS running FreeBSD:
  ```
  FreeBSD freebsd-13-1 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64
  ```

ACKs for top commit:
  maflcko:
    re-cr-lgtm-ACK 5a0688a20d
  jonatack:
    ACK 5a0688a20d tested on macOS only
  theStack:
    ACK 5a0688a20d

Tree-SHA512: 8c88d282d09c00355d22c4c504b779f60e420327a5e07bcf80fa77b97fefcb04952af9ceaf439d9033a0a2448cb26a02663fe6bddcd4a74792857cfbaf1c5162
2023-10-24 10:32:48 +01:00
Ryan Ofsky
d724bb5291
Merge bitcoin/bitcoin#28609: wallet: Reload watchonly and solvables wallets after migration
4814e4063e test: Check tx metadata is migrated to watchonly (Andrew Chow)
d616d30ea5 wallet: Reload watchonly and solvables wallets after migration (Andrew Chow)
118f2d7d70 wallet: Copy all tx metadata to watchonly wallet (Andrew Chow)
9af87cf348 test: Check that a failed wallet migration is cleaned up (Andrew Chow)

Pull request description:

  Some incomplete/incorrect state as a result of migration can be mitigated/cleaned up by simply restarting the migrated wallets. We already do this for a wallet when it is migrated, but we do not for the new watchonly and solvables wallets that may be created. This PR introduces this behavior, in addition to creating those wallets initially without an attached chain.

  While implementing this, I noticed that not all `CWalletTx` metadata was being copied over to the watchonly wallet and so some data, such as time received, was being lost. This PR fixes this as a side effect of not having a chain attached to the watchonly wallet. A test has also been added.

ACKs for top commit:
  ishaanam:
    light code review ACK 4814e4063e
  ryanofsky:
    Code review ACK 4814e4063e. Just implemented the suggested orderpos, copyfrom, and path set comments since last review
  furszy:
    ACK 4814e406

Tree-SHA512: 0b992430df9f452cb252c2212df8e876613f43564fcd1dc00c6c31fa497adb84dfff6b5ef597590f9b288c5f64cb455f108fcc9b6c9d1fe9eb2c39e7f2c12a89
2023-10-23 17:35:36 -04:00
Andrew Chow
da8e397e4a
Merge bitcoin/bitcoin#28685: coinstats, assumeutxo: fix hash_serialized2 calculation
4bfaad4eca chainparams, assumeutxo: Fix signet txoutset hash (Fabian Jahr)
a503cd0f0b chainparams, assumeutxo: Fix testnet txoutset hash (Fabian Jahr)
f6213929c5 assumeutxo: Check deserialized coins for out of range values (Fabian Jahr)
66865446a7 docs: Add release notes for #28685 (Fabian Jahr)
cb0336817e scripted-diff: Rename hash_serialized_2 to hash_serialized_3 (Fabian Jahr)
351370a1d2 coinstats: Fix hash_serialized2 calculation (Fabian Jahr)

Pull request description:

  Closes #28675

  The last commit demonstrates that theStack's analysis [here](https://github.com/bitcoin/bitcoin/issues/28675#issuecomment-1770389468) seems to be correct. There will be more changes needed for the rest of the test suite but the `feature_assumeutxo.py` with my additional tests pass.

ACKs for top commit:
  achow101:
    ACK 4bfaad4eca
  theStack:
    Code-review ACK 4bfaad4eca
  ryanofsky:
    Code review ACK 4bfaad4eca

Tree-SHA512: 2f6abc92b282f7c5da46391803cf0804d13978d191d541f2509b532c538abccd0a081e46cda23d80d47206a05fa2b5d41b7ab246e6a263db7a7461d6292116ef
2023-10-23 15:16:08 -04:00
Ryan Ofsky
5c32c5971c
Merge bitcoin/bitcoin#28618: doc: assumeutxo prune and index notes
03f82087f6 doc: assumeutxo prune and index notes (Sjors Provoost)

Pull request description:

  Based on recent comments on #27596.

ACKs for top commit:
  pablomartin4btc:
    re ACK 03f82087f6
  ryanofsky:
    ACK 03f82087f6. Nice changes, these seem like very helpful notes

Tree-SHA512: fe651b49f4d667400a3655899f27a96dd1eaf67cf9215fb35db5f44fb8c0313e7d541518be6791fec93392df24b909793f3886adb808e53228ed2a291165639d
2023-10-23 12:41:15 -04:00
Matthew Zipkin
5a0688a20d
test: enable reindex readonly test on *BSD and macOS as root 2023-10-23 10:58:54 -04:00
fanquake
d90eea989a
Merge bitcoin/bitcoin#28708: ci: Add missing --external to podman image prune
fa65887377 ci: Add missing --external to podman image prune (MarcoFalke)

Pull request description:

  This should fix the out-of-space issues seen in CI. For example:

  https://cirrus-ci.com/task/6208410429947904?logs=ci#L8613

  ```
  Error: committing container for step {Env:[FILE_ENV=./ci/test/00_setup_env_native_msan.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] Command:run Args:[bash -c cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh] Flags:[] Attrs:map[json:true] Message:RUN bash -c cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh Original:RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]}: copying layers and metadata for container "8d882455cc157be6a85d9779b45cacf4dd92a37cfb16fad38213f758a830827d": writing blob: adding layer with blob "sha256:371f657e226fef20f4af6fb88a288dd6248c82c2088daca2d53aaacb51b4303a": processing tar file(write /usr/lib/x86_64-linux-gnu/perl/5.34.0/auto/Unicode/Collate/Collate.so: no space left on device): exit status 1

ACKs for top commit:
  stickies-v:
    utACK fa65887377

Tree-SHA512: a949b957654272b9c9450feebb64397542029019f031a18444b5b403aca899c972b3b163be716bf1bfbd5820430c70a6fec008771c6e13d3d8281ed100df575b
2023-10-23 15:38:24 +01:00
Hennadii Stepanov
565c55119b
Merge bitcoin-core/gui#770: Revert "gui: provide wallet controller context to wallet actions"
f09bfab4af Revert "gui: provide wallet controller context to wallet actions" (Hennadii Stepanov)

Pull request description:

  The commit 7066e8996d from https://github.com/bitcoin-core/gui/pull/765 breaks "Open Wallet", "Close Wallet" and "Close All Wallets" items in the File menu (at least on Ubuntu 23.10 + Wayland).

  Reverting it to avoid this regression in the 26.0 release.

ACKs for top commit:
  furszy:
    ACK f09bfab4 for including it in v26.
  jarolrod:
    ACK f09bfab4af

Tree-SHA512: fedc621c8e9bf84a263b0c28da53225febe0267d0123830a6192297f38e40726e1613e003b634215e7d16791ba6eab52fb4baab3da9637f6660b6ae1ae98462b
2023-10-23 15:15:48 +01:00
MarcoFalke
fa65887377
ci: Add missing --external to podman image prune 2023-10-23 14:10:12 +02:00
Hennadii Stepanov
f09bfab4af
Revert "gui: provide wallet controller context to wallet actions"
This reverts commit 7066e8996d.
2023-10-23 12:14:37 +01:00
fanquake
0046f3dc27
Merge bitcoin/bitcoin#28693: build: Include config/bitcoin-config.h explicitly in util/trace.h
6bdff429ec build: Include `config/bitcoin-config.h` explicitly in `util/trace.h` (Hennadii Stepanov)

Pull request description:

  The `ENABLE_TRACING` macro is expected to be defined in the `config/bitcoin-config.h` header.

  Therefore, the current code is error-prone as it depends on whether the `config/bitcoin-config.h` header was included before or not.

  This bug was noticed while working on CMake [stuff](https://github.com/hebasto/bitcoin/pull/37).

ACKs for top commit:
  fanquake:
    ACK 6bdff429ec

Tree-SHA512: 22c4fdeb51628814050eb99a83db4268a4f3106207eeef918a07214bbc52f2b22490f6b05fcb96216f147afa4197c51102503738131e2583e750b6d195747a49
2023-10-23 11:32:43 +01:00
fanquake
f4e96c29a6
Merge bitcoin/bitcoin#28691: refactor: Remove CBlockFileInfo::SetNull
fac36b94ef refactor: Remove CBlockFileInfo::SetNull (MarcoFalke)

Pull request description:

  Seems better to use C++11 member initializers and then let the compiler figure out how to construct objects of this class.

ACKs for top commit:
  stickies-v:
    ACK fac36b94ef
  pablomartin4btc:
    ACK fac36b94ef
  theStack:
    LGTM ACK fac36b94ef

Tree-SHA512: aee741c8f668f0e5b658fc83f4ebd196b43fead3dd437afdb0a2dafe092ae3d559332b3d9d61985c92e1a59982d8f24942606e6a98598c6ef7ff43697e858725
2023-10-23 10:37:27 +01:00
fanquake
3f482ac231
doc: add historical release notes for 24.2 2023-10-23 10:21:00 +01:00
fanquake
0f15db0ec9
Merge bitcoin/bitcoin#28697: fuzz: Increase merge -rss_limit_mb
fa21535551 fuzz: Increase merge -rss_limit_mb (MarcoFalke)

Pull request description:

  For some reason, the limit is hit. (Presumably due to `-set_cover_merge=1` eating more memory, or by simply having more fuzz inputs).

  Fix it by increasing it for the merge operation.

ACKs for top commit:
  dergoegge:
    ACK fa21535551
  hebasto:
    ACK fa21535551, considering the discussion in https://github.com/bitcoin-core/qa-assets/pull/155.

Tree-SHA512: 4fed0f254eccc6fe0b53656bc345ff898b13811dc39387387317d34b521ab77cee03d82b0896dd92d253b7546b6a7e4bdcd478749f47064374ab44ad759ab9ff
2023-10-23 10:10:53 +01:00
Fabian Jahr
4bfaad4eca
chainparams, assumeutxo: Fix signet txoutset hash
Review hint: You can use devtools/utxo_snapshot.sh to validate this.

./contrib/devtools/utxo_snapshot.sh 160000 signet-utxo.dat ./src/bitcoin-cli
2023-10-20 22:53:07 +02:00
Fabian Jahr
a503cd0f0b
chainparams, assumeutxo: Fix testnet txoutset hash
Review hint: You can use devtools/utxo_snapshot.sh to validate this.

./contrib/devtools/utxo_snapshot.sh 2500000 testnet-utxo.dat ./src/bitcoin-cli
2023-10-20 22:53:07 +02:00
Fabian Jahr
f6213929c5
assumeutxo: Check deserialized coins for out of range values 2023-10-20 22:53:07 +02:00
Fabian Jahr
66865446a7
docs: Add release notes for #28685 2023-10-20 22:53:06 +02:00
Fabian Jahr
cb0336817e
scripted-diff: Rename hash_serialized_2 to hash_serialized_3
-BEGIN VERIFY SCRIPT-
sed -i 's/hash_serialized_2/hash_serialized_3/g' $( git grep -l 'hash_serialized_2' ./src ./contrib ./test )
-END VERIFY SCRIPT-
2023-10-20 22:53:06 +02:00
Fabian Jahr
351370a1d2
coinstats: Fix hash_serialized2 calculation
The legacy serialization was vulnerable to maleation and is fixed by
adopting the same serialization procedure as was already in use for
MuHash.

This also includes necessary test fixes where the hash_serialized2 was
hardcoded as well as correction of the regtest chainparams.

Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2023-10-20 22:53:05 +02:00
Andrew Chow
c1106cfef5
Merge bitcoin/bitcoin#28669: test: check assumeutxo file for changed outpoint index + de-duplications
d3223685b1 test: De-dublicate/optimize assumeutxo test for further extensions (Fabian Jahr)
0a576d62fe test: check au file with changed outpoint index (Fabian Jahr)

Pull request description:

  Also doing some de-duplications. I kept the second commit separate for now as I am not 100% if this is overdoing it and makes it harder to reason about. But it also makes it easier to add more cases where we change more data.

ACKs for top commit:
  maflcko:
    lgtm ACK d3223685b1
  achow101:
    ACK d3223685b1

Tree-SHA512: be950a34b0ed50cb58459df47cff6513df19d834bf81815572cd26b10dee26e6f80866f0c44023cf246aafbbd256e62d23ce903e8b07fdff2297bc7065799bb8
2023-10-20 16:24:16 -04:00
MarcoFalke
fa21535551
fuzz: Increase merge -rss_limit_mb 2023-10-20 18:16:59 +02:00
fanquake
abfc8c901d
Merge bitcoin/bitcoin#28692: fuzz: Delete i2p fuzz test
dd4dcbd4cd [fuzz] Delete i2p target (dergoegge)

Pull request description:

  closes #28665

  The target is buggy and doesn't reach basic coverage.

ACKs for top commit:
  maflcko:
    lgtm ACK dd4dcbd4cd
  glozow:
    ACK dd4dcbd4cd, agree it's better to delete this test until somebody wants to write a better one

Tree-SHA512: b6ca6cad1773b1ceb6e5ac0fd501ea615f66507ef811745799deaaa4460f1700d96ae03cf55b740a96ed8cd2283b3d6738cd580ba97f2af619197d6c4414ca21
2023-10-20 15:30:16 +01:00
MarcoFalke
fac36b94ef
refactor: Remove CBlockFileInfo::SetNull 2023-10-20 16:29:02 +02:00
Hennadii Stepanov
6bdff429ec
build: Include config/bitcoin-config.h explicitly in util/trace.h
The `ENABLE_TRACING` macro is expected to be defined in the
`config/bitcoin-config.h` header.

Therefore, the current code is error-prone as it depends on whether the
`config/bitcoin-config.h` header was included before or not.
2023-10-20 14:40:26 +01:00
fanquake
3c856e2fe8
Merge bitcoin/bitcoin#28569: log: Don't log cache rebalancing in absense of a snapshot chainstate
ec84f999f1 log: Don't log cache rebalancing in absense of a snapshot chainstate (Fabian Jahr)

Pull request description:

  I have noticed that this log now is always printed, even if there is no snapshot chainstate present or even was present. I think this is confusing to users that have never even thought about using assumeutxo since in that case the rebalancing is just ensuring the normal environment with one chainstate. So I suggest we don't log in absence of a snapshot chainstate. We could also think about rewording the message instead but I think this is simpler.

ACKs for top commit:
  stickies-v:
    utACK ec84f999f1
  glozow:
    concept ACK ec84f999f1, don't have opinions other than removing confusing log
  theStack:
    utACK ec84f999f1

Tree-SHA512: 30bbfc648e7c788106f78d52e47a3aa1e1874f65d13743643dc50bcf7f450d8330711ff9fdeac361722542da6051533153829c6d49033227ed315e111afc899f
2023-10-20 14:39:34 +01:00
dergoegge
dd4dcbd4cd [fuzz] Delete i2p target 2023-10-20 14:03:34 +01:00
Fabian Jahr
ec84f999f1
log: Don't log cache rebalancing in absense of a snapshot chainstate 2023-10-20 14:53:44 +02:00
Fabian Jahr
d3223685b1
test: De-dublicate/optimize assumeutxo test for further extensions 2023-10-20 14:39:23 +02:00
Fabian Jahr
0a576d62fe
test: check au file with changed outpoint index 2023-10-20 14:39:21 +02:00
fanquake
fc1073bb45
Merge bitcoin/bitcoin#28643: ci: Add missing CI_RETRY_EXE before git clone
6889a80766 ci: Add missing CI_RETRY_EXE before git clone (MarcoFalke)
b705bade44 ci: Export `IN_GETOPT_BIN` on macOS (Hennadii Stepanov)
1c2132ddd9 Revert "ci: Upgrading pip version in macos environment" (Hennadii Stepanov)

Pull request description:

  This PR is a resurrection of https://github.com/bitcoin/bitcoin/pull/28623:

  > This should fix [bitcoin/bitcoin/actions/runs/6457002476/job/17527598426#step:7:240](https://github.com/bitcoin/bitcoin/actions/runs/6457002476/job/17527598426#step:7:240):
  >
  > ```
  > + git clone --depth=1 https://github.com/bitcoin-core/qa-assets /Users/runner/work/bitcoin/bitcoin/ci/scratch/qa-assets
  > Cloning into '/Users/runner/work/bitcoin/bitcoin/ci/scratch/qa-assets'...
  > error: RPC failed; curl 18 HTTP/2 stream 5 was reset
  > error: 54975 bytes of body are still expected
  > fetch-pack: unexpected disconnect while reading sideband packet
  > fatal: early EOF
  > fatal: fetch-pack: invalid index-pack output
  > Error: Process completed with exit code 128.
  > ```

ACKs for top commit:
  maflcko:
    lgtm ACK 6889a80766

Tree-SHA512: cd50102061a5c57fcf53ecbf552e7eae09995395e91651d00037e3f101c4906c0a994b2f6b1ccf984f2fc902ca59f0db66206ace56a2b6e2810dfa4167f3e115
2023-10-20 11:23:04 +01:00
Andrew Chow
4814e4063e test: Check tx metadata is migrated to watchonly 2023-10-19 18:06:44 -04:00
Andrew Chow
d616d30ea5 wallet: Reload watchonly and solvables wallets after migration
When migrating, create the watchonly and solvables wallets without a
context. Then unload and reload them after migration completes, as we do
for the actual wallet.

There is also additional handling for a failed reload.
2023-10-19 18:06:43 -04:00
Andrew Chow
118f2d7d70 wallet: Copy all tx metadata to watchonly wallet
When moving a tx to the watchonly wallet during migration, make sure
that all of the CWalletTx data follows it.
2023-10-19 18:06:43 -04:00
Andrew Chow
77f0ceb717
Merge bitcoin/bitcoin#28077: I2P: also sleep after errors in Accept() & destroy the session if we get an unexpected error
5c8e15c451 i2p: destroy the session if we get an unexpected error from the I2P router (Vasil Dimov)
762404a68c i2p: also sleep after errors in Accept() (Vasil Dimov)

Pull request description:

  ### Background

  In the `i2p::sam::Session` class:

  `Listen()` does:
  * if the session is not created yet
    * create the control socket and on it:
    * `HELLO`
    * `SESSION CREATE ID=sessid`
    * leave the control socked opened
  * create a new socket and on it:
  * `HELLO`
  * `STREAM ACCEPT ID=sessid`
  * read reply (`STREAM STATUS`), `Listen()` only succeeds if it contains `RESULT=OK`

  Then a wait starts, for a peer to connect. When connected,

  `Accept()` does:
  * on the socket from `STREAM ACCEPT` from `Listen()`: read the Base64 identification of the connecting peer

  ### Problem

  The I2P router may be in such a state that this happens in a quick succession (many times per second, see https://github.com/bitcoin/bitcoin/issues/22759#issuecomment-1609907115): `Listen()`-succeeds, `Accept()`-fails.

  `Accept()` fails because the I2P router sends something that is not Base64 on the socket: `STREAM STATUS RESULT=I2P_ERROR MESSAGE="Session was closed"`

  We only sleep after failed `Listen()` because the assumption was that if `Accept()` fails then the next `Listen()` will also fail.

  ### Solution

  Avoid filling the log with "Error accepting:" messages and sleep also after a failed `Accept()`.

  ### Extra changes

  * Reset the error waiting time after one successful connection. Otherwise the timer will remain high due to problems that have been solved long time in the past.

  * Increment the wait time less aggressively.

  * Handle the unexpected "Session was closed" message more gracefully (don't log stupid messages like `Cannot decode Base64: "STREAM STATUS...`) and destroy the session right way.

ACKs for top commit:
  achow101:
    ACK 5c8e15c451
  jonatack:
    re-ACK 5c8e15c451

Tree-SHA512: 1d47958c50eeae9eefcb668b8539fd092adead93328e4bf3355267819304b99ab41cbe1b5dbedbc3452c2bc389dc8330c0e27eb5ccb880e33dc46930a1592885
2023-10-19 16:08:06 -04:00
Andrew Chow
0655e9dd92
Merge bitcoin/bitcoin#27071: Handle CJDNS from LookupSubNet()
0e6f6ebc06 net: remove unused CConnman::FindNode(const CSubNet&) (Vasil Dimov)
9482cb780f netbase: possibly change the result of LookupSubNet() to CJDNS (Vasil Dimov)
53afa68026 net: move MaybeFlipIPv6toCJDNS() from net to netbase (Vasil Dimov)
6e308651c4 net: move IsReachable() code to netbase and encapsulate it (Vasil Dimov)
c42ded3d9b fuzz: ConsumeNetAddr(): avoid IPv6 addresses that look like CJDNS (Vasil Dimov)
64d6f77907 net: put CJDNS prefix byte in a constant (Vasil Dimov)

Pull request description:

  `LookupSubNet()` would treat addresses that start with `fc` as IPv6 even if `-cjdnsreachable` is set. This creates the following problems where it is called:

  * `NetWhitelistPermissions::TryParse()`: otherwise `-whitelist=` fails to white list CJDNS addresses: when a CJDNS peer connects to us, it will be matched against IPv6 `fc...` subnet and the match will never succeed.

  * `BanMapFromJson()`: CJDNS bans are stored as just IPv6 addresses in `banlist.json`. Upon reading from disk they have to be converted back to CJDNS, otherwise, after restart, a ban entry like (`fc00::1`, IPv6) would not match a peer (`fc00::1`, CJDNS).

  * `RPCConsole::unbanSelectedNode()`: in the GUI the ban entries go through `CSubNet::ToString()` and back via `LookupSubNet()`. Then it must match whatever is stored in `BanMan`, otherwise it is impossible to unban via the GUI.

  These were uncovered by https://github.com/bitcoin/bitcoin/pull/26859.

  Thus, flip the result of `LookupSubNet()` to CJDNS if the network base address starts with `fc` and `-cjdnsreachable` is set. Since subnetting/masking does not make sense for CJDNS (the address is "random" bytes, like Tor and I2P, there is no hierarchy) treat `fc.../mask` as an invalid `CSubNet`.

  To achieve that, `MaybeFlipIPv6toCJDNS()` has to be moved from `net` to `netbase` and thus also `IsReachable()`. In the process of moving `IsReachable()`, `SetReachable()` and `vfLimited[]` encapsulate those in a class.

ACKs for top commit:
  jonatack:
    Code review ACK 0e6f6ebc06
  achow101:
    ACK 0e6f6ebc06
  mzumsande:
    re-ACK 0e6f6ebc06

Tree-SHA512: 4767a60dc882916de4c8b110ce8de208ff3f58daaa0b560e6547d72e604d07c4157e72cf98b237228310fc05c0a3922f446674492e2ba02e990a272d288bd566
2023-10-19 12:48:39 -04:00
fanquake
6e721c923c
Merge bitcoin/bitcoin#28667: doc: add historical release notes for 25.1
2338715506 doc: add historical release notes for 25.1 (fanquake)

Pull request description:

  v25.1 has [been tagged](https://github.com/bitcoin/bitcoin/releases/tag/v25.1).
  For merge post-bin-availability.

ACKs for top commit:
  stickies-v:
    ACK 2338715506

Tree-SHA512: 799937b8bacab7908d86c91855bfcdfd1f8f806d82df0d04cf984d957d9bf1bbdde6103975358360ef35b0cfeba3ce894bc7dce412ea6790d495b78b3cebee0d
2023-10-19 15:45:43 +01:00
fanquake
9e616baec0
Merge bitcoin/bitcoin#22764: build: Include qt sources for parsing with extract_strings.py
b59b31ae0b build: Drop redundant qt/bitcoin.cpp (Hennadii Stepanov)
d90ad5a42e build: Include qt sources for parsing with extract_strings.py (Hennadii Stepanov)

Pull request description:

  On master (4fc15d1566) some strings are still untranslated.

  This PR fixes this issue.

  To verify:
  1) `./autogen.sh && ./configure && make -C src translate` _before_ applying this change
  2) apply this change
  3) `./autogen.sh && ./configure && make -C src translate` _after_ applying this change

  The result of `git diff src/qt/bitcoinstrings.cpp`:
  ```diff
  --- a/src/qt/bitcoinstrings.cpp
  +++ b/src/qt/bitcoinstrings.cpp
  @@ -126,6 +126,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
   "You need to rebuild the database using -reindex to go back to unpruned "
   "mode.  This will redownload the entire blockchain"),
   QT_TRANSLATE_NOOP("bitcoin-core", "%s is set very high!"),
  +QT_TRANSLATE_NOOP("bitcoin-core", "(press q to shutdown and continue later)"),
   QT_TRANSLATE_NOOP("bitcoin-core", "-maxmempool must be at least %d MB"),
   QT_TRANSLATE_NOOP("bitcoin-core", "A fatal internal error occurred, see debug.log for details"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -%s address: '%s'"),
  @@ -204,6 +205,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "SQLiteDatabase: Failed to prepare statement t
   QT_TRANSLATE_NOOP("bitcoin-core", "SQLiteDatabase: Failed to read database verification error: %s"),
   QT_TRANSLATE_NOOP("bitcoin-core", "SQLiteDatabase: Unexpected application id. Expected %u, got %u"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Section [%s] is not recognized."),
  +QT_TRANSLATE_NOOP("bitcoin-core", "Settings file could not be read"),
  +QT_TRANSLATE_NOOP("bitcoin-core", "Settings file could not be written"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Specified -walletdir \"%s\" does not exist"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Specified -walletdir \"%s\" is a relative path"),
  @@ -242,4 +245,5 @@ QT_TRANSLATE_NOOP("bitcoin-core", "User Agent comment (%s) contains unsafe chara
   QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks…"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet(s)…"),
   QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart %s to complete"),
  +QT_TRANSLATE_NOOP("bitcoin-core", "press q to shutdown"),
   };
  ```

ACKs for top commit:
  ryanofsky:
    Code review ACK b59b31ae0b. Being able to use `_()` macro in qt would allow simplifying some code, for example replacing repetitive:
  TheCharlatan:
    ACK b59b31ae0b

Tree-SHA512: 13d9d86b487a1b6e718ae96c198a0a927c881bf33df318412793ec9efba3a7e59cfa836204f73f5b53ff4c99edce778c11bffaa88138b80e37b71e36df6b816f
2023-10-19 13:25:49 +01:00
fanquake
106ab20f12
Merge bitcoin/bitcoin#28673: docs: Add reference to total.coverage report
2ce7e31d2d docs: Add reference to total.coverage report (Greg Sanders)

Pull request description:

  I couldn't get fuzz coverage to work, so couldn't verify what it would look like if made.

ACKs for top commit:
  darosior:
    ACK 2ce7e31d2d
  dergoegge:
    ACK 2ce7e31d2d

Tree-SHA512: c773ef28f7cc630cb094740805c0d235255e7b0559ac7fed4e8952ade4005335f3787bdd2f8786979e341e914b41c4f3eef02bb4773b15f92d618f1040f53c54
2023-10-19 10:32:04 +01:00
fanquake
091d29c495
Merge bitcoin/bitcoin#28617: test: Add Wallet Unlock Context Manager
004903ebad test: Add Wallet Unlock Context Manager (Brandon Odiwuor)

Pull request description:

  Fixes #28601, see https://github.com/bitcoin/bitcoin/pull/28403#discussion_r1325426430

  Add Context Manager to manage the locking and unlocking of locked wallets with a passphrase during testing.

ACKs for top commit:
  kevkevinpal:
    lgtm ACK [004903e](004903ebad)
  maflcko:
    lgtm ACK 004903ebad

Tree-SHA512: ab234c167e71531df0d974ff9a31d444f7ce2a1d05aba5ea868cc9452f139845eeb24ca058d88f058bc02482b762adf2d99e63a6640b872cc71a57a0068abfe8
2023-10-19 10:23:44 +01:00
fanquake
5eb82d5706
Merge bitcoin/bitcoin#28672: build: move -fstack-reuse=none to CORE_CXXFLAGS
8cfa22a846 build: move -fstack-reuse=none to CORE_CXXFLAGS (fanquake)

Pull request description:

  This is not a hardening specific flag, it should be used at all times, regardless of if hardening is enabled or not. Note that this was still the case here, but having this exist in the hardening flags is confusing, and may lead someone to move it inside one of the `use_hardening` blocks, where it would become unused, with `--disable-hardening`.

  Noticed while reviewing https://github.com/hebasto/bitcoin/pull/32#discussion_r1363564161.

ACKs for top commit:
  theuni:
    ACK 8cfa22a846. Agree it's confusing as-is and this better matches the intent.
  hebasto:
    ACK 8cfa22a846
  luke-jr:
    utACK 8cfa22a846
  TheCharlatan:
    ACK 8cfa22a846

Tree-SHA512: 74c3219301398361d06b1ef2257fc9ec18055b1661f8733ee909adefee61e458d70991c32adf0e0450905a7ffbddc99799f5fdac894f4896cfade19f961818df
2023-10-19 10:07:04 +01:00
fanquake
f4049eaf08
Merge bitcoin/bitcoin#28671: test: Fix failing time check in rpc_net.py
fa4c6836c9 test: Fix failing time check in rpc_net.py (MarcoFalke)

Pull request description:

  This check fails on slow runners, such as s390x qemu.

  Fix it by using mocktime.

  See https://github.com/bitcoin/bitcoin/pull/28523#discussion_r1357980527

ACKs for top commit:
  0xB10C:
    ACK fa4c6836c9
  pinheadmz:
    ACK fa4c6836c9
  brunoerg:
    crACK fa4c6836c9

Tree-SHA512: 83fb534682e11e97537dc89de8c16f206f38af1a892a2d5970c02684c05eaea8fc9adba3159f16b2440ca0b3871d513a0562a6f3a38f19a5574a47be0919e42f
2023-10-19 09:46:28 +01:00
fanquake
8cfa22a846
build: move -fstack-reuse=none to CORE_CXXFLAGS
This is not a hardening specific flag, it should be used at all times,
regardless of if hardening is enabled or not. Note that this was
still the case here, but having this exist in the hardening flags is
confusing, and may lead someone to move it inside one of the `use_hardening`
blocks, where it would become unused, with `--disable-hardening`.
2023-10-18 15:20:30 +01:00
Greg Sanders
2ce7e31d2d docs: Add reference to total.coverage report 2023-10-18 09:27:50 -04:00