Commit graph

41421 commits

Author SHA1 Message Date
MarcoFalke
fa9cb101cf
refactor: Add explicit cast to expected_last_page to silence fuzz ISan 2024-06-07 17:30:38 +02:00
Matthew Zipkin
1f6ab1215b
minor: remove unnecessary semicolons from RPC content type examples 2024-06-07 10:47:24 -04:00
glozow
feab35189b
Merge bitcoin/bitcoin#30161: util: add VecDeque
7b8eea067f tests: add fuzz tests for VecDeque (Pieter Wuille)
62fd24af6a util: add VecDeque (Pieter Wuille)

Pull request description:

  Extracted from #30126.

  This adds a `VecDeque` data type, inspired by `std::deque`, but backed by a single allocated memory region used as a ring buffer instead of a linked list of arrays. This gives better memory locality and less allocation overhead, plus better guarantees (some C++ standard library implementations, though not libstdc++ and libc++, use a separate allocation per element in a deque).

  It is intended for the candidate set search queue in #30126, but may be useful as a replacement for `std::deque` in other places too. It's not a full drop-in replacement, as I did not add iteration support which is unnecessary for the intended use case, but nothing prevents adding that if needed.

  Everything is tested through a simulation-based fuzz test that compares the behavior with normal `std::deque` equivalent operations, both for trivially-copyable/destructible types and others.

ACKs for top commit:
  instagibbs:
    reACK 7b8eea067f
  cbergqvist:
    re-ACK 7b8eea067f
  hebasto:
    re-ACK 7b8eea067f, I've verified changes since my recent [review](https://github.com/bitcoin/bitcoin/pull/30161#pullrequestreview-2103018546) with
  glozow:
    ACK 7b8eea067f

Tree-SHA512: 1b62f3ba1a43a1293d8c9de047e2399442e74c46de2df81406151fe27538716ce265f35fb6779ee56d77a39cddf8fb4b4e15bda8f04ebf3b149e2f05fa55cb21
2024-06-07 14:32:13 +01:00
Matthew Zipkin
b225295298
test: use json-rpc 2.0 in all functional tests by default 2024-06-07 09:26:55 -04:00
Matthew Zipkin
391843b029
bitcoin-cli: use json-rpc 2.0 2024-06-07 09:26:55 -04:00
Matthew Zipkin
d39bdf3397
test: remove unused variable in interface_rpc.py 2024-06-07 09:26:55 -04:00
Matthew Zipkin
0ead71df8c
doc: update and link for JSON-RPC 2.0 2024-06-07 09:26:50 -04:00
TheCharlatan
e172553223
validation: Remove needs_init from LoadBlockIndex
It does not control any actual logic and the log message as well as the
comment are obsolete, since no database initialization takes place there
anymore. Log messages indicating when indexes and chainstate databases
are loaded exist in other places.
2024-06-07 13:06:57 +02:00
TheCharlatan
533eab7d67
bugfix: Streamline setting reindex option
Reverts a bug introduced in b47bd95920
"kernel: De-globalize fReindex". The change leads to a GUI user being
prompted to re-index on a chainstate loading failure more than once as
well as the node actually not reindexing if the user chooses to. Fix
this by setting the reindexing option instead of the atomic, which can
be safely re-used to indicate that a reindex should be attempted.

The bug specifically is caused by the chainman, and thus the blockman
and its m_reindexing atomic being destroyed on every iteration of
the for loop.

The reindex option for ChainstateLoadOptions is currently also set in a
confusing way. By using the reindex atomic, it is not obvious in which
scenario it is true or false.

The atomic is controlled by both the user passing the -reindex option,
the user chosing to reindex if something went wrong during chainstate
loading when running the gui, and by reading the reindexing flag from
the block tree database in LoadBlockIndexDB. In practice this read is
done through the chainstate module's CompleteChainstateInitialization's
call to LoadBlockIndex. Since this is only done after the reindex option
is set already, it does not have an effect on it.

Make this clear by using the reindex option from the blockman opts which
is only controlled by the user.
2024-06-07 13:06:52 +02:00
Hennadii Stepanov
0d3ef83433
ci: Use relative paths in win64-native CI job consistently
This change improves readability. Also the `Tee-Object` cmdlet is used
when appropriate.
2024-06-07 10:47:36 +01:00
Hennadii Stepanov
501aceefcf
ci: Remove no longer needed workaround for GHA Windows images
GHA Windows images previously had multiple VC Build Tools installed,
which required specifying the `VCPKG_PLATFORM_TOOLSET_VERSION`
explicitly to avoid linker errors. This issue has been resolved as per
https://github.com/actions/runner-images/issues/9701.
2024-06-07 09:55:34 +01:00
Ava Chow
4a020ca443
Merge bitcoin/bitcoin#29401: test: Remove struct.pack from almost all places
fa52e13ee8 test: Remove struct.pack from almost all places (MarcoFalke)
fa826db477 scripted-diff: test: Use int.to_bytes over struct packing (MarcoFalke)
faf2a975ad test: Use int.to_bytes over struct packing (MarcoFalke)
faf3cd659a test: Normalize struct.pack format (MarcoFalke)

Pull request description:

  `struct.pack` has many issues:

  * The format string consists of characters that may be confusing and may need to be looked up in the documentation, as opposed to using easy to understand self-documenting code.

  This lead to many test bugs, which weren't hit, which is fine, but still confusing. Ref: https://github.com/bitcoin/bitcoin/pull/29400, https://github.com/bitcoin/bitcoin/pull/29399, https://github.com/bitcoin/bitcoin/pull/29363, fa3886b7c6, ...

  Fix all issues by using the built-in `int` helpers `to_bytes` via a scripted diff.

  Review notes:

  * For `struct.pack` and `int.to_bytes` the error behavior is the same, although the error messages are not identical.
  * Two `struct.pack` remain. One for float serialization in a C++ code comment, and one for native serialization.

ACKs for top commit:
  achow101:
    ACK fa52e13ee8
  rkrux:
    tACK [fa52e13](fa52e13ee8)
  theStack:
    Code-review ACK fa52e13ee8

Tree-SHA512: ee80d935b68ae43d1654b047e84ceb80abbd20306df35cca848b3f7874634b518560ddcbc7e714e2e7a19241e153dee64556dc4701287ae811e26e4f8c57fe3e
2024-06-06 19:18:55 -04:00
Pieter Wuille
7b8eea067f tests: add fuzz tests for VecDeque 2024-06-06 17:06:15 -04:00
Pieter Wuille
62fd24af6a util: add VecDeque
This is an STL-like container that interface-wise looks like std::deque, but
is backed by a (fixed size, with vector-like capacity/reserve) circular buffer.
2024-06-06 17:06:15 -04:00
marcofleon
193c748e44 fuzz: add I2P harness 2024-06-06 13:06:23 -07:00
Pieter Wuille
6eecba475e net_processing: make MaybePunishNodeFor{Block,Tx} return void 2024-06-06 13:50:54 -04:00
Cory Fields
15796d4b61 build: warn on self-assignment
Belt-and suspenders after #30234. Self-assignment should be safe _and_
discouraged.

We used to opt out of this warning because something deep in our
serialization/byteswapping code could self-assign, but that doesn't appear to
be the case anymore.
2024-06-06 14:14:34 +00:00
Cory Fields
53372f2176 refactor: disable self-assign warning for tests
clang-16 and earlier detect "foo -= foo" and "foo /= foo" as self-assignments.
2024-06-06 14:14:08 +00:00
merge-script
1040a1fc80
Merge bitcoin/bitcoin#30228: build: no-longer allow GCC-10 in C++20 check
232928b58a build: no-longer allow GCC-10 in C++20 check (fanquake)

Pull request description:

  Reverts part of fa67f096bd, now that we require a minimum of GCC 11.

  See also:
  https://github.com/bitcoin/bitcoin/pull/28349#issuecomment-1745143612.

ACKs for top commit:
  maflcko:
    utACK 232928b58a
  theuni:
    utACK 232928b58a

Tree-SHA512: 10e0adac2dd6e455aaf97ebfe73c7586430349fc27ac435bc6c0d99a4934a380398d14467aacd9cedf371345da291366b3ab2c3be7db5d97e21ad6212b2c7890
2024-06-06 10:59:25 +01:00
merge-script
f47cd649e9
Merge bitcoin/bitcoin#30236: build: re-enable deprecated warning copy
c3a5e8a063 build: re-enable deprecated warning copy (Cory Fields)

Pull request description:

  Noticed while looking at the `-wno-*` flags in #30235.

  This was disabled in #18738 due to the combo of old gcc and qt. We no longer support the affected gcc, and the old qt should no longer be relevant to us anyway.

  See old fixes in:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88136
  and
  https://bugreports.qt.io/browse/QTBUG-75210
  and
  https://codereview.qt-project.org/c/qt/qtbase/+/245434

ACKs for top commit:
  maflcko:
    ACK c3a5e8a063
  fanquake:
    ACK c3a5e8a063 - this is in `-Wextra` for Clang and GCC.

Tree-SHA512: bd008dc50134d15ca3bb0c4f78d910db5b7a0ee98b04c159122a6f13a24b18827806492f053293d9cc1f1528ba60dea6d9ed31a366f63840ccb7c55f002d263b
2024-06-06 10:49:37 +01:00
Cory Fields
c3a5e8a063 build: re-enable deprecated warning copy
This was disabled in #18738 due to the combo of old gcc and qt, neither of
which are relevant to us anymore.
2024-06-05 21:06:44 +00:00
Sebastian Falbesoner
5cf0a1f230 test: add createmultisig P2MS encoding test for all n (1..20) 2024-06-05 16:18:34 +02:00
Sebastian Falbesoner
0570d2c204 test: add unit test for keys_to_multisig_script 2024-06-05 16:18:31 +02:00
Sebastian Falbesoner
0c41fc3fa5 test: fix keys_to_multisig_script (P2MS) helper for n/k > 16
The helper assumes that the n and k values have to be provided as a
single byte push operation, which is only possible for values up to 16.
Fix that by passing the numbers directly to the CScript list, where it's
automatically converted to minimally-encoded pushes (see class
method `CScript.__coerce_instance`, branch `isinstance(other, int)`).

In case of 17..20, this means that the data-pushes are done with two
bytes using OP_PUSH1 (0x01), e.g. for n=20: 0x01,0x14
2024-06-05 16:15:17 +02:00
fanquake
2599655c1f
guix: bump time-machine to f0bb724211872cd6158fce6162e0b8c73efed126
Includes:
LLVM 18.1.x (#30201)
GCC 13.x (#29881)

git-minimal 2.41.0 -> 2.45.1
Kernel Headers 6.1.80 -> 6.1.92
moreutils 0.68 -> 0.69

Commits like
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7b0f145802f0c2c785014293d748721678fef824,
which should improve the bootstrap situation (#30042).
2024-06-05 14:15:10 +01:00
Lőrinc
07f64177a4 Reduce memory copying operations in bech32 encode
Here I've reduced the memory reallocations and copying operations in bech32 encode, making it ~15% faster.

make && ./src/bench/bench_bitcoin --filter='Bech32Encode' --min-time=1000

Before:

|             ns/byte |              byte/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|               19.97 |       50,074,562.72 |    0.1% |      1.06 | `Bech32Encode`
After:

|             ns/byte |              byte/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|               17.33 |       57,687,668.20 |    0.1% |      1.10 | `Bech32Encode`

Co-authored-by: josibake <josibake@protonmail.com>
2024-06-05 13:18:13 +02:00
Lőrinc
d5ece3c4b5 Reserve hrp memory in Decode and LocateErrors 2024-06-05 12:46:39 +02:00
merge-script
ff7d2054c4
Merge bitcoin/bitcoin#30185: guix: show *_FLAGS variables in pre-build output
5f2c1d84e3 guix: show *_FLAGS variables in pre-build output (fanquake)

Pull request description:

  For example:
  ```bash
  # ADDITIONAL_GUIX_COMMON_FLAGS set in the ENV
  ADDITIONAL_GUIX_ENVIRONMENT_FLAGS="--emulate-fhs" ./contrib/guix/guix-build
  <snip>
  INFO: Building f751991 for platform triple x86_64-linux-gnu:
        ...using reference timestamp: 1716905119
        ...running at most 10 jobs
        ...from worktree directory: '/bitcoin'
            ...bind-mounted in container to: '/bitcoin'
        ...in build directory: '/bitcoin/guix-build-f75199182133/distsrc-f75199182133-x86_64-linux-gnu'
            ...bind-mounted in container to: '/distsrc-base/distsrc-f75199182133-x86_64-linux-gnu'
        ...outputting in: '/bitcoin/guix-build-f75199182133/output/x86_64-linux-gnu'
            ...bind-mounted in container to: '/outdir-base/x86_64-linux-gnu'
        ADDITIONAL FLAGS (if set)
            ADDITIONAL_GUIX_COMMON_FLAGS: --no-substitutes
            ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: --emulate-fhs
            ADDITIONAL_GUIX_TIMEMACHINE_FLAGS:
  ```

ACKs for top commit:
  hebasto:
    ACK 5f2c1d84e3.

Tree-SHA512: 85a6d508499b4ec1d6166343a1707b682d327b2fcfb2fb438571894478aac0062d21e1239b5092091ff98711c5c747151973c4f325a7a7c447d0e807166fcb07
2024-06-05 11:40:47 +01:00
merge-script
74dc8585b3
Merge bitcoin/bitcoin#30174: test: Set mocktime in p2p_disconnect_ban.py to avoid intermittent test failure
4444de152f test: Set mocktime in p2p_disconnect_ban.py to avoid intermittent test failure (MarcoFalke)
fa6aa4027c test: Fix typos and use names args (MarcoFalke)

Pull request description:

  Otherwise, the test may fail on slow hardware when running in valgrind.

  Also, use named args for the absolute timepoint, while touching this file.

ACKs for top commit:
  tdb3:
    ACK for 4444de152f
  AngusP:
    re-ACK 4444de152f

Tree-SHA512: 660269c8dd18887d69b284f38656899caf028159ce83ddf921f3e9c080a5d0e663989f0e42b4baf4c4939f20f34da0e7e844dff9b7c91d0cab570c60958bd0e1
2024-06-05 11:37:15 +01:00
fanquake
232928b58a
build: no-longer allow GCC-10 in C++20 check
Reverts part of fa67f096bd, now that we
require a minimum of GCC 11.

See also:
https://github.com/bitcoin/bitcoin/pull/28349#issuecomment-1745143612.
2024-06-05 10:47:52 +01:00
fanquake
e6636ff4ec
doc: fixup deps doc after #30198 2024-06-05 10:08:35 +01:00
Ava Chow
2721d64989 chainparams: Add achow101 DNS seeder 2024-06-04 23:25:19 -04:00
Ava Chow
23b3dc2dd1
Merge bitcoin/bitcoin#30218: refactor: remove unused CKey::Negate method
8801e319d5 refactor: remove unused `CKey::Negate` method (Sebastian Falbesoner)

Pull request description:

  This method was introduced as a pre-requirement for the v2 transport protocol back then (see PR #14047, commit 463921bb), when it was still BIP151. With the replacement BIP324, this is not needed anymore, and it's also unlikely that for any other proposal we'd ever need to negate private keys at this abstraction level. I'd argue that this operation is usually something that should happen within a secp256k1 module (like e.g. done in MuSig2, Silent Payments...).

  (If there is really demand in the future, it's also trivial to reintroduce the method.)

ACKs for top commit:
  laanwj:
    ACK 8801e319d5
  sipa:
    ACK 8801e319d5
  achow101:
    ACK 8801e319d5

Tree-SHA512: 7bc1566399635c5c6e4940a2724c865d5443eb190024379099330c023c516f1e4f423ed9e8c42bc93413b723a5464ec79d3f879f58c0e598fe24f495238df4ec
2024-06-04 21:57:36 -04:00
Ava Chow
c29314ecfc
Merge bitcoin/bitcoin#29998: functional test: ensure confirmed utxo being sourced for 2nd chain
07aba8dd21 functional test: ensure confirmed utxo being sourced for 2nd chain (Greg Sanders)

Pull request description:

  The test could fail/stop testing what we want if non-confirmed utxos become sourced through some internal change to `MiniWallet`; better to just fetch confirmed explicitly.

ACKs for top commit:
  achow101:
    ACK 07aba8dd21
  ismaelsadeeq:
    utACK 07aba8dd21
  theStack:
    ACK 07aba8dd21

Tree-SHA512: 66795fdf881139ed91bde0f8239a46bd9bc70bb311fa97c0e2b5537e1fd2a1fd36bf3a225fc77b9695deb835a9d6d29879aa1e05ea5054b9a33a400e199da014
2024-06-04 21:47:16 -04:00
Ava Chow
76a33be21d
Merge bitcoin/bitcoin#28307: rpc, wallet: fix incorrect segwit redeem script size limit
2451a217dd test: addmultisigaddress, coverage for script size limits (furszy)
53302a0981 bugfix: addmultisigaddress, add unsupported operation for redeem scripts over 520 bytes (furszy)
9be6065cc0 test: coverage for 16-20 segwit multisig scripts (furszy)
9d9a91c4ea rpc: bugfix, incorrect segwit redeem script size used in signrawtransactionwithkey (furszy)
0c9fedfc45 fix incorrect multisig redeem script size limit for segwit (furszy)
f7a173b578 test: rpc_createmultisig, decouple 'test_sortedmulti_descriptors_bip67' (furszy)
4f33dbd8f8 test: rpc_createmultisig, decouple 'test_mixing_uncompressed_and_compressed_keys' (furszy)
25a81705d3 test: rpc_createmultisig, remove unnecessary checkbalances() (furszy)
b5a3289433 test: refactor, multiple cleanups in rpc_createmultisig.py (furszy)
3635d43268 test: rpc_createmultisig, remove manual wallet initialization (furszy)

Pull request description:

  Fixing https://github.com/bitcoin/bitcoin/issues/28250#issuecomment-1674830104 and more.

  Currently, redeem scripts longer than 520 bytes, which are technically valid under segwit rules, have flaws in the following processes:
  1) The multisig creation process fails to deduce the output descriptor, resulting in the generation of an incorrect descriptor. Additionally, the accompanying user warning is also inaccurate.
  2) The `signrawtransactionwithkey` RPC command fail to sign them.
  3) The legacy wallet `addmultisigaddress` wrongly discards them.

  The issue arises because most of these flows are utilizing the legacy spkm keystore, which imposes
  the [p2sh max redeem script size rule](ded6873340/src/script/signingprovider.cpp (L160)) on all scripts. Which blocks segwit redeem scripts longer than
  the max element size in all the previously mentioned processes (`createmultisig`, `addmultisigaddress`, and
  `signrawtransactionwithkey`).

  This PR fixes the problem, enabling the creation of multisig output descriptors involving more than 15 keys and
  allowing the signing of these scripts, along with other post-segwit redeem scripts that surpass the 520-byte
  p2sh limit.

  Important note:
  Instead of adding support for these longer redeem scripts in the legacy wallet, an "unsupported operation"
  error has been added. The reasons behind this decision are:

  1) The introduction of this feature brings about a compatibility-breaking change that requires downgrade
      protection; older wallets would be unable to interact with these "new" legacy wallets.

  2) Considering the ongoing deprecation of the legacy spkm, this issue provides another compelling
      reason to transition towards descriptors.

  Testing notes:
  To easily verify each of the fixes, I decoupled the tests into standalone commits. So they can be
  cherry-picked on top of master. Where `rpc_createmultisig.py` (with and without the `--legacy-wallet`
  arg) will fail without the bugs fixes commits.

  Extra note:
  The initial commits improves the `rpc_createmultisig.py` test in many ways. I found this test very
  antiquated, screaming for an update and cleanup.

ACKs for top commit:
  pinheadmz:
    ACK 2451a217dd
  theStack:
    Code-review ACK 2451a217dd
  achow101:
    ACK 2451a217dd

Tree-SHA512: 71794533cbd46b3a1079fb4e9d190d3ea3b615de0cbfa443466e14f05e4616ca90e12ce2bf07113515ea8113e64a560ad572bb9ea9d4835b6fb67b6ae596167f
2024-06-04 21:39:49 -04:00
Ava Chow
b3a61bd7b1
Merge bitcoin/bitcoin#28074: fuzz: wallet, add target for Crypter
d7290d662f fuzz: wallet, add target for Crypter (Ayush Singh)

Pull request description:

  This PR adds fuzz coverage for `wallet/crypter`.

  Motivation: Issue [27272](https://github.com/bitcoin/bitcoin/issues/27272#issue-1628327906)

  I ran this for a long time with Sanitizers on and had no crashes; the average `exec/sec` also looks good to me. However, I would really appreciate it if some of the reviewers could try it on their machines too, and give their feedback.

ACKs for top commit:
  maflcko:
    utACK d7290d662f
  achow101:
    ACK d7290d662f
  brunoerg:
    utACK d7290d662f

Tree-SHA512: f5c496cabdd3263a7e1ad49eeff702725336f76bf19a82e5dbbead082e990889dd43c851d0d2d6ab740f44b8ec2aa06defd9ff6b02be68b5f8b4eaf963f88599
2024-06-04 21:26:42 -04:00
Ava Chow
55cf34a5c3
Merge bitcoin/bitcoin#30047: refactor: Model the bech32 charlimit as an Enum
7f3f6c6dc8 refactor: replace hardcoded numbers (Lőrinc)
5676aec1e1 refactor: Model the bech32 charlimit as an Enum (josibake)

Pull request description:

  Broken out from #28122

  ---

  Bech32(m) was defined with a 90 character limit so that certain guarantees for error detection could be made for segwit addresses (see https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#checksum-design).

  However, there is nothing about the encoding scheme itself that requires a limit of 90 and in practice bech32(m) is being used without the 90 char limit (e.g. lightning invoices, silent payments). Further, increasing the character limit doesn't do away with error detection, it simply changes the guarantee.

  The primary motivation for this change is for being able to parse BIP352 v0 silent payment addresses (see 622c7a98b9), which require up to 118 characters. In addition to BIP352, modeling the character limit as an enum allows us to easily support new address types that use bech32m and specify their own character limit.

ACKs for top commit:
  paplorinc:
    re-ACK 7f3f6c6dc8
  achow101:
    ACK 7f3f6c6dc8
  theuni:
    utACK 7f3f6c6dc8

Tree-SHA512: 9c793d657448c1f795093b9f7d4d6dfa431598f48d54e1c899a69fb2f43aeb68b40ca2ff08864eefeeb6627d4171877234b5df0056ff2a2b84415bc3558bd280
2024-06-04 20:32:25 -04:00
Ava Chow
09fe1435d9
Merge bitcoin/bitcoin#29997: rpc: Remove index-based Arg accessor
fa3169b073 rpc: Remove index-based Arg accessor (MarcoFalke)

Pull request description:

  The index-based Arg accessor is redundant with the name-based one. It does not provide any benefit to the code reader, or otherwise, so remove it.

ACKs for top commit:
  stickies-v:
    re-ACK fa3169b073, addressed doc nits
  achow101:
    ACK fa3169b073
  ryanofsky:
    Code review ACK fa3169b073. One changes since last review are some documentation improvements

Tree-SHA512: f9da1c049dbf38c3b47a8caf8d24d195c2d4b88c7ec45a9ccfb78f1e39f29cb86869f84b308f6e49856b074c06604ab634c90eb89c9c93d2a8169e070aa1bd40
2024-06-04 20:11:59 -04:00
Ava Chow
56ea8ed3d3
Merge bitcoin/bitcoin#29428: test: Assumeutxo: snapshots with less work should not be loaded
df6dc2aaae test: Assumeutxo: snapshots with less work should not be loaded (Hernan Marino)

Pull request description:

  This PR adds a test which checks that snapshots with less accumulated work than the node's active chain, should not be loaded and return with an error. Although in a different context of discussion the missing test was detect in a thread in https://github.com/bitcoin/bitcoin/pull/29394 (see https://github.com/bitcoin/bitcoin/pull/29394#discussion_r1484122214)

ACKs for top commit:
  maflcko:
    utACK df6dc2aaae
  kevkevinpal:
    utACK [df6dc2a](df6dc2aaae)
  achow101:
    ACK df6dc2aaae
  alfonsoromanz:
    Re ACK df6dc2aaae. Make is successful and the test passes.

Tree-SHA512: 07a394b4b288cc8ad3f66ed4e70dcda468db18113e9442eb7215cf491768432d55efaaa5b79d633094917e05475a30f0c5e4f64f8f2da293ba306891b4485560
2024-06-04 19:13:03 -04:00
Ava Chow
a937458904
Merge bitcoin/bitcoin#30154: doc: update mention of generating bitcoin.conf
9013e2b97e Link to gen-bitcoin-conf.sh instead of bitcoin.conf placeholder (Epic Curious)

Pull request description:

  Closes #30153.

  This PR updates `doc/init.md` to mention generating an example bitcoin.conf instead of referencing the placeholder `share/examples/bitcoin.conf`. Also changes the code-formatted text to a markdown link.

  ## Background

  - Two years ago, `share/examples/bitcoin.conf` was replaced with [a placeholder file](b483084d86). To see an example `bitcoin.conf`, the user now runs the `contrib/devtools/gen-bitcoin-conf.sh` script, which replaces the placeholder file with the parsed contents of `bitcoind --help`.

  - The instructions in `init.md` about an example `bitcoin.conf` haven't changed significantly since they were [added almost 10 years ago](234bfbf6a5/doc/init.md (L39)). They should be updated to improve clarity.

ACKs for top commit:
  edilmedeiros:
    ACK 9013e2b97e
  kevkevinpal:
    reACK [9013e2b](9013e2b97e)
  achow101:
    ACK 9013e2b97e
  stickies-v:
    ACK 9013e2b97e
  tdb3:
    ACK for 9013e2b97e

Tree-SHA512: 5ac5ad672ad181d574e19e29c3727fb9e5373282444fae09b42d113d5c8915cb2829d496212638cdc4b70540b7e1794a751fcdc9539f956a594cddd70c8fd747
2024-06-04 19:00:59 -04:00
Ava Chow
e54c392356
Merge bitcoin/bitcoin#28979: wallet, rpc: document and update sendall behavior around unconfirmed inputs
71aae72e1f test: test sendall does ancestor aware funding (ishaanam)
36757941a0 wallet, rpc: implement ancestor aware funding for sendall (ishaanam)
544131f3fb rpc, test: test sendall spends unconfirmed change and unconfirmed inputs when specified (ishaanam)

Pull request description:

  This PR:
  - Adds a functional test that `sendall` spends unconfirmed change
  - Adds a functional test that `sendall` spends regular unconfirmed inputs when specified by user
  - Adds ancestor aware funding to `sendall` by using `calculateCombinedBumpFee` and adjusting the effective value accordingly
  - Adds a functional test for ancestor aware funding in `sendall`

ACKs for top commit:
  S3RK:
    ACK 71aae72e1f
  achow101:
    ACK 71aae72e1f
  furszy:
    ACK 71aae72e1f

Tree-SHA512: acaeb7c65166ce53123a1d6cb5012197202246acc02ef9f37a28154cc93afdbd77c25e840ab79bdc7e0b88904014a43ab1ddea79d5337dc310ea210634ab61f0
2024-06-04 18:46:47 -04:00
Ava Chow
701b0cf2f3
Merge bitcoin/bitcoin#28366: Fix waste calculation in SelectionResult
bd34dd85e7 Use `exact_target` shorthand in coinselector_tests (Murch)
7aa7e30441 Fold GetSelectionWaste() into ComputeAndSetWaste() (Murch)

Pull request description:

  PR #26152 moved waste calculation into SelectionResult to be able to correct the waste score on basis of the bump_fee_group_discount for overlapping ancestries. This left two functions with largely overlapping purpose, where one was simply a wrapper of the other. This PR cleans up the overlap, and fixes the double-meaning of `change_cost` where the `GetChange()` function assumed that no change was created when `change_cost` was set to 0. This behavior was exploited in a bunch of tests, but is problematic, because a `change_cost` of 0 is permitted with custom settings for feerate and discard_feerate (i.e. when they’re both 0).

ACKs for top commit:
  achow101:
    ACK bd34dd85e7
  furszy:
    Code ACK bd34dd85e7
  ismaelsadeeq:
    Code Review ACK bd34dd85e7

Tree-SHA512: 83a2688d45d719dc61a64b5180fe136107faccf401a59df65245c05d701748a03e85ed56fde8c9b7ef39a3ab54374dd3718c559bda5b3f55dafedfd7fed25161
2024-06-04 18:37:18 -04:00
MarcoFalke
4444de152f
test: Set mocktime in p2p_disconnect_ban.py to avoid intermittent test failure 2024-06-04 21:49:50 +02:00
MarcoFalke
fa6aa4027c
test: Fix typos and use names args 2024-06-04 21:49:47 +02:00
merge-script
d39f15a8a5
Merge bitcoin/bitcoin#30211: fuzz: Make FuzzedSock fuzz friendlier
22d0f1a27e [fuzz] Avoid endless waiting in FuzzedSock::{Wait,WaitMany} (marcofleon)
a7fceda68b [fuzz] Make peeking through FuzzedSock::Recv fuzzer friendly (dergoegge)
865cdf3692 [fuzz] Use fuzzer friendly ConsumeRandomLengthByteVector in FuzzedSock::Recv (dergoegge)

Pull request description:

  `FuzzedSock` has a few issues that block a fuzzer from making progress. See commit messages for details.

ACKs for top commit:
  marcofleon:
    Tested ACK 22d0f1a27e
  brunoerg:
    utACK 22d0f1a27e

Tree-SHA512: 2d66fc94ba58b6652ae234bd1dcd33b7d685b5054fe83e0cd624b053dd51519c23148f43a865ab8c8bc5fc2dc25e701952831b99159687474978a90348faa4c5
2024-06-04 14:56:47 +01:00
David Gumberg
0fcbfdb7ad Support running individual lint checks
Add support for passing `--lint=LINT_TO_RUN` to the lint runner and
add corresponding help message.
2024-06-04 09:13:44 -04:00
merge-script
9efc2af3be
Merge bitcoin/bitcoin#30217: depends: Update Boost download link
ffbc173ca1 depends: Update Boost download link (Hennadii Stepanov)

Pull request description:

  The Boost has [migrated](https://github.com/boostorg/boost-tasks/pull/3) their downloads from from boostorg.jfrog.io to archives.boost.io.

  So do we.

  FWIW, the download speed at my location is much better :)

ACKs for top commit:
  maflcko:
    ACK ffbc173ca1

Tree-SHA512: 3f66675c390510ecfdacf2ac8af4a0a6bdbdf6fbfe01ed66fbe1b11bc9e935709e5492a754711cd788352c5853738fce755afd0c0480f36d0f8af31fcc108263
2024-06-04 09:11:46 +01:00
Sebastian Falbesoner
8801e319d5 refactor: remove unused CKey::Negate method
This method was introduced as a pre-requirement for the v2 transport
protocol back then (see PR #14047, commit 463921bb), when it was still
BIP151. With the replacement BIP324, this is not needed anymore, and
it's also unlikely that any other proposal would need to negate private
keys at this abstraction level.
(If there is really demand, it's trivial to reintroduce the method.)
2024-06-03 16:59:43 +02:00
merge-script
f7a6d34449
Merge bitcoin/bitcoin#30215: doc: JSON-RPC request Content-Type is application/json
3c08e11c3e doc: JSON-RPC request Content-Type is application/json (Luke Dashjr)

Pull request description:

  Specify json content type in RPC examples.

  Picks up #29946. Which needed rebasing and the commit message fixing,

ACKs for top commit:
  laanwj:
    ACK 3c08e11c3e
  tdb3:
    ACK for 3c08e11c3e

Tree-SHA512: 770bbbc0fb324cb63628980b13583cabf02e75079851850170587fb6eca41a70b01dcedaf1926bb6488eb9816a3cc6616fe8cee8c4b7e09aa39b7df5834ca0ec
2024-06-03 14:41:34 +01:00
merge-script
c065ae8469
Merge bitcoin/bitcoin#30134: fuzz: add more coverage for ScriptPubKeyMan
e3249f2111 fuzz: add more coverage for `ScriptPubKeyMan` (brunoerg)

Pull request description:

  This PR adds more coverage for `ScriptPubKeyMan`:

  - Check `GetKey` and `HasPrivKey` after adding descriptor key.
  - Cover `GetEndRange` and `GetKeyPoolSize`.
  - Cover `MarkUnusedAddresses` with the scripts from ScriptPubKeys and `GetMetadata` with the destinations from them.

ACKs for top commit:
  marcofleon:
    Tested ACK e3249f2111. I ran the updated harness for ~9 hours on an empty corpus, generated a coverage report, and checked that the new functions mentioned were hit. Coverage of `scriptpubkeyman.cpp` increased.
  murchandamus:
    Tested ACK e3249f2111

Tree-SHA512: cfab91f6c8401174842e79209c0e9225c08f011fe9b41d0a58bcec716ae4545eaf803867f899ed7b5fbcefea45711f91894e36df082ba19732dd310cd9e61a79
2024-06-03 14:01:47 +01:00