aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-25refactor: use unlink rather than os.removetdb3
2024-08-24Merge bitcoin/bitcoin#30651: fuzz: remove repeated word in notemerge-script
3f05a1068d10ffe0f2859cd20c5fc9bc8efa1c70 remove repeated word in note (sunerok) Pull request description: Fix typo. ACKs for top commit: maflcko: ACK 3f05a1068d10ffe0f2859cd20c5fc9bc8efa1c70 danielabrozzoni: ACK 3f05a1068d10ffe0f2859cd20c5fc9bc8efa1c70 Tree-SHA512: 709d96ed18608c0ea788b4f0696abad79ab1b81c4f266487d16bbe4cfca5b99b8f7f9a58f830866db9695aa3aebcc6442098b1533d85507729af99709a53d26a
2024-08-24Merge bitcoin/bitcoin#30687: test: replace deprecated secp256k1 context ↵merge-script
flags usage 60055f1abc4b4ad5f66a2fcf2e61c65efc777036 test: replace deprecated secp256k1 context flags usage (Sebastian Falbesoner) Pull request description: The flags `SECP256K1_CONTEXT_{SIGN,VERIFY}` have been marked as deprecated since libsecp256k1 version 0.2 (released in December 2022), with the recommendation to use SECP256K1_CONTEXT_NONE instead, see https://github.com/bitcoin-core/secp256k1/pull/1126 and https://github.com/bitcoin-core/secp256k1/blob/1988855079fa8161521b86515e77965120fdc734/CHANGELOG.md?plain=1#L132. Note that in contrast to other deprecated functions/variables, these defines don't have a deprecated attribute and hence don't lead to a compiler warning (see https://github.com/bitcoin-core/secp256k1/pull/1126#discussion_r922105271), so they are not easily detected. ACKs for top commit: TheCharlatan: ACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036 ismaelsadeeq: utACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036 tdb3: light CR and test ACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036 Tree-SHA512: d93cf49e018a58469620c0d2f50242141f22dabc70afb2a7cd64e416f4f55588714510ae5a877376dd1e6b6f7494261969489af4b18a1c9dff0d0dfdf93f1fa8
2024-08-24Merge bitcoin/bitcoin#30703: test: Avoid duplicate curl call in ↵merge-script
get_previous_releases.py fa5aeab3cb18405ecf8a1401d89539b924a618f6 test: Avoid duplicate curl call in get_previous_releases.py (MarcoFalke) Pull request description: Seems odd having to translate `404` to "Binary tag was not found". Also, it seems odd to write a for-loop over a list with one item. Fix both issues by just using a single call to `curl --fail ...`. Can be tested with: `test/get_previous_releases.py -b v99.99.99` Before: ``` Releases directory: releases Fetching: https://bitcoincore.org/bin/bitcoin-core-99.99.99/bitcoin-99.99.99-x86_64-linux-gnu.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 286k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 Binary tag was not found ``` After: ``` Releases directory: releases Fetching: https://bitcoincore.org/bin/bitcoin-core-99.99.99/bitcoin-99.99.99-x86_64-linux-gnu.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 286k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 curl: (22) The requested URL returned error: 404 ACKs for top commit: fanquake: ACK fa5aeab3cb18405ecf8a1401d89539b924a618f6 brunoerg: utACK fa5aeab3cb18405ecf8a1401d89539b924a618f6 tdb3: tested ACK fa5aeab3cb18405ecf8a1401d89539b924a618f6 Tree-SHA512: d5d31e0bccdd9de9b4a8ecf2e69348f4e8cee773050c8259b61db1ce5de73f6fbfffbe8c4d2571f7bef2de29cb42fd244573deebfbec614e487e76ef41681b9c
2024-08-23test: add blocks_key_pathtdb3
Adds a convenience function to TestNode to provide the path to the blocks xor key. Updates util and feature_blocksxor to use it.
2024-08-23test: Avoid intermittent block download timeout in p2p_ibd_stallingMarcoFalke
2024-08-23Merge bitcoin/bitcoin#30665: test: Enable detect_leaks=1 in ASAN_OPTIONS ↵merge-script
explicitly cccc5bfd35a008adf08d99ed463fe00d6a6f29c0 test: Enable detect_leaks=1 in ASAN_OPTIONS explicitly (MarcoFalke) Pull request description: It should be enabled by default, but being explicit can't hurt. ACKs for top commit: fanquake: ACK cccc5bfd35a008adf08d99ed463fe00d6a6f29c0 Tree-SHA512: ed284abd05c7a99c30b509844aa75785a5ccb506d8296a71347b4c328750a6a4ed1f87e7a3ec36ab17f27b467c033cc8ca5eb5e2b951f2ae7473327c5eb1ddae
2024-08-23test: Avoid duplicate curl call in get_previous_releases.pyMarcoFalke
2024-08-22test: Add time-timewarp-attack boundary casesGreg Sanders
2024-08-22Merge bitcoin/bitcoin#30658: kernel: pre-28.x chainparams and headerssync updateglozow
221809b81cfcecb04050915eebacffda2599da42 headerssync: Update headerssync configuration (Ava Chow) c2707446f745015d279af663e181219757ad6eb7 params: Update assumevalid and minimum chainwork (Ava Chow) 255d4514d3cd9f545f1d3eca5bbda8d8c90ee351 params: Update chainTxData (Ava Chow) 6a5bdae3225117651708aa430e04b6da58387cf2 params: Update assumed blockchain and chainstate sizes (Ava Chow) Pull request description: Update chainparams and headerssync parameters for the pre-28.x branching, per https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-branch-off ACKs for top commit: fjahr: re-ACK 221809b81cfcecb04050915eebacffda2599da42 Sjors: re-ACK 221809b81cfcecb04050915eebacffda2599da42 glozow: ACK 221809b81cfcecb04050915eebacffda2599da42 marcofleon: ACK 221809b81cfcecb04050915eebacffda2599da42 Tree-SHA512: 5106d59f46dbe167fffa339519e52975ae5bfd7e52202d76ec058da0d4e8bf87355e90678f7ace7c8c402a2f7264050a0355680b9f727c7962ff60e8fcdb3a90
2024-08-22Merge bitcoin/bitcoin#30681: Have miner account for timewarp mitigation, ↵Ava Chow
activate on regtest, lower nPowTargetTimespan to 144 and add test 59ff17e5af4e382cbe16f183767beef1bdcd9131 miner: adjust clock to timewarp rule (Sjors Provoost) e929054e12210353812f440c685a23329e7040f7 Add timewarp attack mitigation test (Sjors Provoost) e85f386c4b157b7d1ac16aface9bd2c614e62b46 consensus: enable BIP94 on regtest (Sjors Provoost) dd154b05689c60fad45df0df6d31cec12e09ab21 consensus: lower regtest nPowTargetTimespan to 144 (Sjors Provoost) Pull request description: Because #30647 reduced the timewarp attack threshold from 7200s to 600s, our miner code will fail to propose a block template (on testnet4) if the last block of the previous period has a timestamp two hours in the future. This PR fixes that and also adds a test. The non-test changes in the last commit should be in v28, otherwise miners have to patch it themselves. If necessary I can split that out into a separate PR, but I prefer to get the tests in as well. In order to add the test, we activate BIP94 on regtest. In order for the test to run faster, we reduce its difficulty retarget period to 144, the same number that's already used for softfork activation logic. Regtest does not actually adjust its difficulty, so this change has no effect (except for `getnetworkhashps`, see commit). An alternative approach would be to run this test on testnet4, by hardcoding its first 2015 in the test suite. But since the timewarp mitigation is a serious candidate for a future mainnet softfork, it seems better to just deploy it on regtest. The next commits add a test and fix the miner code. The `MAX_TIMEWARP` constant is moved to `consensus.h` so both validation and miner code have access to it. ACKs for top commit: achow101: ACK 59ff17e5af4e382cbe16f183767beef1bdcd9131 fjahr: ACK 59ff17e5af4e382cbe16f183767beef1bdcd9131 glozow: ACK 59ff17e5af4e382cbe16f183767beef1bdcd9131 Tree-SHA512: 50af9fdcba9b0d5c57e1efd5feffd870bd11b5318f1f8b0aabf684657f2d33ab108d5f00b1475fe0d38e8e0badc97249ef8dda20c7f47fcc1698bc1008798830
2024-08-22Merge bitcoin/bitcoin#30691: Fix maybe-uninitialized warning in IsSpentKeyglozow
17707db939cb09a16c002d226152e71fce9289f2 Fix maybe-uninitialized warning in IsSpentKey (Ava Chow) Pull request description: After 6ed424f2db609f9f39ec1d1da2077c7616f3a0c2, I started seeing a maybe-unitialized warning in `CWallet::IsSpentKey`: ``` In destructor ‘constexpr std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’, inlined from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_vector.h:738:7, inlined from ‘constexpr WitnessUnknown::~WitnessUnknown()’ at ./addresstype.h:95:8, inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_construct.h:88:18, inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_construct.h:149:22, inlined from ‘std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)> mutable [with auto:20 = WitnessUnknown&]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:498:19, inlined from ‘constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&& ...) [with _Res = void; _Fn = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/invoke.h:61:36, inlined from ‘constexpr std::enable_if_t<is_invocable_r_v<_Res, _Callable, _Args ...>, _Res> std::__invoke_r(_Callable&&, _Args&& ...) [with _Res = void; _Callable = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/invoke.h:111:28, inlined from ‘static constexpr decltype(auto) std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<_Result_type (*)(_Visitor, _Variants ...)>, std::integer_sequence<long unsigned int, __indices ...> >::__visit_invoke(_Visitor&&, _Variants ...) [with _Result_type = void; _Visitor = std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>&&; _Variants = {std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>&}; long unsigned int ...__indices = {8}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1064:40, inlined from ‘constexpr decltype(auto) std::__do_visit(_Visitor&&, _Variants&& ...) [with _Result_type = void; _Visitor = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Variants = {variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1823:5, inlined from ‘constexpr void std::__detail::__variant::_Variant_storage<false, _Types ...>::_M_reset() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:496:23, inlined from ‘constexpr std::__detail::__variant::_Variant_storage<false, _Types ...>::~_Variant_storage() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:506:17, inlined from ‘constexpr std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Copy_ctor_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:581:12, inlined from ‘constexpr std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Move_ctor_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:618:12, inlined from ‘constexpr std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Copy_assign_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:656:12, inlined from ‘constexpr std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Move_assign_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:708:12, inlined from ‘constexpr std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Variant_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:762:12, inlined from ‘constexpr std::variant<_Types>::~variant() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1432:28, inlined from ‘bool wallet::CWallet::IsSpentKey(const CScript&) const’ at wallet/wallet.cpp:1055:37: /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_vector.h:370:31: error: ‘*(std::_Vector_base<unsigned char, std::allocator<unsigned char> >*)((char*)&<unnamed> + offsetof(const std::CTxDestination, std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_u) + 8).std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_impl.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl_data::_M_end_of_storage’ may be used uninitialized [-Werror=maybe-uninitialized] 370 | _M_impl._M_end_of_storage - _M_impl._M_start); | ~~~~~~~~^~~~~~~~~~~~~~~~~ wallet/wallet.cpp: In member function ‘bool wallet::CWallet::IsSpentKey(const CScript&) const’: wallet/wallet.cpp:1055:37: note: ‘<anonymous>’ declared here 1055 | if (IsAddressPreviouslySpent(pkh_dest)) { | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ ``` Refactoring the function so that the `WitnessV0KeyHash`, `ScriptHash`, and `PKHash` are constructed within an `if` statement seems to make it go away without changing behavior. ACKs for top commit: maflcko: lgtm ACK 17707db939cb09a16c002d226152e71fce9289f2 l0rinc: utACK 17707db939cb09a16c002d226152e71fce9289f2 hebasto: ACK 17707db939cb09a16c002d226152e71fce9289f2, tested on Ubuntu 24.04. The warning has been silenced for both GCC 13.2.0 and 14.0.1. tdb3: ACK 17707db939cb09a16c002d226152e71fce9289f2 BrandonOdiwuor: Code Review ACK 17707db939cb09a16c002d226152e71fce9289f2 Tree-SHA512: df10a494adfaecb29060f3936d2910aa4291e8caa2a64cbd48e57ed67208f16a02441a14a599a092e0e8de3b338866f666f042b9c6109d0003c0d3e7af4daf48
2024-08-21Fix maybe-uninitialized warning in IsSpentKeyAva Chow
2024-08-21Merge bitcoin/bitcoin#30636: test: assumeutxo: check that UTXO-querying RPCs ↵Ava Chow
operate on snapshot chainstate 917e70a6206c62c4c492fa922425fc8e00d3f328 test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate (Sebastian Falbesoner) Pull request description: Inspired by some manual testing I did for #28553, this PR checks that RPCs which explicitly query the UTXO set database (i.e. `gettxoutsetinfo`, `scantxoutset` and `gettxout`) operate on the snapshot chainstate as expected. ACKs for top commit: fjahr: utACK 917e70a6206c62c4c492fa922425fc8e00d3f328 achow101: ACK 917e70a6206c62c4c492fa922425fc8e00d3f328 tdb3: ACK 917e70a6206c62c4c492fa922425fc8e00d3f328 Tree-SHA512: 40ecd1c5dd879234df1667fa5444a1fbbee9b7c456f597dc982d1a2bce46fe9107711b005ab829e570ef919a4914792f72f342d71d92bad2ae9434b5e68d5bd3
2024-08-21devtools, utxo-snapshot: Fix block height out of rangepablomartin4btc
Handle the Block height out of range error gracefully by checking if the node has synchronized to or beyond the required block height, otherwise without this validation the node would keep the network disabled if the user selected that option. Provide a user-friendly message if the block height is out of range and exit the script cleanly.
2024-08-20Merge bitcoin/bitcoin#30644: fuzz: Faster utxo_snapshot fuzz targetAva Chow
fa899fb7aa8a14acecadd8936ad5824fa0f697ff fuzz: Speed up utxo_snapshot fuzz target (MarcoFalke) fa386642b4dfd88f74488c288c7886494d69f4ed fuzz: Speed up utxo_snapshot by lazy re-init (MarcoFalke) fa645c7a861ffa83a53a459263b6a620defe31f9 fuzz: Remove unused DataStream object (MarcoFalke) fae8c73d9e4eba4603447bb52b6e3e760fbf15f8 test: Disallow fee_estimator construction in ChainTestingSetup (MarcoFalke) Pull request description: Two commits to speed up unit and fuzz tests. Can be tested by running the fuzz target and looking at the time it took, or by looking at the flamegraph. For example: ``` FUZZ=utxo_snapshot perf record -g --call-graph dwarf ./src/test/fuzz/fuzz -runs=100 hotspot ./perf.data ACKs for top commit: TheCharlatan: Re-ACK fa899fb7aa8a14acecadd8936ad5824fa0f697ff marcofleon: Re ACK fa899fb7aa8a14acecadd8936ad5824fa0f697ff brunoerg: ACK fa899fb7aa8a14acecadd8936ad5824fa0f697ff Tree-SHA512: d3a771bb12d7ef491eee61ca47325dd1cea5c20b6ad42554babf13ec98d03bef8e7786159d077e59cc7ab8112495037b0f6e55edae65b871c7cf1708687cf717
2024-08-21test: replace deprecated secp256k1 context flags usageSebastian Falbesoner
The flags SECP256K1_CONTEXT_{SIGN,VERIFY} have been deprecated since libsecp256k1 version 0.2 (released in December 2022), with the recommendation to use SECP256K1_CONTEXT_NONE instead.
2024-08-20miner: adjust clock to timewarp ruleSjors Provoost
2024-08-20Add timewarp attack mitigation testSjors Provoost
2024-08-20consensus: enable BIP94 on regtestSjors Provoost
2024-08-20test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstateSebastian Falbesoner
2024-08-20consensus: lower regtest nPowTargetTimespan to 144Sjors Provoost
This currently has no effect due to fPowNoRetargeting, except for the getnetworkhashps when called with -1. It will when the next commit enforces the timewarp attack mitigation on regtest.
2024-08-20fuzz: Speed up utxo_snapshot fuzz targetMarcoFalke
This speeds up the fuzz target, which allows "valid" inputs. It does not affect the "INVALID" fuzz target.
2024-08-19Merge bitcoin/bitcoin#30647: Move maximum timewarp attack threshold back to ↵Ava Chow
600s from 7200s 16e95bda86302af20cfb314a2c0252256d01f750 Move maximum timewarp attack threshold back to 600s from 7200s (Matt Corallo) Pull request description: In 6bfa26048dbafb91e9ca63ea8d3960271e798098 the testnet4 timewarp attack fix block time variation was increased from the Great Consensus Cleanup value of 600s to 7200s on the thesis that this allows miners to always create blocks with the current time. Sadly, doing so does allow for some nonzero inflation, even if not a huge amount. While it could be that some hardware ignores the timestamp provided to it over Stratum and forces the block header timestamp to the current time, I'm not aware of any such hardware, and it would also likely suffer from random invalid blocks due to relying on NTP anyway, making its existence highly unlikely. This leaves the only concern being pools, but most of those rely on work generated by Bitcoin Core (in one way or another, though when spy mining possibly not), and it seems likely that they will also not suffer any lost work. While its possible that a pool does generate invalid work due to spy mining or otherwise custom logic, it seems unlikely that a substantial portion of hashrate would do so, making the difference somewhat academic (any pool that screws this up will only do so once and the network would come out just fine). Further, while we may end up deciding these assumptions were invalid and we should instead use 7200s, it seems prudent to try with the value we "want" on testnet4, giving us the ability to learn if the compatibility concerns are an issue before we go to mainnet. ACKs for top commit: fjahr: tACK 16e95bda86302af20cfb314a2c0252256d01f750 achow101: ACK 16e95bda86302af20cfb314a2c0252256d01f750 murchandamus: crACK 16e95bda86302af20cfb314a2c0252256d01f750 Tree-SHA512: ae46d03b728b6e23cb6ace64c9813bc01c01e38dd7f159cf0fab53b331ef84b3b811edab225453ccdfedb53b242f55b0efd69829782657490fe393d24dacbeb2
2024-08-16seeds: Use fjahr's more up to date asmapAva Chow
2024-08-16Merge bitcoin/bitcoin#30621: wallet: fix blank legacy detectionglozow
6ed424f2db609f9f39ec1d1da2077c7616f3a0c2 wallet: fix, detect blank legacy wallets in IsLegacy (furszy) Pull request description: 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. To test this: 1) Create a blank legacy wallet. 2) Try to migrate it using the GUI's toolbar "Migrate Wallet" button. -> In master: The button will be disabled because `CWallet::IsLegacy()` returns false for blank legacy wallet. -> In this PR: the button will be enabled, allowing the migration of legacy wallets. ACKs for top commit: achow101: ACK 6ed424f2db609f9f39ec1d1da2077c7616f3a0c2 tdb3: ACK 6ed424f2db609f9f39ec1d1da2077c7616f3a0c2 glozow: ACK 6ed424f2db609f9f39ec1d1da2077c7616f3a0c2 Tree-SHA512: c06c4c4c2e546ccb033287b9aa3aee4ca36b47aeb2fac6fbed5de774b65caef9c818fc8dfdaac6ce78839b2d5d642a5632a5b44c5e889ea169ced80ed50501a7
2024-08-16seeds: Fixed seeds updateAva Chow
Update the fixed seeds for both mainnet and testnet
2024-08-16seeds: Add testnet4 fixed seeds fileAva Chow
2024-08-16seeds: Remove manual onion and i2p seedsAva Chow
The seeders now produce onion and i2p seeds, so there is no need to keep these in the manual list. Although should also be produced, there are not enough good ones detected by the seeder, so we keep the manual seeds for them.
2024-08-16seeds: Add testnet instructionsAva Chow
2024-08-16seeds: Also pull from achow101 seederAva Chow
2024-08-16makeseeds: Configurable minimum blocks for testnet4's smaller chainAva Chow
2024-08-16Merge bitcoin/bitcoin#30657: test: add functional test for XORed block/undo ↵glozow
files (`-blocksxor` option) faa1b9b0e6de7d213699fbdbc2e25a2a81c35cdc test: add functional test for XORed block/undo files (`-blocksxor`) (Sebastian Falbesoner) 6b3676be3e5b6e407876031791172f441b359295 test: refactor: move `read_xor_key`/`util_xor` helpers to util module (Sebastian Falbesoner) Pull request description: This PR adds a dedicated functional test for XORed block data/undo file support (bitcoind option `-blocksxor`, see PR #28052). In order to verify that the XOR pattern has been applied, the {blk,rev}*.dat files are rewritten un-XORed manually by the test while the node is shut down; the node is then started again with `-blocksxor=0`, and both the data and undo files are verified via the `verifychain` RPC (with checklevel=2). Note that starting bitcoind with `-blocksxor=0` fails if a xor key is present already, which is also tested explicitly. Fixes #30599. ACKs for top commit: glozow: ACK faa1b9b0e6d maflcko: ACK faa1b9b0e6de7d213699fbdbc2e25a2a81c35cdc ismaelsadeeq: Tested ACK faa1b9b0e6de7d213699fbdbc2e25a2a81c35cdc Tree-SHA512: e1df106f6b4e3ba67eca108e36d762f1b991673b881934b84cd36946496a09ce9c329c1363c36aa29409137ae4881e2d177e651359686511632ddf2870f7ca8e
2024-08-16headerssync: Update headerssync configurationAva Chow
2024-08-16params: Update assumevalid and minimum chainworkAva Chow
2024-08-16params: Update chainTxDataAva Chow
2024-08-16params: Update assumed blockchain and chainstate sizesAva Chow
2024-08-16test: Enable detect_leaks=1 in ASAN_OPTIONS explicitlyMarcoFalke
2024-08-16fuzz: Speed up utxo_snapshot by lazy re-initMarcoFalke
The re-init is expensive, so skip it if there is no need. Also, add an even faster fuzz target utxo_snapshot_invalid, which does not need any re-init at all.
2024-08-15Merge bitcoin/bitcoin#30659: wallet: fix UnloadWallet thread safety assumptionsAva Chow
f550a8e035b4603787273ea250f403f6f0be453f Rename ReleaseWallet to FlushAndDeleteWallet (furszy) 64e736d79efc7201768244fc297084f70c0bebc1 wallet: WaitForDeleteWallet, do not expect thread safety (Ryan Ofsky) 8872b4a6ca91a83bf8d5a118fb808c043b9e879d wallet: rename UnloadWallet to WaitForDeleteWallet (furszy) 5d15485aafefdc759ba97e039bb1b9ccac267358 wallet: unload, notify GUI as soon as possible (furszy) Pull request description: Coming from #29073. Applied ryanofsky suggested changes on https://github.com/bitcoin/bitcoin/issues/29073#issuecomment-2274237242 with few modifications coming from https://github.com/bitcoin/bitcoin/pull/18338#issuecomment-605060348. The only point I did not tackle from https://github.com/bitcoin/bitcoin/pull/18338#issuecomment-605060348 is: > * Move log print and flush out of ReleaseWallet into CWallet destructor Because it would mean every `CWallet` object would flush data to disk during destruction. Which is not necessary for wallet tool utilities and unit tests. ACKs for top commit: achow101: ACK f550a8e035b4603787273ea250f403f6f0be453f ryanofsky: Code review ACK f550a8e035b4603787273ea250f403f6f0be453f. Just a simple rename since last review ismaelsadeeq: Re-ACK f550a8e035b4603787273ea250f403f6f0be453f Tree-SHA512: e2eb69bf36883c514f601f4838ae6a41113996b9559abf8dc2b46e16bbcdad401195ac0f2b9d1fb55a10e78bb8ea9953788a168c80474e3f101350d208cb3bd2
2024-08-15Rename ReleaseWallet to FlushAndDeleteWalletfurszy
To better describe the function's behavior. And add wallet name to logprint.
2024-08-15Merge bitcoin/bitcoin#30655: doc: mention bip94 supportglozow
99eeb51bf65fa00ee863f32d70f478bb9db0e351 [doc] mention bip94 support (glozow) Pull request description: Followup to #29775, noticed while looking at #30604 and #30647. See [release process](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-major-and-minor-release). ACKs for top commit: maflcko: ACK 99eeb51bf65fa00ee863f32d70f478bb9db0e351 fjahr: ACK 99eeb51bf65fa00ee863f32d70f478bb9db0e351 tdb3: ACK 99eeb51bf65fa00ee863f32d70f478bb9db0e351 Tree-SHA512: 95838d3ace7e5d7b1a2481f2d7bd82902081713e6e89dbf21e0dad16d1cf5295e0c1cfda1f03af72304a5844743d24769f5fa04d4dc9f02f36462ef0ae82a552
2024-08-15fuzz: Remove unused DataStream objectMarcoFalke
2024-08-14wallet: WaitForDeleteWallet, do not expect thread safetyRyan Ofsky
Multiple threads could try to delete the wallet at the same time.
2024-08-14wallet: rename UnloadWallet to WaitForDeleteWalletfurszy
And update function's documentation.
2024-08-14wallet: unload, notify GUI as soon as possiblefurszy
Releases wallet shared pointers prior to doing the final settings update and prevent GUI races trying to access a wallet that is no longer loaded.
2024-08-14makeseeds: Shuffle ips after parsingAva Chow
The crawlers are not guaranteed to output nodes in a random order, so shuffle the ips list after parsing to break any biasing that may be caused by the output order.
2024-08-14makeseeds: Support CJDNSAva Chow
2024-08-14makeseeds: Update user agent regexAva Chow
Update the user agent regex to match all 3 digits of the version number, not just the first 2 digits. Also updates it to include 24.2, 25.2, 26.1, 27.0, 27.1, 27.99, 28.0 and 28.99.
2024-08-14Merge bitcoin/bitcoin#28553: validation: assumeutxo params mainnetAva Chow
1610643c8b37a9f674b236cfa79abf8f8aaf1410 chainparams: add mainnet assumeutxo param at height 840_000 (Sjors Provoost) Pull request description: This adds snapshot parameters for mainnet block 840,000. You can generate the snapshot yourself using `./contrib/devtools/utxo_snapshot.sh` or download my torrent: * torrent: `magnet:?xt=urn:btih:596c26cc709e213fdfec997183ff67067241440c&dn=utxo-840000.dat&tr=udp%3A%2F%2Ftracker.bitcoin.sprovoost.nl%3A6969` It would be a good idea to test: 1. That you can produce the same snapshot file, sha256 sum: ``` dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b utxo-840000.dat ``` 2. That the snapshot works ACKs for top commit: fjahr: re-ACK 1610643c8b37a9f674b236cfa79abf8f8aaf1410 achow101: ACK 1610643c8b37a9f674b236cfa79abf8f8aaf1410 theStack: Tested ACK 1610643c8b37a9f674b236cfa79abf8f8aaf1410 mzumsande: tested ACK 1610643c8b37a9f674b236cfa79abf8f8aaf1410 willcl-ark: tACK 1610643c8b37a9f674b236cfa79abf8f8aaf1410 Tree-SHA512: 581d8e86379bb044324f04f8559dd0a8946b6e2b145d5f25b38727b30b8cf13d6ac3c8777ff06554d3cf1a072809f7b5fbd693239868578f25dceafe5ba5f57c