aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-12-28test: Add test for updating addrman entriesMartin Zumsande
This covers Connected() which updates nTime, and SetServices() which updates nServices
2021-12-28test: introduce utility function to retrieve an addrmanMartin Zumsande
2021-12-28test: Remove unused AddrManTest classMartin Zumsande
2021-12-28test: Remove tests for internal helper functionsMartin Zumsande
The logic of these functions is already covered by existing unit tests using publicly exposed functions of the interface. Therefore, removing them does not decrease test coverage.
2021-12-28test: use AddrMan instead of AddrManTest where possibleMartin Zumsande
Switches to AddrMan for tests that use no features of AddrManTest. Also removes unusued AddrManTest variables Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
2021-12-28test: Inline SimConnFail functionMartin Zumsande
No need for a function, since it is only used once. Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
2021-12-28test: delete unused GetBucketAndEntry functionAmiti Uttarwar
2021-12-28test: Update addrman_serialization unit test to use AddrMan's interfaceAmiti Uttarwar
By updating the test to use FindEntry, it no longer needs to reach into AddrMan's internals (via GetBucketAndEntry) to assert expected behaviors.
2021-12-28addrman: Introduce a test-only function to lookup addressesAmiti Uttarwar
Co-Authored-By: Martin Zumsande <mzumsande@gmail.com>
2021-12-28Merge bitcoin/bitcoin#23878: doc: Remove TODO comment in tx_verifyfanquake
fa50d8b66e74792eb46515853e4aa8a99f25561b doc: Remove TODO comment in tx_verify (MarcoFalke) Pull request description: The comment has no clear motivation, so it seems better to remove it and fix it when there is a reason. An alternative (if a fix isn't possible when there is a clear motivation) would be to create an issue thread for easier discussion. ACKs for top commit: fanquake: ACK fa50d8b66e74792eb46515853e4aa8a99f25561b Tree-SHA512: e9c25bab46a73b7c2db288c62ed9838a5e794b3b72db494173f4502da60b58dec4383064964c0842932cd30e4251fc01ad0c28681e2ef6cb442482eea2bad595
2021-12-28Merge bitcoin/bitcoin#23840: doc: Fix -changetype help textfanquake
fa993d0e7e4d27ca1cf7d88a5a6ec5b93b7ed503 doc: Fix -changetype help text (MarcoFalke) Pull request description: This was forgotten in commit 3ac38058ce0e80a9f4276bfa82951decdb237e9a ACKs for top commit: shaavan: ACK fa993d0e7e4d27ca1cf7d88a5a6ec5b93b7ed503 w0xlt: ACK fa993d0 josibake: ACK https://github.com/bitcoin/bitcoin/pull/23840/commits/fa993d0e7e4d27ca1cf7d88a5a6ec5b93b7ed503 Tree-SHA512: 9f84b1168e3b3ab06e5c1f4915a1874598b273099eb5878ed28c3a66f1484e34c836fd3c68c4131bee541f3428052f6b66e02b192170752d1082de689d44cd4d
2021-12-28Merge bitcoin/bitcoin#23883: doc: Remove fixed TODO from wallet/feebumperfanquake
fa562fdd5e36566f8013eee17c6dbf830942094e doc: Remove fixed TODO from wallet/feebumper (MarcoFalke) Pull request description: Fixed in commit 9522b53a91f28032c34b94662d50b000534708ce ACKs for top commit: shaavan: ACK fa562fdd5e36566f8013eee17c6dbf830942094e Tree-SHA512: 968fda0994020c369b7acfc01db109d0f50d4c137fadf533ae55d0e14a353ebbde4320e798cf89e5489f1020c459712631b3967976c1f73d99db8a2d1cbad982
2021-12-27doc: Remove fixed TODO from wallet/feebumperMarcoFalke
Fixed in commit 9522b53a91f28032c34b94662d50b000534708ce
2021-12-27doc: testnet3 was not reset and is doing BIP30 checks againMarcoFalke
2021-12-27doc: Remove TODO from block fuzz testMarcoFalke
2021-12-27doc: Remove TODO comment in tx_verifyMarcoFalke
2021-12-26wallettool: Check that the dumpfile checksum is the correct sizeAndrew Chow
After parsing the checksum, make sure that it is the size that we expect it to be.
2021-12-24Merge bitcoin/bitcoin#22875: util: Fix Racy ParseOpCode function initializationMarcoFalke
7b481f015a0386f5ee3e13415474952653ddc198 Fix Racy ParseOpCode function initialization (Jeremy Rubin) Pull request description: If multiple callers call ParseOpCode concurrently it will cause a race condition. We can either move the static to it's own area and require init be called explicitly, or just allow concurrent first callers to race to fill in an atomic variable that never changes thereafter. The second approach is taken here. Static initialization *is* threadsafe, but only insofar as definining the variable being guaranteed to be called once. This is used incorrectly here. practicalswift --> are there tools we can deploy to catch usage like this? ACKs for top commit: MarcoFalke: re-ACK 7b481f015a0386f5ee3e13415474952653ddc198 🗣 Tree-SHA512: cbf9dc3af26d7335305026f32ce8472a018309b89b3d81a67357e59fbeed72c37b5b8a6e30325ea68145c3b2403867be82de01f22decefb6e6717cf0c0045633
2021-12-23Fix Racy ParseOpCode function initializationJeremy Rubin
2021-12-23init: Use clang-tidy named args syntaxCarl Dong
2021-12-23style-only: Rename *Chainstate return valuesCarl Dong
2021-12-23docs: Make LoadChainstate comment more accurateCarl Dong
2021-12-23node/chainstate: Use MAX_FUTURE_BLOCK_TIMECarl Dong
2021-12-23Merge bitcoin/bitcoin#23842: scripted-diff: Rename interfaces::WalletClient ↵MarcoFalke
to interfaces::WalletLoader ff5f6dea5336075d1a6cace1112be3252d97540b scripted-diff: Rename interfaces::WalletClient to interfaces::WalletLoader (Russell Yanofsky) Pull request description: Name has been confusing since it was introduced, and it was pointed in recent review club https://bitcoincore.reviews/10102 that it was particularly unclear how `interfaces::WalletClient` was different from `interfaces::Wallet`. ACKs for top commit: w0xlt: ACK ff5f6de Tree-SHA512: 26fa10baa457e76da1933adab187e9be61b8d76cff1cf2c73ad4320461c7e31fb9db07b7c2486998294826beb4a1aca255c14903920b443db6213e653c5f7e0a
2021-12-23util: move MapIntoRange() for reuse in fuzz testsfanquake
2021-12-23Merge bitcoin/bitcoin#23736: test: call VerifyLoadedChainstate during ↵fanquake
ChainTestingSetup 826e12b010eda4238f9e8cd875e8915a405bed0d test: call VerifyLoadedChainstate during ChainTestingSetup (James O'Beirne) Pull request description: for additional coverage and similarity to actual init process. Followup to #23280. ACKs for top commit: dongcarl: Code Review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d ryanofsky: Code review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d Tree-SHA512: a4e7fd25e5d7a08b1e154ae6daf67c3048260a2684b0e569b544dd826693b7b969db9923b191e499cb8d8d0a2a73eb9330ff45909313145a9abb6052eb8c3ad9
2021-12-22[rest] drop superfluous rpc serializations flags for block filtersNiklas Gögge
2021-12-22[rest] add a more verbose error message for invalid header countsNiklas Gögge
2021-12-22[refactor] various style fix-upsNiklas Gögge
2021-12-22scripted-diff: Rename interfaces::WalletClient to interfaces::WalletLoaderRussell Yanofsky
Name has been confusing since it was introduced, and it was pointed in recent review club as https://bitcoincore.reviews/10102 that it was particularly unclear how interfaces::WalletClient was different from interfaces::Wallet. -BEGIN VERIFY SCRIPT- ren() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; } ren WalletClient WalletLoader ren walletClient walletLoader ren wallet_client wallet_loader ren "wallet clients release the wallet" "wallet pointer owners release the wallet" ren "wallet client" "wallet loader" ren "Wallet client" "Wallet loader" -END VERIFY SCRIPT-
2021-12-22doc: Fix -changetype help textMarcoFalke
This was forgotten in commit 3ac38058ce0e80a9f4276bfa82951decdb237e9a
2021-12-21gui: address type dropdown, add bech32mSjors Provoost
Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
2021-12-21wallet: add taprootEnabled() to interfaceSjors Provoost
2021-12-20Merge bitcoin/bitcoin#23341: RPC: Better safety with newkeypool command and ↵Andrew Chow
wallet backups a2a92317ad4ab88cfca234f68337a7cd37897f10 rpc: Add warning to user about newkeypool command (Samuel Dobson) Pull request description: This PR prevents `newkeypool` from being run on non-HD wallets, because this would require a new backup every time, so it isn't very safe. David Harding also suggested [here](https://github.com/bitcoin/bitcoin/pull/23093#issuecomment-945350003) that the RPC help text should include a warning to the users about the interaction between newkeypool. ACKs for top commit: achow101: ACK a2a92317ad4ab88cfca234f68337a7cd37897f10 Tree-SHA512: 0aa497900f1d179764bce13ffce0bb081ba2ca354492bf2e04b21d0212e960b3ed13a386fbf65602b6b50461f4056a0285752ef707d312da28e82449cd8ea048
2021-12-20Merge bitcoin/bitcoin#23789: wallet: Strictly match tx change type to ↵Andrew Chow
improve privacy fada6c65d23f7bd4682fac281026612b835c4f8b wallet: Strictly match tx change type to improve privacy (MarcoFalke) Pull request description: Currently the change type will only match a destination by accident, making it easier to determine the change. Fix that by strictly matching one of the destinations. ACKs for top commit: S3RK: Concept & Approach ACK fada6c6. Also did light code review . achow101: ACK fada6c65d23f7bd4682fac281026612b835c4f8b prayank23: tACK https://github.com/bitcoin/bitcoin/pull/23789/commits/fada6c65d23f7bd4682fac281026612b835c4f8b w0xlt: tACK fada6c6 Tree-SHA512: 2b072c3c32debac7b0bef07a6df9a8f1a631e0f7d556b859973f18894ca490225582dc13e4588b29fa205ffbcd30fb632d5313b304d10ad17a26adc3f7684471
2021-12-20scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.aRussell Yanofsky
Goal along with namespacing PR #23497 is to have src/node/ code in node:: namespace in libbitcoin_node.a library -BEGIN VERIFY SCRIPT- bash -c ' # Bash shell needed for brace expansion {a,b} git mv build_msvc/libbitcoin_{server,node} git mv build_msvc/libbitcoin_node/libbitcoin_{server,node}.vcxproj.in ren() { git grep -l "$1" src build_msvc | xargs sed -i "s/$1/$2/g"; } ren LIBBITCOIN_{SERVER,NODE} ren libbitcoin_{server,node} ' -END VERIFY SCRIPT-
2021-12-20Merge bitcoin/bitcoin#23801: Refactor: Change time variable type from ↵MarcoFalke
int64_t to std::chrono::seconds in net_processing.cpp 92082ea0bb62ab6ec723b57ca4f2b2c5f6b28469 Change time variable type to std::chrono::seconds in src/net_processing.cpp (Shashwat) Pull request description: - This is a follow-up to PR #23758 - This changes the remaining time variable in `net_processing.cpp` from **int64_t** to **std::chrono::seconds** ACKs for top commit: naumenkogs: ACK 92082ea0bb62ab6ec723b57ca4f2b2c5f6b28469 hebasto: re-ACK 92082ea0bb62ab6ec723b57ca4f2b2c5f6b28469 Tree-SHA512: 559e351d9046d4ba2b842ae38da13b4befc7feee71f0762f97907812471e2840b0d43c90c92222d15619fe40cc21f11d40900500ca07b470f7ac8b0046cc1d68
2021-12-20Merge bitcoin/bitcoin#23780: refactor, test: update `addrman_tests.cpp` to ↵MarcoFalke
use output from `AddrMan::Good()` bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 refactor: addrman_select test (josibake) 5a64dc018c04ce16202a8e58ce92d2657c0b1806 refactor: addrman_evictionworks test (josibake) e281fccd8a80d7cd48c3b17d58fd4a8915e1e965 refactor: addrman_noevict test (josibake) 8bdd9240d4310aafa1332159355f106a8fcfc5c9 refactor: addrman_selecttriedcollisions test (josibake) Pull request description: As a follow-up to #23713 , this PR refactors the remaining tests in `src/tests/addrman_tests.cpp` to use the output from `AddrMan::Good()` where appropriate. ACKs for top commit: naumenkogs: ACK bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 mzumsande: Code Review ACK bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 Tree-SHA512: 93cc127aecff42c1c174daa04911af7e3460a5c40ddf96952fe4a6ab86fa1ff22d66724326abb709008d7f9f79c26c55c6d62753c40059c9ac60f869507ec913
2021-12-20Merge bitcoin/bitcoin#17631: Expose block filters over RESTMarcoFalke
2b64fa3251ac5ff4b4d174f1f0be7226490dce87 Update REST docs with new accessors (Matt Corallo) ef7c8228fd5cf45526518ae2bd5ebdd483e65525 Expose block filters over REST. (Matt Corallo) Pull request description: This adds a new rest endpoint: /rest/blockfilter/filtertype/requesttype/blockhash (eg /rest/blockfilter/basic/header/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f.hex) which exposes either the filter "header" or the filter data itself. Most of the code is cribbed from the equivalent RPC. You can test it at http://bitcoin-rest.bitcoin.ninja/rest//blockfilter/basic/header/000000005b7a58a939b2636f61fa4ddd62258c5fed57667a35d23f2334c4f86d.hex ACKs for top commit: dergoegge: ACK 2b64fa3251ac5ff4b4d174f1f0be7226490dce87 - Adding blockfilters to the REST interface is analogous to serving other public data such as transactions or blocks. Tree-SHA512: d487bc694266375c94d6fcf2e9d788a8a42a3b94e8d3290e46335a64cbcde55084ce5ea6119b79a4065888d94d7c3ae25a59a901fa46e3711f0eb296add12696
2021-12-20Change time variable type to std::chrono::seconds in src/net_processing.cppShashwat
- This commit is a followup to commit: 60b579 - This changes the remaining time variable in net_processing.cpp from int64_t to std::chrono
2021-12-18Merge bitcoin/bitcoin#23219: p2p, refactor: tidy up LookupSubNet()W. J. van der Laan
c44c20108f7b7314f59f034110789385a24db280 p2p, refactor: drop unused DNSLookupFn param in LookupSubnet() (Vasil Dimov) f0c9e68080432c1ab11b14e571b8dfb7cfe727f8 p2p, refactor: tidy up LookupSubNet() (Jon Atack) Pull request description: This pull originally resolved a code `TO-DO`, as well as fixing different param names between the function declaration and definition, updating the function to current style standards, clearer variable naming, and improving the Doxygen documentation. Following the merge of #17160, it now does the non-`TODO` changes and also now drops an unused param to simplify the function. ACKs for top commit: dunxen: ACK c44c201 vasild: ACK c44c20108f7b7314f59f034110789385a24db280 shaavan: crACK c44c20108f7b7314f59f034110789385a24db280 Tree-SHA512: 55f64c7f403819dec84f4da06e63db50f7c0601a2d9a1ec196fda667c220ec6f5ad2a3c95e0e02275da9f6da6b984275d1dc10e19ed82005c5e13da5c5ecab02
2021-12-18Merge bitcoin/bitcoin#23781: test: Fix `system_tests/run_command` on WindowsW. J. van der Laan
edd0313ae7c94420642081c9172e349080bb9335 test: Improve "invalid_command" subtest in system_tests for Windows (Hennadii Stepanov) fb1b0590af138e317803893d2cab9dc887f33c5b test: Fix "non-zero exit code" subtest in system_tests for Windows (Hennadii Stepanov) 0aad33db6410ed36fa0f4b96245cacbae7897d2e test: Fix "false" subtest in system_tests for Windows (Hennadii Stepanov) 507c009c1ee68a4c3ad100f765bf854307d5bf39 test: Fix "echo" subtest in the system_tests for Windows (Hennadii Stepanov) Pull request description: An attempt to fix bitcoin/bitcoin#23775. With this PR on Windows 10 Pro 21H1 (build 19043.1348): ``` C:\Users\hebasto\bitcoin>src\test_bitcoin.exe --run_test=system_tests/run_command Running 1 test case... *** No errors detected C:\Users\hebasto\bitcoin>src\test_bitcoin.exe Running 482 test cases... *** No errors detected ``` ACKs for top commit: sipsorcery: tACK edd0313ae7c94420642081c9172e349080bb9335 Tru3Nrg: tACK https://github.com/bitcoin/bitcoin/pull/23781/commits/edd0313ae7c94420642081c9172e349080bb9335 Tree-SHA512: 66a4f2372858011ff862b71c6530bedb8bc731b18595636fac9affc9189d9320f212c68b62498f2b57ee7a07f59e842dbec085b76a7419791d1a06c8e80e7744
2021-12-18Merge bitcoin/bitcoin#23806: fuzz: follow up for #22704MarcoFalke
8f79831ab57b8fce48bb7b01fce86fac338755a5 Refactor the chacha20 differential fuzz test (stratospher) Pull request description: This PR addresses [comments from #22704](https://github.com/bitcoin/bitcoin/pull/22704/files#discussion_r771510963) to make the following changes in `src/test/fuzz/crypto_diff_fuzz_chacha20.cpp`: - replace `memcmp()` with == - add a missing assert statement to compare the encrypted bytes Top commit has no ACKs. Tree-SHA512: 02338460fb3a89e732558bf00f3aebf8f04daba194e03ae0e3339bb2ff6ba35d06841452585b739047a29f8ec64f36b1b4ce2dfa39a08f6ad44a6a937e7b3acb
2021-12-18Merge bitcoin/bitcoin#23383: Update libsecp256k1 subtree to current masterfanquake
314195c8be3bd7db0d5817c4fb3aa85c84363ce9 Remove unnecessary cast in CKey::SignSchnorr (Pieter Wuille) a1f76cdb22e3278a48d63dd23c1fe3308daedd8c Remove --disable-openssl-tests for libsecp256k1 configure (Pieter Wuille) 86dbc4d075decb82fbba837aaa283cf0561897ad Squashed 'src/secp256k1/' changes from be8d9c262f..0559fc6e41 (Pieter Wuille) Pull request description: The motivation for this bump is getting rid of a cast in `CKey::SignSchnorr`; the `aux_rand` argument isn't modified by the `secp256k1_schnorrsig_sign` function, but was marked as non-`const` anyway. This is fixed now (bitcoin-core/secp256k1#966), and the cast is removed in this PR. There are a few other relevant changes: * (bitcoin-core/secp256k1#956): replaces a runtime-computed table with a precomputed one; this adds arouns 1 MiB to the binary size, but is a step towards significantly simplifying the API. If 1 MiB is too much, it can be reduced by 2 or 4 (or more) for a slight verification performance reduction. * (bitcoin-core/secp256k1#983): removes (test/bench only) OpenSSL support entirely, removing the need to pass `--disable-openssl-tests` (see #23314). * (bitcoin-core/secp256k1#810): mild performance increase for 64-bit non-x86 platforms. * (bitcoin-core/secp256k1#1002): Make aux_rnd32==NULL behave identical to 0x0000..00 (which impacts BIP341/BIP342 signing in Bitcoin Core, making it more strictly BIP340 compliant, though not in a manner that affects security). ACKs for top commit: fanquake: ACK 314195c8be3bd7db0d5817c4fb3aa85c84363ce9 - this includes a nice simplification to the lilbsecp build system (and thus our build system), and fixes issues like #22854. Did a Guix build on x86 (above), as well as a build on arm64 (except for the arm64 host): Tree-SHA512: 0e048390fc148fbbdf5b98d9cce8c71067564e7d69d97b68347808a9bc45a04f4fc653c392c880d79d5d8b9cf282195520955581ac4f1595f6a948080cf5949d
2021-12-17Merge bitcoin/bitcoin#23695: p2p: Always serialize local timestamp for ↵W. J. van der Laan
version msg fa1dc9b36a0ccf96cbaf106c060336d91b54579e p2p: Always serialize local timestamp for version msg (MarcoFalke) Pull request description: Currently we serialize the local time when connecting to outbound connections and the "adjusted network" time when someone connects to us. I presume the reason is to avoid a fingerprint in case the local time is misconfigured. However, the fingerprint still exits when: * The local time goes out-of-sync after timedata is filled up, in which case the adjusted time is *not* adjusted. See comment in `src/timedata.cpp`. (In practise I expect no adjustment to happen after timedata is filled up by one entry more than half its size). * The local time is off by more than 70 minutes. See `DEFAULT_MAX_TIME_ADJUSTMENT`. While there is a warning in this case, the warning might be missed by the node operator. * The adjusted time is poisoned by an attacker. This is only a theoretical concern after commit e457513eb1bad11482f0820feb0f5810324a9d06. Using the adjusted time does help in a the case where the local time is off by a constant less than 70 minutes and the node quickly connects to 5 outbound peers to retrieve the adjusted time. Still, I think using `GetAdjustedTime` here gives a false sense of security. It will be better for node operators to instead set the correct time. ACKs for top commit: naumenkogs: ACK fa1dc9b36a0ccf96cbaf106c060336d91b54579e laanwj: Code review ACK fa1dc9b36a0ccf96cbaf106c060336d91b54579e w0xlt: crACK fa1dc9b Tree-SHA512: 70a0f4ab3500e6ddcde291620e35273018cefd1d9e94b91ad333e360139ed18862718bb1a9854af2bf79990bf74b05d95492f77d0747c7b9bdd276c020116dcb
2021-12-17Refactor the chacha20 differential fuzz teststratospher
2021-12-17Merge bitcoin/bitcoin#22704: fuzz: Differential fuzzing to compare Bitcoin ↵W. J. van der Laan
Core's and D. J. Bernstein's implementation of ChaCha20 4d0ac72f3ae78e3c6a0d5dc4f7e809583abd0546 [fuzz] Add fuzzing harness to compare both implementations of ChaCha20 (stratospher) 65ef93203cc6a977c8e96f07cb9155f46faf5004 [fuzz] Add D. J. Bernstein's implementation of ChaCha20 (stratospher) Pull request description: This PR compares Bitcoin Core's implementation of ChaCha20 with D. J. Bernstein's in order to find implementation discrepancies if any. ACKs for top commit: laanwj: Code review ACK 4d0ac72f3ae78e3c6a0d5dc4f7e809583abd0546 Tree-SHA512: f826144b4db61b9cbdd7efaaca8fa9cbb899953065bc8a26820a566303b2ab6a17431e7c114635789f0a63fbe3b65cb0bf2ab85baf882803a5ee172af4881544
2021-12-17refactor: Avoid integer overflow in ApplyStats when activating snapshotMarcoFalke
2021-12-17Move AdditionOverflow to util, Add CheckedAdd with unit testsMarcoFalke
2021-12-17Add dev doc to CCoinsStats::m_hash_type and make it constMarcoFalke