aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-04chainparams: Change nChainTx to uint64_tFabian Jahr
Also update types of assumeutxo chainparams and some related local variables for consistency. Co-authored-by: russeree <reese.russell@ymail.com>
2024-08-04refactor: remove un-tested early returnsjosibake
Replace early returns in KeyPair::KeyPair() with asserts. The if statements imply there is an error we are handling, but keypair_xonly_pub and xonly_pubkey_serialize can only fail if the keypair object is malformed, i.e., it was created with a bad secret key. Since we check that the keypair was created successfully before attempting to extract the public key, using asserts more accurately documents what we expect here and removes untested branches from the code.
2024-08-04tests: add tests for KeyPairjosibake
Reuse existing BIP340 tests, as there should be no behavior change between the two
2024-08-04refactor: move SignSchnorr to KeyPairjosibake
Move `SignSchnorr` to `KeyPair`. This makes `CKey::SignSchnorr` now compute a `KeyPair` object and then call `KeyPair::SignSchorr`. The notable changes are: * Move the merkle_root tweaking out of the sign function and into the KeyPair constructor * Remove the temporary secp256k1_keypair object and have the functions access m_keypair->data() directly
2024-08-04logging: clarify -debug and -debugexclude descriptionsAnthony Towns
2024-08-04rpc: make logging method reject "0" category and correct the help textVasil Dimov
Current logging RPC method documentation claims to accept "0" and "none" categories, but the "none" argument is actually rejected and the "0" argument is ignored. Update the implementation to refuse both categories, and remove the help text claiming to support them.
2024-08-04logging, refactor: minor encapsulation improvement and use BCLog::NONE ↵Vasil Dimov
instead of 0 * Make the standalone function `LogCategoryToStr()` private inside `logging.cpp` (aka `static`) - it is only used in that file. * Make the method `Logger::GetLogPrefix()` `private` - it is only used within the class. * Use `BCLog::NONE` to initialize `m_categories` instead of `0`. We later check whether it is `BCLog::NONE` (in `Logger::DefaultShrinkDebugFile()`).
2024-08-04logging, refactor: make category special cases explicitRyan Ofsky
Make special cases explicit in GetLogCategory() and LogCategoryToStr() functions. Simplify the LOG_CATEGORIES_BY_STR and LOG_CATEGORIES_BY_FLAG mappings and LogCategoriesList() function. This makes the maps `LOG_CATEGORIES_BY_STR` and `LOG_CATEGORIES_BY_FLAG` consistent (one is exactly the opposite of the other).
2024-08-03doc + test: Correct uint256 hex string endiannessHodlinator
Follow-up to #30436. uint256 string representation was wrongfully documented as little-endian due to them being reversed by GetHex() etc, and base_blob::Compare() giving most significance to the beginning of the internal array. They are closer to "big-endian", but this commit tries to be even more precise than that. uint256_tests.cpp - Avoid using variable from the left side of the condition in the right side. setup_common.cpp - Skip needless ArithToUint256-conversion.
2024-08-03doc: Add missed cmake package to build dependsHennadii Stepanov
2024-08-03crypto: add KeyPair wrapper classjosibake
Add a `KeyPair` class which wraps the `secp256k1_keypair`. This keeps the secret data in secure memory and enables passing the `KeyPair` object directly to libsecp256k1 functions expecting a `secp256k1_keypair`. Motivation: when passing `CKeys` for taproot outputs to libsecp256k1 functions, the first step is to create a `secp256k1_keypair` data type and use that instead. This is so the libsecp256k1 function can determine if the key needs to be negated, e.g., when signing. This is a bit clunky in that it creates an extra step when using a `CKey` for a taproot output and also involves copying the secret data into a temporary object, which the caller must then take care to cleanse. In addition, the logic for applying the merkle_root tweak currently only exists in the `SignSchnorr` function. In a later commit, we will add the merkle_root tweaking logic to this function, which will make the merkle_root logic reusable outside of signing by using the `KeyPair` class directly. Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2024-08-03tests: add key tweak smoke testjosibake
Sanity check that using CKey/CPubKey directly vs using secp256k1_keypair objects returns the same results for BIP341 key tweaking. Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2024-08-03bench: add benchmark for signing with a taptweakjosibake
Add benchmarks for signing with null and non-null merkle_root arguments. Null and non-null merkle_root arguments will apply the taptweaks H_TapTweak(P) and H_TapTweak(P | merkle_root), respectively, to the private key during signing. This benchmark is added to verify there are no significant performance changes after moving the taptweak signing logic in a later commit. Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2024-08-03doc: Add note about distro's g++-mingw-w64-x86-64-posix versionHennadii Stepanov
This stems from a requirement for the g++ minimum supported version being >= 11.
2024-08-02policy: enable full-rbf by defaultPeter Todd
Enable full rbf (mempool policy) by default and update tests accordingly.
2024-08-02doc: add release notes for full-rbfPeter Todd
2024-08-02test: check that keyless P2A 'signing' via `signrawtransactionwithkey` succeedsSebastian Falbesoner
2024-08-02test: check that P2A with witness data is still consensus-legalGreg Sanders
2024-08-02test: P2A is a destination type with an addressGreg Sanders
2024-08-02gui, qt: brintToFront workaround for Waylandpablomartin4btc
2024-08-02Merge bitcoin/bitcoin#30352: policy: Add PayToAnchor(P2A), `OP_1 <0x4e73>` ↵glozow
as a standard output script for spending 75648cea5a9032b3d388cbebacb94d908e08924e test: add P2A ProduceSignature coverage (Greg Sanders) 7998ce6b20fba62c022228355907b612ba6692e1 Add release note for P2A output feature (Greg Sanders) 71c9b02a04742eeecab14aae4697b1a3eb51ff7f test: add P2A coverage for decodescript (Greg Sanders) 1349e9ec1558484f2912a2444c410170fcec8745 test: Add anchor mempool acceptance test (Greg Sanders) 9d892099378b2ad5f52220403bdeae43c61d6955 policy: stop 3rd party wtxid malleability of anchor spend (Greg Sanders) b60aaf8b239978947d2b0e3f56e7d8a4092d7570 policy: make anchor spend standard (Greg Sanders) 455fca86cfada1823aa28615b5683f9dc73dbb9a policy: Add OP_1 <0x4e73> as a standard output type (Greg Sanders) Pull request description: This is a sub-feature taken out of the original proposal for ephemeral anchors #30239 This PR makes *spending* of `OP_1 <0x4e73>` (i.e. `bc1pfeessrawgf`) standard. Creation of this output type is already standard. Any future witness output types are considered relay-standard to create, but not to spend. This preserves upgrade hooks, such as a completely new output type for a softfork such as BIP341. It also gives us a bit of room to use a new output type for policy uses. This particular sized witness program has no other known use-cases (https://bitcoin.stackexchange.com/a/110664/17078), s it affords insufficient cryptographic security for a secure commitment to data, such as a script or a public key. This makes this type of output "keyless", or unauthenticated. As a witness program, the `scriptSig` of the input MUST be blank, by BIP141. This helps ensure txid-stability of the spending transaction, which may be required for smart contracting wallets. If we do not use segwit, a miner can simply insert an `OP_NOP` in the `scriptSig` without effecting the result of program execution. An additional relay restriction is to disallow non-empty witness data, which an adversary may use to penalize the "honest" transactor when RBF'ing the transaction due to the incremental fee requirement of RBF rules. The intended use-case for this output type is to "anchor" the transaction with a spending child to bring exogenous CPFP fees into the transaction package, encouraging the inclusion of the package in a block. The minimal size of creation and spending of this output makes it an attractive contrast to outputs like `p2sh(OP_TRUE)` and `p2wsh(OP_TRUE)` which are significantly larger in vbyte terms. Combined with TRUC transactions which limits the size of child transactions significantly, this is an attractive option for presigned transactions that need to be fee-bumped after the fact. ACKs for top commit: sdaftuar: utACK 75648cea5a9032b3d388cbebacb94d908e08924e theStack: re-ACK 75648cea5a9032b3d388cbebacb94d908e08924e ismaelsadeeq: re-ACK 75648cea5a9032b3d388cbebacb94d908e08924e via [diff](https://github.com/bitcoin/bitcoin/compare/e7ce6dc070c0319cbb868d41cadd836b2e6ca9db..75648cea5a9032b3d388cbebacb94d908e08924e) glozow: ACK 75648cea5a9032b3d388cbebacb94d908e08924e tdb3: ACK 75648cea5a9032b3d388cbebacb94d908e08924e Tree-SHA512: d529de23d20857e6cdb40fa611d0446b49989eaafed06c28280e8fd1897f1ed8d89a4eabbec1bbf8df3d319910066c3dbbba5a70a87ff0b2967d5205db32ad1e
2024-08-02[rpc, fees]: add more detail on the fee estimation modesismaelsadeeq
- Add description that indicates the fee estimation modes behaviour. - This description will be returned in the RPC's help texts.
2024-08-02[doc]: add `30275` release notesismaelsadeeq
2024-08-02Merge bitcoin-core/gui#626: Showing Local Addresses in Node WindowHennadii Stepanov
189c987386a0da132d7ef076cdf539f9eb75fc3c Showing local addresses on the Node Window (Jadi) a5d7aff867a3df9ac77664deed03e930e2636db0 net: Providing an interface for mapLocalHost (Jadi) Pull request description: This change adds a new row to the Node Window (debugwindow.ui) under the Network section which shows the LocalAddresses. fixes #564 <!-- *** Please remove the following help text before submitting: *** Pull requests without a rationale and clear improvement may be closed immediately. GUI-related pull requests should be opened against https://github.com/bitcoin-core/gui first. See CONTRIBUTING.md --> <!-- Please provide clear motivation for your patch and explain how it improves Bitcoin Core user experience or Bitcoin Core developer experience significantly: * Any test improvements or new tests that improve coverage are always welcome. * All other changes should have accompanying unit tests (see `src/test/`) or functional tests (see `test/`). Contributors should note which tests cover modified code. If no tests exist for a region of modified code, new tests should accompany the change. * Bug fixes are most welcome when they come with steps to reproduce or an explanation of the potential issue as well as reasoning for the way the bug was fixed. * Features are welcome, but might be rejected due to design or scope issues. If a feature is based on a lot of dependencies, contributors should first consider building the system outside of Bitcoin Core, if possible. * Refactoring changes are only accepted if they are required for a feature or bug fix or otherwise improve developer experience significantly. For example, most "code style" refactoring changes require a thorough explanation why they are useful, what downsides they have and why they *significantly* improve developer experience or avoid serious programming bugs. Note that code style is often a subjective matter. Unless they are explicitly mentioned to be preferred in the [developer notes](/doc/developer-notes.md), stylistic code changes are usually rejected. --> <!-- Bitcoin Core has a thorough review process and even the most trivial change needs to pass a lot of eyes and requires non-zero or even substantial time effort to review. There is a huge lack of active reviewers on the project, so patches often sit for a long time. --> ACKs for top commit: pablomartin4btc: re-ACK 189c987386a0da132d7ef076cdf539f9eb75fc3c furszy: utACK 189c987 Tree-SHA512: 93f201bc6d21d81b27b87be050a447b841f01e3efb69b9eca2cc7af103023d7cd69eb5e16e2875855573ef51a5bf74a6ee6028636c1b6798cb4bb11567cb4996
2024-08-02Merge bitcoin/bitcoin#30554: test: Avoid CScript() as default function argumentmerge-script
fa46a1b74bd35371036af17b2df2036dbc993ce1 test: Avoid CScript() as default function argument (MarcoFalke) fadf621825fdbf5fd131da14419bb19bb81e5801 test: Make leaf_script mandatory when scriptpath is set in TaprootSignatureMsg (MarcoFalke) Pull request description: Unlike other function calls in default arguments, CScript should not cause any issues in the tests, because they are const. However, this change allows to enable the "function-call-in-default-argument (B008)" lint rule, which will help to catch severe test bugs, such as https://github.com/bitcoin/bitcoin/issues/30543#issuecomment-2259260024 . The lint rule will be enabled in a follow-up, when all violations are fixed. ACKs for top commit: instagibbs: utACK fa46a1b74bd35371036af17b2df2036dbc993ce1 theStack: lgtm ACK fa46a1b74bd35371036af17b2df2036dbc993ce1 ismaelsadeeq: Tested ACK fa46a1b74bd35371036af17b2df2036dbc993ce1 Tree-SHA512: bc68b15121d50ead0fc70ad772360a7829908aedeaff8426efcb8a67f33117f67d26b4f5da94fa735dd8de9c9ff65fc10a29323f1b12f238b75486fa7cc32a89
2024-08-02fuzz: fix timeout in crypter targetbrunoerg
Move `SetKeyFromPassphrase` to out of LIMITED_WHILE, remove `SetKey` calls since it is already called internally by other functions and reduce the number of iterations.
2024-08-02Merge bitcoin/bitcoin#30574: test: Disable known broken USDT test for nowmerge-script
faed5337435f025811caeb5f782ecbf9683a24b3 test: Disable known broken USDT test for now (MarcoFalke) Pull request description: (cherry picked from commit faf8be7c32be00f660eba90d3f07313fb25d5d1c) Sadly, it still happens: https://github.com/bitcoin/bitcoin/issues/27380#issuecomment-2265205214 ACKs for top commit: fanquake: ACK faed5337435f025811caeb5f782ecbf9683a24b3 Tree-SHA512: 7108c468efd31a1f062646b7b21d69ddaaa9808cdc44db75c78d7a840830f85d016d4a95571c239402f0b6639b714224720182bcda8f53b147a0be06cfbd2b25
2024-08-02test: Disable known broken USDT test for nowMarcoFalke
(cherry picked from commit faf8be7c32be00f660eba90d3f07313fb25d5d1c)
2024-08-02Revert "build: pass --with-ecmult-gen-kb=86 to secp256k1"fanquake
This reverts commit a057869aa3c42457570765966cb66accb2375b13.
2024-08-02Update secp256k1 subtree to latest masterfanquake
2024-08-02Squashed 'src/secp256k1/' changes from 4af241b320..642c885b61fanquake
642c885b61 Merge bitcoin-core/secp256k1#1575: release: prepare for 0.5.1 cdf08c1a2b Merge bitcoin-core/secp256k1#1576: doc: mention `needs-changelog` github label in release process 40d87b8e45 release: prepare for 0.5.1 5770226176 changelog: clarify CMake option 759bd4bbc8 doc: mention `needs-changelog` github label in release process fded437c4c Merge bitcoin-core/secp256k1#1574: Fix compilation when extrakeys module isn't enabled 763d938cf0 ci: only enable extrakeys module when schnorrsig is enabled af551ab9db tests: do not use functions from extrakeys module 0055b86780 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example ea2d5f0f17 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults ca06e58b2c Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing e2af491263 ci: Switch to the new default value of the precomputed table for signing d94a9273f8 build: Adjust the default size of the precomputed table for signing fcc5d7381b Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16 9420eece24 cmake: Bump CMake minimum required version up to 3.16 16685649d2 doc: Add convention for defaults a5269373fa Merge bitcoin-core/secp256k1#1555: Fixed O3 replacement b8fe33332b cmake: Fixed O3 replacement 31f84595c4 Add ellswift usage example fe4fbaa7f3 examples: fix case typos in secret clearing paragraphs (s/, Or/, or/) git-subtree-dir: src/secp256k1 git-subtree-split: 642c885b6102725e25623738529895a95addc4f4
2024-08-02Merge bitcoin/bitcoin#30567: qt, build: Drop `QT_STATICPLUGIN` macromerge-script
7231c7630e61c062440459963f7b00ccbec68f0f qt: Replace deprecated LogPrintf with LogInfo in GUIUtil::LogQtInfo() (Hennadii Stepanov) b3d3ae0680e7529853413de045aa9fbd7ac51e5c qt, build: Drop `QT_STATICPLUGIN` macro (Hennadii Stepanov) Pull request description: Broken out of https://github.com/bitcoin/bitcoin/pull/30454. Our `QT_STATICPLUGIN` macro is effectively equivalent to the Qt's `QT_STATIC` macro. It is easy to see in the `_BITCOIN_QT_IS_STATIC` macro implementation: https://github.com/bitcoin/bitcoin/blob/ebd82fa9fae13d5a7a395800295dd7fd34185b58/build-aux/m4/bitcoin_qt.m4#L269-L292 No need to handle both macros. ACKs for top commit: maflcko: re-ACK 7231c7630e61c062440459963f7b00ccbec68f0f TheCharlatan: ACK 7231c7630e61c062440459963f7b00ccbec68f0f Tree-SHA512: abbf21859b7ac2aaf47c5b0e075403e4cc9bc540b1565d23f51650b8932dde314586aca67fd4ed5daadebc89268baf8c18f65348fa2b836078ac24543c14cfd6
2024-08-02Merge bitcoin/bitcoin#30544: rpc: fix maybe-uninitialized compile warning in ↵merge-script
getchaintxstats 2e86f2b2019ea0edbd89dd3fd13540c5bbfa104d rpc: fix maybe-uninitialized compile warning in getchaintxstats (Michael Dietz) Pull request description: This resolves the compiler warning about potential uninitialized use of window_tx_count introduced in fa2dada. The warning: ``` CXX rpc/libbitcoin_node_a-blockchain.o rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const JSONRPCRequest&)>’: rpc/blockchain.cpp:1742:38: warning: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1742 | ret.pushKV("txrate", double(*window_tx_count) / nTimeDiff); | ``` ACKs for top commit: maflcko: lgtm ACK 2e86f2b2019ea0edbd89dd3fd13540c5bbfa104d theStack: ACK 2e86f2b2019ea0edbd89dd3fd13540c5bbfa104d tdb3: ACK 2e86f2b2019ea0edbd89dd3fd13540c5bbfa104d Tree-SHA512: c087e8f1cd68dd8df734a8400d30a95abe57ebd56cd53aef4230e425b33a23aa55b3af42abfd162e3be8c937a4c27e56abb70a4fedb10e2df64d52d577e0f262
2024-08-02doc: tor.md: use -bind=127.0.0.1:8334=onion for the Tor bindDavid Gumberg
After https://github.com/bitcoin/bitcoin/pull/22729 if `-bind=127.0.0.1` is used, then bitcoind will not automatically also bind on `127.0.0.1:8334`.
2024-08-02Showing local addresses on the Node WindowJadi
Adds a new row to the Node Window (debugwindow.ui) under the Network section which shows the LocalAddresses. fixes #564
2024-08-02net: Providing an interface for mapLocalHostJadi
Contributes to #564 by providing an interface for mapLocalHost through net -> node interface -> clientModel. Later this value can be read by GUI to show the local addresses.
2024-08-02coins: call ClearFlags in CCoinsCacheEntry destructorAndrew Toth
No behavior change. Prepares for flags adding CCoinsCacheEntrys to a linked list which need to be removed on destruction.
2024-08-02refactor: require self and sentinel parameters for AddFlagsAndrew Toth
No behavior change. Prepares for adding the CoinsCachePairs to a linked list when flagged.
2024-08-01refactor: add CoinsCachePair aliasAndrew Toth
2024-08-01refactor: move flags to private uint8_t and rename to m_flagsAndrew Toth
No behavior change. This prepares to add CCoinsCacheEntrys to a doubly linked list when a flag is added.
2024-08-01refactor: disallow setting flags in CCoinsCacheEntry constructorsAndrew Toth
No behavior change because any entries that are added in EmplaceCoinInternalDANGER have DIRTY assigned to them after, and if they are not inserted then they will not be modified as before. This prepares moving the cache entry flags field to private access. Co-Authored-By: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
2024-08-01refactor: encapsulate flags setting with AddFlags and ClearFlagsAndrew Toth
No behavior change. This prepares moving the cache entry flags field to private access.
2024-08-01refactor: encapsulate flags get access for all other checksAndrew Toth
No behavior change. This prepares moving the cache entry flags field to private access.
2024-08-01refactor: encapsulate flags access for dirty and fresh checksAndrew Toth
No behavior change. This prepares moving the cache entry flags field to private access. Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2024-08-01clusterlin: improve rechunking in LinearizationChunking (optimization)Pieter Wuille
When the transactions being marked done exactly match the first chunk of what remains of the linearization, we can just remember to skip that chunk instead of computing a full rechunking. Further, chop off prefixes of the input linearization that are already done, so they don't need to be reconsidered for further rechunkings.
2024-08-01clusterlin: add MergeLinearizations function + fuzz test + benchmarkPieter Wuille
2024-08-01clusterlin: add PostLinearize + benchmarks + fuzz testsPieter Wuille
2024-08-01clusterlin: add algorithms for connectedness/connected componentsPieter Wuille
Add utility functions to DepGraph for finding connected components.
2024-08-01clusterlin: rename Intersect -> IntersectPrefixesPieter Wuille
This makes it clearer what the function does.
2024-08-01Merge bitcoin/bitcoin#30548: release: Update translations for v28.0 soft ↵Hennadii Stepanov
translation string freeze be419674da66e9c349c9c35246c20a7b9fda2dd0 qt: Update translation source file (Hennadii Stepanov) e49d858aab9bfae2455d87226d9ebebbdf2c40c8 qt: Bump Transifex slug for 28.x (Hennadii Stepanov) 31b33019b7fe0c81ab1cfe0eeee03c3193de3f17 qt: Pull recent translations from Transifex (Hennadii Stepanov) Pull request description: This PR follows our [Release Process](https://github.com/bitcoin/bitcoin/blob/4c62f4b53561bce5b2eb8639cdc24d284be537eb/doc/release-process.md). Note: (possible) vandalism/damage has been prevented by reverting the deletion of `bitcoin_af`, `bitcoin_es_MX`, and `bitcoin_ru` translations. Required to open Transifex translations for v28.0 as it's scheduled in https://github.com/bitcoin/bitcoin/issues/29891. The previous similar PR: https://github.com/bitcoin/bitcoin/pull/29397. ACKs for top commit: stickies-v: ACK be419674da66e9c349c9c35246c20a7b9fda2dd0 Tree-SHA512: 76f7947af9c156c2aaf24c7f926f82e4d8e2664beb5ebde5c7cda8dd7a8dbf672b4a886302c8d189e0cb2145c0ed755f45f9cdb545e29d38bb1ec90ca18fa539