aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-27Merge bitcoin-core/gui#665: Switch to the selected wallet after loadingHennadii Stepanov
b8b59ff9fea69f4f25d98005e3ac9172a7a11c12 gui: update the screen after loading wallet (w0xlt) Pull request description: Currently, the user loads a wallet and the screen does not switch to the selected wallet after loading (File -> Open Wallet -> wallet name). This PR changes that by making the `OpenWalletActivity::opened` signal connection a `Qt::QueuedConnection` type. ACKs for top commit: jarolrod: ACK b8b59ff9fea69f4f25d98005e3ac9172a7a11c12 hebasto: ACK b8b59ff9fea69f4f25d98005e3ac9172a7a11c12, tested on Ubuntu 22.04. Tree-SHA512: 43cd755638b643f481014a7933a0af25df2d109e859cb5f878bc04e562950d550716fa38465140060e28526b2441688580cbcbe4ec6819566b4f95162ca5e527
2022-10-27Merge bitcoin/bitcoin#26394: Fix typo in comment SHA256->SHA512glozow
0cc23fc60374512b3c4be888d98a7dbdd3a0c931 Fix typo in comment SHA256->SHA512 (Elichai Turkel) Pull request description: The comment says it's the SHA-256 state, while it's actually the SHA-512 state ACKs for top commit: andrewtoth: ACK 0cc23fc60374512b3c4be888d98a7dbdd3a0c931 aureleoules: ACK 0cc23fc60374512b3c4be888d98a7dbdd3a0c931 Tree-SHA512: 4e390ceefb847d3bbe4f5caab390a4fdd14892fe443f58c32b08b3444fccd611cff22938c3dfa611dfd2497736f779fae4165497b4208e48aa8fc9d2236f943b
2022-10-26bench: benchmark transaction creation processfurszy
Goal 1: Benchmark the transaction creation process for pre-selected-inputs only. Setting `m_allow_other_inputs=false` to disallow the wallet to include coins automatically. Goal 2: Benchmark the transaction creation process for pre-selected-inputs and coin selection. ----------------------- Benchmark Setup: 1) Generates a 5k blockchain, loading the wallet with 5k transactions with two outputs each. 2) Fetch 4 random UTXO from the wallet's available coins and pre-select them as inputs inside CoinControl. Benchmark (Goal 1): Call `CreateTransaction` providing the coin control, who has set `m_allow_other_inputs=false` and the manually selected coins. Benchmark (Goal 2): Call `CreateTransaction` providing the coin control, who has set `m_allow_other_inputs=true` and the manually selected coins.
2022-10-26wallet: SelectCoins, return early if target is covered by preset-inputsfurszy
2022-10-26wallet: simplify preset inputs selection target checkfurszy
we are already computing the preset inputs total amount inside `PreSelectedInputs::Insert`, which internally decides whether to use the effective value or the raw output value based on the 'subtract_fee_outputs' flag.
2022-10-26wallet: remove fetch pre-selected-inputs responsibility from SelectCoinsfurszy
so if there is an error in any of the pre-set coins, we can fail right away without computing the wallet available coins set (calling `AvailableCoins`) which is a slow operation as it goes through the entire wallet's txes map. ---------------------- And to make the Coin Selection flow cleared, have decoupled SelectCoins in two functions: 1) AutomaticCoinSelection. 2) SelectCoins. 1) AutomaticCoinSelection: Receives a set of coins and selects the best subset of them to cover the target amount. 2) SelectCoins In charge of select all the user manually selected coins first ("pre-set inputs"), and if coin_control 'm_allow_other_inputs=true', call 'AutomaticCoinSelection' to select a subset of coins owned by the wallet to cover for the target - preset_inputs.total_amount remaining value.
2022-10-26wallet: encapsulate pre-selected-inputs lookup into its own functionfurszy
First step towards decoupling the pre-selected-inputs fetching functionality from `SelectCoins`. Which, will let us not waste resources calculating the available coins if one of the pre-set inputs has an error. (right now, if one of the pre-set inputs is invalid, we first walk through the entire wallet txes map just to end up failing right after it finish)
2022-10-26wallet: skip manually selected coins from 'AvailableCoins' resultfurszy
No need to walk through the entire wallet's txes map just to get coins that we could have gotten by just doing a simple map.find(out.hash). (Which is what we are doing inside `SelectCoins` anyway)
2022-10-26wallet: skip available coins fetch if "other inputs" are disallowedfurszy
no need to waste resources calculating the wallet available coins if they are not going to be used. The 'm_allow_other_inputs=true` default value change is to correct an ugly misleading behavior: The tx creation process was having a workaround patch to automatically fall back to select coins from the wallet if `m_allow_other_inputs=false` (previous default value) and no manual inputs were selected. This could be seen in master in flows like `sendtoaddress`, `sendmany` and even the GUI, where the `m_allow_other_inputs` value isn't customized and the wallet still selects and adds coins to the tx internally.
2022-10-26Merge bitcoin/bitcoin#26395: rpc: add missing lock around chainman.ActiveTip()MacroFake
f5ff3d773c2f781016b6b047ea8d4aa029756544 rpc: add missing lock around chainman.ActiveTip() (Andrew Toth) Pull request description: https://github.com/bitcoin/bitcoin/pull/23927 seems to have missed a lock around `chainman.ActiveChain()`. ACKs for top commit: aureleoules: ACK f5ff3d773c2f781016b6b047ea8d4aa029756544 Tree-SHA512: 3f116ca44c1b2bc0c7042698249ea3417dfb7c0bb81158a7ceecd087f1e02baa89948f9bb7924b1757798a1691a7de6e886aa72a0a9e227c13a3f512cc59d6c9
2022-10-26rpc: add missing lock around chainman.ActiveTip()Andrew Toth
2022-10-26Merge bitcoin/bitcoin#26341: test: add BIP158 false-positive element check ↵Andrew Chow
in rpc_scanblocks.py fa54d3011ed0cbb7bcdc76548423ba41f0042832 test: check for false-positives in rpc_scanblocks.py (Sebastian Falbesoner) 3bca6cd61a8cd677023f18c146f2a6534829b1c7 test: add compact block filter (BIP158) helper routines (Sebastian Falbesoner) 25ee74dd11401ce2bfb0b24c4ce70578c5b99e51 test: add SipHash implementation for generic data in Python (Sebastian Falbesoner) Pull request description: This PR adds a fixed false-positive element check to the functional test rpc_scanblocks.py by using a pre-calculated scriptPubKey that collides with the regtest genesis block's coinbase output. Note that determining a BIP158 false-positive at runtime would also be possible, but take too long (we'd need to create and check ~800k output scripts on average, which took at least 2 minutes on average on my machine). The introduced check is related to issue #26322 and more concretely inspired by PR #26325 which introduces an "accurate" mode that filters out these false-positives. The introduced cryptography routines (siphash for generic data) and helpers (BIP158 ranged hash calculation, relevant scriptPubKey per block determination) could potentially also be useful for more tests in the future that involve compact block filters. ACKs for top commit: achow101: ACK fa54d3011ed0cbb7bcdc76548423ba41f0042832 Tree-SHA512: c6af50864146028228d197fb022ba2ff24d1ef48dc7d171bccfb21e62dd50ac80db5fae0c53f5d205edabd48b3493c7aa2040f628a223e68df086ec2243e5a93
2022-10-26Merge bitcoin/bitcoin#23927: rpc: Pruning nodes can not fetch blocks before ↵Andrew Chow
syncing past their height 5826bf546e83478947edbdf49978414f0b69eb1a test: Add test for getblockfrompeer on syncing pruned nodes (Fabian Jahr) 7fa851fba8570ef256317f7d5759aa3de9088bf1 rpc: Pruned nodes can not fetch unsynced blocks (Fabian Jahr) Pull request description: This PR prevents `getblockfrompeer` from getting used on blocks that the node has not synced past yet if the node is in running in prune mode. ### Problem While a node is still catching up to the tip that it is aware of via the headers, the user can currently use to fetch blocks close to or at the tip. These blocks are stored in the block/rev file that otherwise contains blocks the node is receiving as part of the syncing process. This creates a problem for pruned nodes: The files containing a fetched block are not pruned during syncing because they contain a block close to the tip. This means the entire file (~130MB) will not be pruned until the tip has moved on far enough from the fetched block. In extreme cases with heavy pruning (like 550) and multiple blocks being fetched this could mean that the disc usage far exceeds what the user expects, potentially running out of space. ### Approach There would be certainly other approaches that could fix the problem while still allowing the current behavior, but all of the ideas I came up with seemed like overkill for a niche problem on a new RPC where it's still unclear how and how much it will be used. ### Testing So far I did not see a simple enough way to test this I am still looking into it and if it's complex will potentially add it in a follow-up. What would be needed is a way to have a node fetch headers but not sync the blocks yet, that seems like a pattern that could be generally useful. To manually reproduce the problematic behavior: 1. Start a node with current `master` with `-prune=550` and an empty/new datadir, Testnet and Mainnet should both work. 2. While the node is syncing run `getblockfrompeer` on the current tip and a few other recent blocks. 3. Go to your datadir and observe the blocks folder: There should be a few full `blk*.dat` and `rev*.dat` files that are not being pruned. When you "pinned" a few of these files the blocks folder should be significantly above the target size of 550MB. ACKs for top commit: Sjors: utACK 5826bf546e83478947edbdf49978414f0b69eb1a achow101: ACK 5826bf546e83478947edbdf49978414f0b69eb1a aureleoules: tACK 5826bf546e83478947edbdf49978414f0b69eb1a Tree-SHA512: aa3f477ec755a9df2331c047cb10b3cd08292522bf6ad7a36a7ea36d7eba4894b84de8bd23003c9baea5ac0c53b77142c3c2819ae7528cece9d10a0d06c850d8
2022-10-26Merge bitcoin/bitcoin#25957: wallet: fast rescan with BIP157 block filters ↵Andrew Chow
for descriptor wallets 0582932260e7de4e8aba01d63e7c8a9ddb9c3685 test: add test for fast rescan using block filters (top-up detection) (Sebastian Falbesoner) ca48a4694f73e5be8f971ae482ebc2cce4caef44 rpc: doc: mention rescan speedup using `blockfilterindex=1` in affected wallet RPCs (Sebastian Falbesoner) 3449880b499d54bfbcf6caeed52851ce55259ed7 wallet: fast rescan: show log message for every non-skipped block (Sebastian Falbesoner) 935c6c4b234bbb0565cda6f58ee298048856acae wallet: take use of `FastWalletRescanFilter` (Sebastian Falbesoner) 70b35139040a2351c845a1cec1dafd2fbcd16e93 wallet: add `FastWalletRescanFilter` class for speeding up rescans (Sebastian Falbesoner) c051026586fb269584bcba41de8a4a90280f5a7e wallet: add method for retrieving the end range for a ScriptPubKeyMan (Sebastian Falbesoner) 845279132b494f03b84d689c666fdcfad37f5a42 wallet: support fetching scriptPubKeys with minimum descriptor range index (Sebastian Falbesoner) 088e38d3bbea9694b319bc34e0d2e70d210c38b4 add chain interface methods for using BIP 157 block filters (Sebastian Falbesoner) Pull request description: ## Description This PR is another take of using BIP 157 block filters (enabled by `-blockfilterindex=1`) for faster wallet rescans and is a modern revival of #15845. For reviewers new to this topic I can highly recommend to read the corresponding PR review club (https://bitcoincore.reviews/15845). The basic idea is to skip blocks for deeper inspection (i.e. looking at every single tx for matches) if our block filter doesn't match any of the block's spent or created UTXOs are relevant for our wallet. Note that there can be false-positives (see https://bitcoincore.reviews/15845#l-199 for a PR review club discussion about false-positive rates), but no false-negatives, i.e. it is safe to skip blocks if the filter doesn't match; if the filter *does* match even though there are no wallet-relevant txs in the block, no harm is done, only a little more time is spent extra. In contrast to #15845, this solution only supports descriptor wallets, which are way more widespread now than back in the time >3 years ago. With that approach, we don't have to ever derive the relevant scriptPubKeys ourselves from keys before populating the filter, and can instead shift the full responsibility to that to the `DescriptorScriptPubKeyMan` which already takes care of that automatically. Compared to legacy wallets, the `IsMine` logic for descriptor wallets is as trivial as checking if a scriptPubKey is included in the ScriptPubKeyMan's set of scriptPubKeys (`m_map_script_pub_keys`): https://github.com/bitcoin/bitcoin/blob/e191fac4f3c37820f0618f72f0a8e8b524531ab8/src/wallet/scriptpubkeyman.cpp#L1703-L1710 One of the unaddressed issues of #15845 was that [the filter was only created once outside the loop](https://github.com/bitcoin/bitcoin/pull/15845#discussion_r343265997) and as such didn't take into account possible top-ups that have happened. This is solved here by keeping a state of ranged `DescriptorScriptPubKeyMan`'s descriptor end ranges and check at each iteration whether that range has increased since last time. If yes, we update the filter with all scriptPubKeys that have been added since the last filter update with a range index equal or higher than the last end range. Note that finding new scriptPubKeys could be made more efficient than linearly iterating through the whole `m_script_pub_keys` map (e.g. by introducing a bidirectional map), but this would mean introducing additional complexity and state and it's probably not worth it at this time, considering that the performance gain is already significant. Output scripts from non-ranged `DescriptorScriptPubKeyMan`s (i.e. ones with a fixed set of output scripts that is never extended) are added only once when the filter is created first. ## Benchmark results Obviously, the speed-up indirectly correlates with the wallet tx frequency in the scanned range: the more blocks contain wallet-related transactions, the less blocks can be skipped due to block filter detection. In a [simple benchmark](https://github.com/theStack/bitcoin/blob/fast_rescan_functional_test_benchmark/test/functional/pr25957_benchmark.py), a regtest chain with 1008 blocks (corresponding to 1 week) is mined with 20000 scriptPubKeys contained (25 txs * 800 outputs) each. The blocks each have a weight of ~2500000 WUs and hence are about 62.5% full. A global constant `WALLET_TX_BLOCK_FREQUENCY` defines how often wallet-related txs are included in a block. The created descriptor wallet (default setting of `keypool=1000`, we have 8*1000 = 8000 scriptPubKeys at the start) is backuped via the `backupwallet` RPC before the mining starts and imported via `restorewallet` RPC after. The measured time for taking this import process (which involves a rescan) once with block filters (`-blockfilterindex=1`) and once without block filters (`-blockfilterindex=0`) yield the relevant result numbers for the benchmark. The following table lists the results, sorted from worst-case (all blocks contain wallte-relevant txs, 0% can be skipped) to best-case (no blocks contain walltet-relevant txs, 100% can be skipped) where the frequencies have been picked arbitrarily: wallet-related tx frequency; 1 tx per... | ratio of irrelevant blocks | w/o filters | with filters | speed gain --------------------------------------------|-----------------------------|-------------|--------------|------------- ~ 10 minutes (every block) | 0% | 56.806s | 63.554s | ~0.9x ~ 20 minutes (every 2nd block) | 50% (1/2) | 58.896s | 36.076s | ~1.6x ~ 30 minutes (every 3rd block) | 66.67% (2/3) | 56.781s | 25.430s | ~2.2x ~ 1 hour (every 6th block) | 83.33% (5/6) | 58.193s | 15.786s | ~3.7x ~ 6 hours (every 36th block) | 97.22% (35/36) | 57.500s | 6.935s | ~8.3x ~ 1 day (every 144th block) | 99.31% (143/144) | 68.881s | 6.107s | ~11.3x (no txs) | 100% | 58.529s | 5.630s | ~10.4x Since even the (rather unrealistic) worst-case scenario of having wallet-related txs in _every_ block of the rescan range obviously doesn't take significantly longer, I'd argue it's reasonable to always take advantage of block filters if they are available and there's no need to provide an option for the user. Feedback about the general approach (but also about details like naming, where I struggled a lot) would be greatly appreciated. Thanks fly out to furszy for discussing this subject and patiently answering basic question about descriptor wallets! ACKs for top commit: achow101: ACK 0582932260e7de4e8aba01d63e7c8a9ddb9c3685 Sjors: re-utACK 0582932260e7de4e8aba01d63e7c8a9ddb9c3685 aureleoules: ACK 0582932260e7de4e8aba01d63e7c8a9ddb9c3685 - minor changes, documentation and updated test since last review w0xlt: re-ACK https://github.com/bitcoin/bitcoin/pull/25957/commits/0582932260e7de4e8aba01d63e7c8a9ddb9c3685 Tree-SHA512: 3289ba6e4572726e915d19f3e8b251d12a4cec8c96d041589956c484b5575e3708b14f6e1e121b05fe98aff1c8724de4564a5a9123f876967d33343cbef242e1
2022-10-26Fix typo in comment SHA256->SHA512Elichai Turkel
2022-10-26Merge bitcoin/bitcoin#26381: test: Fix intermittent issue in p2p_sendtxrcncl.pyMacroFake
fa3da8307baa96ea7e51cc6ba4820aca7f93ec32 test: Check debug log as well in p2p_sendtxrcncl.py (MacroFake) fae0439486e9af428829b4604b3be5bb97b67b24 test: Check correct disconnect reason in p2p_sendtxrcncl.py (MacroFake) fa590cfaae887c927ffb4af92a15516332428d69 test: Fix intermittent issue in p2p_sendtxrcncl.py (MacroFake) Pull request description: Should fix https://github.com/bitcoin/bitcoin/issues/26364 I can't reproduce this, but my guess would be that `PeerNoVerack::on_version`, which sends the `wtxidrelay` message, is executed in the event loop and thus may run after the main thread sending `msg_verack`. Also, fix another bug. Finally, add some `assert_debug_log` to ensure the right code branch is executed (and not some random, unrelated disconnect). ACKs for top commit: naumenkogs: ACK fa3da8307baa96ea7e51cc6ba4820aca7f93ec32 Tree-SHA512: ee2988372223ea22e94e9783ef6d37114a3945991b6d60f0157917f3850fb7077c566564c3771d915ee74ab28202a3b73c6d89ddec6e2c918462db9a3c02e6cf
2022-10-26[net processing] Simplify use of IsContinuationOfLowWorkHeadersSync in ↵dergoegge
TryLowWorkHeaderSync `m_headers_sync` is already reset in IsContinuationOfLowWorkHeadersSync if there is a failure, so there is no need to also reset in TryLowWorkHeaderSync.
2022-10-26Merge bitcoin/bitcoin#25704: refactor: Remove almost all validation option ↵MacroFake
globals aaaa7bd0ba60aa7114810d4794940882d987c0aa iwyu: Add missing includes (MacroFake) fa9ebec096ae185576a54aa80bd2a9e57f867ed4 Remove g_parallel_script_checks (MacroFake) fa7c834b9f988fa7f2ace2d67b1628211b7819df Move ::fCheckBlockIndex into ChainstateManager (MacroFake) fa43188d86288fa6666307a77c106c8f069ebdbe Move ::fCheckpointsEnabled into ChainstateManager (MacroFake) cccca83099453bf0882bce4f897f77eee5836e8b Move ::nMinimumChainWork into ChainstateManager (MacroFake) fa29d0b57cdeb91c8798d5c90ba9cc18085e99fb Move ::hashAssumeValid into ChainstateManager (MacroFake) faf44876db555f7488c8df96db9fa88b793f897c Move ::nMaxTipAge into ChainstateManager (MacroFake) Pull request description: It seems preferable to assign globals to a class (in this case `ChainstateManager`), than to leave them dangling. This should clarify scope for code-readers, as well as clarifying unit test behaviour. ACKs for top commit: dergoegge: Code review ACK aaaa7bd0ba60aa7114810d4794940882d987c0aa ryanofsky: Code review ACK aaaa7bd0ba60aa7114810d4794940882d987c0aa. No changes since last review, other than rebase aureleoules: reACK aaaa7bd0ba60aa7114810d4794940882d987c0aa Tree-SHA512: 83ec3ba0fb4f1dad95810d4bd4e578454e0718dc1bdd3a794cc4e48aa819b6f5dad4ac4edab3719bdfd5f89cbe23c2740a50fd56c1ff81c99e521c5f6d4e898d
2022-10-26Merge bitcoin/bitcoin#26275: Fix crash on deriveaddresses when index is ↵MacroFake
2147483647 (2^31-1) 9153ff3e274953ea0d92d53ddab4c72deeace1b1 rpc: add non-regression test about deriveaddresses crash when index is 2147483647 (muxator) addf9d6502db12cebcc5976df3111cac1a369b82 rpc: fix crash in deriveaddresses when derivation index is 2147483647 (muxator) Pull request description: This PR is a proposal for fixing #26274 (better described there). The problem is due to a signed int wrapping when the `index` parameter of the `deriveaddresses` RPC call has the value `2^31-1`. ```C++ for (int i = range_begin; i <= range_end; ++i) { ``` * the first commit adds a "temporary" test case (`test/functional/rpc_deriveaddresses_crash.py`) that shows the crash, and can be used to generate a core dump; * the second commit fixes the problem giving an explicit size to the `i` variable in a for loop, from `int` to `int64_t`. The same commit also removes the ephemeral test case and adds a passing test to `test/functional/rpc_deriveaddresses.py`, in order to prevent future regressions. This is my first submission to this project and I do not know its conventions. Please advise if something needs to be changed. ACKs for top commit: achow101: ACK 9153ff3e274953ea0d92d53ddab4c72deeace1b1 Tree-SHA512: 0477b57b15dc2c682cf539d6002f100d44a8c7e668041aa3340c39dcdbd40e083c75dec6896b6c076b044a01c2e5254272ae6696d8a1467539391926f270940a
2022-10-26rpc: make `address` field optionalw0xlt
2022-10-26Merge bitcoin/bitcoin#23578: Add external signer taproot supportfanquake
796b020c37c793674f9d614d5d70fd1ed65f0938 wallet: add taproot support to external signer (Sjors Provoost) Pull request description: Builds on #22558 (merged on 2022-06-28). [HWI 2.1.0](https://github.com/bitcoin-core/HWI/releases/tag/2.1.0) or newer is required to import and use taproot descriptors. Older versions will work, but won't import a taproot descriptor. Tested with HWI 2.1.1: * Trezor T (firmware v2.5.1) on Signet: signs, change detection works * Ledger Nano S (firmware 2.1.0, Bitcoin app 2.0.6): signs, change detection works Only the most basic `tr(key)` descriptor is supported, script path spending is completely untested (if it works at all). ACKs for top commit: jb55: utACK 796b020c37c793674f9d614d5d70fd1ed65f0938 achow101: ACK 796b020c37c793674f9d614d5d70fd1ed65f0938 Tree-SHA512: 6dcb7eeb45421a3bbf2bdabeacd29979867db69077d7bf192bb77faa4bfefe446487b8df07bc40f9457009a88e598bdc09f769e6106fed2833ace7ef205a157a
2022-10-25test: add test for fast rescan using block filters (top-up detection)Sebastian Falbesoner
2022-10-25rpc: doc: mention rescan speedup using `blockfilterindex=1` in affected ↵Sebastian Falbesoner
wallet RPCs
2022-10-25wallet: fast rescan: show log message for every non-skipped blockSebastian Falbesoner
For that purpose, a new logging category BCLog::SCAN is introduced.
2022-10-25wallet: take use of `FastWalletRescanFilter`Sebastian Falbesoner
Can be reviewed with `--ignore-all-space`.
2022-10-25wallet: add `FastWalletRescanFilter` class for speeding up rescansSebastian Falbesoner
This only supports wallet descriptors right now.
2022-10-25wallet: add method for retrieving the end range for a ScriptPubKeyManSebastian Falbesoner
2022-10-25wallet: support fetching scriptPubKeys with minimum descriptor range indexSebastian Falbesoner
This extra method will be needed for updating the filter set for faster wallet rescans; after an internal top-up has happened, we only want to add the newly created scriptPubKeys.
2022-10-25add chain interface methods for using BIP 157 block filtersSebastian Falbesoner
This is useful for speeding up wallet rescans and is based on an earlier version from PR #15845 ("wallet: Fast rescan with BIP157 block filters"), which was never merged. Co-authored-by: MacroFake <falke.marco@gmail.com>
2022-10-25ci: Use `macos-ventura-xcode:14.1` image for "macOS native" taskHennadii Stepanov
2022-10-25test: Check debug log as well in p2p_sendtxrcncl.pyMacroFake
2022-10-25test: Check correct disconnect reason in p2p_sendtxrcncl.pyMacroFake
Previously it disconnected due to "sendtxrcncl received after verack", now it disconnects for the correct reason.
2022-10-25ci: Make `getopt` path architecture agnosticHennadii Stepanov
2022-10-25Merge bitcoin/bitcoin#26372: build, msvc: Drop no longer required macro ↵fanquake
definitions for leveldb 393be867241bed175bc65c05ad40c7579b51c393 build, msvc: Drop no longer required macro definitions for leveldb (Hennadii Stepanov) Pull request description: Since levedb v1.21: - the `__STDC_LIMIT_MACROS` macro definition is unneeded; commit: [50fbc87e8c62a816d6afd4740e0652a13ac6dc3e](https://github.com/bitcoin-core/leveldb-subtree/commit/50fbc87e8c62a816d6afd4740e0652a13ac6dc3e) - the `LEVELDB_ATOMIC_PRESENT` macro is unused; commit: [04f39105c5a418905da8b7657ca244d672c99d3b](https://github.com/bitcoin-core/leveldb-subtree/commit/04f39105c5a418905da8b7657ca244d672c99d3b) ACKs for top commit: sipsorcery: tACK 393be867241bed175bc65c05ad40c7579b51c393. jarolrod: crACK 393be867241bed175bc65c05ad40c7579b51c393 Tree-SHA512: 845bb310474cf17f9f0f70a585054a222914313a0fc28c42a023133250efbb9ab7fb2d1ebb355943233b6fd24d5bddfb73fbbf5dce71ea232ae652af8b695149
2022-10-24[net processing] Fixup TryLowWorkHeadersSync commentdergoegge
2022-10-24Merge bitcoin/bitcoin#26380: Revert "test: check importing wallets when ↵MacroFake
blocks are pruned throw an error" e1eadaa72d6831d1d0a53ba97c215dc4cdb64436 Revert "test: check importing wallets when blocks are pruned throw an error" (Aurèle Oulès) Pull request description: The test doesn't pass (not detected by the normal CI, because it is an extended test): ``` Traceback (most recent call last): File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/test_framework.py", line 133, in main self.run_test() File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/feature_pruning.py", line 480, in run_test self.wallet_test() File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/feature_pruning.py", line 361, in wallet_test assert_raises_rpc_error(-4, "Importing wallets is disabled when blocks are pruned", self.nodes[2].importwallet, "abc") File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/util.py", line 130, in assert_raises_rpc_error assert try_rpc(code, message, fun, *args, **kwds), "No exception raised" File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/util.py", line 145, in try_rpc raise AssertionError( AssertionError: Expected substring not found in error message: substring: 'Importing wallets is disabled when blocks are pruned' error message: 'Only legacy wallets are supported by this command'. ``` So revert it for now, which will be done anyway in https://github.com/bitcoin/bitcoin/pull/24865/commits. (This commit is taken from there) ACKs for top commit: andrewtoth: ACK e1eadaa72d6831d1d0a53ba97c215dc4cdb64436 Tree-SHA512: 10f556ea1aa97dc9cb64f91055977eecb9534f658170aabb4909c3e85ca6c20588c7a021219356fab678e0e2bec999d347facd00054f07a9445ad393e6353b4c
2022-10-24Merge bitcoin/bitcoin#26355: p2p: Handle IsContinuationOfLowWorkHeadersSync ↵glozow
return value correctly when new headers sync is started 7ad15d11005eac36421398530da127333d87ea80 [net processing] Handle IsContinuationOfLowWorkHeadersSync return value correctly when new headers sync is started (dergoegge) Pull request description: This PR fixes a bug in the headers sync logic that enables submitting headers to a nodes block index that don't lead to a chain that surpasses our DoS limit. The issue is that we ignore the return value on [the first `IsContinuationOfLowWorkHeadersSync` call after a new headers sync is started](https://github.com/bitcoin/bitcoin/blob/fabc0310480b49e159a15d494525c5aa15072cba/src/net_processing.cpp#L2553-L2568), which leads to us passing headers to [`ProcessNewBlockHeaders`](https://github.com/bitcoin/bitcoin/blob/fabc0310480b49e159a15d494525c5aa15072cba/src/net_processing.cpp#L2856) when that initial `IsContinuationOfLowWorkHeadersSync` call returns `false`. One easy way (maybe the only?) to trigger this is by sending 2000 headers where the last header has a different `nBits` value than the prior headers (which fails the pre-sync logic [here](https://github.com/bitcoin/bitcoin/blob/fabc0310480b49e159a15d494525c5aa15072cba/src/headerssync.cpp#L189)). Those 2000 headers will be passed to `ProcessNewBlockHeaders`. I haven't included a test here so far because we can't test this without changing the default value for `CRegTestParams::consensus.fPowAllowMinDifficultyBlocks` or doing some more involved refactoring. ACKs for top commit: sipa: ACK 7ad15d11005eac36421398530da127333d87ea80 glozow: ACK 7ad15d1100 Tree-SHA512: 9aabb8bf3700401e79863d0accda0befd2a83c4d469a53f97d827e51139e2f826aee08cdfbc8866b311b153f61fdac9b7aa515fcfa2a21c5e2812c2bf3c03664
2022-10-24test: Fix intermittent issue in p2p_sendtxrcncl.pyMacroFake
2022-10-24test: Make `system_tests/run_command` locale agnosticHennadii Stepanov
2022-10-24Merge bitcoin-core/gui#676: Update peers window "Transaction Relay" label ↵MacroFake
and tooltip a079103c94fbaabb40bc086d56e91af6fcee6fe9 gui: update peers window "Transaction Relay" label and tooltip (Jon Atack) Pull request description: to current v24.0 p2p behavior. Similar updates have been made to RPC getpeerinfo and CLI -netinfo. Top commit has no ACKs. Tree-SHA512: 400a794f655f799eefcb77c479fef6bcd3f81aede2af54a4a9bcb7c0c783e2e3f18bc5fd2484a79e8c30af279747a05fc0ebb69dbc47375d4c55b16ceba97b99
2022-10-24Merge bitcoin-core/gui#673: Use fallback value for Version and User Agent ↵MacroFake
during peer connection c2a21c06703fd20e314da8431220776c8f1cc08d gui: use fallback value for Version and User Agent during peer connection (Jon Atack) Pull request description: During connection setup for a peer, getpeerinfo returns `"version": 0, "subver": ""` and the GUI Peers window displays 0 and an empty field, respectively. Give these fields the same behavior as the other fields in the GUI Peers window: display the fallback value in `src/qt/forms/debugwindow.ui` (i.e. `N/A`) until a valid result is available after the peer connection completes. An alternative would be to display nothing for both, as is the case currently for User Agent. ACKs for top commit: jarolrod: ACK c2a21c06703fd20e314da8431220776c8f1cc08d furszy: code ACK c2a21c06 Tree-SHA512: 4f0060fa9abde120a2bb48c9dcc87894d9bb70c33e6ab43b22400a4bcd0ceff0fa098adf7f385b0a7a4cf5d7053463b36fe1232e19a8d5025eecd8db9833f73b
2022-10-24Merge bitcoin/bitcoin#26358: doc: Rearrange a few lines in the dependency ↵MacroFake
graph of libraries 1184a66347afbaeca69e2d891a138e435fbfd5bb doc: Rearrange some lines in the dependency graph of libraries (Stacie Waleyko) Pull request description: In this PR, I've attempted to improve readability in the [dependency graph of libraries](https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md) by untangling a few crossed lines. I'm not sure if this is that big of an improvement but wanted to throw it out there. I used an extremely scientific method of manually counting the number of crossed lines in the original diagram and got 15. This PR reduces that number down to about 10. I also changed the curve of the lines to "basis" which rounds the edges out. Again, not sure if it really is that much of an improvement, but it seems marginally easier on the eyes. Here is what the new graph looks like rendered: ![Screenshot from 2022-10-20 22-09-30](https://user-images.githubusercontent.com/1823216/197095545-5fc90cce-a817-4db2-a0f5-1a8a95380b70.png) The changes can be verified independently with [Mermaid](https://mermaid-js.github.io/mermaid/#/), with the easiest way being the online editor: https://mermaid.live/ I did try moving some more stuff around, particularly the top level of library callers, but was not able to simplify the graph any further. ACKs for top commit: shaavan: ACK 1184a66347afbaeca69e2d891a138e435fbfd5bb Tree-SHA512: 61d33d68c1e6fa354aebdda5e06e9c7a722ca20886c6acc30dd08af7133d737130d7a646d87f9e5a8ae0bc5a5aabfbc64ded9ee04dfeed8f23d948444add916b
2022-10-24Merge bitcoin/bitcoin#26302: refactor: Use type-safe time point for ↵fanquake
CWallet::m_next_resend fa51cc965110e14661c848364a29c493287673be refactor: Use type-safe time point for CWallet::m_next_resend (MacroFake) Pull request description: `GetTime` is not type-safe, thus deprecated, see https://github.com/bitcoin/bitcoin/blob/75cbbfa279685f70d9f6fa71432df00862ffa865/src/util/time.h#L62-L70 ACKs for top commit: shaavan: Code Review ACK fa51cc965110e14661c848364a29c493287673be aureleoules: ACK fa51cc965110e14661c848364a29c493287673be Tree-SHA512: 030de10070518580763ea75079442e2f934c54d3083be3ebe35e7f1bc6db2096745bb46d95aa1e6efe29ced30a048acfe5cd999178e6787b7647dfbec5ecb444
2022-10-23Update minisketch subtree to latest upstreamHennadii Stepanov
2022-10-23Squashed 'src/minisketch/' changes from 47f0a2d26f..a571ba20f9Hennadii Stepanov
a571ba20f9 Merge sipa/minisketch#68: Add missed `#include <string>` b9a7f7e2bc Merge sipa/minisketch#69: refactor: Drop unused `total` local variables 8a5af94edc Merge sipa/minisketch#70: build: Remove `-Qunused-arguments` workaround for clang + ccache c36f1f03a3 Merge sipa/minisketch#72: Fix MSVC implementation of `CountBits()` function 0078bedda6 Ignore `HAVE_CLZ` macro when building with MSVC 1c772918c4 Fix MSVC implementation of `CountBits()` function 98f87c55f4 build: Remove `-Qunused-arguments` workaround for clang + ccache 11a1e25c81 refactor: Drop unused `total` local variables ed6c8fcfd9 Add missed `#include <string>` git-subtree-dir: src/minisketch git-subtree-split: a571ba20f9dd1accab6a2309d066369878042ca6
2022-10-23build, msvc: Drop no longer required macro definitions for leveldbHennadii Stepanov
Since levedb v1.21: - the `__STDC_LIMIT_MACROS` macro definition is unneeded; commit: 50fbc87e8c62a816d6afd4740e0652a13ac6dc3e - the `LEVELDB_ATOMIC_PRESENT` macro is unused; commit: 04f39105c5a418905da8b7657ca244d672c99d3b
2022-10-21[net processing] Handle IsContinuationOfLowWorkHeadersSync return value ↵dergoegge
correctly when new headers sync is started
2022-10-21Merge bitcoin/bitcoin#26352: doc: add `scanblocks` to list of descriptor RPCsMacroFake
ff138f9cf11b94bdfa5b16d7d03af93e619842d8 doc: add `scanblocks` to list of descriptor RPCs (Sebastian Falbesoner) Pull request description: This is a tiny documentation follow-up to #23549. ACKs for top commit: aureleoules: ACK ff138f9cf11b94bdfa5b16d7d03af93e619842d8 shaavan: ACK ff138f9cf11b94bdfa5b16d7d03af93e619842d8 Tree-SHA512: cc45b78c13ec4aa5bac688648f8e83f04a9ae54376e67371b280428f0253e2585cf0575fa51e3835d4c13c940559bfcdd88d7504bf97a81b2a73bb34a0db7577
2022-10-21Merge bitcoin/bitcoin#26248: net: Set relay in version msg to peers with ↵MacroFake
relay permission in -blocksonly mode dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247 net: Set relay in version msg to peers with relay permission (MacroFake) Pull request description: Seems odd to set the `relay` permission in -blocksonly mode and also ask the peer not to relay transactions. ACKs for top commit: dergoegge: ACK dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247 naumenkogs: ACK https://github.com/bitcoin/bitcoin/commit/dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247 mzumsande: ACK dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247 Tree-SHA512: 7bb0e964993ea4982747ae2801fe963ff88586e2ded03015b60ab83172b5b61f2d50e9cde9d7711b7ab207f8639467ecafc4d011ea151ec6c82c722f510f4df7
2022-10-21build: remove threadinterrupt from libbitcoinkernelfanquake