aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-14Clean up things that include script/standard.hAndrew Chow
Remove standard.h from files that don't use anything in it, and include it in files that do.
2023-08-14MOVEONLY: Move datacarrier defaults to policy.hAndrew Chow
2023-08-14Move CTxDestination to its own fileAndrew Chow
CTxDestination is really our internal representation of an address and doesn't really have anything to do with standard script types, so move them to their own file.
2023-08-14Move Taproot{SpendData/Builder} to signingprovider.{h/cpp}Andrew Chow
TaprootSpendData and TaprootBuilder are used in signing in SigningProvider contexts, so they should live near that.
2023-08-14Move CScriptID to script.{h/cpp}Andrew Chow
CScriptID should be next to CScript just as CKeyID is next to CPubKey
2023-08-14Remove ScriptHash from CScriptID constructorAndrew Chow
Replaces the constructor in CScriptID that converts a ScriptHash with a function ToScriptID that does the same. This prepares for a move of CScriptID to avoid a circular dependency.
2023-08-14Move MANDATORY_SCRIPT_VERIFY_FLAGS from script/standard.h to policy/policy.hAnthony Towns
2023-08-14ci: Drop no longer needed `macos_sdk_cache`Hennadii Stepanov
It has been cached in the Docker image since https://github.com/bitcoin/bitcoin/pull/27028.
2023-08-14Merge bitcoin/bitcoin#28232: test: locked_wallet, skip default fee estimationfanquake
5364dd8666ae1afa35536f9b4fc0170eeaf37888 test: locked_wallet, skip default fee estimation (furszy) Pull request description: Coming from https://github.com/bitcoin/bitcoin/pull/28139#discussion_r1284563239. No test case in this file is meant to exercise fee estimation. All default wallets have a custom tx fee set [here](https://github.com/bitcoin/bitcoin/blob/b7138252ace6d21476964774e094ed1143cd7a1c/test/functional/wallet_fundrawtransaction.py#L100). The only one missing is the one created for `locked_wallet`. ACKs for top commit: theStack: ACK 5364dd8666ae1afa35536f9b4fc0170eeaf37888 Tree-SHA512: 514c02708081d18330d759d10e306cee16c6350de243c68f0973777d2582f5d81968a237393c1f59aba245297e03f3f98d3ae5249a042469d0d016255f568719
2023-08-14[functional test] transaction orphan handlingglozow
2023-08-14[test framework] make it easier to fast-forward setmocktimeglozow
Have each TestNode keep track of the last timestamp it called setmocktime with, and add a bumpmocktime() function to bump by a number of seconds. Makes it easy to fast forward n seconds without keeping track of what the last timestamp was.
2023-08-14Merge bitcoin/bitcoin#28258: bitcoin-tidy: fix macOS buildfanquake
bb3263d3e3d9f9d4db86dde679f469e7278bf737 bitcoin-tidy: fix macOS build (Cory Fields) Pull request description: [LLVM uses these options](https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/HandleLLVMOptions.cmake#L178) for building as well, so there's precedent. Also fix the shared library extension which was incorrectly being set to dylib. Thanks to jonatack for reporting and debugging. ACKs for top commit: jonatack: ACK bb3263d3e3d9f9d4db86dde679f469e7278bf737 tested with arm64 macos 13.5, llvm 16.0.6 and cmake 3.27.2 Tree-SHA512: de7bfd497f38f1565a14d217d0b057cbfa788bdda702b5942b7f0b55947ae5e1c05af13e7d6a073ed036bc4db57035868f180034508b6e084ab9b901a5baaf2f
2023-08-14crypto: BIP324 ciphersuite follow-upstratospher
follow-up to #28008. * move `dummy_tag` variable in FSChaCha20Poly1305 crypto_tests outside of the loop to be reused every time * use easy to read `cipher.last()` in `AEADChaCha20Poly1305::Decrypt()` * comment for initiator in `BIP324Cipher::Initialize()` * systematically damage ciphertext with bit positions in bip324_tests * use 4095 max bytes for aad in bip324 fuzz test
2023-08-13gui: make '-min' minimize wallet loading dialogfurszy
When '-min' is enabled, no loading dialog should be presented on screen during startup.
2023-08-11test: check backup from `migratewallet` can be successfully restoredbrunoerg
2023-08-11fuzz: coins_view: remove an incorrect assertionAntoine Poinsot
Again, this was not hit because the default implementation of `CCoinsView` return `false` for `GetCoin`.
2023-08-11Merge bitcoin/bitcoin#28245: doc: use llvm-config for bitcoin-tidy examplefanquake
d82bb90a5b9dc1fd48b10514bdcd8f425aced256 doc: use llvm-config for bitcoin-tidy example (fanquake) Pull request description: An LLVM installation will have `llvm-config` available to query for info. Ask it for the `--cmakedir`, and use that in our bitcoin-tidy example, rather than listing multiple different (potential) paths per distro/OS etc. ACKs for top commit: theuni: ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256. jonatack: ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256 TheCharlatan: Nice, Re-ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256 Tree-SHA512: e07e979231f8f000deafce0751bed4b73ff0eff995bec49e90f579c9051cf5859dac5e49554b8219d33b00c81192db979eed98fee1c643a9205ea8babfce2c5d
2023-08-10bitcoin-tidy: fix macOS buildCory Fields
LLVM uses these options for building as well, so there's precedent. Also fix the shared library extension which was incorrectly being set to dylib
2023-08-10test: wallet, verify migration doesn't crash for an invalid scriptfurszy
The migration process must skip any invalid script inside the legacy spkm and all the addressbook records linked to them. These scripts are not being watched by the current wallet, nor should be watched by the migrated one. IsMine() returns ISMINE_NO for them.
2023-08-10wallet: disallow migration of invalid or not-watched scriptsfurszy
The legacy wallet allowed to import any raw script, without checking if it was valid or not. Appending it to the watch-only set. This causes a crash in the migration process because we are only expecting to find valid scripts inside the legacy spkm. These stored scripts internally map to `ISMINE_NO` (same as if they weren't stored at all..). So we need to check for these special case, and take into account that the legacy spkm could be storing invalid not watched scripts. Which, in code words, means IsMineInner() returning IsMineResult::INVALID for them.
2023-08-10test: locked_wallet, skip default fee estimationfurszy
Same as we do with the nodes default wallets. No test case on this file is meant to exercise fee estimation.
2023-08-10doc: use llvm-config for bitcoin-tidy examplefanquake
An LLVM installation will have `llvm-config` available to query for info. Ask it for the `--cmakedir`, and use that in our bitcoin-tidy example, rather than listing multiple different (potential) paths per distro/OS etc.
2023-08-10Merge bitcoin/bitcoin#28008: BIP324 ciphersuitefanquake
1c7582ead6e1119899922041c1af2b4169b0bc74 tests: add decryption test to bip324_tests (Pieter Wuille) 990f0f8da92a2d11828a7c05ca93bf0520b2a95e Add BIP324Cipher, encapsulating key agreement, derivation, and stream/AEAD ciphers (Pieter Wuille) c91cedf281e5207fb5fd2ca81feec9760f7c2ed0 crypto: support split plaintext in ChaCha20Poly1305 Encrypt/Decrypt (Pieter Wuille) af2b44c76e5de8ce880381e5535ead37ab0b3ba9 bench: add benchmark for FSChaCha20Poly1305 (Pieter Wuille) aa8cee93342ee857931afec9af3ff5dbd8ce7749 crypto: add FSChaCha20Poly1305, rekeying wrapper around ChaCha20Poly1305 (Pieter Wuille) 0fee267792eb8cbdd48ad78f1712420b5d8d905b crypto: add FSChaCha20, a rekeying wrapper around ChaCha20 (Pieter Wuille) 9ff0768bdcca06836ccc673eacfa648e801930cb crypto: add the ChaCha20Poly1305 AEAD as specified in RFC8439 (Pieter Wuille) 9fd085a1a49d317abcaf1492b71c48bf1a1b3007 crypto: remove outdated variant of ChaCha20Poly1305 AEAD (Pieter Wuille) Pull request description: Depends on #27985 and #27993, based on and partially replaces #25361, part of #27634. Draft while dependencies are not merged. This adds implementations of: * The ChaCha20Poly1305 AEAD from [RFC8439 section 2.8](https://datatracker.ietf.org/doc/html/rfc8439#section-2.8), including test vectors. * The FSChaCha20 stream cipher as specified in [BIP324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki#rekeying-wrappers-fschacha20poly1305-and-fschacha20), a rekeying wrapper around ChaCha20. * The FSChaCha20Poly1305 AEAD as specified in [BIP324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki#rekeying-wrappers-fschacha20poly1305-and-fschacha20), a rekeying wrapper around ChaCha20Poly1305. * A BIP324Cipher class that encapsulates key agreement, key derivation, and stream ciphers and AEADs for [BIP324 packet encoding](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki#overall-packet-encryption-and-decryption-pseudocode). The ChaCha20Poly1305 and FSChaCha20Poly1305 implementations are new, taking advance of the improvements in #27993. ACKs for top commit: jamesob: reACK 1c7582e theStack: ACK 1c7582ead6e1119899922041c1af2b4169b0bc74 stratospher: tested ACK 1c7582e. Tree-SHA512: 06728b4b95b21c5b732ed08faf40e94d0583f9d86ff4db3b92dd519dcd9fbfa0f310bc66ef1e59c9e49dd844ba8c5ac06e2001762a804fb5aa97027816045a46
2023-08-10doc: Improve documentation of rpcallowip rpchelpwillcl-ark
Closes #21070 v21.0 introduced a behaviour changed noted in #21070 where using a config value `rpcallowip=::0` no longer also permitted ipv4 ip addresses. The rpc_bind.py functional test covers this new behaviour already by checking that the list of bind addresses exactly matches what is expected so this commit only updates the documentation.
2023-08-09Merge bitcoin/bitcoin#28189: doc: diversify network outbounds release notefanquake
7463d259e14676846f0b43e2b5f2af3faf688cb4 doc: Add release note (Amiti Uttarwar) Pull request description: release notes for #27213 ACKs for top commit: mzumsande: ACK 7463d259e14676846f0b43e2b5f2af3faf688cb4 Tree-SHA512: 16c479774ed9242d8d044d08cc919550ccd07020423a3dcd99f07dad36e4dafd8243dc47f9f7f0c8eedcb53efd85ec65afedba56422452f637d313ec7c901520
2023-08-09Merge bitcoin/bitcoin#28149: net processing: clamp PeerManager::Options user ↵glozow
input 547fa52443cbb5e8ccfee993486f5ced8cdbb33b net processing: clamp -blockreconstructionextratxn to uint32_t bounds (stickies-v) e451d1e3c66350017da195335f428a96fdc7d840 net processing: clamp -maxorphantx to uint32_t bounds (stickies-v) aa89e04e07ca9ff51b1d7d310a11821c6ad963cf doc: document PeerManager::Options members (stickies-v) Pull request description: Avoid out-of-bounds user input for `PeerManager::Options` by safely clamping `-maxorphantx` and `-blockreconstructionextratxn`, and avoid platform-specific behaviour by changing `PeerManager::Options::max_extra_txs` from `size_t` to a `uint32_t`. Addresses https://github.com/bitcoin/bitcoin/pull/27499#pullrequestreview-1544114932. Also documents all `PeerManager::Options` members, addressing https://github.com/bitcoin/bitcoin/pull/27499#discussion_r1272302469. ACKs for top commit: dergoegge: Code review ACK 547fa52443cbb5e8ccfee993486f5ced8cdbb33b glozow: reACK 547fa52443cbb5e8ccfee993486f5ced8cdbb33b Tree-SHA512: 042d47b35bb8a7b29ef3dadd4c0c5d26f13a8f174f33687855d603c19f8de0fcbbda94418453331e149885412d4edd5f402d640d938f6d94b4dcf54e2fdbbcc9
2023-08-09ci: Move tidy to persistent workerMarcoFalke
2023-08-09ci: Use hard-coded root path for CI containersMarcoFalke
2023-08-09ci: Only create folders when neededMarcoFalke
Now that container volumes are used, the folders are no longer mounted. They are only needed when running without a container engine (docker, podman).
2023-08-09ci: Drop BASE_SCRATCH_DIR from LIBCXX_DIRMarcoFalke
Using a hard-coded path avoids non-determinism issues and improves CI UX.
2023-08-09Merge bitcoin/bitcoin#28087: ci: Use qemu-user through container enginefanquake
fad0b67c212dcb8a16fcbda5a74acc959ed4e284 ci: Use qemu-user through container engine (MarcoFalke) Pull request description: Currently the CI containers always run on the host architecture, and only wrap `bitcoind` into `qemu-user` when needed. This has many issues: * The `i386` tasks can not be run on non-x86 hosts. * `config.guess` isn't present when building the CI image, which is fine. But it prints a warning, see https://github.com/bitcoin/bitcoin/pull/27739#pullrequestreview-1446580353 * The python tests are run on the host architecture, making it harder to find architecture specific bugs. See for example https://github.com/bitcoin/bitcoin/pull/27529#issuecomment-1521387810 * All modern container engines support automatic dispatch to qemu-user, so it seems redundant to re-invent the wheel. Fix all issues by: * removing `HOST` from `ci/test/00_setup_env.sh`. * removing `QEMU_USER_CMD` and `ci/test/wrap-qemu.sh`. * removing `DPKG_ADD_ARCH` where possible, and pruning `PACKAGES` where possible. * specifying the architecture in `CI_IMAGE_NAME_TAG` to be used by the container engine. ACKs for top commit: fanquake: ACK fad0b67c212dcb8a16fcbda5a74acc959ed4e284 - this seems ok to me, and removes complexity from our CI system. Tree-SHA512: 85e79f9f570e292d70a629d112fd4a6e6217d96226a1b665ed13485f616d84720ad2126b7d4b22fc603049f72fa7f2163b56a6bc276319fcd8b0496304ea4157
2023-08-09ci: Run "macOS native x86_64" job on GitHub ActionsHennadii Stepanov
Also, the "macOS native arm64" task has been removed from Cirrus CI.
2023-08-08Sort includes in compat.hMarcoFalke
Can be reviewed with: --color-moved=blocks --color-moved-ws=ignore-all-space --ignore-all-space
2023-08-08remove unused limits.h include in compat.hMarcoFalke
2023-08-08Replace LocaleIndependentAtoi with ToIntegralMarcoFalke
No need for saturating behavior when the int is composed of 3 digits.
2023-08-08iwyu on torcontrolMarcoFalke
2023-08-08Remove unused boost signals2 from torcontrolMarcoFalke
2023-08-08refactor: Enforce C-str fmt strings in WalletLogPrintf()MarcoFalke
2023-08-08doc: Fix bitcoin-unterminated-logprintf tidy commentsMarcoFalke
* Move module description from test to LogPrintfCheck * Add test doc * Remove unused comment, see https://github.com/bitcoin/bitcoin/pull/26296/files#r1279351539
2023-08-07Merge bitcoin/bitcoin#28186: kernel: Prune leveldb headersfanquake
d8f1222ac50f089a0af29eaf8ce0555bad8366ef refactor: Correct dbwrapper key naming (TheCharlatan) be8f159ac59b9e700cbd3314ed71ebf39bd5b67a build: Remove leveldb from BITCOIN_INCLUDES (TheCharlatan) c95b37d641b1eed4a62d55ca5342a6ed8c7a1ce7 refactor: Move CDBWrapper leveldb members to their own context struct (TheCharlatan) c534a615e93452a5f509aaf5f68c600391a98d6a refactor: Split dbwrapper CDBWrapper::EstimateSize implementation (TheCharlatan) 586448888b72f7c87db4dcd30fc4e4044afae13b refactor: Move HandleError to dbwrapper implementation (TheCharlatan) dede0eef7adb7413f62f5abd68cac8e01635ba4a refactor: Split dbwrapper CDBWrapper::Exists implementation (TheCharlatan) a5c2eb57484314b04ec94523d14e0ef0c6c46d4f refactor: Fix logging.h includes (TheCharlatan) 84058e0eed9c05bc30984b39131e88ad1425628f refactor: Split dbwrapper CDBWrapper::Read implementation (TheCharlatan) e4af2408f2ac59788567b6fc8cb3a68fc43da9fe refactor: Pimpl leveldb::Iterator for CDBIterator (TheCharlatan) ef941ff1281e76308c3e746e592375bec023e9e4 refactor: Split dbwrapper CDBIterator::GetValue implementation (TheCharlatan) b7a1ab5cb4e60230f62c94efb3a10d07c9af4883 refactor: Split dbwrapper CDBIterator::GetKey implementation (TheCharlatan) d7437908cdf242626263ba9d5541addcddadc594 refactor: Split dbwrapper CDBIterator::Seek implementation (TheCharlatan) ea8135de7e617259cda3fc7b1c8e7569d454fd57 refactor: Pimpl leveldb::batch for CDBBatch (TheCharlatan) b9870c920dc475ec759eaf7339ea42aecba92138 refactor: Split dbwrapper CDBatch::Erase implementation (TheCharlatan) 532ee812a499e13b123af6b8415d8de1f3804f0f refactor: Split dbwrapper CDBBatch::Write implementation (TheCharlatan) afc534df9adbf5599b286b5dc3531a4b9ac2d056 refactor: Wrap DestroyDB in dbwrapper helper (TheCharlatan) Pull request description: Leveldb headers are currently included in the `dbwrapper.h` file and thus available to many of Bitcoin Core's source files. However, leveldb-specific functionality should be abstracted by the `dbwrapper` and does not need to be available to the rest of the code. Having leveldb included in a widely-used header such as `dbwrapper.h` bloats the entire project's header tree. The `dbwrapper` is a key component of the libbitcoinkernel library. Future users of this library would not want to contend with having the leveldb headers exposed and potentially polluting their project's namespace. For these reasons, the leveldb headers are removed from the `dbwrapper` by moving leveldb-specific code to the implementation file and creating a [pimpl](https://en.cppreference.com/w/cpp/language/pimpl) where leveldb member variables are indispensable. As a final step, the leveldb include flags are removed from the `BITCOIN_INCLUDES` and moved to places where the dbwrapper is compiled. --- This pull request is part of the [libbitcoinkernel project](https://github.com/bitcoin/bitcoin/issues/27587), and more specifically its stage 1 step 3 "Decouple most non-consensus headers from libbitcoinkernel". ACKs for top commit: stickies-v: re-ACK https://github.com/bitcoin/bitcoin/commit/d8f1222ac50f089a0af29eaf8ce0555bad8366ef MarcoFalke: ACK d8f1222ac50f089a0af29eaf8ce0555bad8366ef 🔠 Tree-SHA512: 0f58309be165af0162e648233451cd80fda88726fc10c0da7bfe4ec2ffa9afe63fbf7ffae9493698d3f39653b4ad870c372eee652ecc90ab1c29d86c387070f3
2023-08-07Merge bitcoin/bitcoin#28231: doc: remove Fedora libdb4-*-devel install docsfanquake
11a499eb4d57f2c5eabd7955bcc7e419364b3194 doc: remove Fedora libdb4-*-devel install docs (fanquake) Pull request description: These are no-longer installable on any recent Fedora (last working version was 32). Remove the install instructions, and consolidate this section to be the same as the Ubuntu & Debian BDB install instructions. ACKs for top commit: MarcoFalke: lgtm ACK 11a499eb4d57f2c5eabd7955bcc7e419364b3194 Tree-SHA512: 11e3c92d6dcf475a6f5529a2e41dc9f79eeae8f8d3600087ce5ae083264f999782a2c04a4c4c70073e96d4053daa23037a344224197ee5f15a3d635172c201e2
2023-08-07ci: Use qemu-user through container engineMarcoFalke
2023-08-07Merge bitcoin/bitcoin#26296: ci: Integrate `bitcoin-tidy` clang-tidy pluginfanquake
1c976c691cc4b20f43071aabf36c7afed1571057 tidy: Integrate bicoin-tidy clang-tidy plugin (fanquake) 7de23cceb8ac13fcc709453ef0fa14fb93c460b0 refactor: fix unterminated LogPrintf()s (fanquake) 0a1029aa2946787bfe91a84de882c2dd0de076e9 lint: remove /* Continued */ markers from codebase (fanquake) 910007995d8603ffc466878856227153a638caff lint: remove lint-logs.py (fanquake) d86a83d6b8587b0971e66c6910af23dd8c042969 lint: drop DIR_IWYU global (fanquake) Pull request description: Demo of integrating the [bitcoin-tidy](https://github.com/theuni/bitcoin-tidy-plugin), [clang-tidy plugin](https://clang.llvm.org/extra/clang-tidy/) written by theuni into our tidy CI job. The plugin currently has a single check, `bitcoin-unterminated-logprintf`. This would replace our current Python driven, `git-grep`-based, `.cpp` file only, lint-logs linter. ACKs for top commit: TheCharlatan: ACK 1c976c691cc4b20f43071aabf36c7afed1571057 theuni: ACK 1c976c691cc4b20f43071aabf36c7afed1571057 MarcoFalke: re-ACK 1c976c691cc4b20f43071aabf36c7afed1571057 👠 Tree-SHA512: 725b45c70e431d48e6f276671e05c694e10b6047cae1a31906ac3ee9093bc8105fb226b36a5bac6709557526ca6007222112d66aecec05a574434edc4897e4b8
2023-08-07Merge bitcoin/bitcoin#27401: tracepoints: Disables ↵fanquake
`-Wgnu-zero-variadic-macro-arguments` to compile without warnings 5197660e947435e510ef3ef72be8be8dee3ffa41 tracepoints: Disables `-Wgnu-zero-variadic-macro-arguments` to compile without warnings (Martin Leitner-Ankerl) Pull request description: Fixes #26916 by disabling the warning `-Wgnu-zero-variadic-macro-arguments` when clang is used as the compiler. Also see the comments * Proposed changes in the bug https://github.com/bitcoin/bitcoin/issues/26916#issuecomment-1480997053 * Proposed changes when moving to a variadic maro: https://github.com/bitcoin/bitcoin/pull/26593#discussion_r1155488768 ACKs for top commit: hebasto: ACK 5197660e947435e510ef3ef72be8be8dee3ffa41, I've reconsidered my [comment](https://github.com/bitcoin/bitcoin/pull/27401#issuecomment-1507142439) and I think the current localized approach is optimal. fanquake: ACK 5197660e947435e510ef3ef72be8be8dee3ffa41 - checked that this fixes the warnings under Clang. Tree-SHA512: c3dda3bcbb2540af6283ffff65885a9937bfdaaef3b00dc7d60b9f9740031d5c36ac9cb3d3d8756dbadce4812201a9754f5b8770df0d5e0d5ee690ba8a7135d2
2023-08-07doc: remove Fedora libdb4-*-devel install docsfanquake
These are no-longer installable on any recent Fedora (33+). Remove the install instructions. Fix the typo in the Ubuntu/Debian instructions.
2023-08-07mempool_entry: improve struct packingAnthony Towns
2023-08-07test: add bip157 coverage for (start height > stop height) disconnectSebastian Falbesoner
2023-08-07test: check for specific disconnect reasons in p2p_blockfilters.pySebastian Falbesoner
This ensures that the disconnect happens for the expected reason and also makes it easier to navigate between implementation and test code, i.e. both the questions "do we have test coverage for this disconnect?" (from an implementation reader's perspective) and "where is the code handling this disconnect?" (from a test reader's perspective) can be answered simply by grep-ping the corresponding debug message. Can be easiest reviewed with `-w` (to ignore whitespace changes).
2023-08-07Add importmempool RPCMarcoFalke
test_importmempool_union contributed by glozow Co-authored-by: glozow <gloriajzhao@gmail.com>
2023-08-07refactor: Add and use kernel::ImportMempoolOptionsMarcoFalke
This allows optional named arguments with default values.