Commit graph

42311 commits

Author SHA1 Message Date
Fabian Jahr
b29c21fc92
assumeutxo: Remove devtools/utxo_snapshot.sh 2024-09-01 20:56:39 +02:00
Fabian Jahr
20a1c77aa7
contrib: Remove test_utxo_snapshots.sh 2024-09-01 20:56:39 +02:00
Fabian Jahr
8426850352
test: Test for dumptxoutset at specific height 2024-09-01 20:56:39 +02:00
Fabian Jahr
993cafe7e4
RPC: Add type parameter to dumptxoutset 2024-09-01 20:56:38 +02:00
Fabian Jahr
fccf4f91d2
RPC: Extract ReconsiderBlock helper 2024-09-01 20:56:38 +02:00
Fabian Jahr
446ce51c21
RPC: Extract InvalidateBlock helper 2024-09-01 20:56:37 +02:00
merge-script
5abb9b1af4
Merge bitcoin/bitcoin#30763: doc: update Fedora build instructions for cmake
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
877c55a68b doc: update fedora build instructions for cmake (Marnix)

Pull request description:

  Update Fedora build instructions for cmake:

  - update the Fedora build requirements
  - remove old configure instruction

  This was forgotten to update

ACKs for top commit:
  davidgumberg:
    ACK 877c55a68b
  l0rinc:
    utACK 877c55a68b
  hebasto:
    ACK 877c55a68b.
  pablomartin4btc:
    ACK 877c55a68b
  tdb3:
    ACK 877c55a68b

Tree-SHA512: 53fbd4bef96d2aeef753f26359eab53023a154fbcc75952aecd15e8805cc24ceb8ebdc6d8746416720b5655ed694299b3381a2e4d621ebd522fb09d145c48665
2024-09-01 09:53:23 +01:00
Ryan Ofsky
b52d547361
Merge bitcoin/bitcoin#30377: refactor: Replace ParseHex with consteval ""_hex literals
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
8756ccd712 scripted-diff: Replace ParseHex[<std::byte>]("str") -> "str"_hex[_u8] (Hodlinator)
9cb687351f refactor: Prepare for ParseHex -> ""_hex scripted-diff (Hodlinator)
50bc017040 refactor: Hand-replace some ParseHex -> ""_hex (Hodlinator)
5b74a849cf util: Add consteval ""_hex[_v][_u8] literals (l0rinc)
dc5f6f6812 test refactor: util_tests - parse_hex clean up (Hodlinator)
2b5e6eff36 refactor: Make XOnlyPubKey tolerate constexpr std::arrays (Hodlinator)
403d86f1cc refactor: vector -> span in CCrypter (Hodlinator)
bd0830bbd4 refactor: de-Hungarianize CCrypter (Hodlinator)
d99c816971 refactor: Improve CCrypter related lines (Hodlinator)
7e1d9a8468 refactor: Enforce lowercase hex digits for consteval uint256 (Hodlinator)

Pull request description:

  Motivation:
  * Validates and converts the hex string into bytes at compile time instead of at runtime like `ParseHex()`.
  * Eliminates runtime dependencies: https://github.com/bitcoin/bitcoin/pull/30377#issuecomment-2214432177, https://github.com/bitcoin/bitcoin/pull/30048#discussion_r1592108480
  * Has stricter requirements than `ParseHex()` (disallows whitespace and uppercase hex digits) and replaces it in a bunch of places.
  * Makes it possible to derive other compile time constants.
  * Minor: should shave off a few runtime CPU cycles.

  `""_hex` produces `std::array<std::byte>` as the momentum in the codebase is to use `std::byte` over `uint8_t`.

  Also makes `uint256` hex string constructor disallow uppercase hex digits. Discussed: https://github.com/bitcoin/bitcoin/pull/30560#discussion_r1701323070

  Surprisingly does not change the size of the Guix **bitcoind** binary (on x86_64-linux-gnu) by 1 single byte.

  Spawned already merged PRs: #30436, #30482, #30532, #30560.

ACKs for top commit:
  l0rinc:
    ACK 8756ccd712
  stickies-v:
    Rebase re-ACK 8756ccd712, no changes since a096215c9c71a2ec03e76f1fd0bcdda0727996e0
  ryanofsky:
    Code review ACK 8756ccd712, just rebasing since last review and taking advantage of CScript constructors in #29369, also tweaking a code comment

Tree-SHA512: 9b2011b7c37e0ef004c669f8601270a214b388916316458370f5902c79c2856790b1b2c7c123efa65decad04886ab5eff95644301e0d84358bb265cf1f8ec195
2024-08-31 10:18:00 -04:00
Marnix
877c55a68b doc: update fedora build instructions for cmake 2024-08-31 15:18:06 +02:00
merge-script
e96f657e20
Merge bitcoin/bitcoin#30777: ci: Delete no longer needed workaround
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
74da8cb286 ci: Delete no longer needed workaround (Hennadii Stepanov)

Pull request description:

  This PR removes a workaround that was necessary at some point during the development of the CMake staging branch.

ACKs for top commit:
  fanquake:
    ACK 74da8cb286

Tree-SHA512: 619a513efe86af8e24fc3b6e4124df8f3ff3699216a3f87a4385aeb5e3c605f2b035d1594604cd3efe66281ac879d954d412ee4ae8423408e46ebd32956883a5
2024-08-31 12:07:21 +01:00
Hennadii Stepanov
74da8cb286
ci: Delete no longer needed workaround
It was necessary at some point during the development of the CMake
staging branch.
2024-08-30 23:13:25 +01:00
merge-script
96b0a8f858
Merge bitcoin/bitcoin#30752: guix: Drop unused autotools packages
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
0004dcc7b1 guix: Drop unused autotools packages (Hennadii Stepanov)

Pull request description:

  This PR implements https://github.com/hebasto/bitcoin/pull/294.

  From https://github.com/hebasto/bitcoin/pull/294#issuecomment-2317292100:
  > I think guix was already bumped to cmake, so this can be done in a separate pull already today?

ACKs for top commit:
  fanquake:
    ACK 0004dcc7b1

Tree-SHA512: 60d0be8df6340797bebcd6a734e2a5a0a24df18b65c174af47ea652110f26aca00b019dd205b83ae0e664ba1322628f252ade461d2dc01353045347d405ad5fa
2024-08-30 17:40:13 +01:00
Hennadii Stepanov
0004dcc7b1
guix: Drop unused autotools packages 2024-08-30 14:44:21 +01:00
merge-script
c91cabbf56
Merge bitcoin/bitcoin#30753: build: Drop no longer needed workaround
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
66dd1b4e58 build: Drop no longer needed workaround (Hennadii Stepanov)

Pull request description:

  This PR deletes a workaround that is no longer needed since https://github.com/bitcoin/bitcoin/pull/30508 was merged.

ACKs for top commit:
  fanquake:
    ACK 66dd1b4e58

Tree-SHA512: abb8e79b525989afe88f94899e4dc29c80d4593ea23f44c6b3d08710e6ddd1619e748798534973fa4ee9f48d9fad7226445b7a2cb4aec0bdb5d1b7ff2f6689ea
2024-08-30 14:04:39 +01:00
merge-script
3ee1521c04
Merge bitcoin/bitcoin#30730: guix: Bump time machine to 53396a22afc04536ddf75d8f82ad2eafa5082725
60d4398a34 guix: drop GCC 12.4.0 package (fanquake)
5ed1511e50 guix: bump time-machine to 53396a22afc04536ddf75d8f82ad2eafa5082725 (fanquake)

Pull request description:

  Followup to #30511.
  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=9aa38f98cbd41644abe2c43bb4f44f74df642df2 landed.

  Linux headers `6.1.102` -> `6.1.106`

ACKs for top commit:
  hebasto:
    ACK 60d4398a34.
  TheCharlatan:
    ACK 60d4398a34

Tree-SHA512: 6ff4372897e5abb15c28d4607915f777585d54b7a35787ac46f7ddca0d695dc60a7da532d8beb37e2df1de12511220f0dc6428f68d6a4db628de816e2d339914
2024-08-30 09:51:43 +01:00
merge-script
ffdc3d6060
Merge bitcoin/bitcoin#30754: misc: Autotools -> CMake changes
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
a865494dee lint: remove autotools packages (fanquake)
b02f29e7ef doc: replace Autotools with CMake (fanquake)

Pull request description:

  These don't seem to be included in, i.e #30664.

ACKs for top commit:
  maflcko:
    lgtm ACK a865494dee
  hebasto:
    re-ACK a865494dee.

Tree-SHA512: bafa2675d7c819478fb9b3f44f557ec767acb8fa3c4a191b1b8a1e47352a4cb6cebbb3138d961058d846926359f5451241a8badcbe3edd7e067d69ecfc45df93
2024-08-29 17:34:36 +01:00
fanquake
a865494dee
lint: remove autotools packages 2024-08-29 16:06:34 +01:00
fanquake
b02f29e7ef
doc: replace Autotools with CMake 2024-08-29 16:06:29 +01:00
glozow
1e48238700
Merge bitcoin/bitcoin#30714: test: fix TestShell initialization (late follow-up for #30463)
bd7ce05f9d test: fix `TestShell` initialization (late follow-up for #30463) (Sebastian Falbesoner)

Pull request description:

  Creating a `TestShell` instance as stated in the [docs](https://github.com/bitcoin/bitcoin/blob/master/test/functional/test-shell.md) currently fails on master:
  ```
  $ python3
  Python 3.10.13 (main, Mar 15 2024, 07:36:23) [Clang 16.0.6 ] on openbsd7
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import sys
  >>> sys.path.insert(0, "/home/thestack/bitcoin/test/functional")
  >>> from test_framework.test_shell import TestShell
  >>> test = TestShell().setup(num_nodes=2, setup_clean_chain=True)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/thestack/bitcoin/test/functional/test_framework/test_shell.py", line 70, in __new__
      TestShell.instance = TestShell.__TestShell()
  TypeError: BitcoinTestFramework.__init__() missing 1 required positional argument: 'test_file'
  ```
  Since #30463, BitcoinTestFramework instances expect the path of the calling test at construction, in order to find shared data like the configuration (config.ini) and the cache. Note that in contrast to actual functional tests, we can't simply pass `__file__` here, as the test shell module sits within the `test_framework` subfolder, so we have to navigate up to the parent directory and append some dummy test file name.

  On the long-term we should probably add some TestShell instantation smoke-test to detect issues like this early. As I'm not too familiar with the CI I'm not sure what is a good way to achieve this (a functional test obviously can't be used, as that's already a BitcoinTestFramework test in itself), but happy to take suggestions.

ACKs for top commit:
  ismaelsadeeq:
    Tested ACK bd7ce05f9d
  danielabrozzoni:
    tACK bd7ce05f9d
  brunoerg:
    ACK bd7ce05f9d

Tree-SHA512: c3a2365e2cda48a233ee724673c490787981354914f33e10eadbbad9c68e8403d84c5551229a611401e743886539de380ba4bfcb77032b6c85731e3bbe962dc1
2024-08-29 15:47:56 +01:00
glozow
7349d572c3
Merge bitcoin/bitcoin#30701: Use MiniWallet in functional test rpc_signrawtransactionwithkey.
a563f41232 Remove second node since only 1 is needed for the test (Martin Saposnic)
1f4cdb3d69 Replace custom funding tx creation with MiniWallet. (Martin Saposnic)

Pull request description:

  In response to issue https://github.com/bitcoin/bitcoin/issues/30600, optimizations have been implemented to enhance test efficiency and readability:

  This PR refactors the `rpc_signrawtransactionwithkey.py` functional test to use MiniWallet for creating funding transactions. This simplifies the test code and improves performance by eliminating the need to mine new blocks for each funding transaction.

  Key changes:
  - Replaced custom `send_to_address` method with MiniWallet's `send_to` method
  - Removed unnecessary setup of a clean chain and second node
  - Simplified transaction creation and signing process

ACKs for top commit:
  glozow:
    ACK a563f41232
  ismaelsadeeq:
    code review ACK a563f41232
  theStack:
    ACK a563f41232

Tree-SHA512: 318959f89702b169453d537dafb822f5ef1921db1088941d8bbdb3171dd7a6ecad590e57a3802bc37bcf8992267ed6ffa7f156b229d9817ebf812bd35df509b5
2024-08-29 15:45:40 +01:00
Hennadii Stepanov
66dd1b4e58
build: Drop no longer needed workaround 2024-08-29 14:13:48 +01:00
merge-script
5c7d4b9dec
Merge bitcoin/bitcoin#30749: Remove bsdmainutils from doc/ci
78358ce09d ci: add libzmq3-dev to test-each-commit job (fanquake)
a2b1d2c5ec doc: remove bsdmainutils (fanquake)
36ff336d2e ci: remove bsdmainutils (fanquake)

Pull request description:

  This was previously used to install `hexdump` (for the tests). However that isn't used by CMake. I'm not aware of any other tools from this package being used.

ACKs for top commit:
  maflcko:
    ACK 78358ce09d
  hebasto:
    ACK 78358ce09d.

Tree-SHA512: 01c1be81feba03a9645e3d382067df4cd7c64de184871c8d9691053a8f871fcedf48d298303554560df2cb1949fb35d5ce9ff20c751ff35789b7689d656c0287
2024-08-29 12:30:11 +01:00
merge-script
7a226eb4d9
Merge bitcoin/bitcoin#30653: guix: Drop unused module from manifest
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
c7fb80a08f guix: Drop unused module from manifest (Hennadii Stepanov)

Pull request description:

  My Guix build:
  ```
  x86_64
  170df52c2238510bd166f3fb1c4c3c11d2c1480a2e468fd532cb4d0435ac11cf  guix-build-c7fb80a08f98/output/aarch64-linux-gnu/SHA256SUMS.part
  54e71ef5135464f58e3db4a3b893fa2f26a2c9cfb465699a363bb59a0d1bd94f  guix-build-c7fb80a08f98/output/aarch64-linux-gnu/bitcoin-c7fb80a08f98-aarch64-linux-gnu-debug.tar.gz
  806d6042151e0af026748379b9bbbfea53d4c91555b2f0d05ed11faf83f429bb  guix-build-c7fb80a08f98/output/aarch64-linux-gnu/bitcoin-c7fb80a08f98-aarch64-linux-gnu.tar.gz
  96f111f81311b55c805f1ebe74c5a5bc3160819e8fc6d14aab778e6a20a5c266  guix-build-c7fb80a08f98/output/arm-linux-gnueabihf/SHA256SUMS.part
  231a29a9ffec9cc88260324da28d8443a6fd455ff0b010574af455034581aea3  guix-build-c7fb80a08f98/output/arm-linux-gnueabihf/bitcoin-c7fb80a08f98-arm-linux-gnueabihf-debug.tar.gz
  a545801e94e2a7a9859f0111be8762a2a7e5ea4636eed86ac95d17f2f4cdb37a  guix-build-c7fb80a08f98/output/arm-linux-gnueabihf/bitcoin-c7fb80a08f98-arm-linux-gnueabihf.tar.gz
  f565c1c7c10cc5c36f2206c3c5aab54422f20e38185c43f4dbd91c12cb33d10d  guix-build-c7fb80a08f98/output/arm64-apple-darwin/SHA256SUMS.part
  0b0d3d7e7300984063109f2ea23fabdf3961fa337ff28ed602a22965cdf6b499  guix-build-c7fb80a08f98/output/arm64-apple-darwin/bitcoin-c7fb80a08f98-arm64-apple-darwin-unsigned.tar.gz
  78cfb54230e3b054c4bb121925844720be52269db6a63161eeebe93ebfb2dc21  guix-build-c7fb80a08f98/output/arm64-apple-darwin/bitcoin-c7fb80a08f98-arm64-apple-darwin-unsigned.zip
  95124a8019053cc296187c0332e3b5b3acef401298baadacf52713068764dd99  guix-build-c7fb80a08f98/output/arm64-apple-darwin/bitcoin-c7fb80a08f98-arm64-apple-darwin.tar.gz
  a8b36c808c7b57cb2a20e43af36749c07f14392b9816752b68a986f9124806fc  guix-build-c7fb80a08f98/output/dist-archive/bitcoin-c7fb80a08f98.tar.gz
  f7221bc6ed56b5af1196f67c776bd80de9f2b9dc8bf84b0a8602a586fda43079  guix-build-c7fb80a08f98/output/powerpc64-linux-gnu/SHA256SUMS.part
  e04410e453a9fcefacdbe9a1a43ad1f9ec6a36d622d258ea4208af1dc461692d  guix-build-c7fb80a08f98/output/powerpc64-linux-gnu/bitcoin-c7fb80a08f98-powerpc64-linux-gnu-debug.tar.gz
  64135391e147c7357b17b72b1e54e93a9a7931f90c4d14a2066f1c9a160881a0  guix-build-c7fb80a08f98/output/powerpc64-linux-gnu/bitcoin-c7fb80a08f98-powerpc64-linux-gnu.tar.gz
  3f2375042bc29a7f87cadc6ba3ce7389fa5e6f6c53b32836c7fc249e4ba9838e  guix-build-c7fb80a08f98/output/riscv64-linux-gnu/SHA256SUMS.part
  33b8396ab0e1fd3121a85f1a80d81d52fe9be151f401f08283f9d5b8ecbd251b  guix-build-c7fb80a08f98/output/riscv64-linux-gnu/bitcoin-c7fb80a08f98-riscv64-linux-gnu-debug.tar.gz
  418a264d0bcde9665d5760061284ca3b5533c9f63769a76bc64c69d8b3c7d82f  guix-build-c7fb80a08f98/output/riscv64-linux-gnu/bitcoin-c7fb80a08f98-riscv64-linux-gnu.tar.gz
  3fed3e2d050059694da965e1752468c3d054f1acf5b774242eb8e7a73a775af5  guix-build-c7fb80a08f98/output/x86_64-apple-darwin/SHA256SUMS.part
  a5d2ddf1c1bbc22d104ef08d0bd73f8d9c5c8404791df66d51ffc76a0c638fb2  guix-build-c7fb80a08f98/output/x86_64-apple-darwin/bitcoin-c7fb80a08f98-x86_64-apple-darwin-unsigned.tar.gz
  bc3a44ca40c5bad631b76c240a7f1f46d0597cbf0c2389473d856e29775b3f1a  guix-build-c7fb80a08f98/output/x86_64-apple-darwin/bitcoin-c7fb80a08f98-x86_64-apple-darwin-unsigned.zip
  5b2f0aaf4c023cda33fe952f18a977cc735c5e1524b45e734f99641ee605cc5d  guix-build-c7fb80a08f98/output/x86_64-apple-darwin/bitcoin-c7fb80a08f98-x86_64-apple-darwin.tar.gz
  e56223d773f7d1a0a0dbe99d98e60420f729987f14fb98f18eabe6575352f68c  guix-build-c7fb80a08f98/output/x86_64-linux-gnu/SHA256SUMS.part
  6e4a27fcafb1ec2dda41c7e486897ff51a4447d0ebfa6be30bdef6648c673786  guix-build-c7fb80a08f98/output/x86_64-linux-gnu/bitcoin-c7fb80a08f98-x86_64-linux-gnu-debug.tar.gz
  3ff4232266a461bb55518a1e8834867e7e79c02914c59eb8f6b5052a26aefc12  guix-build-c7fb80a08f98/output/x86_64-linux-gnu/bitcoin-c7fb80a08f98-x86_64-linux-gnu.tar.gz
  fd2cfb0befaf849e98574698ddab121a01c7894bb5acc789b9eb9c3bbe78e7b2  guix-build-c7fb80a08f98/output/x86_64-w64-mingw32/SHA256SUMS.part
  58a2f67ecc94b2daad37ab99e74708c062094eb047136e57451d89f856d0c9aa  guix-build-c7fb80a08f98/output/x86_64-w64-mingw32/bitcoin-c7fb80a08f98-win64-debug.zip
  6ccf68edc22dab4cc3171f3d8cdaed0444c438bca812512586edd81029de2c57  guix-build-c7fb80a08f98/output/x86_64-w64-mingw32/bitcoin-c7fb80a08f98-win64-setup-unsigned.exe
  d466b5bc2ace63995ca22943997db7c292e240cdee7c63e127ecd380a1ca9558  guix-build-c7fb80a08f98/output/x86_64-w64-mingw32/bitcoin-c7fb80a08f98-win64-unsigned.tar.gz
  b3fd8af55443feb8667940a18fb511e6d85ece1dd9fa0aa40f68e5ea86ab46df  guix-build-c7fb80a08f98/output/x86_64-w64-mingw32/bitcoin-c7fb80a08f98-win64.zip
  ```

ACKs for top commit:
  fanquake:
    ACK c7fb80a08f - looks like this was last used in https://github.com/bitcoin/bitcoin/pull/27179.

Tree-SHA512: 40498cb514a31609e721b3865a99b91e4ff2bf5760750a42b5b16333d905d13cf2f87481aabc679c08b9e872a6886a7c928706b6d7ada08df02672d4b5156ba1
2024-08-29 11:40:27 +01:00
fanquake
78358ce09d
ci: add libzmq3-dev to test-each-commit job 2024-08-29 11:04:51 +01:00
fanquake
a2b1d2c5ec
doc: remove bsdmainutils 2024-08-29 10:58:20 +01:00
fanquake
36ff336d2e
ci: remove bsdmainutils 2024-08-29 10:58:20 +01:00
merge-script
d08bedd81f
Merge bitcoin/bitcoin#30735: ci: Use C++23 in one task
fac587ea07 ci: Use C++23 once for testing (MarcoFalke)
fa053ab7c0 build: Add Centos Stream 9 EOL URL (MarcoFalke)

Pull request description:

  There are no plans to switch to C++23 anytime soon in the next couple of years. The only place right now that is known to benefit is `src/compat/byteswap.h`.

  However, it is still useful to test with the option, because deprecated, removed or changed language features, as well as compiler changes that are guarded by the language version will be tested and developers can learn about them upfront.

  Also includes a minor doc fixup commit.

ACKs for top commit:
  davidgumberg:
    ACK fac587ea07
  TheCharlatan:
    ACK fac587ea07

Tree-SHA512: 1b81788eb5b4da77715d8b047279de65ae6b8920d5a21fd8cc94c3b0edb588ab8ffb7eaffb2f8b7806045de1d47ca85ca629f49038eca762f3136bf380cf3c87
2024-08-29 10:54:44 +01:00
merge-script
8f761ea742
Merge bitcoin/bitcoin#30739: doc: update dev note examples for CMake
7de0c99804 doc: update dev note examples for CMake (fanquake)

Pull request description:

  Update the examples in the developer notes to work with CMake.
  Also added an explicit `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` for clarity.

ACKs for top commit:
  davidgumberg:
    Tested ACK 7de0c99804
  TheCharlatan:
    ACK 7de0c99804
  jonatack:
    Tested ACK 7de0c99804 on arm64 macOS 14.6.1

Tree-SHA512: 561fe5e777c5b29a4f26309700c03a730c5bbb2f838630abfaa4174112ced66e733c2109cb429a1927f1f3692bf1945f6386bcaffe604a76ea24633932d39171
2024-08-29 10:53:11 +01:00
merge-script
00ad716c2b
Merge bitcoin/bitcoin#30740: ci: Re-add configs removed in cmake migration
fa80d39d82 ci: Re-add configs removed in cmake migration (MarcoFalke)

Pull request description:

  In commit 9730288a0c many configs were removed from the CI without explanation.

  Fix it by adding them back.

  Can be reviewed by looking at:

  * the parity table https://gist.github.com/hebasto/2ef97d3a726bfce08ded9df07f7dab5e
  * the installed packages
  * the CI logs from before the cmake migration and the CI logs of this pull request

ACKs for top commit:
  fanquake:
    ACK fa80d39d82

Tree-SHA512: a33335e117750e6c2e1490bb621f67c466f901793e43abe1bd0e263ef16fdcbc9e88be55c206167f3a5ddb39c1df6989c0fb7a96d9240243c000ba2e7f5e2747
2024-08-29 10:23:01 +01:00
merge-script
0e0de94846
Merge bitcoin/bitcoin#30700: doc: fix CI codespell warnings
837fbca036 Update spelling.ignore-words (Lőrinc)
f9a08f35a5 doc: fix a few simple codespell warnings (Lőrinc)

Pull request description:

  Can be checked locally by running `test/lint/lint-spelling.py`

ACKs for top commit:
  maflcko:
    lgtm ACK 837fbca036
  jonatack:
    ACK 837fbca036

Tree-SHA512: a83c78b9de4085749b916ffd255a9e72ffed06f09736ccff2dd4a4436d1fae7b22b1fb6073b0ce59ecb5bfdef4e43271494dadf3824647a42a4f26c26f092364
2024-08-29 09:36:35 +01:00
merge-script
4ae3be772d
Merge bitcoin/bitcoin#30744: doc: Fix typo in build-unix.md
e78551baec doc: Fix typo in `build-unix.md` (Hennadii Stepanov)

Pull request description:

  Addresses https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1735220144.

ACKs for top commit:
  davidgumberg:
    ACK e78551baec
  l0rinc:
    ACK e78551baec
  tdb3:
    ACK e78551baec

Tree-SHA512: a312a7718ac3fe4a9a204518f1306f4d4622b9c11e027f26960d15ac2e2380682604890a2ae4b874a28e0798f243f8226475cda3a8f468a1aa98df7ab26eea5f
2024-08-29 09:33:54 +01:00
Hennadii Stepanov
e78551baec
doc: Fix typo in build-unix.md 2024-08-28 21:05:19 +01:00
Hodlinator
8756ccd712
scripted-diff: Replace ParseHex[<std::byte>]("str") -> "str"_hex[_u8]
Ideally all call sites should accept std::byte instead of uint8_t but those transformations are left to future PRs.

-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended 's/\bParseHex\(("[^"]*")\)/\1_hex_u8/g' $(git grep -l ParseHex -- :src ':(exclude)src/test/util_tests.cpp')
sed -i --regexp-extended 's/\bParseHex<std::byte>\(("[^"]*")\)/\1_hex/g' $(git grep -l ParseHex -- :src ':(exclude)src/test/util_tests.cpp')
sed -i --regexp-extended 's/\bScriptFromHex\(("[^"]*")\)/ToScript(\1_hex)/g' src/test/script_tests.cpp
-END VERIFY SCRIPT-

Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
2024-08-28 19:11:59 +02:00
Hodlinator
9cb687351f
refactor: Prepare for ParseHex -> ""_hex scripted-diff
- Adds using namespace.
- Extracts ToScript helper function from ScriptFromHex, to be used heavily in the next commit.
- Changes ScriptFromHex from using ParseHex to TryParseHex, now asserting the string is valid.
- Use even number of hex digits in comment (and apply replacement from next commit to only touch line once).
2024-08-28 19:11:59 +02:00
Hodlinator
50bc017040
refactor: Hand-replace some ParseHex -> ""_hex
The following scripted-diff commit will replace ParseHex("...") with "..."_hex_u8, but this replacement will not work in cases where vectors are needed instead of arrays, and is not ideal in cases where std::byte is accepted.

For example, it is currently necessary to use _hex_v_u8 when calling CScript operator<< because that operator does not currently support std::array or std::byte.

Conversely, it is incorrect to use _hex_v instead of _hex in net_processing.cpp for the MakeAndPushMessage argument, because if the argument is a std::vector it is considered variable-length and serialized with a size prefix, but if the argument is a std::array or Span is it considered fixed length and serialized without a prefix.

By the same logic, it is also safe to change the NUMS_H constant in pubkey.cpp from a std::vector to std::array because it is never serialized.
2024-08-28 19:11:59 +02:00
l0rinc
5b74a849cf
util: Add consteval ""_hex[_v][_u8] literals
""_hex is a compile-time user-defined literal returning std::array<std::byte>, equivalent of ParseHex.

Variants:
- ""_hex_v returns std::vector<std::byte>
- ""_hex_u8 returns std::array<uint8_t>
- ""_hex_v_u8 returns std::vector<uint8_t> - Directly serializable as a size-prefixed OP_PUSH CScript payload using operator<<.

Also extracts from_hex into shared util::ConstevalHexDigit function.

Co-Authored-By: hodlinator <172445034+hodlinator@users.noreply.github.com>
Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
Co-Authored-By: stickies-v <stickies-v@protonmail.com>
2024-08-28 19:09:51 +02:00
Hodlinator
dc5f6f6812
test refactor: util_tests - parse_hex clean up
* Use BOOST_CHECK_EQUAL_COLLECTIONS and BOOST_CHECK_EQUAL instead of deprecated BOOST_CHECK.
* Avoid repeating expected values.
* Break out repeated HEX_PARSE_INPUT and rename ParseHex_expected to HEX_PARSE_OUTPUT.

Done in preparation for adding a couple more tests in the next commit.

Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2024-08-28 19:09:51 +02:00
Hodlinator
2b5e6eff36
refactor: Make XOnlyPubKey tolerate constexpr std::arrays
Length was already asserted inside of base_blob-ctor.
2024-08-28 19:09:51 +02:00
Hodlinator
403d86f1cc
refactor: vector -> span in CCrypter
TestEncryptSingle: Remove no longer needed plaintext2-variable that existed because vectors had different allocators.
2024-08-28 19:09:51 +02:00
Hodlinator
bd0830bbd4
refactor: de-Hungarianize CCrypter
Beyond renaming it also adjusts whitespace and adds braces to conform to current doc/developer-notes.md.

TestEncrypt: Change iterator type to auto in ahead of vector -> span conversion.

Only touches functions that will be modified in next commit.
2024-08-28 19:09:51 +02:00
Hodlinator
d99c816971
refactor: Improve CCrypter related lines
Lines will be touched in next 2 commits.
2024-08-28 19:09:51 +02:00
Hodlinator
7e1d9a8468
refactor: Enforce lowercase hex digits for consteval uint256
Also changes compile-time asserts with comments into throws.
2024-08-28 19:09:51 +02:00
Lőrinc
837fbca036 Update spelling.ignore-words
Removed ba, inflight, keypair and warmup.
Added incomin found in optionsdialog.ui:345 and re-use found in utxo_snapshot.cpp
2024-08-28 18:42:19 +02:00
Lőrinc
f9a08f35a5 doc: fix a few simple codespell warnings 2024-08-28 18:42:10 +02:00
merge-script
4ee1940e84
Merge bitcoin/bitcoin#30734: doc: fix a few likely documentation typos related to CMake migration
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
7ee5c3c5b2 Fix a few likely documentation typos (Lőrinc)

Pull request description:

  Found them during CMake migration - and ran a quick spellcheck for the rest to cover any remaining ones

ACKs for top commit:
  maflcko:
    lgtm ACK 7ee5c3c5b2

Tree-SHA512: c6e7aa1e952e0d093745c4e6004c3907b7a215c6f998cc205307c0c68abcc067bf3f56e22af0deb1710186e8a871306f4bae8a35c74581e5299abcbbcddfaa75
2024-08-28 17:33:34 +01:00
merge-script
d184fc3ba4
Merge bitcoin/bitcoin#30571: test: [refactor] Use m_rng directly
948238a683 test: Remove FastRandomContext global (Ryan Ofsky)
fa0fe08eca scripted-diff: [test] Use g_rng/m_rng directly (MarcoFalke)
fa54cab473 test: refactor: Accept any RandomNumberGenerator in RandMoney (MarcoFalke)
68f77dd21e test: refactor: Pass rng parameters to test functions (Ryan Ofsky)
fa19af555d test: refactor: Move g_insecure_rand_ctx.Reseed out of the helper that calls MakeRandDeterministicDANGEROUS (MarcoFalke)
3dc527f460 test: refactor: Give unit test functions access to test state (Ryan Ofsky)
fab023e177 test: refactor: Make unsigned promotion explicit (MarcoFalke)
fa2cb654ec test: Add m_rng alias for the global random context (MarcoFalke)
fae7e3791c test: Correct the random seed log on a prevector test failure (MarcoFalke)

Pull request description:

  This is mostly a style-cleanup for the tests' random generation:

  1) `g_insecure_rand_ctx` in the tests is problematic, because the name is a leftover when the generator was indeed insecure. However, now the generator is *deterministic*, because the seed is either passed in or printed (c.f. RANDOM_CTX_SEED). Stating that deterministic randomness is insecure in the tests seems redundant at best. Fix it by just using `m_rng` for the name.

  2) The global random context has many one-line aliases, such as `InsecureRand32`. This is problematic, because the same line of code may use the context directly and through a wrapper at the same time. For example in net_tests (see below). This inconsistency is harmless, but confusing. Fix it by just removing the one-line aliases.

  ```
  src/test/net_tests.cpp:        auto msg_data_1 = g_insecure_rand_ctx.randbytes<uint8_t>(InsecureRandRange(100000));
  ````

  3) The wrapper for randmoney has the same problem that the same unit test uses the context directly and through a wrapper at the same time. Also, it has a single type of Rng hardcoded. Fix it by accepting any type.

ACKs for top commit:
  hodlinator:
    ACK 948238a683
  ryanofsky:
    Code review ACK 948238a683. Only changes since last review were changing a comments a little bit.
  marcofleon:
    Code review ACK 948238a683. Only changes since my last review are the improvements in `prevector_tests`.

Tree-SHA512: 69c6b46a42cb743138ee8c87ff26a588dbe083e3efb3dca49b8a133ba5d3b09e8bf01c590ec7e121a7d77cb1fd7dcacd927a9ca139ac65e1f7c6d1ec46f93b57
2024-08-28 16:56:32 +01:00
MarcoFalke
fac587ea07
ci: Use C++23 once for testing 2024-08-28 17:23:56 +02:00
glozow
f93d5553d1
Merge bitcoin/bitcoin#22838: descriptors: Be able to specify change and receiving in a single descriptor string
a0abcbd382 doc: Mention multipath specifier (Ava Chow)
0019f61fc5 tests: Test importing of multipath descriptors (Ava Chow)
f97d5c137d wallet, rpc: Allow importdescriptors to import multipath descriptors (Ava Chow)
32dcbca3fb rpc: Allow importmulti to import multipath descriptors correctly (Ava Chow)
64dfe3ce4b wallet: Move internal to be per key when importing (Ava Chow)
1692245525 tests: Multipath descriptors for scantxoutset and deriveaddresses (Ava Chow)
cddc0ba9a9 rpc: Have deriveaddresses derive receiving and change (Ava Chow)
360456cd22 tests: Multipath descriptors for getdescriptorinfo (Ava Chow)
a90eee444c tests: Add unit tests for multipath descriptors (Ava Chow)
1bbf46e2da descriptors: Change Parse to return vector of descriptors (Ava Chow)
0d640c6f02 descriptors: Have ParseKeypath handle multipath specifiers (Ava Chow)
a5f39b1034 descriptors: Change ParseScript to return vector of descriptors (Ava Chow)
0d55deae15 descriptors: Add DescriptorImpl::Clone (Ava Chow)
7e86541f72 descriptors: Add PubkeyProvider::Clone (Ava Chow)

Pull request description:

  It is convenient to have a descriptor which specifies both receiving and change addresses in a single string. However, as discussed in https://github.com/bitcoin/bitcoin/issues/17190#issuecomment-895515768, it is not feasible to use a generic multipath specification like BIP 88 due to combinatorial blow up and that it would result in unexpected descriptors.

  To resolve that problem, this PR proposes a targeted solution which allows only a single pair of 2 derivation indexes to be inserted in the place of a single derivation index. So instead of two descriptor `wpkh(xpub.../0/0/*)` and `wpkh(xpub.../0/1/*)` to represent receive and change addresses, this could be written as `wpkh(xpub.../0/<0;1>/*)`. The multipath specifier is of the form `<NUM;NUM>`. Each `NUM` can have its own hardened specifier, e.g. `<0;1h>` is valid. The multipath specifier can also only appear in one path index in the derivation path.

  This results in the parser returning two descriptors. The first descriptor uses the first `NUM` in all pairs present, and the second uses the second `NUM`. In our implementation, if a multipath descriptor is not provided, a pair is still returned, but the second element is just `nullptr`.

  The wallet will not output the multipath descriptors (yet). Furthermore, when a multipath descriptor is imported, it is expanded to the two descriptors and each imported on its own, with the second descriptor being implicitly for internal (change) addresses. There is no change to how the wallet stores or outputs descriptors (yet).

  Note that the path specifier is different from what was proposed. It uses angle brackets and the semicolon because these are unused characters available in the character set and I wanted to avoid conflicts with characters already in use in descriptors.

  Closes #17190

ACKs for top commit:
  darosior:
    re-ACK a0abcbd382
  mjdietzx:
    reACK a0abcbd382
  pythcoiner:
    reACK a0abcbd
  furszy:
    Code review ACK a0abcbd
  glozow:
    light code review ACK a0abcbd382

Tree-SHA512: 84ea40b3fd1b762194acd021cae018c2f09b98e595f5e87de5c832c265cfe8a6d0bc4dae25785392fa90db0f6301ddf9aea787980a29c74f81d04b711ac446c2
2024-08-28 15:56:15 +01:00
MarcoFalke
fa80d39d82
ci: Re-add configs removed in cmake migration 2024-08-28 16:50:04 +02:00
fanquake
7de0c99804
doc: update dev note examples for CMake 2024-08-28 15:25:14 +01:00