aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-08-27Merge bitcoin/bitcoin#30695: seeds: Add additional seed source and bump ↵Ava Chow
uptime requirements for Onion and I2P nodes b061b3510585a1fe113cc9d1af65852b155aba45 seeds: Regenerate mainnet seeds (virtu) 02dc45c506f78eae96b5fe8e8e4899b45811da05 seeds: Pull nodes from Luke's seeder (virtu) 7a2068a0ff9eec2bab436b47eba37fd34b71bba4 seeds: Pull nodes from virtu's crawler (virtu) Pull request description: This builds on #30008 and adds data [exported](https://github.com/virtu/seed-exporter) by [my crawler](https://github.com/virtu/p2p-crawler) an additional source for seed nodes. Data covers all supported network types. [edit: Added Luke's seeder as input as well.] ### Motivation - Further decentralizes the seed node selection process (in the long term potentially enabling an _n_-source threshold for nodes to prevent a single source from entering malicious nodes) - No longer need to manually curate seed node list for any network type: See last paragraph of OP in #30008. My crawler has been [discovering the handful of available cjdns nodes](https://21.ninja/reachable-nodes/nodes-by-net-type/) for around two months, all but one of which meet the reliability criteria. - Alignment of uptime requirements for Onion and I2P nodes with those of clearnet nodes to 50%: If I'm reading the code correctly, seeders appear to optimize for up-to-dateness by using [lower connection timeouts](https://github.com/achow101/dnsseedrs/blob/3c1a63c6723819871d76fe0fbd2155fe5a5bb171/src/crawl.rs#L349) than [Bitcoin Core](https://github.com/bitcoin/bitcoin/blob/bc87ad98543299e1990ee1994d0653df3ac70093/src/netbase.cpp#L40C27-L40C48) to maximize throughput. Since my crawler does not have the same timeliness requirements, it opts for accuracy by using generous timeouts. As a result, its data contains additional eligible Onion (and other darknet nodes), as is shown in the histogram below. Around 4500 Onion nodes are discovered so far (blue); my data adds ~6400 more (orange); ~ 1500 nodes take longer than the default 20-second Bitcoin Core timeout and won't qualify as "good". ![Connection time histogram for Onion nodes](https://github.com/user-attachments/assets/c3513604-aa48-4c75-b51d-13421eaed9eb) Here's the current results with 512 nodes for all networks except cjdns: <details> <summary>Using the extra data</summary> ``` IPv4 IPv6 Onion I2P CJDNS Pass 10335 2531 11545 1589 10 Initial 10335 2531 11545 1589 10 Skip entries with invalid address 5639 1431 11163 1589 8 After removing duplicates 5606 1417 11163 1589 8 Enforce minimal number of blocks 5606 1417 11163 1589 8 Require service bit 1 4873 1228 11163 1589 8 Require minimum uptime 4846 1225 11161 1588 8 Require a known and recent user agent 4846 1225 11161 1588 8 Filter out hosts with multiple bitcoin ports 512 512 512 512 8 Look up ASNs and limit results per ASN and per net ``` </details> <details> <summary>Before</summary> ``` IPv4 IPv6 Onion I2P CJDNS Pass 5772 1323 443 0 2 Initial 5772 1323 443 0 2 Skip entries with invalid address 4758 1110 443 0 2 After removing duplicates 4723 1094 443 0 2 Enforce minimal number of blocks 4723 1094 443 0 2 Require service bit 1 3732 867 443 0 2 Require minimum uptime 3718 864 443 0 2 Require a known and recent user agent 3718 864 443 0 2 Filter out hosts with multiple bitcoin ports 512 409 443 0 2 Look up ASNs and limit results per ASN and per net ``` </details> ### To dos - [x] Remove manual nodes and update README - [x] Mark nodes with connection times exceeding Bitcoin Core's default as bad in [exporter](https://github.com/virtu/seed-exporter): [done](https://github.com/virtu/seed-exporter/pull/12) - [x] Regenerate mainnet seeds - [x] Rebase, then remove WIP label once #30008 gets merged ACKs for top commit: achow101: ACK b061b3510585a1fe113cc9d1af65852b155aba45 fjahr: utACK b061b3510585a1fe113cc9d1af65852b155aba45 Tree-SHA512: 63e86220787251c7e8d2d5957bad69352e19ae17d7b9b2d27d8acddfec5bdafe588edb68d77d19c57f25f149de723e2eeadded0c8cf13eaca22dc33bd8cf92a0
2024-08-27Merge bitcoin/bitcoin#30697: Bugfix: Ensure Atomicity in Wallet Settings ↵Ava Chow
Updates from Chain Interface 1b41d45d462d856a9d0b44ae0039bbb2cd78407c wallet: bugfix: ensure atomicity in settings updates (ismaelsadeeq) Pull request description: This PR fixes #30620. As outlined in the issue, creating two wallets with `load_on_startup=true` simultaneously results in only one wallet being added to the startup file. The current issue arises because the wallet settings update process involves: 1. Obtaining the settings value while acquiring the settings lock. 2. Modifying the settings value. 3. Overwriting the settings value while acquiring the settings lock again. This sequence is not thread-safe. Different threads could modify the same base value simultaneously, overwriting data from other workers without realizing it. The PR attempts to fix this by modifying the chain interface's `updateRwSetting` method to accept a function that will be called with the settings reference. This function will either update or delete the setting and return an enum indicating whether the settings need to be overwritten in this or not. Additionally, this PR introduces two new methods to the chain interface: - `overwriteRwSetting`: This method replaces the setting with a new value. Used in `VerifyWallets` - `deleteRwSettings`: This method completely erases a specified setting. This method is currently used only in `overwriteRwSetting`. These changes ensure that updates are race-free across all clients. ACKs for top commit: achow101: ACK 1b41d45d462d856a9d0b44ae0039bbb2cd78407c furszy: self-code-ACK https://github.com/bitcoin/bitcoin/commit/1b41d45d462d856a9d0b44ae0039bbb2cd78407c Tree-SHA512: 50cda612b782aeb5e03e2cf63cc44779a013de1c535b883b57af4de22f24b0de80b4edecbcda235413baec0a12bdf0e5750fb6731c9e67d32e742d8c63f08c13
2024-08-27fuzz: fix timeout in `crypto_fschacha20poly1305`brunoerg
2024-08-27Merge bitcoin/bitcoin#30720: chainparams: Remove seed.bitcoinstats.commerge-script
c88a7dc53e3be7489605c3326cf768df5437393a chainparams: Remove seed.bitcoinstats.com (Ava Chow) Pull request description: This seeder no longer appears to be serving sufficient addresses. Fixes #29911 ACKs for top commit: 1440000bytes: ACK https://github.com/bitcoin/bitcoin/pull/30720/commits/c88a7dc53e3be7489605c3326cf768df5437393a virtu: ACK https://github.com/bitcoin/bitcoin/commit/c88a7dc53e3be7489605c3326cf768df5437393a mzumsande: ACK c88a7dc53e3be7489605c3326cf768df5437393a BrandonOdiwuor: ACK c88a7dc53e3be7489605c3326cf768df5437393a Tree-SHA512: 23db3a217bbc3cd96785f17bd2b1db886392cc864dfc00498fa30e69df414ad02cb35f34cd6b7e8adab7c024a7efa8fd4a39b8b8ef274d95974cb16eb1c39a5b
2024-08-27refactor: Testnet4 - Replace uint256S("str") -> uint256{"str"}Hodlinator
Ran scripted-diff from 2d9d752e4fc30aabf2ddd36ca7a63432d26d4fea. Follow-up to #29775 which overlapped with work on #30560 (the latter includes the scripted-diff commit).
2024-08-27bench: [refactor] iwyuMarcoFalke
2024-08-27seeds: Regenerate mainnet seedsvirtu
Regenerate mainnet seeds from new sources without the need for hardcoded data. Result has 512 nodes from each network type except cjdns, for which only eight nodes were found that match the seed node criteria.
2024-08-26Merge bitcoin/bitcoin#30008: seeds: Pull additional nodes from my seeder and ↵Ava Chow
update fixed seeds 41ad84a00c20f54b520aab7f6f975231da0ee2d0 seeds: Use fjahr's more up to date asmap (Ava Chow) d8fd1e0fafa144a9ff96fc646cf9f21e220d5cd6 seeds: Fixed seeds update (Ava Chow) f1f24d72141dcd2955420195135cabe5092017ff seeds: Add testnet4 fixed seeds file (Ava Chow) 8ace71c73750e3b537784178f3fc299447c461ed seeds: Remove manual onion and i2p seeds (Ava Chow) ed5b86cbe47676276f8ff1a48001d5ecd560e153 seeds: Add testnet instructions (Ava Chow) 0676515397fcc8fb580973047e60279ce65bec48 seeds: Also pull from achow101 seeder (Ava Chow) 5bab3175a663610070c1000dd4211a58490e5023 makeseeds: Configurable minimum blocks for testnet4's smaller chain (Ava Chow) d2465dfac68f96ffdaad88a0bd4891ed37cbfdfc makeseeds: Shuffle ips after parsing (Ava Chow) af550b3a0fd406f175f197ea9867b41ff4e97af4 makeseeds: Support CJDNS (Ava Chow) d5a8c4c4bd76f296f4d744184dc80a6a6a0731bd makeseeds: Update user agent regex (Ava Chow) Pull request description: The [DNS seeder](https://github.com/achow101/dnsseedrs) that I wrote collects statistics on node reliability in the same way that sipa's seeder does, and also outputs this information in the same file format. Thus it can also be used in our fixed seeds update scripts. My seeder additionally crawls onion v3, i2p, and cjdns, so will now be able to set those fixed seeds automatically rather than curating manual lists. In doing this update, I've found that `makeseeds.py` is missing newer versions from the regex as well as cjdns support; both of these have been updated. I also noticed that the testnet fixed seeds are all manually curated and sipa's seeder does not appear to publish any testnet data. Since I am also running the seeder for testnet, I've added the commands to generate testnet fixed seeds from my seeder's data too. Lastly, I've updated all of the fixed seeds. However, since my seeder has not found any cjdns nodes that met the reliability criteria (possibly due to connectivity issues present in those networks), I've left the previous manual seeds for that network. ACKs for top commit: fjahr: re-ACK 41ad84a00c20f54b520aab7f6f975231da0ee2d0 virtu: ACK [41ad84a](https://github.com/bitcoin/bitcoin/commit/41ad84a00c20f54b520aab7f6f975231da0ee2d0) Tree-SHA512: 6ba0141f053d9d6ae7d8c9574f061be38f3e65b28de1d6660c1885ab942623b5a0ec70754b4fcfc5d98fe970f5f179a940d5880b5061ed698f7932500e01d3ee
2024-08-26chainparams: Remove seed.bitcoinstats.comAva Chow
This seeder no longer appears to be serving sufficient addresses.
2024-08-26wallet: bugfix: ensure atomicity in settings updatesismaelsadeeq
- Settings updates were not thread-safe, as they were executed in three separate steps: 1) Obtain settings value while acquiring the settings lock. 2) Modify settings value. 3) Overwrite settings value while acquiring the settings lock. This approach allowed concurrent threads to modify the same base value simultaneously, leading to data loss. When this occurred, the final settings state would only reflect the changes from the last thread that completed the operation, overwriting updates from other threads. Fix this by making the settings update operation atomic. - Add test coverage for this behavior. Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2024-08-26test: Remove FastRandomContext globalRyan Ofsky
Drop g_insecure_rand_ctx
2024-08-26scripted-diff: [test] Use g_rng/m_rng directlyMarcoFalke
-BEGIN VERIFY SCRIPT- # Use m_rng in unit test files ren() { sed -i "s:\<$1\>:$2:g" $( git grep -l "$1" src/test/*.cpp src/wallet/test/*.cpp src/test/util/setup_common.cpp ) ; } ren InsecureRand32 m_rng.rand32 ren InsecureRand256 m_rng.rand256 ren InsecureRandBits m_rng.randbits ren InsecureRandRange m_rng.randrange ren InsecureRandBool m_rng.randbool ren g_insecure_rand_ctx m_rng ren g_insecure_rand_ctx_temp_path g_rng_temp_path -END VERIFY SCRIPT-
2024-08-26test: refactor: Accept any RandomNumberGenerator in RandMoneyMarcoFalke
Accepting any Rng in RandMoney makes tests more flexible to use a different Rng. Also, passing in the Rng clarifies the call sites, so that they all use g_rand_ctx explicitly and consistently.
2024-08-26test: refactor: Pass rng parameters to test functionsRyan Ofsky
Add FastRandomContext parameter to the utility function AddTestCoin(), and a few local test functions and classes.
2024-08-26test: refactor: Move g_insecure_rand_ctx.Reseed out of the helper that calls ↵MarcoFalke
MakeRandDeterministicDANGEROUS The global g_insecure_rand_ctx will be removed in the future, so removing it from this helper is useful. Also, tying the two concepts of the global internal RNGState and the global test-only rng context is a bit confusing, because tests can simply use the m_rng, if it exists. Also, tests may seed more than one random context, or none at all, or a random context of a different type. Fix all issues by moving the Reseed call to the two places where it is used.
2024-08-26qt: 28.0 translations updateHennadii Stepanov
2024-08-25http: set TCP_NODELAY when creating HTTP serverRoman Zeyde
Otherwise, the default HTTP server config may result in high latency. [1] https://www.extrahop.com/blog/tcp-nodelay-nagle-quickack-best-practices [2] https://eklitzke.org/the-caveats-of-tcp-nodelay
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-23test: use uint256::FromUserHex for RANDOM_CTX_SEEDstickies-v
Removes dependency on unsafe and deprecated uint256S. This makes parsing more strict, by requiring RANDOM_CTX_SEED to be a string of up to 64 hex digits (optionally prefixed with "0x"), whereas previously any string would be accepted, with non-hex characters silently ignored and input longer than 64 characters (ignoring "0x" prefix) silently trimmed. Can be tested with: $ RANDOM_CTX_SEED=z ./src/test/test_bitcoin --log_level=all --run_test=timeoffsets_tests/timeoffsets_warning -- -printtoconsole=1 | grep RANDOM_CTX_SEED RANDOM_CTX_SEED must consist of up to 64 hex digits ("0x" prefix allowed), it was set to: 'z'. Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
2024-08-23node: use uint256::FromUserHex for -assumevalid parsingstickies-v
Removes dependency on unsafe and deprecated uint256S. This makes parsing more strict, by returning an error when the input contains non-hex characters, or when it contains more than 64 hex digits. Also make feature_assumevalid.py more robust by using CBlock.hash which is guaranteed to be 64 characters long, as opposed to the variable-length hex(CBlock.sha256)
2024-08-23util: remove unused IsHexNumberstickies-v
The relevant unit tests have been incorporated in uint256_tests/from_user_hex in a previous commit.
2024-08-23node: use uint256::FromUserHex for -minimumchainwork parsingstickies-v
Removes dependency on unsafe and deprecated uint256S. This makes parsing more strict, by returning an error when the input contains more than 64 hex digits.
2024-08-23refactor: add uint256::FromUserHex helperstickies-v
FromUserHex will be used in future commits to construct uint256 instances from user hex input without being unnecessarily restrictive on formatting by allowing 0x-prefixed input that is shorter than 64 characters.
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-21test: refactor: Give unit test functions access to test stateRyan Ofsky
Add unit test subclasses as needed so unit test functions that need to access members like m_rng can reference it directly.
2024-08-21test: refactor: Make unsigned promotion explicitMarcoFalke
Integer promotion will already turn the `signed` into `unsigned` in those lines. However, make the `unsigned` explicit so that the code is clearer and a compiler warning is avoided when switching to m_rng: | test/validation_block_tests.cpp: warning: comparison of integers of different signs: 'int' and 'const unsigned int' [-Wsign-compare] | 136 | bool gen_invalid = m_rng.randrange(100) < invalid_rate; | | ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ | 137 | bool gen_fork = m_rng.randrange(100) < branch_rate; | | ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ | 2 warnings generated.
2024-08-21test: Add m_rng alias for the global random contextMarcoFalke
The two names point to the same object, but having the reference now allows easier removal of the global in the future.
2024-08-21test: Correct the random seed log on a prevector test failureMarcoFalke
rand_cache is unused since commit 16329224e70d0525208f6b0ba00c5e1531a4f5ea, so it can be removed rand_seed is wrong since commit 022cf47dd7ef8f46e32a184e84f94d1e9f3a495c, because it is no longer printing the seed that was used to seed the global random context in tests. Instead, it prints a (random-ish) value derived from the global random context via InsecureRand256(). Finally, the for loop creating new prevector_tester objects will always use the same seed since commit fae43a97ca947cd0802392e9bb86d9d0572c0fba, because repeated calls to SeedInsecureRand/SeedRandomForTest will always reseed the global with the same "static const" seed. Fix all issues by * removing the unused rand_cache, * removing the call to SeedRandomForTest which restored the same seed on every call in the process, and * Reseeding the global random context with the (random-ish) rand_seed.
2024-08-21test: unittest chainstatemanager_argsstickies-v
2024-08-21Fix maybe-uninitialized warning in IsSpentKeyAva Chow
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-20consensus: enable BIP94 on regtestSjors Provoost
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-16doc: Update for CMake-based build systemHennadii Stepanov
Co-authored-by: Lőrinc <pap.lorinc@gmail.com> Co-authored-by: pablomartin4btc <pablomartin4btc@gmail.com>
2024-08-16cmake: Add `APPEND_{CPP,C,CXX,LD}FLAGS` cache variablesHennadii Stepanov
The content of those variables is appended to the each target after the flags added by the build system.
2024-08-16cmake: Add `AddWindowsResources` moduleHennadii Stepanov
2024-08-16cmake: Implement `install` build targetHennadii Stepanov
2024-08-16cmake: Add cross-compiling supportHennadii Stepanov
To configure CMake for cross-compiling, use `--toolchain depends/${HOST}/toolchain.cmake` command-line option.
2024-08-16cmake: Add `MULTIPROCESS` optionHennadii Stepanov
2024-08-16cmake: Build `bitcoin-chainstate` executableHennadii Stepanov
2024-08-16cmake: Build `bitcoinkernel` libraryHennadii Stepanov
Co-authored-by: TheCharlatan <seb.kung@gmail.com>
2024-08-16cmake: Build `test_bitcoin-qt` executableHennadii Stepanov
2024-08-16cmake: Add `WITH_DBUS` optionHennadii Stepanov
2024-08-16cmake: Build `bitcoin-qt` executableHennadii Stepanov