Commit graph

270 commits

Author SHA1 Message Date
Tom Trevethan
030ab66c70 Merge 54c4b09f08 into merged_master (Bitcoin PR bitcoin/bitcoin#31042) 2026-04-01 22:41:52 +01:00
Tom Trevethan
a7e8a376fa Merge 74fb19317a into merged_master (Bitcoin PR bitcoin/bitcoin#30849) 2026-03-31 23:04:42 +01:00
ivanlele
55dd6d547d
Merge 9f45062b9b into merged_master (Bitcoin PR bitcoin/bitcoin#30937) 2026-03-30 10:51:11 +00:00
ivanlele
a12fdfb304
Merge e983ed41d9 into merged_master (Bitcoin PR bitcoin/bitcoin#30410) 2026-03-26 12:41:48 +00:00
ivanlele
985fd76510
Merge 30e8a79aef into merged_master (Bitcoin PR bitcoin/bitcoin#30482) 2026-03-10 11:29:20 +00:00
ivanlele
ae2fd3624b
Merge 6144aa21d0 into merged_master (Bitcoin PR bitcoin/bitcoin#30444) 2026-03-09 15:09:19 +00:00
ikripaka
e9f110879b
Merge b4b9854394 into merged_master (Bitcoin PR bitcoin/bitcoin#30321) 2026-03-02 15:29:58 +00:00
ikripaka
006073614d
Merge 011a895a82 into merged_master (Bitcoin PR bitcoin/bitcoin#29015) 2026-02-27 22:51:31 +00:00
Tom Trevethan
b64d8b87c8 Merge 6300438a2e into merged_master (Bitcoin PR bitcoin/bitcoin#30115) 2026-02-23 23:41:30 +00:00
ivanlele
f64242fec3
Merge 8efd03ad04 into merged_master (Bitcoin PR bitcoin/bitcoin#29494) 2026-02-19 16:14:46 +00:00
Tom Trevethan
d6ba7f08d6 Merge bde3db40f6 into merged_master (Bitcoin PR #26415) 2026-02-16 01:41:42 +00:00
Byron Hambly
451ac2cc1c
Merge 45b2a91897 into merged_master (Bitcoin PR bitcoin/bitcoin#29404) 2025-12-04 09:29:58 +02:00
Byron Hambly
a264d5785d
Merge 143ace65db into merged_master (Bitcoin PR bitcoin/bitcoin#28890) 2025-11-17 21:42:59 +02:00
Byron Hambly
6abf91ab3d
Merge 622e79e0fb into merged_master (Bitcoin PR bitcoin/bitcoin#29021) 2025-11-17 15:07:22 +02:00
Byron Hambly
26b9abc2f2
Merge b5a271334c into merged_master (Bitcoin PR bitcoin/bitcoin#28922) 2025-11-11 08:56:23 +02:00
Byron Hambly
d46449ab86
Merge 950af7c876 into merged_master (Bitcoin PR bitcoin/bitcoin#28878) 2025-11-10 14:35:23 +02:00
Byron Hambly
8cf8bd5564
Merge 108462139b into merged_master (Bitcoin PR bitcoin/bitcoin#28438) 2025-11-10 13:45:17 +02:00
Byron Hambly
d0c39be53c
Merge e77339632e into merged_master (Bitcoin PR bitcoin/bitcoin#28136) 2025-11-06 09:36:00 +02:00
Byron Hambly
69492d27da
Merge 08ea835220 into merged_master (Bitcoin PR bitcoin/bitcoin#28583) 2025-08-07 10:05:15 +02:00
Byron Hambly
905b2db43d Merge d80348ccb6 into merged_master (Bitcoin PR bitcoin/bitcoin#27853) 2025-06-27 14:01:33 +02:00
Byron Hambly
edc585d157 Merge 9564f98fee into merged_master (Bitcoin PR bitcoin/bitcoin#27636) 2025-06-25 11:40:46 +02:00
Byron Hambly
b1d470027d Merge c2f2abd0a4 into merged_master (Bitcoin PR bitcoin/bitcoin#27125) 2025-06-20 10:46:05 +02:00
Byron Hambly
ecf7719740 Merge e054b7390c into merged_master (Bitcoin PR bitcoin/bitcoin#27468) 2025-04-14 08:20:23 +02:00
Byron Hambly
9111b218a7 Merge ebb15ea75a into merged_master (Bitcoin PR bitcoin/bitcoin#26207) 2025-04-10 09:39:45 +02:00
Tom Trevethan
1435fb334b Merge 79e007d1d6 into merged_master (Bitcoin PR bitcoin/bitcoin#25296) 2025-04-04 13:36:08 +00:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Tom Trevethan
ef3c367aa4 Merge 1801d8c3c9 into merged_master (Bitcoin PR bitcoin/bitcoin#26308) 2025-03-25 16:20:40 +00:00
Byron Hambly
ca0a68b350
Merge UP TO 551c8e9526 into merged_master (UP TO bitcoin/bitcoin#26349)
Includes FIXMEs for a few functional tests
2025-02-05 09:50:17 +02:00
Byron Hambly
793d471d13 Merge a75b7796b7 into merged_master (Bitcoin PR bitcoin/bitcoin#25077) 2024-11-03 16:10:34 +02:00
Hennadii Stepanov
70713303b6
scripted-diff: Rename PACKAGE_* variables to CLIENT_*
This change ensures consistent use of the `CLIENT_` namespace everywhere
in the repository.

-BEGIN VERIFY SCRIPT-

ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./cmake ./src :\(exclude\)./src/secp256k1 ./test ) ; }

ren PACKAGE_NAME      CLIENT_NAME
ren PACKAGE_VERSION   CLIENT_VERSION_STRING
ren PACKAGE_URL       CLIENT_URL
ren PACKAGE_BUGREPORT CLIENT_BUGREPORT

-END VERIFY SCRIPT-
2024-10-28 12:36:19 +00:00
Byron Hambly
c544145c90 Merge 7d3817b29a into merged_master (Bitcoin PR bitcoin/bitcoin#25760) 2024-10-25 13:41:22 +02:00
Ava Chow
74fb19317a
Merge bitcoin/bitcoin#30849: refactor: migrate bool GetCoin to return optional<Coin>
4feaa28728 refactor: Rely on returned value of GetCoin instead of parameter (Lőrinc)
46dfbf169b refactor: Return optional of Coin in GetCoin (Lőrinc)
e31bfb26c2 refactor: Remove unrealistic simulation state (Lőrinc)

Pull request description:

  While reviewing [the removal of the unreachable combinations from the Coin cache logic](https://github.com/bitcoin/bitcoin/pull/30673#discussion_r1721727681), we've noticed that the related tests often [reflect impossible states](https://github.com/bitcoin/bitcoin/pull/30673/files#r1740154464).

  Browsing the Coin cache refactoring history revealed that migrating `bool GetCoin` to `optional<Coin> GetCoin` was [already proposed a few times before](https://github.com/bitcoin/bitcoin/pull/18746#issuecomment-842393167).

  This refactor makes certain invalid states impossible, reducing the possibility of errors and making the code easier to understand. This will let us remove test code that exercises the impossible states as well.
  The PR is done in multiple small steps, first swapping the new `optional` return value, slowly strangling out the usages of the return parameter, followed by the removal of the parameter.

  Most of the invalid test states were still kept, except for https://github.com/bitcoin/bitcoin/pull/30673/files#r1748087322, where the new design prohibits invalid usage and https://github.com/bitcoin/bitcoin/pull/30673/files#r1749350258 was just marked with a TODO, will be removed in a follow-up PR.

ACKs for top commit:
  andrewtoth:
    re-ACK 4feaa28728
  achow101:
    ACK 4feaa28728
  laanwj:
    Code review ACK 4feaa28728
  theStack:
    Code-review ACK 4feaa28728

Tree-SHA512: 818d60b2e97f58c489a61120fe761fb67a08dffbefe7a3fce712d362fc9eb8c2cced23074f1bec55fe71c616a3561b5a8737919ad6ffb2635467ec4711683df7
2024-10-24 13:52:47 -04:00
Sebastian Falbesoner
1786be7b4a scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h
Follow-up for PR #30856, commit 0dd66251.

-BEGIN VERIFY SCRIPT-
sed -i "s|config/bitcoin-config\.h|bitcoin-build-config.h|g" $(git grep -l config/bitcoin-config\.h)
sed -i "s|bitcoin-config\.h|bitcoin-build-config.h|g" $(git grep -l "bitcoin-config\.h" ./src ./test ./cmake)
git mv ./cmake/bitcoin-config.h.in ./cmake/bitcoin-build-config.h.in
-END VERIFY SCRIPT-
2024-10-10 12:22:12 +02:00
James Dorfman
61b0543ba7 Merge cdcc74bbcc into merged_master (Elements PR #1270) 2024-09-23 16:51:13 +00:00
Lőrinc
4feaa28728 refactor: Rely on returned value of GetCoin instead of parameter
Also removed the unused coin parameter of GetCoin.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>
2024-09-18 20:03:47 +02:00
Martin Zumsande
e5b537bbdf rest: improve error when only header of a block is available.
This avoids calling ReadRawBlockFromDisk() when the block is expected
not to be available because we haven't downloaded it yet and only know
the header.
2024-09-13 10:50:43 -04:00
James Dorfman
fe8d041f9f Merge 489b587669 into merged_master (Bitcoin PR bitcoin/bitcoin#25215) 2024-09-10 20:19:35 +00:00
James Dorfman
66bc45020f Merge 4d0c00dffd into merged_master (Bitcoin PR bitcoin/bitcoin#25168) 2024-08-13 20:10:21 +00:00
James Dorfman
84f5f4cf9c Merge f436bfd126 into merged_master (Bitcoin PR bitcoin/bitcoin#22953) 2024-08-02 05:19:51 +00:00
James Dorfman
d4aa6eba2f Merge dbdc83ae01 into merged_master (Bitcoin PR bitcoin/bitcoin#24909) 2024-08-01 18:03:20 +00:00
James Dorfman
38cf680443 Merge 41720a1f54 into merged_master (Bitcoin PR bitcoin/bitcoin#24786) 2024-07-29 19:42:59 +00:00
MarcoFalke
fa7b57e5f5
refactor: Replace ParseHashStr with FromHex
No need to have two functions with different names that achieve the
exact same thing.
2024-07-24 17:40:18 +02:00
MarcoFalke
fa90777245
rest: Reject truncated hex txid early in getutxos parsing 2024-07-24 17:40:13 +02:00
MarcoFalke
fac932bf93
refactor: Use util::Split to avoid a harmless unsigned-integer-overflow
The previous commit added a test which would fail the
unsigned-integer-overflow sanitizer. The warning is harmless and can be
triggered on any commit, since the code was introduced.

For reference, the warning would happen when the separator `-` was not
present.

For example:

  GET /rest/getutxos/6a297bfa5cb8dd976ab0207a767d6cbfaa5e876f30081127ec8674c8c52b16c0_+1.json

would result in:

rest.cpp:792:77: runtime error: unsigned integer overflow: 18446744073709551615 + 1 cannot be represented in type 'size_type' (aka 'unsigned long')
    #0 0x55ad42c16931 in rest_getutxos(std::any const&, HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) src/rest.cpp:792:77
    #1 0x55ad4319e3c0 in std::function<bool (HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>::operator()(HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
    #2 0x55ad4319e3c0 in HTTPWorkItem::operator()() src/httpserver.cpp:59:9
    #3 0x55ad431a3eea in WorkQueue<HTTPClosure>::Run() src/httpserver.cpp:114:13
    #4 0x55ad4318f961 in HTTPWorkQueueRun(WorkQueue<HTTPClosure>*, int) src/httpserver.cpp:403:12
    #5 0x7f078ebcbbb3  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xeabb3) (BuildId: 40b9b0d17fdeebfb57331304da2b7f85e1396ef2)
    #6 0x55ad4277e01c in asan_thread_start(void*) asan_interceptors.cpp.o
    #7 0x7f078e840a93  (/lib/x86_64-linux-gnu/libc.so.6+0x9ca93) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)
    #8 0x7f078e8cdc3b  (/lib/x86_64-linux-gnu/libc.so.6+0x129c3b) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)

SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow rest.cpp:792:77
2024-07-17 12:22:28 +02:00
MarcoFalke
fab54db9f1
rest: Reject negative outpoint index in getutxos parsing 2024-07-12 17:48:26 +02:00
James Dorfman
18d0ebdd77 Merge 27cfaeed1e into merged_master (Bitcoin PR bitcoin/bitcoin#24098) 2024-07-09 02:27:59 +00:00
James Dorfman
9616104db4 Merge a2e1590f67 into merged_master (Bitcoin PR bitcoin/bitcoin#24673) 2024-07-08 06:22:20 +00:00
Roman Zeyde
1556d21599
rest: don't copy data when sending binary response
Also, change `HTTPRequest::WriteReply` to accept `std::span`.
2024-06-26 06:47:30 +03:00
Ava Chow
011a895a82
Merge bitcoin/bitcoin#29015: kernel: Streamline util library
c7376babd1 doc: Clarify distinction between util and common libraries in libraries.md (Ryan Ofsky)
4f74c59334 util: Move util/string.h functions to util namespace (Ryan Ofsky)
4d05d3f3b4 util: add TransactionError includes and namespace declarations (Ryan Ofsky)
680eafdc74 util: move fees.h and error.h to common/messages.h (Ryan Ofsky)
02e62c6c9a common: Add PSBTError enum (Ryan Ofsky)
0d44c44ae3 util: move error.h TransactionError enum to node/types.h (Ryan Ofsky)
9bcce2608d util: move spanparsing.h to script/parsing.h (Ryan Ofsky)
6dd2ad4792 util: move spanparsing.h Split functions to string.h (Ryan Ofsky)
23cc8ddff4 util: move HexStr and HexDigit from util to crypto (TheCharlatan)
6861f954f8 util: move util/message to common/signmessage (Ryan Ofsky)
cc5f29fbea build: move memory_cleanse from util to crypto (Ryan Ofsky)
5b9309420c build: move chainparamsbase from util to common (Ryan Ofsky)
ffa27af24d test: Add check-deps.sh script to check for unexpected library dependencies (Ryan Ofsky)

Pull request description:

  Remove `fees.h`, `errors.h`, and `spanparsing.h` from the util library. Specifically:

  - Move `Split` functions from `util/spanparsing.h` to `util/string.h`, using `util` namespace for clarity.
  - Move remaining spanparsing functions to `script/parsing.h` since they are used for descriptor and miniscript parsing.
  - Combine `util/fees.h` and `util/errors.h` into `common/messages.h` so there is a place for simple functions that generate user messages to live, and these functions are not part of the util library.

  Motivation for this change is that the util library is a dependency of the kernel, and we should remove functionality from util that shouldn't be called by kernel code or kernel applications. These changes should also improve code organization and make functions easier to discover. Some of these same moves are (or were) part of #28690, but did not help with code organization, or made it worse, so it is better to move them and clean them up in the same PR so code only has to change one time.

ACKs for top commit:
  achow101:
    ACK c7376babd1
  TheCharlatan:
    Re-ACK c7376babd1
  hebasto:
    re-ACK c7376babd1.

Tree-SHA512: 5bcef16c1255463b1b69270548711e7ff78ca0dd34e300b95e3ca1ce52ceb34f83d9ddb2839e83800ba36b200de30396e504bbb04fa02c6d0c24a16d06ae523d
2024-06-12 17:12:54 -04:00
James Dorfman
b4185c7008 CI: fix asan lock issues 2024-05-21 16:56:01 +00:00