Commit Graph

39839 Commits

Author SHA1 Message Date
fanquake
fe1eccd4d7
Merge bitcoin/bitcoin#29243: wallet: Reset chain notifications handler if AttachChain fails
ea2551e55d wallet: Reset chain notifications handler if AttachChain fails (Ava Chow)

Pull request description:

  AttachChain will create the chain notifications handler which contains a reference to the wallet's shared_ptr. If AttachChain fails, the wallet needs to be unloaded, and this is expected to happen with its custom deleter ReleaseWallet. However, if the chain notifications handler is still set, then the shared_ptr is still referenced by something, so the wallet is never actually released.

  This behavior can also be verified by looking at the debug.log file. When the wallet is released, the line "Releasing wallet" should appear in the debug.log file. However the failing test does not contain that line, indicating that the problem is that the `CWallet` object is not being destroyed. After this PR, that log line now appears, and the test also passes.

  Fixes #29234

ACKs for top commit:
  jamesob:
    ACK ea2551e55d
  murchandamus:
    ACK ea2551e55d
  TheCharlatan:
    ACK ea2551e55d
  furszy:
    Code review ACK ea2551e5
  BrandonOdiwuor:
    Code Review ACK ea2551e55d

Tree-SHA512: 73d676068c699303d9bcf70c9288ecb05f5f2e400ff3b7201367658d39d2fab63def97ab5ce4a742a6f2ca5e325f598fdbb6ce8f157a0423c07abc9a19bd5c81
2024-01-15 10:10:16 +00:00
Ava Chow
ea2551e55d wallet: Reset chain notifications handler if AttachChain fails
AttachChain will create the chain notifications handler which contains a
reference to the wallet's shared_ptr. If AttachChain fails, the wallet
needs to be unloaded, and this is expected to happen with its custom
deleter ReleaseWallet. However, if the chain notifications handler is
still set, then the shared_ptr is still referenced by something, so the
wallet is never actually released.
2024-01-12 20:09:08 -05:00
glozow
3ba8de1b70
Merge bitcoin/bitcoin#29235: doc: refer to "Node relay options" in policy/README
0d627c4ca8 doc: refer to "Node relay options" in policy/README (djschnei21)

Pull request description:

  Fixed up #29095, to refer to `-help`, rather than listing every option.

ACKs for top commit:
  stickies-v:
    ACK 0d627c4ca8
  glozow:
    lgtm ACK 0d627c4ca8

Tree-SHA512: 37d36ffa48297371eb0032ed48dce28802f862f6c18bdb50207555a228ce252e51a93a6fdef86b3e596d486c5107594d64db89f077b77fc885fe84cecb1dadc3
2024-01-12 12:25:22 +00:00
glozow
cd603361a4
Merge bitcoin/bitcoin#28885: mempool / rpc: followup to getprioritisedtransactions and delete a mapDeltas entry when delta==0
0eebd6fe7d test: Assert that a new tx with a delta of 0 is never added (kevkevin)
cfdbcd19b3 rpc: exposing modified_fee in getprioritisedtransactions (kevkevin)
252a86729a rpc: renaming txid -> transactionid (kevkevin)
2fca6c2dd0 rpc: changed prioritisation-map -> "" (kevkevin)
3a118e19e1 test: Directly constructing 2 entry map for getprioritisedtransactions (kevkevin)

Pull request description:

  In this PR I am addressing some comments in https://github.com/bitcoin/bitcoin/pull/27501 as a followup.
  - changed `prioritisation-map` in the `RPCResult` to `""`
  - Directly constructing 2 entry map for getprioritisedtransactions in functional tests
  - renamed `txid` to `transactionid` in `RPCResult` to be more consistent with naming elsewhere
  - exposed the `modified_fee` field instead of having it be a useless arg
  - Created a new test that asserts when `prioritisedtransaction` is called with a fee_delta of 0 it is not added to mempool

ACKs for top commit:
  glozow:
    reACK 0eebd6fe7d, only change is the doc suggestion

Tree-SHA512: e99056e37a8b1cfc511d87c83edba7c928b50d2cd6c2fd7c038976779850677ad37fddeb2b983e8bc007ca8567eb21ebb78d7eae9b773657c2b297299993ec05
2024-01-12 12:03:52 +00:00
fanquake
8c5e4f42d5
Merge bitcoin/bitcoin#29208: build: Bump clang minimum supported version to 14
aaaace2fd1 fuzz: Assume presence of __builtin_*_overflow, without checks (MarcoFalke)
fa223ba5eb Revert "build: Fix undefined reference to __mulodi4" (MarcoFalke)
fa7c751bd9 build: Bump clang minimum supported version to 14 (MarcoFalke)

Pull request description:

  Most supported operating systems ship with clang-14 (or later), so bump the minimum to that and allow new code to drop workarounds for previous clang bugs.

  For reference:
  * https://packages.debian.org/bookworm/clang (`clang-14`)
  * https://packages.ubuntu.com/jammy/clang (`clang-14`)
  * CentOS-like 8/9 Stream: All Clang versions from 15 to 17
  * FreeBSD 12/13: All Clang versions from 15 to 16
  * OpenSuse Tumbleweed ships with https://software.opensuse.org/package/clang (`clang17`); No idea about OpenSuse Leap

  On operating systems where the clang version is not shipped by default, the user would have to use GCC, or install clang in a different way. For example:

  * https://packages.debian.org/bullseye/g++ (g++-10)
  * https://packages.ubuntu.com/focal/g++-10
  * https://apt.llvm.org/, or nix, or guix, or compile clang from source, ...

ACKs for top commit:
  fanquake:
    ACK aaaace2fd1

Tree-SHA512: 81d066b14cc568d27312f1cc814b09540b038a10a0a8e9d71fc9745b024fb6c32a959af673e6819b817ea7cef98da4abfa63dff16cffb7821b40083016b0291f
2024-01-12 10:03:22 +00:00
fanquake
8c0d1c6cc2
Merge bitcoin/bitcoin#29218: ci: Rename tasks (previous releases, macOS cross)
fa0c594b33 ci: Rename tasks (previous releases, macOS cross) (MarcoFalke)

Pull request description:

  The previous releases task no longer uses the qt5 dev package, but the depends package, so fix that in the name.

  Also, remove a detail from the macOS cross task name, because anyone can look it up in the source, if they really want to. Otherwise, it may go out of date in the name.

  Also, rename the two tasks' config file to reflect the same.

ACKs for top commit:
  fanquake:
    ACK fa0c594b33

Tree-SHA512: e6f1d04128d35462c49367c98a0227988695d75add88c569804551e3fd30c22292d22b88fa19c54f02fab0c9784c77a078447de0280553a3fc7162dcf992d7ae
2024-01-12 09:56:53 +00:00
djschnei21
0d627c4ca8
doc: refer to "Node relay options" in policy/README 2024-01-11 18:06:01 +00:00
Ava Chow
4baa162dbb
Merge bitcoin/bitcoin#29212: Fix -netinfo backward compat with getpeerinfo pre-v26
5fa74609b8 Fix -netinfo backward compat with getpeerinfo pre-v26 (Jon Atack)

Pull request description:

  Commit fb5bfed26a in #29058 will cause `-netinfo` to break when calling it on a node that is running pre-v26 bitcoind, as `getpeerinfo` doesn't yet return a "transport_protocol_type" field.

  Fix this by adding an `IsNull()` check, as already done for other recent getpeerinfo fields, and also in the same commit:

  a) avoid checking for the full string "detecting", and instead do the cheaper check for the most frequent case of the string starting with "v"

  b) drop displaying the "v" prefix in all the rows, as it doesn't add useful information, and instead use "v" for the column header

  c) display nothing when a value isn't determined yet, like for the -netinfo mping and ping columns (as `*` already has a separate meaning in this dashboard, and `?` might look like there is a bug)

ACKs for top commit:
  mzumsande:
    Code Review ACK 5fa74609b8
  achow101:
    ACK 5fa74609b8
  kristapsk:
    ACK 5fa74609b8

Tree-SHA512: 4afc513dc669b95037180008eb4c57fc0a0d742c02f24b236562d6b8daad5c120eb1ce0d90e51696e0f9b8361a72fc930c0b64f04902cf96fb48c8e042e58624
2024-01-11 13:04:26 -05:00
Ava Chow
bb6de1befb
Merge bitcoin/bitcoin#29034: test: detect OS in functional tests consistently using platform.system()
878d914777 doc: test: mention OS detection preferences in style guideline (Sebastian Falbesoner)
4c65ac96f8 test: detect OS consistently using `platform.system()` (Sebastian Falbesoner)
37324ae3df test: use `skip_if_platform_not_linux` helper where possible (Sebastian Falbesoner)

Pull request description:

  There are at least three ways to detect the operating system in Python3:
  - `os.name` (https://docs.python.org/3.9/library/os.html#os.name)
  - `sys.platform` (https://docs.python.org/3.9/library/sys.html#sys.platform)
  - `platform.system()` (https://docs.python.org/3.9/library/platform.html#platform.system)

  We are currently using all of them in functional tests (both in individual tests and shared test framework code), which seems a bit messy. This PR consolidates into using `platform.system()`, as it appears to be one most consistent and easy to read (see also [IRC discussion](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2023-12-08#989301;) and table below). `sys.platform` is inconsistent as it has the major version number encoded for BSD systems, which doesn't make much sense for e.g. OpenBSD, where there is no concept of major versions, but instead the version is simply increased by 0.1 on each release.

  Note that `os.name` is still useful to detect whether we are running a POSIX system (see `BitcoinTestFramework.skip_if_platform_not_posix`), so for this use-case it is kept as only exception. The following table shows values for common operating systems, found via
  ```
  $ python3 -c "import os; import sys; import platform; print(os.name, sys.platform, platform.system())"
  ```

  |     OS       | os.name | sys.platform | platform.system()  |
  |--------------|---------|--------------|--------------------|
  | Linux 6.2.0  |  posix  |   linux      |      Linux         |
  | MacOS*       |  posix  |   darwin     |      Darwin        |
  | OpenBSD 7.4  |  posix  |   openbsd7   |      OpenBSD       |
  | Windows*     |  nt     |   win32      |      Windows       |

  \* = I neither have a MacOS nor a Windows machine available, so I extracted the values from documentation and our current code. Also I'm relying on CI for testing the relevant code-paths. Having reviewers to this this locally would be very appreciated, if this gets Concept ACKed.

ACKs for top commit:
  kevkevinpal:
    ACK [878d914](878d914777)
  achow101:
    ACK 878d914777
  hebasto:
    ACK 878d914777, I have reviewed the code and it looks OK.
  pablomartin4btc:
    tACK 878d914777

Tree-SHA512: 24513d493e47f572028c843260b81c47c2c29bfb701991050255c9f9529cd19065ecbc7b3b6e15619da7f3f608b4825c345ce6fee30d8fd1eaadbd08cff400fc
2024-01-11 12:17:01 -05:00
fanquake
dff6d1884a
Merge bitcoin/bitcoin#29222: doc: update Bitcoin Core license to 2024
1f8450f066 doc: upgrade Bitcoin Core license to 2024 (22388o️)

Pull request description:

  See  https://github.com/bitcoin/bitcoin/pull/26748.

  Cherry-picked these commits from 22388o and then squashed them.

ACKs for top commit:
  fanquake:
    ACK 1f8450f066

Tree-SHA512: 6d12f24a6c7cd421f7d975d7e445de4583144a4d0902d4e68e7648395074ca804e3ee585b2d3f307d193690e2ed2f9fbd8e7938f8fb8af263888b8701993782a
2024-01-11 16:47:56 +00:00
fanquake
131dd11ffd
Merge bitcoin/bitcoin#28870: depends: Include config.guess and config.sub into meta_depends
ff3f51b402 depends: Include `config.guess` and `config.sub` into `meta_depends` (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  theuni:
    ACK ff3f51b402.

Tree-SHA512: e8575473d3fca2293181131c76bd6d43017fe753d2e670c53227a646b64b069dc542a0fc50a77b43e74bc6a0c0159ffa2fb1c3ff3aef9625684e0f78c16ad960
2024-01-11 16:32:52 +00:00
MarcoFalke
fa0c594b33
ci: Rename tasks (previous releases, macOS cross) 2024-01-11 17:32:43 +01:00
Ava Chow
4e104e2381
Merge bitcoin/bitcoin#28838: test: add assumeutxo wallet test
997b9a73e5 test: add assumeutxo wallet test (Sjors Provoost)

Pull request description:

  Extracted from #28616, this adds a (very) basic wallet test for assume utxo. It checks some circumstances where a backup can and can't be loaded.

ACKs for top commit:
  maflcko:
    lgtm ACK 997b9a73e5
  achow101:
    ACK 997b9a73e5
  theStack:
    Code-review ACK 997b9a73e5

Tree-SHA512: 69474e56c6a46bb4f30fc54f8e5844766ac2a5f8226bb0b168d11ae1e3d4eae58570c1f1b4cc2b2f6f51b5d0e055bbe2bbd11684265215e01d4eb81ab4b7b0bb
2024-01-11 11:30:18 -05:00
fanquake
014f52550b
Merge bitcoin/bitcoin#29186: ci, iwyu: Drop backported mappings
a395218d8c ci, iwyu: Drop backported mappings (Hennadii Stepanov)

Pull request description:

  See https://github.com/include-what-you-use/include-what-you-use/pull/1026.

  Split from https://github.com/bitcoin/bitcoin/pull/27710 as a non-controversial change.

ACKs for top commit:
  fanquake:
    ACK a395218d8c

Tree-SHA512: ae7955a99396ab4f62ab7c989dba59c26448837f0ba4436bf3fddebe4099b5d3c03492e22a8497104c6afcceede1bb1b81f9d71c7c7e43692e6d70dcdfc11e7c
2024-01-11 16:18:26 +00:00
fanquake
12865d21ef
Merge bitcoin/bitcoin#29225: ci: move CMake into base packages
f3ca6db8d3 ci: move CMake into base packages (fanquake)

Pull request description:

  This is already used in multiple CIs, and will soon become a requirement for most CIs, i.e when we migrate depends packages to use CMake, for example: https://github.com/bitcoin/bitcoin/pull/21778#issuecomment-1885576324.

  Some of the CIs in 21778 are failing because CMake isn't available, so just break this out and make CMake globally available.

ACKs for top commit:
  maflcko:
    lgtm ACK f3ca6db8d3

Tree-SHA512: b3daa82c1ead29600168b3f064dc65c8e632baa6e7efb5f2e87ba1e9130a48c31becdf0a89e6ede479c5b08dd97eb4c9cfd4cc10207235c601dd089d5b808b59
2024-01-11 16:17:47 +00:00
kevkevin
0eebd6fe7d
test: Assert that a new tx with a delta of 0 is never added 2024-01-11 08:16:42 -06:00
kevkevin
cfdbcd19b3
rpc: exposing modified_fee in getprioritisedtransactions
Instead of having modified_fee be hidden we are now exposing it to avoid
having useless code
2024-01-11 08:16:22 -06:00
fanquake
4ae5171d42
Merge bitcoin/bitcoin#29219: fuzz: Improve fuzzing stability for ellswift_roundtrip harness
154fcce55c [fuzz] Improve fuzzing stability for ellswift_roundtrip harness (dergoegge)

Pull request description:

  See #29018

ACKs for top commit:
  sipa:
    utACK 154fcce55c
  brunoerg:
    crACK 154fcce55c

Tree-SHA512: 1e1ee47467a4a0d3a4e79f672018b440d8b3ccafba7428d37b9d0b8d3afd07e3f64f53ee668ed8a6a9ad1919422b5970814eaf857890acae7546951d8cb141d6
2024-01-11 11:51:57 +00:00
fanquake
f3ca6db8d3
ci: move CMake into base packages
This is already used in multiple CIs, and will soon become a requirement
for most CIs, i.e when we migrate depends packages to use CMake, for
example:
https://github.com/bitcoin/bitcoin/pull/21778#issuecomment-1885576324.

Some of the CIs in 21778 are failing because CMake isn't available, so
just break this out and make CMake globally available.
2024-01-11 11:30:04 +00:00
fanquake
522b8370d9
Merge bitcoin/bitcoin#29127: Use hardened runtime on macOS release builds.
4fdd836db9 Use hardened runtime on macOS release builds. (Mark Friedenbach)

Pull request description:

  The Apple notary service requires submitted app bundles to be configured to use the hardened runtime libraries.  This is configured at signing time, and supported by the signapple tool Bitcoin Core uses for reproduceable signed binaries.  We simply need to pass "--hardened-runtime" when the signature is created.  Once attached to the bundle, the resulting codesigned binary can be successfully submitted to the Apple binary notarization service by any Apple Developer.

  This partially resolves #15774. The release maintainer, or any authorized Apple Developer, will need to run `xcrun notarytool` to prevent gatekeeper warnings on macOS. Using `xcrun staple` to generate a binary that doesn't call home on first launch would be bonus, but at least this would massively improve the user experience.

ACKs for top commit:
  fanquake:
    ACK 4fdd836db9 - we can move ahead with this, and figure out notarisation / stapling as a followup.

Tree-SHA512: 7b8ba50030fb230d44bd63d12ed082537e8eaaa61396114c5df715f8dd6772fd8d84b00dc819f88d9a463996c2170a84981fce1bde7f7999b4bdb914fbcdfdac
2024-01-11 10:03:09 +00:00
22388o⚡️
1f8450f066
doc: upgrade Bitcoin Core license to 2024 2024-01-10 16:29:01 -06:00
Ava Chow
fcacbab487
Merge bitcoin/bitcoin#29204: test: wallet migration, add coverage for tx extra data
016cc807f7 test: wallet migration, add coverage for tx extra data (furszy)

Pull request description:

  Quick follow-up to #28610, coming from https://github.com/bitcoin/bitcoin/pull/28610#pullrequestreview-1802823938.

  Verifying that the 'replaced_by_txid' and 'replaces_txid' tx data is preserved after migration,
  as well as the extra tx comments.

ACKs for top commit:
  jamesob:
    Nice, ACK 016cc807f7
  achow101:
    ACK 016cc807f7
  pablomartin4btc:
    ACK 016cc807f7
  BrandonOdiwuor:
    lgtm ACK 016cc807f7

Tree-SHA512: 697cabece730cbe5c5947bf98455e80a8877c0352fbe2a66362ce5ea530b67882b0bec561a67d48fee200cdad717cd62c57fd809e2a94ff83c3fad30021e1d9e
2024-01-10 14:35:22 -05:00
Ava Chow
507dbe4ca2
Merge bitcoin/bitcoin#29211: fuzz: fix connman initialization
e84dc36733 fuzz: fix `connman` initialization (brunoerg)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/pull/29172#issuecomment-1883547121

ACKs for top commit:
  achow101:
    ACK e84dc36733

Tree-SHA512: e5f3c378cfe367cc4c387fa1b13663a74d8b667a5d130d62919e21455861cfb9383b63ef4ebe56daab7b2c09e3b5031acc463065455f71607c5fb9e3c370d3ad
2024-01-10 14:20:57 -05:00
Ava Chow
7ff8e6b240
Merge bitcoin/bitcoin#28318: logging: Simplify API for level based logging
e60fc7d5d3 logging: Replace uses of LogPrintfCategory (Anthony Towns)
f7ce5ac08c logging: add LogError, LogWarning, LogInfo, LogDebug, LogTrace (Anthony Towns)
fbd7642c8e logging: add -loglevelalways=1 option (Anthony Towns)
782bb6a056 logging: treat BCLog::ALL like BCLog::NONE (Anthony Towns)
667ce3e329 logging: Drop BCLog::Level::None (Anthony Towns)
ab34dc6012 logging: Log Info messages unconditionally (Anthony Towns)
dfe98b6874 logging: make [cat:debug] and [info] implicit (Anthony Towns)
c5c76dc615 logging: refactor: pull prefix code out (Anthony Towns)

Pull request description:

  Replace `LogPrint*` functions with severity based logging functions:

   * `LogInfo(...)`, `LogWarning(...)`, `LogError(...)` for unconditional (uncategorised) logging (replaces `LogPrintf`)
   * `LogDebug(CATEGORY, ...)` and `LogTrace(CATEGORY, ...)` for conditional logging (replaces `LogPrint`)
   * `LogPrintLevel(CATEGORY, LEVEL, ...)` for when the level isn't known in advance, or a category needs to be added for an info/warning/error log message (mostly unchanged, but rarely needed)

  Logs look roughly as they do now with `LogInfo` not having an `[info]` prefix, and `LogDebug` having a `[cat]` prefix, rather than a `[cat:debug]` prefix. This removes `BCLog::Level::None` entirely -- for `LogFlags::NONE` just use `Level::Info`, for any actual category, use `Level::Debug`.

  Adds docs to developer-notes about when to use which level.

  Adds `-loglevelalways=1` option so that you get `[net:debug]`, `[all:info]`, `[all:warning]` etc, which might be helpful for automated parsing, or just if you like everything to be consistent. Defaults to off to reduce noise in the default config, and to avoid unnecessary changes on upgrades.

  Changes the behaviour of `LogPrintLevel(CATEGORY, BCLog::Level::Info, ...)` to be logged unconditionally, rather than only being an additional optional logging level in addition to trace and debug. Does not change the behaviour of `LogPrintLevel(NONE, Debug, ...)` and `LogPrintLevel(NONE, Trace, ...)` being no-ops.

ACKs for top commit:
  maflcko:
    re-ACK e60fc7d5d3 🌚
  achow101:
    ACK e60fc7d5d3
  stickies-v:
    ACK e60fc7d5d3
  jamesob:
    ACK e60fc7d5d3 ([`jamesob/ackr/28318.1.ajtowns.logging_simplify_api_for`](https://github.com/jamesob/bitcoin/tree/ackr/28318.1.ajtowns.logging_simplify_api_for))

Tree-SHA512: e7a4588779b148242495b7b6f64198a00c314cd57100affab11c43e9d39c9bbf85118ee2002792087fdcffdea08c84576e20844b3079f27083e26ddd7ca15d7f
2024-01-10 14:11:32 -05:00
glozow
632a2bb731
Merge bitcoin/bitcoin#29215: test: assumeutxo: spend coin from snapshot chainstate after loading
931575418e test: assumeutxo: spend coin from snapshot chainstate after loading (Sebastian Falbesoner)

Pull request description:

  This PR extends the AssumeUTXO functional test by submitting a spending transaction for an UTXO that is only available in a the snapshot chainstate (after loading via `loadtxoutset`), i.e. it hasn't been seen in a block before. With that we can verify that snapshot coins are visible to the mempool.

  Note that we unfortunately can't use MiniWallet here, as the only available UTXO to spend from the snapshot chainstate is at height 200, where a P2PKH created from the test framework's deterministic private key is used (see `TestNode.generate(...)` and the `PRIV_KEYS` array). Coinbase outputs with smaller heights (<= 199) would be part of the pre-generated chain and hence not qualify for the "UTXO is only in snapshot chainstate and has never been seen in a block" scenario, coinbase outputs with larger heights (>= 201) can't be spent due to immaturity, as the snapshot chainstate block height is 299.

  One could of course mine a different chain with outputs that MiniWallet supports (e.g. taproot anyone-can-spend), but this would change the hardcoded AssumeUTXO hash, colliding with other PRs like #28838, so I wanted to avoid that.

ACKs for top commit:
  maflcko:
    lgtm ACK 931575418e
  jamesob:
    ACK 931575418e

Tree-SHA512: 0665868e1e91fe74f408d0a239cc264bbbc11a6b55bcc0e86cc8b4b2ec1f44977884b817dbe9065a7c768332cab464636656858bc8b9c8e7d7810498e0a17d78
2024-01-10 16:55:46 +00:00
dergoegge
154fcce55c [fuzz] Improve fuzzing stability for ellswift_roundtrip harness
`CPubKey::VerifyPubKey` uses rng internally which leads to instability
in the fuzz test.

We fix this by avoiding `VerifyPubKey` in the test and verifying the
decoded public key with a fuzzer chosen message instead.
2024-01-10 16:21:16 +00:00
Sebastian Falbesoner
931575418e test: assumeutxo: spend coin from snapshot chainstate after loading
Check that an UTXO that is only available in the snapshot chainstate
is also visible to the mempool by submitting a spending transaction.
2024-01-10 01:18:27 +01:00
Jon Atack
5fa74609b8 Fix -netinfo backward compat with getpeerinfo pre-v26
CLI -netinfo will currently break when calling it on a node that is running
pre-v26 bitcoind, as `getpeerinfo` doesn't yet return a transport_protocol_type
field.

Fix this by adding an `IsNull()` check as already done for other fields, and also:

- avoid checking for the full string "detecting", and instead do the cheaper
  check for the most frequent case of the string starting with "v"

- drop displaying the "v" prefix in all the rows, as it doesn't add useful
  information, and instead use "v" for the column header

- display nothing during peer setup, like for the -netinfo mping and ping columns
2024-01-09 15:27:08 -06:00
brunoerg
e84dc36733 fuzz: fix connman initialization 2024-01-09 15:15:36 -03:00
Ava Chow
063a8b8387
Merge bitcoin/bitcoin#29058: net, cli: use v2transport for manual/addrfetch connections, add to -netinfo
fb5bfed26a cli: add transport protcol column to -netinfo (Martin Zumsande)
9eed22e870 net: attempt v2 transport for addrfetch connections if we support it (Martin Zumsande)
770c0311ef net: attempt v2 transport for manual connections if we support it (Martin Zumsande)

Pull request description:

  Some preparations before enabling `-v2transport` as the default:
  * Use v2 for `-connect`, `-addnode` config arg and `-seednode` if `-v2transport` is enabled.
  Our peer may or may not support v2, but I don't think an extra option is necessary for any of these (we  have that for the `addnode` rpc), because we have the reconnection mechanism that will try again with `v1` if our peer doesn't support `v2`.
  * Add a column for the transport protocol to `-netinfo`. I added it next to the `net` column because I thought it looked nice there, but if people prefer it somewhere else I'm happy to move it.

  ![Screenshot from 2023-12-11 17-51-22](https://github.com/bitcoin/bitcoin/assets/48763452/b4f5dfcb-16be-4d8f-9303-9d342123deec)

ACKs for top commit:
  sipa:
    utACK fb5bfed26a
  achow101:
    ACK fb5bfed26a
  stratospher:
    tested ACK fb5bfed. addrfetch + manual connections aren't frequent and it would be useful to have this for transition to v2 one day.
  theStack:
    ACK fb5bfed26a
  kristapsk:
    ACK fb5bfed26a

Tree-SHA512: c4575ad11b99613870b342acae369fa08f877ac79e6e04eb62e94ad7a92d528e289183c0963c78aa779ba11cb91e2a6fad7c8b0d813126c46c3e5b54bd962c26
2024-01-09 12:46:52 -05:00
fanquake
5a121bcdee
Merge bitcoin/bitcoin#29200: net: create I2P sessions using both ECIES-X25519 and ElGamal encryption
9d728916b2 net: create I2P sessions with both ECIES-X25519 and ElGamal encryption (Jon Atack)

Pull request description:

  A Bitcoin Core node may only connect to a peer destination via I2P if both sides have sessions with the same encryption type.  Encryption type is a property of the session, not the destination.  Sessions may support multiple encryption types.

  As Bitcoin Core is not currently setting the encryption type when creating I2P sessions, it uses the older default, ElGamal (type 0).

  This pull updates our I2P session creation to use both ECIES-X25519 and ElGamal (types 4 and 0, respectively). This allows to connect to I2P peers of either type, and the newer, faster ECIES-X25519 will be preferred.

  See also:

  - discussion around https://github.com/qbittorrent/qBittorrent/issues/19625#issuecomment-1879582395
  - recently updated "Signature and Encryption Types" in https://geti2p.net/en/docs/api/samv3

  Thank you and credit to zzzi2p for reporting and to vort for the patch.

  Closes https://github.com/bitcoin/bitcoin/issues/29197.

ACKs for top commit:
  zzzi2p:
    ACK 9d728916b2
  recursive-rat4:
    ACK 9d728916b2
  kristapsk:
    cr utACK 9d728916b2
  brunoerg:
    crACK 9d728916b2
  shaavan:
    crACK 9d728916b2

Tree-SHA512: 0912fc01af9706914a7854f7479b9d82fc86c9530466cad8674e30f7eb4894d90d514efbc1aee8b7ea690faa6ff4a23b62cf5de8737cffdbc463300082c9b917
2024-01-09 17:08:06 +00:00
fanquake
b3b19be20d
Merge bitcoin/bitcoin#29203: build: Drop ALLOW_HOST_PACKAGES support in depends
080763a058 build: Drop `ALLOW_HOST_PACKAGES` support in depends (Hennadii Stepanov)

Pull request description:

  The `ALLOW_HOST_PACKAGES` variable was introduced in bitcoin#10508 "to speed up build and avoid timeout".

  It is no longer the case for our CI infrastructure, which uses self- hosted persistent workers and depends caching.

  In the current circumstances, it does not seem worth porting this feature to the upcoming [CMake-based](https://github.com/bitcoin/bitcoin/issues/28607) build system.

ACKs for top commit:
  fanquake:
    ACK 080763a058 - I can't imagine this option got any use outside our CI. It's also mostly just at odds with the idea of a self-contained dependency builder.
  TheCharlatan:
    ACK 080763a058

Tree-SHA512: 36f52690be913479c5d12be36760b8de1a6e891fe7c2cf98a7b8d6561006a6b18631e431351d79e97edb9409f9902d032aedf7b963aa7615e54b59fc2a58f7d6
2024-01-09 15:52:19 +00:00
MarcoFalke
aaaace2fd1
fuzz: Assume presence of __builtin_*_overflow, without checks 2024-01-09 16:46:58 +01:00
MarcoFalke
fa223ba5eb
Revert "build: Fix undefined reference to __mulodi4"
This reverts commit e4c8bb62e4.
2024-01-09 15:38:57 +01:00
MarcoFalke
fa7c751bd9
build: Bump clang minimum supported version to 14 2024-01-09 14:17:55 +01:00
fanquake
9e1306fc88
Merge bitcoin/bitcoin#29195: build: Fix -Xclang -internal-isystem option
d742be3d3f ci: Switch native macOS CI job to Xcode 15.0 (Hennadii Stepanov)
8decc5c726 build: Fix `-Xclang -internal-isystem` option (Hennadii Stepanov)

Pull request description:

  This PR:
  - addresses https://github.com/bitcoin/bitcoin/pull/29165#discussion_r1439433156
  - fixes https://github.com/bitcoin/bitcoin/issues/29174

ACKs for top commit:
  fanquake:
    ACK d742be3d3f. The same as what was done in #27328.

Tree-SHA512: 4788a0511e9fac638edab8e4f7ec62c5e08aeb07e518ab62fd53074ab3dd4eca1f62dc17c2af2b535bad12e77a7437e5c1c714cd03ce711e5d5e5c87d4620358
2024-01-09 10:39:22 +00:00
fanquake
f921d949a0
Merge bitcoin/bitcoin#29172: fuzz: set nMaxOutboundLimit in connman target
e5b9ee0221 fuzz: set `nMaxOutboundLimit` in connman target (brunoerg)

Pull request description:

  Setting `nMaxOutboundLimit` (`-maxuploadtarget`) will make fuzz to reach more coverage in connman target. This value is used in `GetMaxOutboundTimeLeftInCycle`, `OutboundTargetReached` and `GetOutboundTargetBytesLeft`.

ACKs for top commit:
  dergoegge:
    utACK e5b9ee0221
  jonatack:
    ACK e5b9ee0221

Tree-SHA512: d19c83602b0a487e6da0e3be539aa2abc95b8bbf36cf9a3e391a4af53b959f68ca38548a96d27d56742e3b772f648da04e2bf8973dfc0ab1cdabf4f2e8d44de6
2024-01-09 09:43:13 +00:00
kevkevin
252a86729a
rpc: renaming txid -> transactionid
renamed to transactionid because it is named this way in getrawmempool
and getmempoolancestors
2024-01-08 19:01:45 -06:00
kevkevin
2fca6c2dd0
rpc: changed prioritisation-map -> ""
prioritisation-map gets eaten by the help generator to be "" so we are
setting to "" to begin with
2024-01-08 19:01:21 -06:00
Hennadii Stepanov
080763a058
build: Drop ALLOW_HOST_PACKAGES support in depends
The `ALLOW_HOST_PACKAGES` variable was introduced in bitcoin#10508 "to
speed up build and avoid timeout".

It is no longer the case for our CI infrastructure, which uses self-
hosted persistent workers and depends caching.

In the current circumstances, it does not seem worth porting this
feature to the upcoming CMake-based build system.
2024-01-08 15:56:25 +00:00
furszy
016cc807f7
test: wallet migration, add coverage for tx extra data
Verifying that the 'replaced_by_txid' and 'replaces_txid'
tx data is preserved after migration, as well as the
extra tx comments.
2024-01-08 12:04:31 -03:00
fanquake
c2d04f1319
Merge bitcoin/bitcoin#28610: wallet: Migrate entire address book entries to watchonly and solvables too
406b71abcb wallet: Migrate entire address book entries (Andrew Chow)

Pull request description:

  Not all of the data in an address book entry was being copied to the watchonly and solvables wallets. This includes information such as whether the address was previously spent, and any receive requests that may exist. A test has been added to check that the previously spent information is copied, although it passes without the changes in this PR since this information is also regenerated when a transaction is loaded/added into a wallet.

ACKs for top commit:
  ryanofsky:
    Code review ACK 406b71abcb. Just suggested change since last review
  furszy:
    Code review ACK 406b71ab

Tree-SHA512: 13de42b16a1d8524fe0555764744139566b2e7d29741ceffc1158a905dd537136b762330568b3b5cac28cbee1bfd363a20de97d0a6c5296738cb3aa99133945b
2024-01-08 14:44:47 +00:00
glozow
04b9df0f9f
Merge bitcoin/bitcoin#29184: RPC/Blockchain: scanblocks: Accept named param for filter_false_positives
5779010ed7 RPC/Blockchain: scanblocks: Accept named param for filter_false_positives (Luke Dashjr)

Pull request description:

  Possibly due to a silent cross-merge, `scanblocks` was left out of 96233146dd

ACKs for top commit:
  stickies-v:
    ACK 5779010ed7
  theStack:
    ACK 5779010ed7

Tree-SHA512: bade107c7cb5fdd1265224c263a1e1edfc8bc0698b3abfac8d65c49a270181f0311713f7243813de17932a7a7ca65a36850e527ab0b433cf64c32191d3adde70
2024-01-08 10:37:04 +00:00
Hennadii Stepanov
d742be3d3f
ci: Switch native macOS CI job to Xcode 15.0 2024-01-08 10:30:28 +00:00
Jon Atack
9d728916b2 net: create I2P sessions with both ECIES-X25519 and ElGamal encryption
A Bitcoin Core node may only connect to a peer destination via I2P if both sides
have sessions with the same encryption type.  The encryption type is a property
of the session, not the destination.  Sessions may support multiple encryption
types.

As Bitcoin Core is not currently setting the I2P encryption type when creating
sessions, it is using the older default, ElGamal (type 0).

This pull updates Bitcoin Core to use both ECIES-X25519 and ElGamal (types 4 and
0, respectively).  This allows to connect to I2P peers with either type, and the
newer, faster ECIES-X25519 will be preferred.

See also the recently updated section "Signature and Encryption Types" in
https://geti2p.net/en/docs/api/samv3

Thanks and credit to zzzi2p (https://github.com/zzzi2p) for reporting.

Closes https://github.com/bitcoin/bitcoin/issues/29197.
2024-01-07 16:24:08 -06:00
Hennadii Stepanov
8decc5c726
build: Fix -Xclang -internal-isystem option
LLVM Clang >=16.0 and Apple Clang >=15.0 do not recognize
`-Xclang -internal-isystem/usr/local/include` anymore.

For example, see: cbbe1d4454
2024-01-07 11:32:51 +00:00
fanquake
82ba0f80a0
Merge bitcoin/bitcoin#28962: doc: Rework guix docs after 1.4 release
fad444f6e1 doc: Rework guix docs after 1.4 release (MarcoFalke)

Pull request description:

  Follow-up to https://github.com/bitcoin/bitcoin/pull/28902

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

ACKs for top commit:
  TheCharlatan:
    ACK fad444f6e1
  fanquake:
    ACK fad444f6e1

Tree-SHA512: 23f270b438ede4e3173da68e63c1d022e2ef23bfd83f0ec038ec63a62348038722278385c5dac63ac29a460b4b61f23d8c9939667e00a1a3571b041d3eecb4cb
2024-01-05 17:44:37 +00:00
fanquake
04978c2e18
Merge bitcoin/bitcoin#29117: wallettool: Always be able to dump a wallet's database
d83bea42d1 wallettool: Don't create CWallet when dumping DB (Andrew Chow)
40c80e36b1 wallettool: Don't unilaterally reset wallet_instance if loading error (Ava Chow)

Pull request description:

  https://github.com/bitcoin/bitcoin/issues/29109#issuecomment-1863449058 reports that a wallet with noncritical errors cannot be dumped with `bitcoin-wallet dump`. This was caused by an erroneous reset of the wallet pointer when the loading the wallet returns something other than `LOAD_OK`. Not all errors are errors that require aborting, so unilaterally resetting the pointer at that time is incorrect. The first commit resolves this issue.

  Furthermore, if a wallet has loading errors, that should not prevent the wallet tool from dumping the wallet. The wallet application logic should not get in the way of performing such a low level database operation, especially when it's primary usage is for debugging potentially corrupted wallets. The 2nd commit is taken from #28710 and changes the `dump` to stop at making a `WalletDatabase` rather than making a `CWallet` only to retrieve the underlying `WalletDatabase`.

ACKs for top commit:
  furszy:
    Code review ACK d83bea42d1
  BrandonOdiwuor:
    Code Review ACK d83bea42d1

Tree-SHA512: 425d712dfff1002bd81272aca0bae1016f9126a3c89506f8cb7cf0a0ec9f33d0c03b8d03896394f3a45c2998e59047e19218dfd08dc8a5f40e8625134e886b0f
2024-01-05 17:40:44 +00:00
Hennadii Stepanov
a395218d8c
ci, iwyu: Drop backported mappings
See https://github.com/include-what-you-use/include-what-you-use/pull/1026
2024-01-05 16:01:52 +00:00
brunoerg
e5b9ee0221 fuzz: set nMaxOutboundLimit in connman target 2024-01-05 12:38:35 -03:00