aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-08-13gui: Use wallet name for wallet migration rather than WalletModelAva Chow
To prepare for migrating wallets that are not loaded, when migration occurs in the GUI, it should not rely on a WalletModel existing. Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2024-08-13gui: don't remove wallet manually before migrationfurszy
2024-08-13gui: Consolidate wallet display name to GUIUtil functionAva Chow
Instead of having the code for the wallet display name being copy and pasted, use a GUIUtil function to get that for us.
2024-08-13wallet, interfaces: Include database format in listWalletDirAva Chow
2024-08-13Merge bitcoin/bitcoin#30642: doc: add missing "testnet4" network string in ↵glozow
RPC/init help texts 701530045553f2b9671a3fffea301bf4dc954514 doc: add missing "testnet4" network string in RPC/init help texts (Sebastian Falbesoner) Pull request description: The following bitcoind parameters / RPC calls still missed the "testnet4" network string: - `-chain=` parameter - `getblockchaininfo` RPC, `"chain"` result - `getmininginfo` RPC, `"chain"` result The occurences were found via `$ git grep \".*main.*test.*\"`. ACKs for top commit: maflcko: review ACK 701530045553f2b9671a3fffea301bf4dc954514 glozow: ACK 701530045553f2b9671a3fffea301bf4dc954514 tdb3: ACK 701530045553f2b9671a3fffea301bf4dc954514 BrandonOdiwuor: ACK 701530045553f2b9671a3fffea301bf4dc954514 danielabrozzoni: ACK 701530045553f2b9671a3fffea301bf4dc954514 Tree-SHA512: 99bf5c2b4cf28651feaff2fc7d4669961012dfa8379d8522251540ae1b8fc77d1761b75395903b527580530f42a3c1fd2dd2d8dba4ffbc9b6e55cb357c3a271b
2024-08-13Merge bitcoin/bitcoin#30617: net: Clarify that m_addr_local is only set onceglozow
fa6fe432075df5e0eceb1ccd85038159cc820ccc net: Clarify that m_addr_local is only set once (MarcoFalke) Pull request description: The function is supposed to be only called once when the version msg arrives (a single time). Calling it twice would be an internal logic bug. However, the `LogError` in this function has many issues: * If the error happens in tests, as is the case for the buggy fuzz test, it will go unnoticed * It is dead code, unless a bug is introduced to execute it Fix all issues by using `Assume(!m_addr_local.IsValid())` instead. Idea taken from https://github.com/bitcoin/bitcoin/pull/30364#discussion_r1680530382 ACKs for top commit: achow101: ACK fa6fe432075df5e0eceb1ccd85038159cc820ccc mzumsande: utACK fa6fe432075df5e0eceb1ccd85038159cc820ccc glozow: ACK fa6fe432075df5e0eceb1ccd85038159cc820ccc Tree-SHA512: 8c1e8c524768f4f36cc50110ae54ee423e057a963ff78f736f3bf92df1ce5af28e3e0149153780897944e1d5c22ddbca9dac9865d9f4d44afffa152bc8559405
2024-08-13test: Disallow fee_estimator construction in ChainTestingSetupMarcoFalke
It is expensive to construct, and only one test uses it. Fix both issues by disallowing the construction and moving it to the single test that uses it.
2024-08-12wallet: fix, detect blank legacy wallets in IsLegacyfurszy
Blank legacy wallets do not have active SPKM. They can only be detected by checking the descriptors' flag or the db format. This enables the migration of blank legacy wallets in the GUI.
2024-08-12doc: add missing "testnet4" network string in RPC/init help textsSebastian Falbesoner
The following bitcoind parameters / RPC calls missed the "testnet4" network string: - `-chain=` parameter - `getblockchaininfo` RPC, "chain" result - `getmininginfo` RPC, "chain" result
2024-08-12Merge bitcoin/bitcoin#30326: optimization: Reduce cache lookups in ↵Ava Chow
CCoinsViewCache::FetchCoin 204ca67bba263018374fe86d7a6867362d09536f Reduce cache lookups in CCoinsViewCache::FetchCoin (Lőrinc) Pull request description: Enhanced efficiency and readability of `CCoinsViewCache::FetchCoin` by replacing separate `find()` and `emplace()` calls with a single `try_emplace()`, reducing map lookups and potential insertions. `AssembleBlock` shows `FetchCoin` as one of its bottlenecks: <img src="https://github.com/bitcoin/bitcoin/assets/1841944/79c7f480-aac2-46da-9ac9-526a02a8eafa"> These changes result in a modest performance improvement: > ./src/bench/bench_bitcoin --filter='AssembleBlock' --min-time=10000 before: | ns/op | op/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 156,160.70 | 6,403.66 | 0.6% | 10.91 | `AssembleBlock` after: | ns/op | op/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 152,971.97 | 6,537.15 | 0.2% | 10.95 | `AssembleBlock` Further benchmarks: https://github.com/bitcoin/bitcoin/pull/30326#issuecomment-2188378721 ACKs for top commit: sipa: utACK 204ca67bba263018374fe86d7a6867362d09536f achow101: ACK 204ca67bba263018374fe86d7a6867362d09536f andrewtoth: re-ACK 204ca67bba263018374fe86d7a6867362d09536f Tree-SHA512: 65743a5d4edd442672a59d7b3de38fe197c61270a5c8df65712413904559f360fc58b512234558c7e5169ffb4dda3b2d2f7ded92ad5b04ca999828986b251066
2024-08-12Merge bitcoin/bitcoin#28209: fuzz: a target for the block index databaseAva Chow
86b38529d5014612c3e7bb59fdc4dad3bff2aa64 qa: a fuzz target for the block index database (Antoine Poinsot) Pull request description: This introduces a small fuzz target for `CBlockTreeDB` which asserts a few invariants by using an in-memory LevelDb. ACKs for top commit: achow101: ACK 86b38529d5014612c3e7bb59fdc4dad3bff2aa64 TheCharlatan: Re-ACK 86b38529d5014612c3e7bb59fdc4dad3bff2aa64 maflcko: review ACK 86b38529d5014612c3e7bb59fdc4dad3bff2aa64 🥒 brunoerg: utACK 86b38529d5014612c3e7bb59fdc4dad3bff2aa64 Tree-SHA512: ab75b4ae1c7e0a4b15f8a6ceffdf509fbc79833e6ea073ecef68558d53b83663d1b30362aaa2d77c22b8890a572f5b1d4b1c5abbca483c8c8f9b1fb5b276a59a
2024-08-12Merge bitcoin/bitcoin#30563: fuzz: improve `scriptpubkeyman` targetAva Chow
401cc4ec70d67ba2aa0e078d2fab214e1c40742c fuzz: improve scriptpubkeyman target (brunoerg) Pull request description: Fixes #30541 This PR aims to improve `scriptpubkeyman` target to avoid timeouts. The input provided in #30541 takes too much time to run because it basically calls only `MarkUnusedAddresses` (300 times * number of spks). The following changes were made to improve it: - Reduce keypool size. - When calling `MarkUnusedAddresses`, do it with one of the spks per iteration. - Remove the specific `AddDescriptorKey` call since it is already covered with `AddWalletDescriptor`. - Limit number of iterations to a reasonable value. ACKs for top commit: maflcko: lgtm ACK 401cc4ec70d67ba2aa0e078d2fab214e1c40742c achow101: ACK 401cc4ec70d67ba2aa0e078d2fab214e1c40742c Tree-SHA512: 941812bc6d991dd03675a2974ce1b839494ca7f6e6d8a22c689d4bf4fed2dac5491246998f19cb15dbff516fdd8eeda27e7628c3206d45f57dc292bc05624a5c
2024-08-12Merge bitcoin-core/gui#831: GUIUtil::brintToFront workaround for WaylandHennadii Stepanov
15aa7d023688700a47997b92108de95f2d864f5a gui, qt: brintToFront workaround for Wayland (pablomartin4btc) Pull request description: There are known issues around handling windows focus in `Wayland` ([this one specific](https://bugs.kde.org/show_bug.cgi?id=462574) in KDE but also in [gnome](https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/730)). The idea is that the workaround will be executed if `bitcoin-qt` is running using `Wayland` platform (e.g.: `QT_QPA_PLATFORM=wayland ./src/qt/bitcoin-qt -regtest`), since the workaround behaviour looks like re-opening the window again (which I tried to fix by moving the window to the original position and/ or re-setting the original geometry without success) while in `X11` (not sure in Mac) the current `GUIUtil::brintToFront` actually sets the focus to the desired window, keeping its original position as expected, and I didn't want to change that (`X11` behaviour). The solution was [initially discussed](https://github.com/bitcoin-core/gui/pull/817#issuecomment-2256158902) with hebasto in #817. ACKs for top commit: hebasto: ACK 15aa7d023688700a47997b92108de95f2d864f5a. Tree-SHA512: 141d6cc4a618026e551627b9f4cc284285980db02a54a7b19c7de91e8c5adccf0c1d67380625146b5413e58c59f39c9e944ed5ba68cb8644f67647518918b6f7
2024-08-12Merge bitcoin/bitcoin#30265: wallet: Fix listwalletdir listing of migrated ↵glozow
default wallets and generated backup files 6b2dcba07670f04f32c0dc3a2c86fd805c85f12d wallet: List sqlite wallets with empty string name (Ava Chow) 3ddbdd1815c676a88345b3b0e55a551d2a569e28 wallet: Ignore .bak files when listing wallet files (Ava Chow) Pull request description: When the default wallet is migrated, we do not rename the wallet so we end up having a descriptor wallet with the empty string as its name and the wallet.dat file in the root of the walletdir. This is supposed to be an unsupported configuration and there is no other way to achieve this (other than file copying), but the wallet loading code does not disallow loading such wallets. However `listwalletdir` does not currently list the default wallet if it is sqlite. This is confusing to users, so change `listwalletdir` to include these wallets. Additionally, the migration of the default wallet, and of any plain wallet files in the walletdir, produces a backup file in the walletdir itself. Since these backups are a BDB file, `listwalletdir` will detect them as being another wallet that we could open, but this is erroneous and could lead to confusion and potentially funds loss if both the backup and the migrated wallet are in use simultaneously. To reduce the likelihood of this issue, don't list these wallets in `listwalletdir`. *** Possibly we could have more stringent checks on loading to resolve these issues, but I'm concerned that that will just confuse users and gratuitously break things that already worked. Since the original intent was to disallow default wallets for sqlite/descriptors, a possible alternative would be to prevent people from loading such wallets and change migration to rename those wallets. However, given that this behavior with migrating default wallets has existed since default wallet migration was fixed, I think that making such a change would be confusing and break things for no good reason. Although perhaps we should still do the renaming. For the backups, we could also change loading to refuse to load any wallet named with `.bak` (or `.legacy.bak`) as such wallets can still be loaded by giving the path to them directly, which some users may do to "restore" the backup. However restricting what can be loaded based on filename seems a little heavyhanded. It wouldn't be funds loss though since the correct way to restore the backup is with `restorewallet`. ACKs for top commit: fjahr: Code review ACK 6b2dcba07670f04f32c0dc3a2c86fd805c85f12d furszy: Code ACK 6b2dcba076 glozow: ACK 6b2dcba07670f04f32c0dc3a2c86fd805c85f12d Tree-SHA512: 0b033f6ed55830f8a054afea3fb2cf1fa82a94040053ebfaf123bda36c99f45d3f01a2aec4ed02fed9c61bb3d320b047ed892d7f6644b5a356a7bc5974b10cff
2024-08-12Merge bitcoin/bitcoin#30633: Fixes for GCC 15 compatibilitymerge-script
055bc05792ff5d5b084563044818ebec12bfd748 policy/feerate.h: avoid constraint self-dependency (Matt Whitlock) 138f8671569f7ebb8c84e9d80c44cddeda9e3845 add missing #include <cstdint> for GCC 15 (Matt Whitlock) Pull request description: #30612 with changes made. GCC 15 introduces three build failures: * Two are related to missing includes. You can't use `uint16_t` et al. without including `<cstdint>`. * The third is harder to understand but easy to fix. GCC changed something about the way templates are instantiated when checking type constraints, and now there is a dependency loop while checking `std::optional<CFeeRate>`. This manifests as the following compile-time mess: ``` In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/format:48, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/chrono_io.h:39, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/chrono:3362, from ./util/time.h:9, from ./primitives/block.h:12, from ./blockencodings.h:8, from blockencodings.cpp:5: /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits: In substitution of 'template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]': /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1140:25: required by substitution of 'template<class _Tp, class ... _Args> using std::__is_constructible_impl = std::__bool_constant<__is_constructible(_Tp, _Args ...)> [with _Tp = CFeeRate; _Args = {std::optional<CFeeRate>&}]' 1140 | = __bool_constant<__is_constructible(_Tp, _Args...)>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1145:12: required from 'struct std::is_constructible<CFeeRate, std::optional<CFeeRate>&>' 1145 | struct is_constructible | ^~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:178:35: required by substitution of 'template<class ... _Bn> std::__detail::__first_t<std::integral_constant<bool, false>, typename std::enable_if<(!(bool)(_Bn::value)), void>::type ...> std::__detail::__or_fn(int) [with _Bn = {std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate>}]' 178 | __enable_if_t<!bool(_Bn::value)>...>; | ^~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:196:41: required from 'struct std::__or_<std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate> >' 196 | : decltype(__detail::__or_fn<_Bn...>(0)) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:824:45: required from 'constexpr const bool std::optional<CFeeRate>::__construct_from_contained_value<CFeeRate, CFeeRate>' 824 | = !__converts_from_optional<_Tp, _From>::value; | ^~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:7: required by substitution of 'template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]' 884 | && __construct_from_contained_value<_Up> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./validation.h:164:41: required from here 164 | return MempoolAcceptResult(state); | ^ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:886:2: required by the constraints of 'template<class _Tp> template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<_Tp>::optional(const std::optional<_From>&)' /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:14: error: satisfaction of atomic constraint '__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type> [with _Tp = _Tp; _Up = _Up]' depends on itself 884 | && __construct_from_contained_value<_Up> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` It is easiest to solve this by changing the `static_assert` in the explicit `CFeeRate` constructor to a SFINAE by using a type constraint on the function template parameter. We already [downstreamed](https://github.com/gentoo/gentoo/pull/38015) these fixes in Gentoo. ACKs for top commit: stickies-v: ACK 055bc05792ff5d5b084563044818ebec12bfd748 Tree-SHA512: ce9cb27bcd9b0f4bbc80951e45cf7127112dcb7f9937bcb0167b362026d35beecb1255354746de0aac82e03c41eaccbe26acbfe0ddff2ee1e5a8634673f4f4ba
2024-08-12Merge bitcoin/bitcoin#30625: chainparams: Handle Testnet4 in GetNetworkForMagicmerge-script
b0ec8716bf27335686471e0ae4c6a34f9a08f33c chainparams: Handle Testnet4 in GetNetworkForMagic (Fabian Jahr) Pull request description: Found during testing: The recently introduced `GetNetworkForMagic()` doesn't handle Testnet4 yet. ACKs for top commit: tdb3: cr ACK b0ec8716bf27335686471e0ae4c6a34f9a08f33c maflcko: review ACK b0ec8716bf27335686471e0ae4c6a34f9a08f33c theStack: ACK b0ec8716bf27335686471e0ae4c6a34f9a08f33c willcl-ark: crACK b0ec8716bf27335686471e0ae4c6a34f9a08f33c Tree-SHA512: 77cd0a6791529e5c5dfdb25cff3eff77224be9058d7cf4a8b3544651eb44c5e8ee90c5abfb9751ab0e11c5aa2d8477831dbf1868c4d5909481e0979e4db1eb28
2024-08-12Merge bitcoin/bitcoin#30524: doc: rpc: Use "output script" consistently (2/2)merge-script
fa5755b0a8536b844fdccfecf386c1baab24f1c9 doc: rpc: Use "output script" consistently (2/2) (MarcoFalke) Pull request description: Small follow-up to https://github.com/bitcoin/bitcoin/pull/30408 to fixup the RPCs that were forgotten. ACKs for top commit: theStack: lgtm ACK fa5755b0a8536b844fdccfecf386c1baab24f1c9 Tree-SHA512: f1fc0aabb59017da216d6fe0f08a2274336d04db332ad6ce3d9608cd6f03667be1c76423f24a489ac8e7d536011a129dca752ab64b4621b7bc1d4d53f68602e4
2024-08-12policy/feerate.h: avoid constraint self-dependencyMatt Whitlock
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/format:48, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/chrono_io.h:39, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/chrono:3362, from ./util/time.h:9, from ./primitives/block.h:12, from ./blockencodings.h:8, from blockencodings.cpp:5: /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits: In substitution of 'template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]': /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1140:25: required by substitution of 'template<class _Tp, class ... _Args> using std::__is_constructible_impl = std::__bool_constant<__is_constructible(_Tp, _Args ...)> [with _Tp = CFeeRate; _Args = {std::optional<CFeeRate>&}]' 1140 | = __bool_constant<__is_constructible(_Tp, _Args...)>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1145:12: required from 'struct std::is_constructible<CFeeRate, std::optional<CFeeRate>&>' 1145 | struct is_constructible | ^~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:178:35: required by substitution of 'template<class ... _Bn> std::__detail::__first_t<std::integral_constant<bool, false>, typename std::enable_if<(!(bool)(_Bn::value)), void>::type ...> std::__detail::__or_fn(int) [with _Bn = {std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate>}]' 178 | __enable_if_t<!bool(_Bn::value)>...>; | ^~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:196:41: required from 'struct std::__or_<std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate> >' 196 | : decltype(__detail::__or_fn<_Bn...>(0)) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:824:45: required from 'constexpr const bool std::optional<CFeeRate>::__construct_from_contained_value<CFeeRate, CFeeRate>' 824 | = !__converts_from_optional<_Tp, _From>::value; | ^~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:7: required by substitution of 'template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]' 884 | && __construct_from_contained_value<_Up> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./validation.h:164:41: required from here 164 | return MempoolAcceptResult(state); | ^ /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:886:2: required by the constraints of 'template<class _Tp> template<class _Up> requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<_Tp>::optional(const std::optional<_From>&)' /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:14: error: satisfaction of atomic constraint '__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type> [with _Tp = _Tp; _Up = _Up]' depends on itself 884 | && __construct_from_contained_value<_Up> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-08-12add missing #include <cstdint> for GCC 15Matt Whitlock
2024-08-12Merge bitcoin/bitcoin#30624: doc: Remove outdated nTx faking commentmerge-script
fa04511e44bc6c740ff1c4f912f689b2bc3d1288 doc: Remove outdated nTx faking comment (MarcoFalke) Pull request description: This problematic `nTx` "faking" was removed in commit b50554babdddf452acaa51bac757736766c70e81. So fix the wrong comment. Also, address the typo nits from: * https://github.com/bitcoin/bitcoin/pull/29370#discussion_r1531789314 * https://github.com/bitcoin/bitcoin/pull/30598#discussion_r1711982543 ACKs for top commit: fjahr: ACK fa04511e44bc6c740ff1c4f912f689b2bc3d1288 Tree-SHA512: c918f0b9274be9c347a37d6221915688977a858fb8d2146035718bf17df0bd3b51d67ef12b971556851c0f69f46d26f557c35a5461abeb0683b538b9dc48f5b6
2024-08-12Merge bitcoin/bitcoin#30616: test: remove `ExtractDestination` false ↵glozow
assertion for `ANCHOR` script a4f2b185732649eeea4a042cebd90d0e0e12cc92 [test]: remove `ExtractDestination` false assertion for `ANCHOR` script (ismaelsadeeq) Pull request description: This PR fixes #30615 `ExtractDestination` returns `true` when `TxoutType` is `ANCHOR` see https://github.com/bitcoin/bitcoin/issues/30615#issuecomment-2277538703 ACKs for top commit: maflcko: review ACK a4f2b185732649eeea4a042cebd90d0e0e12cc92 instagibbs: ACK a4f2b185732649eeea4a042cebd90d0e0e12cc92 theStack: utACK a4f2b185732649eeea4a042cebd90d0e0e12cc92 BrandonOdiwuor: Code Review ACK a4f2b185732649eeea4a042cebd90d0e0e12cc92 glozow: ACK a4f2b185732649eeea4a042cebd90d0e0e12cc92 Tree-SHA512: 6120494fe888acf26b252d4aadc01dc256e294ea5e4c954fd9b4694be27dc35cf0e33e3b3bcb012fb4abe1cab0b1d0d515db226fa771e791e0fe7efbcbd8834d
2024-08-10chainparams: Handle Testnet4 in GetNetworkForMagicFabian Jahr
2024-08-10doc: Remove outdated nTx faking commentMarcoFalke
This was fixed in commit b50554babdddf452acaa51bac757736766c70e81. Also, address the typo nits from: * https://github.com/bitcoin/bitcoin/pull/29370#discussion_r1531789314 * https://github.com/bitcoin/bitcoin/pull/30598#discussion_r1711982543
2024-08-10chainparams: add mainnet assumeutxo param at height 840_000Sjors Provoost
2024-08-09Merge bitcoin/bitcoin#29519: p2p: For assumeutxo, download snapshot chain ↵Ava Chow
before background chain 49d569cb1fdd62a9da8dff51dccaf4680fe3d0eb p2p: For assumeutxo, download snapshot chain before background chain (Martin Zumsande) 7a885518d57c6eb818ebef5fd04a575f324ee8b2 p2p: Restrict downloading of blocks for snapshot chain (Martin Zumsande) Pull request description: After loading a snapshot, `pindexLastCommonBlock` is usually already set to some block for existing peers. That means we'd continue syncing the background chain from those peers instead of prioritising the snapshot chain, which defeats the purpose of doing assumeutxo in the first place. Only existing peers are affected by this bug. ACKs for top commit: fjahr: re-ACK 49d569cb1fdd62a9da8dff51dccaf4680fe3d0eb achow101: ACK 49d569cb1fdd62a9da8dff51dccaf4680fe3d0eb Sjors: tACK 49d569cb1fdd62a9da8dff51dccaf4680fe3d0eb Tree-SHA512: 0eaebe1c29a8510d5ced57e14c09b128ccb34b491692815291df68bf12e2a15b52b1e7bf8d9f34808904e7f7bc20f70b0ad0f7e14df93bbdf456bd12cc02a5d2
2024-08-09Merge bitcoin/bitcoin#30598: assumeutxo: Drop block height from metadataAva Chow
00618e8745192d209c23e3ae873c077e58168957 assumeutxo: Drop block height from metadata (Fabian Jahr) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/30514 which has more context and shows how the issue can be reproduced. Since the value in question is removed, there is no test to add to reproduce anything. This is an alternative approach to #30516 with much of the [code being suggested there](https://github.com/bitcoin/bitcoin/pull/30516#discussion_r1689146902). ACKs for top commit: maflcko: re-ACK 00618e8745192d209c23e3ae873c077e58168957 🎌 achow101: ACK 00618e8745192d209c23e3ae873c077e58168957 theStack: Code-review ACK 00618e8745192d209c23e3ae873c077e58168957 ismaelsadeeq: Re-ACK 00618e8745192d209c23e3ae873c077e58168957 mzumsande: ACK 00618e8745192d209c23e3ae873c077e58168957 Tree-SHA512: db9575247bae838ad7742a27a216faaf55bb11e022f9afdd05752bb09bbf9614717d0ad64304ff5722a16bf41d8dea888af544e4ae26dcaa528c1add0269a4a8
2024-08-09wallet: List sqlite wallets with empty string nameAva Chow
Although it is not explicitly possible to create a default wallet with descriptors, it is possible to migrate a default wallet and have it end up being a default wallet with descriptors. These wallets should be listed by ListDatabases so that it appears in wallet directory listings to avoid user confusion.
2024-08-09wallet: Ignore .bak files when listing wallet filesAva Chow
Migration creates backup files in the wallet directory with .bak as the extension. This pollutes the output of listwalletdir with backup files that most users should not need to care about.
2024-08-09Merge bitcoin/bitcoin#30604: doc, chainparams: 29775 release notes and ↵Ava Chow
follow-ups 92c1d7d1f8664fe2d259cc609c87f603609b2b60 validation: Use MAX_TIMEWARP constant as testnet4 timewarp defense delta (Fabian Jahr) 4b2fad502e5c264012e94d2915476f4dfcbd192d doc: Add release notes for 29775 (Fabian Jahr) f7cc97313b91483ed4fed298919ecb16054931ee doc: Align deprecation warnings (Fabian Jahr) 1163b08378a50a9be00ced434d55f1b04bc9dea6 chainparams: Add initial minimum chain work for Testnet4 (Fabian Jahr) Pull request description: This completes follow-ups left open in #29775. - Adds release notes - Addresses the [misalignment](https://github.com/bitcoin/bitcoin/pull/29775#discussion_r1706982102) in deprecation warnings and hints at the intention to remove support for Testnet3. - Adds initial minimum chainwork for Testnet4. - Use the `MAX_TIMEWARP` constant as the timewarp defense delta, equal to `MAX_FUTURE_BLOCK_TIME`. ACKs for top commit: Sjors: ACK 92c1d7d1f8664fe2d259cc609c87f603609b2b60 achow101: ACK 92c1d7d1f8664fe2d259cc609c87f603609b2b60 tdb3: re ACK 92c1d7d1f8664fe2d259cc609c87f603609b2b60 Tree-SHA512: 7ebdac7809f96231f75ca62706af59cd1ed27f713a4c7be5e2ad69fae95832b146b3ea23c712fb03b412da1deda7e8a5dae55bb2bbd2dcfd9f926e85c2a72666
2024-08-09validation: Use MAX_TIMEWARP constant as testnet4 timewarp defense deltaFabian Jahr
The value is equal to MAX_FUTURE_BLOCK_TIME.
2024-08-09net: Clarify that m_addr_local is only set onceMarcoFalke
Includes a rename from addrLocal to m_addr_local to match the name of its corresponding Mutex.
2024-08-09[test]: remove `ExtractDestination` false assertion for `ANCHOR` scriptismaelsadeeq
2024-08-09Merge bitcoin/bitcoin#28687: C++20 std::views::reversemerge-script
2925bd537cbd8c70594e23f6c4298b7101f7f73d refactor: use c++20 std::views::reverse instead of reverse_iterator.h (stickies-v) Pull request description: C++20 introduces [`std::ranges::views::reverse`](https://en.cppreference.com/w/cpp/ranges/reverse_view), which allows us to drop our own `reverse_iterator.h` implementation and also makes it easier to chain views (even though I think we currently don't use this). ACKs for top commit: achow101: ACK 2925bd537cbd8c70594e23f6c4298b7101f7f73d maflcko: ACK 2925bd537cbd8c70594e23f6c4298b7101f7f73d 🎷 Tree-SHA512: 567666ec44af5d1beb7a271836bcc89c4c577abc77f522fcc18bc6d4de516ae9b0df766d0bfa6dd217569e6878331c2aee1d9815620860375e3510dad7fed476
2024-08-09doc: Align deprecation warningsFabian Jahr
2024-08-08assumeutxo: Drop block height from metadataFabian Jahr
The Snapshot format version is updated to 2 to indicate this change. Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
2024-08-08Reduce cache lookups in CCoinsViewCache::FetchCoinLőrinc
Enhanced efficiency and readability of CCoinsViewCache::FetchCoin by replacing separate find() and emplace() calls with a single try_emplace(), reducing map lookups and potential insertions.
2024-08-07Merge bitcoin/bitcoin#28280: Don't empty dbcache on prune flushes: >30% ↵Ava Chow
faster IBD 589db872e116779ab9cae693171ac8a8c02d9923 validation: don't erase coins cache on prune flushes (Andrew Toth) 0e8918755f725b6269ed2be5a0b46f1611233515 Add linked-list test to CCoinsViewCache::SanityCheck (Pieter Wuille) 05cf4e18758618bb493d26014d3a9c89bf28d898 coins: move Sync logic to CoinsViewCacheCursor (Andrew Toth) 7825b8b9aeceb4ff607650cdc9c49e5de9c7719f coins: pass linked list of flagged entries to BatchWrite (Andrew Toth) a14edada8a051e280af6fedd5130be40247e2d7a test: add cache entry linked list tests (Andrew Toth) 24ce37cb867b95e86d9fd4e50858d64ee8a59abf coins: track flagged cache entries in linked list (Andrew Toth) 58b7ed156d5993b69375bb455b03bd8b17f64fa4 coins: call ClearFlags in CCoinsCacheEntry destructor (Andrew Toth) 8bd3959feaa0e71585bc5e0976f584fb06ee6d14 refactor: require self and sentinel parameters for AddFlags (Andrew Toth) 75f36d241d2a344c5c4ce2c80250bdde91b3295e refactor: add CoinsCachePair alias (Andrew Toth) f08faeade2f99ae1de6f3c481697541cc16186c7 refactor: move flags to private uint8_t and rename to m_flags (Andrew Toth) 4e4fb4cbabcc10e723534f5f80f3e3cf09f6ca50 refactor: disallow setting flags in CCoinsCacheEntry constructors (Andrew Toth) 8737c0cefa6ec49a4d17d9bef9e5e1a7990af1ac refactor: encapsulate flags setting with AddFlags and ClearFlags (Andrew Toth) 9715d3bf1e4013476539f1523a6b54d2055c32c6 refactor: encapsulate flags get access for all other checks (Andrew Toth) df34a94e57659c31873c26c86a8de5a032400061 refactor: encapsulate flags access for dirty and fresh checks (Andrew Toth) Pull request description: Since https://github.com/bitcoin/bitcoin/pull/17487 we no longer need to clear the coins cache when syncing to disk. A warm coins cache significantly speeds up block connection, and only needs to be fully flushed when nearing the `dbcache` limit. For frequent pruning flushes there's no need to empty the cache and kill connect block speed. However, simply using `Sync` in place of `Flush` actually slows down a pruned full IBD with a high `dbcache` value. This is because as the cache grows, sync takes longer since every coin in the cache is scanned to check if it's dirty. For frequent prune flushes and a large cache this constant scanning starts to really slow IBD down, and just emptying the cache on every prune becomes faster. To fix this, we can add two pointers to each cache entry and construct a doubly linked list of dirty entries. We can then only iterate through all dirty entries on each `Sync`, and simply clear the pointers after. With this approach a full IBD with `dbcache=16384` and `prune=550` was 32% faster than master. For default `dbcache=450` speedup was ~9%. All benchmarks were run with `stopatheight=800000`. | | prune | dbcache | time | max RSS | speedup | |-----------:|----------:|------------:|--------:|-------------:|--------------:| | master | 550 | 16384 | 8:52:57 | 2,417,464k | - | | branch | 550 | 16384 | 6:01:00 | 16,216,736k | 32% | | branch | 550 | 450 | 8:05:08 | 2,818,072k | 8.8% | | master | 10000 | 5000 | 8:19:59 | 2,962,752k | - | | branch | 10000 | 5000| 5:56:39 | 6,179,764k | 28.8% | | master | 0 | 16384 | 4:51:53 | 14,726,408k | - | | branch | 0 | 16384 | 4:43:11 | 16,526,348k | 2.7% | | master | 0 | 450 | 7:08:07 | 3,005,892k | - | | branch | 0 | 450 | 6:57:24 | 3,013,556k |2.6%| While the 2 pointers add memory to each cache entry, it did not slow down IBD. For non-pruned IBD results were similar for this branch and master. When I performed the initial IBD, the full UTXO set could be held in memory when using the max `dbcache` value. For non-pruned IBD with max `dbcache` to tip ended up using 12% more memory, but it was also 2.7% faster somehow. For smaller `dbcache` values the `dbcache` limit is respected so does not consume more memory, and the potentially more frequent flushes were not significant enough to cause any slowdown. For reviewers, the commits in order do the following: First 4 commits encapsulate all accesses to `flags` on cache entries, and then the 5th makes `flags` private. Commits `refactor: add CoinsCachePair alias` to `coins: call ClearFlags in CCoinsCacheEntry destructor` create the linked list head nodes and cache entry self references and pass them into `AddFlags`. Commit `coins: track flagged cache entries in linked list` actually adds the entries into a linked list when they are flagged DIRTY or FRESH and removes them from the linked list when they are destroyed or the flags are cleared manually. However, the linked list is not yet used anywhere. Commit `test: add cache entry linked list tests` adds unit tests for the linked list. Commit `coins: pass linked list of flagged entries to BatchWrite` uses the linked list to iterate through DIRTY entries instead of using the entire coins cache. Commit `validation: don't erase coins cache on prune flushes` uses `Sync` instead of `Flush` for pruning flushes, so the cache is no longer cleared. Inspired by [this comment](https://github.com/bitcoin/bitcoin/pull/15265#issuecomment-457720636). Fixes https://github.com/bitcoin/bitcoin/issues/11315. ACKs for top commit: paplorinc: ACK 589db872e116779ab9cae693171ac8a8c02d9923 sipa: reACK 589db872e116779ab9cae693171ac8a8c02d9923 achow101: ACK 589db872e116779ab9cae693171ac8a8c02d9923 mzumsande: re-ACK 589db872e116779ab9cae693171ac8a8c02d9923 Tree-SHA512: 23b2bc01c83edacb5b39aa60bb0b766de9a74ce17f0c59bf13b97b4328a7b758ad9aff6581c3ca88e2973f7658380651530d497444f48d6e22ea0bfc51cc921d
2024-08-07chainparams: Add initial minimum chain work for Testnet4Fabian Jahr
This chainwork was observed at height 38487.
2024-08-07Merge bitcoin/bitcoin#30194: refactor: use recommended type hiding on ↵glozow
multi_index types a3cb309e7c31853f272bffaa65fb6ab0a7cc4083 refactor: use recommended type hiding on multi_index types (Cory Fields) Pull request description: Recommended by boost docs: https://www.boost.org/doc/libs/1_85_0/libs/multi_index/doc/compiler_specifics.html#type_hiding This significantly reduces the size of the symbol name lengths that end up in the binaries as well as in compiler warnings/errors. Otherwise there should be no functional change. Example before: > 0000000000000000 W unsigned long boost::multi_index::detail::hashed_index<mempoolentry_txid, SaltedTxidHasher, std::equal_to<uint256>, boost::multi_index::detail::nth_layer<1, CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher, mpl_::na, mpl_::na>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mempoolentry_wtxid, SaltedTxidHasher, mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<CTxMemPoolEntry> >, boost::mpl::vector0<mpl_::na>, boost::multi_index::detail::hashed_unique_tag>::count<uint256, SaltedTxidHasher, std::equal_to<uint256> >(uint256 const&, SaltedTxidHasher const&, std::equal_to<uint256> const&, mpl_::bool_<false>) const After: > 0000000000000000 W unsigned long boost::multi_index::detail::hashed_index<mempoolentry_txid, SaltedTxidHasher, std::equal_to<uint256>, boost::multi_index::detail::nth_layer<1, CTxMemPoolEntry, CTxMemPool::CTxMemPoolEntry_Indicies, std::allocator<CTxMemPoolEntry> >, boost::mpl::vector0<mpl_::na>, boost::multi_index::detail::hashed_unique_tag>::count<uint256, SaltedTxidHasher, std::equal_to<uint256> >(uint256 const&, SaltedTxidHasher const&, std::equal_to<uint256> const&, mpl_::bool_<false>) const ACKs for top commit: glozow: ACK a3cb309e7c31853f272bffaa65fb6ab0a7cc4083, TIL, makes sense to me TheCharlatan: ACK a3cb309e7c31853f272bffaa65fb6ab0a7cc4083 fanquake: ACK a3cb309e7c31853f272bffaa65fb6ab0a7cc4083 Tree-SHA512: f6bb3d133daec126cf064ed6fe4457f457c0cfdbea28778c8ff426be7b41b271ada2d790c6b4129ca22156182c99aaf287e3aa9fb6b076ee55946da40e06e5d8
2024-08-07Merge bitcoin/bitcoin#29775: Testnet4 including PoW difficulty adjustment fixAva Chow
6bfa26048dbafb91e9ca63ea8d3960271e798098 testnet: Add timewarp attack prevention for Testnet4 (Fabian Jahr) 0100907ca168c53e8fe044bdda396f308825162c testnet: Add Testnet4 difficulty adjustment rules fix (Fabian Jahr) 74a04f9e7ad6a16988149cc3438b9ce13c91cdb9 testnet: Introduce Testnet4 (Fabian Jahr) Pull request description: To supplement the [ongoing conceptual discussion about a testnet reset](https://groups.google.com/g/bitcoindev/c/9bL00vRj7OU/m/9yCPo3uUBwAJ) I have drafted a move to v4 including a fix to the difficulty adjustment mechanism, which was part of the motivation that started the discussion. Conceptual considerations: - The conceptual discussion about doing a testnet4 or softforking the fix into testnet3 is outside of the scope of this PR and I would ask reviewers to contribute their opinions on this on the ML instead. However, I am happy to adapt this PR to a softfork change on testnet3 if there is consensus for that instead. - The difficulty adjustment fix suggested here touches the `CalculateNextWorkRequired` function and uses the same logic used in `GetNextWorkRequired` to find the last previous block that was not mined with difficulty 1 under the exceptionf. An alternative fix briefly mentioned on the mailing list by Jameson Lopp would be to "restrict the special testnet minimum difficulty rule so that it can't be triggered on the block right before a difficulty retarget". That would also fix the issue but I find my suggestion here a bit more elegant. ACKs for top commit: jsarenik: tACK 6bfa26048dba achow101: ACK 6bfa26048dbafb91e9ca63ea8d3960271e798098 murchandamus: tACK 6bfa26048dbafb91e9ca63ea8d3960271e798098 Tree-SHA512: 0b8b69a621406a944da5be551b863d065358ba94d85dd3b80d83c412660e230ee93b27316081fbee9b4851cc4ff8585db64c7dfa26cb5148ac835663f2712c3d
2024-08-07Merge bitcoin/bitcoin#30594: docs: doc update for mempoolfullrbf default + ↵glozow
log deprecation 1f93e3c360f3da38a02fe6c01551f424a2d63dc9 add deprecation warning for mempoolfullrbf (glozow) 4400c979a309ed03c7ed55644122622eb7def089 [doc] update documentation for new mempoolfullrbf default (glozow) Pull request description: Followup to #30493. Update bips.md and policy/*.md to reflect new default rules around signaling requirements in RBF. Also, log a warning when `-mempoolfullrbf=0` that this config option is deprecated and will be removed in a future release. ACKs for top commit: petertodd: ACK 1f93e3c360f3da38a02fe6c01551f424a2d63dc9 instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/30594/commits/1f93e3c360f3da38a02fe6c01551f424a2d63dc9 tdb3: ACK 1f93e3c360f3da38a02fe6c01551f424a2d63dc9 Tree-SHA512: f60a9524f15cfaa4c10c40b6f62b787d3f9865aac48ca883def30efac4f8a118f1359532f1b209ea34e201f0b1c92398abc8bc1e439e6b60910cc7f75c51e9ae
2024-08-07add deprecation warning for mempoolfullrbfglozow
2024-08-07Merge bitcoin/bitcoin#30525: doc, rpc : `#30275` followupsAva Chow
fa2f26960ee084971ab09959b213a9b8104482e5 [rpc, fees]: add more detail on the fee estimation modes (ismaelsadeeq) 6e7e620864cc7a2f3c3b576588afe4d44dc394ec [doc]: add `30275` release notes (ismaelsadeeq) Pull request description: This PR: 1. Adds release notes for #30275 2. Describe fee estimation modes in RPC help texts ACKs for top commit: achow101: ACK fa2f26960ee084971ab09959b213a9b8104482e5 glozow: ACK fa2f26960ee084971ab09959b213a9b8104482e5 willcl-ark: ACK fa2f26960ee tdb3: re ACK fa2f26960ee084971ab09959b213a9b8104482e5 Tree-SHA512: b8ea000b599297b954dc770137c29b47153e68644c58550a73e34b74ecb8b65e78417875481efdfdf6aab0018a9cd1d90d8baa5a015e70aca0975f6e1dc9598c
2024-08-06Merge bitcoin/bitcoin#30051: crypto, refactor: add new KeyPair classRyan Ofsky
ec973dd19719541dbcd6f3a6facf6f5dd7cf439c refactor: remove un-tested early returns (josibake) 72a5822d43d47431b2838ebfcb1f2e21210f5ccb tests: add tests for KeyPair (josibake) cebb08b121ce8c4c5e68bd043b8668c106e31169 refactor: move SignSchnorr to KeyPair (josibake) c39fd39ba868253b5118db2e1ac1461d29f0b4ce crypto: add KeyPair wrapper class (josibake) 5d507a0091da1b6c013b00b6c76e19dd4d3b93a7 tests: add key tweak smoke test (josibake) f14900b6e4eac26ae5f1c0badfa176d895851c97 bench: add benchmark for signing with a taptweak (josibake) Pull request description: Broken out from #28201 --- The wallet returns an untweaked internal key for taproot outputs. If the output commits to a tree of scripts, this key needs to be tweaked with the merkle root. Even if the output does not commit to a tree of scripts, BIP341/342 recommend commiting to a hash of the public key. Previously, this logic for applying the taptweak was implemented in the `CKey::SignSchnorr` method. This PR moves introduces a KeyPair class which wraps a `secp256k1_keypair` type and refactors SignSchnorr to use this new KeyPair. The KeyPair class is created with an optional merkle_root argument and the logic from BIP341 is applied depending on the state of the merkle_root argument. The motivation for this refactor is to be able to use the tap tweak logic outside of signing, e.g. in silent payments when retrieving the private key (see #28201). Outside of silent payments, since we almost always convert a `CKey` to a `secp256k1_keypair` when doing anything with taproot keys, it seems generally useful to have a way to model this type in our code base. ACKs for top commit: paplorinc: ACK ec973dd19719541dbcd6f3a6facf6f5dd7cf439c - will happily reack if you decide to apply @ismaelsadeeq's suggestions ismaelsadeeq: Code review ACK ec973dd19719541dbcd6f3a6facf6f5dd7cf439c itornaza: trACK ec973dd19719541dbcd6f3a6facf6f5dd7cf439c theStack: Code-review ACK ec973dd19719541dbcd6f3a6facf6f5dd7cf439c Tree-SHA512: 34947e3eac39bd959807fa21b6045191fc80113bd650f6f08606e4bcd89aa17d6afd48dd034f6741ac4ff304b104fa8c1c1898e297467edcf262d5f97425da7b
2024-08-06Merge bitcoin/bitcoin#30577: miniscript: Use `ToIntegral` instead of ↵Ava Chow
`ParseInt64` 6714276d72244c2e2dbe9617f1341ba7fc06c0cc miniscript: Use `ToIntegral` instead of `ParseInt64` (brunoerg) Pull request description: Currently, miniscript code uses `ParseInt64` function for `after`, `older`, `multi` and `thresh` fragments. It means that a leading `+` or whitespace, among other things, are accepted into the fragments. However, these cases are not useful and cause Bitcoin Core to behave differently compared to other miniscript implementations (see https://github.com/brunoerg/bitcoinfuzz/issues/34). This PR fixes it. ACKs for top commit: achow101: ACK 6714276d72244c2e2dbe9617f1341ba7fc06c0cc tdb3: cr ACK 6714276d72244c2e2dbe9617f1341ba7fc06c0cc danielabrozzoni: tACK 6714276d72244c2e2dbe9617f1341ba7fc06c0cc darosior: utACK 6714276d72244c2e2dbe9617f1341ba7fc06c0cc Tree-SHA512: d9eeb93f380f346d636513eeaf26865285e7b0907b8ed258fe1e02153a9eb69d484c82180eb1c78b0ed77ad5f0e5b244be6672c2f890b1d9fddc9e844bee6dde
2024-08-06p2p: For assumeutxo, download snapshot chain before background chainMartin Zumsande
After loading a snapshot, pindexLastCommonBlock is usually already set to some block for existing peers. That means we'd continue syncing the background chain from those peers instead of prioritising the snapshot chain, which defeats the purpose of doing assumeutxo in the first place. Only existing peers are affected by this bug.
2024-08-06p2p: Restrict downloading of blocks for snapshot chainMartin Zumsande
If the best chain of the peer doesn't include the snapshot block, it is futile to download blocks from this chain, because we couldn't reorg to it. We'd also crash trying to reorg because this scenario is not handled.
2024-08-06Merge bitcoin/bitcoin#30485: log: Remove NOLINT(bitcoin-unterminated-logprintf)Ryan Ofsky
fa18fc705084f3620be566d8c6639b29117ccf68 log: Remove NOLINT(bitcoin-unterminated-logprintf) (MarcoFalke) Pull request description: `NOLINT(bitcoin-unterminated-logprintf)` is used to document a missing trailing `\n` char in the format string. This has many issues: * It is just documentation, assuming that a trailing `\n` ends up in the formatted string. It is not enforced at compile-time, so it is brittle. * If the newline was truly missing and `NOLINT(bitcoin-unterminated-logprintf)` were used to document a "continued" line, the log stream would be racy/corrupt, because any other thread may inject a log message in the meantime. * If the newline was accidentally missing, nothing is there to correct the mistake. * The intention of all code is to always end a log line with a new line. However, historic code exists to deal with the case where the new line was missing (`m_started_new_line`). This is problematic, because the presumed dead code has to be maintained (https://github.com/bitcoin/bitcoin/pull/30386#discussion_r1682963306). Fix almost all issues by removing the `NOLINT(bitcoin-unterminated-logprintf)`, ensuring that a new line is always present. A follow-up will remove the dead logging code. ACKs for top commit: TheCharlatan: ACK fa18fc705084f3620be566d8c6639b29117ccf68 ryanofsky: Code review ACK fa18fc705084f3620be566d8c6639b29117ccf68 Tree-SHA512: bf8a83723cca84e21187658edc19612da79c34f7ef2e1f6e9353e7ba70e4ecc0a878a2ae32290045fb90cba9a44451e35341a36ef2ec1169d13592393aa4a8ca
2024-08-06Merge bitcoin/bitcoin#30212: rename TransactionError:ALREADY_IN_CHAINRyan Ofsky
e9de0a76b99fd4708295e1178f6c079db92e7f36 doc: release note for 30212 (willcl-ark) 87b188052528e97729a85d9701864eaff1ea5ec6 rpc: clarify ALREADY_IN_CHAIN rpc errors (willcl-ark) Pull request description: Closes: #19363 Renaming this error improves clarity around the returned error both internally and externally when a transactions' outputs are already found in the utxo set (`TransactionError::ALREADY_IN_CHAIN -> TransactionError::ALREADY_IN_UTXO_SET`) ACKs for top commit: tdb3: ACK e9de0a76b99fd4708295e1178f6c079db92e7f36 ismaelsadeeq: ACK e9de0a76b99fd4708295e1178f6c079db92e7f36 ryanofsky: Code review ACK e9de0a76b99fd4708295e1178f6c079db92e7f36. Tree-SHA512: 7d2617200909790340951fe56a241448f9ce511900777cb2a712e8b9c0778a27d1f912b460f82335844224f1abb4322bc898ca076440959edade55c082a09237
2024-08-06Merge bitcoin/bitcoin#30596: fuzz: replace hardcoded numbers for bech32 limitsglozow
59c0ece0a785ce9e22fbfefce9ca228d85e5d43d fuzz: replace hardcoded numbers for bech32 limits (josibake) Pull request description: Follow-up to #30047 to replace a hardcoded value that was missed in the original PR ACKs for top commit: paplorinc: ACK 59c0ece0a785ce9e22fbfefce9ca228d85e5d43d dergoegge: utACK 59c0ece0a785ce9e22fbfefce9ca228d85e5d43d marcofleon: ACK 59c0ece0a785ce9e22fbfefce9ca228d85e5d43d. Ran the test a bit to be sure, lgtm. brunoerg: utACK 59c0ece0a785ce9e22fbfefce9ca228d85e5d43d Tree-SHA512: 89799928feb6752a533259117340b087ff7299f9bf204b165dd87708e15b99a338521f2ac9f9e1fd91dc48b93be839059768d9e68b172e36328232174d1dfa3f