Commit Graph

327 Commits

Author SHA1 Message Date
fanquake
eeec2f2799
Merge bitcoin/bitcoin#21884: fuzz: Remove unused --enable-danger-fuzz-link-all option
fa27d6d3ac065684a1219e9a948514d27929cf7c fuzz: Remove unused --enable-danger-fuzz-link-all option (MarcoFalke)

Pull request description:

  Remove the unused build option, which was *dangerous* (as the name implies). Also remove the fuzzbuzz config, which was never used as part of this repo and seems redundant now that we integrate with oss-fuzz.

ACKs for top commit:
  practicalswift:
    cr ACK fa27d6d3ac065684a1219e9a948514d27929cf7c: patch looks correct and rationale makes sense
  hebasto:
    ACK fa27d6d3ac065684a1219e9a948514d27929cf7c, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 9bd65ed6a76d13d8d9c7a88aaae30f701215d5d0619693a3115d5ec350808aaf6a1aa4737466a5b96f3948513ec4d063808fe16219818366720e247880a15177
2024-04-23 22:41:09 +07:00
Wladimir J. van der Laan
b8aec5cb86
Merge #20197: p2p: protect onions in AttemptToEvictConnection(), add eviction protection test coverage
0cca08a8ee33b4e05ff586ae4fd914f5ea860cea Add unit test coverage for our onion peer eviction protection (Jon Atack)
caa21f586f951d626a67f391050c3644f1057f57 Protect onion+localhost peers in ProtectEvictionCandidatesByRatio() (Jon Atack)
8f1a53eb027727a4c0eaac6d82f0a8279549f638 Use EraseLastKElements() throughout SelectNodeToEvict() (Jon Atack)
8b1e156143740a5548dc7b601d40fb141e6aae1c Add m_inbound_onion to AttemptToEvictConnection() (Jon Atack)
72e30e8e03f880eba4bd1c3fc18b5558d8cef680 Add unit tests for ProtectEvictionCandidatesByRatio() (Jon Atack)
ca63b53ecdf377ce777fd959d400748912266748 Use std::unordered_set instead of std::vector in IsEvicted() (Jon Atack)
41f84d5eccd4c2620bf6fee616f2f8f717dbd6f6 Move peer eviction tests to a separate test file (Jon Atack)
f126cbd6de6e1a8fee0e900ecfbc14a88e362541 Extract ProtectEvictionCandidatesByRatio from SelectNodeToEvict (Jon Atack)

Pull request description:

  Now that #19991 and #20210 have been merged, we can determine inbound onion peers using `CNode::m_inbound_onion` and add it to the localhost peers protection in `AttemptToEvictConnection`, which was added in #19670 to address issue #19500.

  Update 28 February 2021: I've updated this to follow gmaxwell's suggestion in https://github.com/bitcoin/bitcoin/pull/20197#issuecomment-713865992.

  This branch now protects up to 1/4 onion peers (connected via our tor control service), if any, sorted by longest uptime. If any (or all) onion slots remain after that operation, they are then allocated to protect localhost peers, or a minimum of 2 localhost peers in the case that no onion slots remain and 2 or more onion peers were protected, sorted as before by longest uptime.

  This patch also adds test coverage for the longest uptime, localhost, and onion peer eviction protection logic to build on the welcome initial unit testing of #20477.

  Suggest reviewing the commits that move code with `colorMoved = dimmed-zebra` and `colorMovedWs = allow-indentation-change`.

  Closes #11537.

ACKs for top commit:
  laanwj:
    Code review ACK 0cca08a8ee33b4e05ff586ae4fd914f5ea860cea
  vasild:
    ACK 0cca08a8ee33b4e05ff586ae4fd914f5ea860cea

Tree-SHA512: 2f5a63f942acaae7882920fc61f0185dcd51da85e5b736df9d1fc72343726dd17da740e02f30fa5dc5eb3b2d8345707aed96031bec143d48a2497a610aa19abd
2024-04-22 09:42:17 -05:00
Kittywhiskers Van Gogh
8c63868d9b
merge bitcoin#19972: Add fuzzing harness for node eviction logic 2024-03-25 11:55:05 +00:00
Kittywhiskers Van Gogh
1b1924e3d5
merge bitcoin#28008: BIP324 ciphersuite 2024-03-05 21:43:21 +00:00
Konstantin Akimov
e8f84afd3e
refactor: move BIP39 related code to wallet 2024-03-06 02:04:25 +07:00
Andrew Chow
c9d3695688
Merge bitcoin/bitcoin#25798: build: fix cleanup of test logs
5474f5c356c5a17fbf6c84110cf83a5753cd0367 build: fix cleanup of test logs (fanquake)

Pull request description:

  `make clean` currently looks for `test_name.cpp.log`, when it should be `test_name.log`, meaning .log files are left after running `make clean`.

  Also fixes #21705. `make distcheck` seems to work fine after the logs files are properly cleaned up:
  ```bash
  ./autogen.sh && ./configure && make distcheck -j9
  ....
  make[1]: Leaving directory '/home/ubuntu/bitcoin/bitcoin-23.99.0/_build/sub'
  if test -d "bitcoin-23.99.0"; then find "bitcoin-23.99.0" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "bitcoin-23.99.0" || { sleep 5 && rm -rf "bitcoin-23.99.0"; }; else :; fi
  =================================================
  bitcoin-23.99.0 archives ready for distribution:
  bitcoin-23.99.0.tar.gz
  =================================================
  ```

  Probably broken in #19385 / #24715.

  Guix Build (x86_64):
  ```bash
  c33306c2ae55bc0e037a1050bd0813fd7654f21fefd0e7df089a541118b629bc  guix-build-5474f5c356c5/output/aarch64-linux-gnu/SHA256SUMS.part
  f3cf5b8366e27155f3a369ab0d017074912506c43b4010054a72e5c3ae8cab2c  guix-build-5474f5c356c5/output/aarch64-linux-gnu/bitcoin-5474f5c356c5-aarch64-linux-gnu-debug.tar.gz
  48f618300f63533c50c31395959737103bb0279972b989cc5417adbf338a5c9f  guix-build-5474f5c356c5/output/aarch64-linux-gnu/bitcoin-5474f5c356c5-aarch64-linux-gnu.tar.gz
  6b3e0ceefc84dfad48aec3a9ea8ae98a427775242370234709605855f593dc88  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/SHA256SUMS.part
  36a38f4d0d2d0fee51256ee9c610cde014055cf18b5b852c8b3235ef218b461e  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/bitcoin-5474f5c356c5-arm-linux-gnueabihf-debug.tar.gz
  3acb46a786323068fe34eaa8b2f7bff428d35367677e456b78fc00db09da8adf  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/bitcoin-5474f5c356c5-arm-linux-gnueabihf.tar.gz
  aaeb126cca3cbbb1d21be2cbb36b3e16a8c110199a5e61172ee55c9c913fb717  guix-build-5474f5c356c5/output/arm64-apple-darwin/SHA256SUMS.part
  0135d47c34dfbfbcd68181292fc810a1be4efaa0ff9fab05f9f33415167fc82c  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin-unsigned.dmg
  261ae9f70238ecbd8fedf9b3e02f34601abe42c4a23b25d0571d04d0881fdaba  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin-unsigned.tar.gz
  de716e0f425bae38cfda2690e86dbfa6831b6d37dd8a7638ca14334eecbddf99  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin.tar.gz
  2e2e1d5cd009ec5c69ce22124afe90ff8c15e9cb546df818b2305ff96efa9c81  guix-build-5474f5c356c5/output/dist-archive/bitcoin-5474f5c356c5.tar.gz
  85dd41584a2c7715b16508dff0f51bbb20b3891a1901a1781ecc37bc1cfd97c8  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/SHA256SUMS.part
  49ae951e9acb34fede0ead4d53679ddc041bfb6d60646efaca2a99cf87972be9  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/bitcoin-5474f5c356c5-powerpc64-linux-gnu-debug.tar.gz
  2efcb3fbb6702bff30bbf05d83b9849f390c67a1c363c883d71f365f4bee7ef6  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/bitcoin-5474f5c356c5-powerpc64-linux-gnu.tar.gz
  cea9e8e2499932ef6e20bba7a6b3408e2cca6fcd1875c1890293dd745add6942  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/SHA256SUMS.part
  7616659242a1f15b7d6f9f54382dfb52d0bbdca701e1fb3d48fbe7bb590e6213  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/bitcoin-5474f5c356c5-powerpc64le-linux-gnu-debug.tar.gz
  d9d4eeaf6f9d1272000aa598c8461afc330a8e65f263d45b0eab222f8ddfec71  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/bitcoin-5474f5c356c5-powerpc64le-linux-gnu.tar.gz
  f83ee11c35001d34f9fba7d1e9e201a4cc6fa5e44bd51e13dabffcb35324348c  guix-build-5474f5c356c5/output/riscv64-linux-gnu/SHA256SUMS.part
  c441e56f23f224122ed064cdb57364fb129f5c9d50c5e8173952ce649b46bdb8  guix-build-5474f5c356c5/output/riscv64-linux-gnu/bitcoin-5474f5c356c5-riscv64-linux-gnu-debug.tar.gz
  319db8af21a4d3c7bbdf54c315ad70bacf7fba1f2559408188d90c9ba60ca63c  guix-build-5474f5c356c5/output/riscv64-linux-gnu/bitcoin-5474f5c356c5-riscv64-linux-gnu.tar.gz
  9ac536a04d7e500f87b1f7dfb60e1e84cde2c192d3dffb89c308b864e9b9d583  guix-build-5474f5c356c5/output/x86_64-apple-darwin/SHA256SUMS.part
  19e70f13fb4bf82375f7ca882a23e831f84729278e643cf5911182bdababa893  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin-unsigned.dmg
  673a20e9457af3d0a89ea6721f84c6136132d3fbe469b7371bf14ce688b567d0  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin-unsigned.tar.gz
  74162d53faffc4372ae4587cde395fe078b5c440c43c5a4ad8b8b890e9546255  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin.tar.gz
  d751d50427d7abcbe9ac1daf087dc3addb7e4e6b90bb4c3ef6c31f8e54cac25e  guix-build-5474f5c356c5/output/x86_64-linux-gnu/SHA256SUMS.part
  49951b53172d4fe193d7ffc15b04a4bc058a3209653982b65912f2b221305dd4  guix-build-5474f5c356c5/output/x86_64-linux-gnu/bitcoin-5474f5c356c5-x86_64-linux-gnu-debug.tar.gz
  93d4c4b07202a9171a72b6887e3931e53b3a8c22433b26521e2cb2a0c942f52a  guix-build-5474f5c356c5/output/x86_64-linux-gnu/bitcoin-5474f5c356c5-x86_64-linux-gnu.tar.gz
  b4b79e3578b6ffbb3075aacff969fb201b386e35a2d9d597047b61ff14bdfbfb  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/SHA256SUMS.part
  8260f5c9a38cc577dff2143f00c465d117aa9835b3633365289d6807d7e46e7c  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-debug.zip
  b20fbf02ddf617b86e5d5f88346ed97f9d169cd56904684ba3ca5f03ea85f008  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-setup-unsigned.exe
  16e9d1b817a832bfb0be2b9065440245a5d04b3aae8e34ff0f43f20c5dd7047f  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-unsigned.tar.gz
  da766e257d10cf8890a530babc6100039c69ae7ed8e4f969eb612b4a411dd88f  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64.zip
  ```

ACKs for top commit:
  adam2k:
    ACK 5474f5c356c5a17fbf6c84110cf83a5753cd0367
  achow101:
    ACK 5474f5c356c5a17fbf6c84110cf83a5753cd0367
  jarolrod:
    ACK 5474f5c356c5a17fbf6c84110cf83a5753cd0367

Tree-SHA512: d5595c96d0386b5ee9b98d9499770a00d8b751500020bf92f75c88e688640a50cfa5ebe7c26dea8cc5473b16a6adb83ec39891dd18d32ef59df5cf48d7091d6c
2024-02-29 09:35:00 -06:00
Kittywhiskers Van Gogh
d0b4e560a6
merge bitcoin#21966: Remove double serialization; use software encoder for fee estimation
continuation of f946c68f8 from dash#4197
2024-02-28 13:37:33 -06:00
Kittywhiskers Van Gogh
5aeb24e020
merge bitcoin#22029: Improve transport deserialization fuzz test coverage 2024-02-19 10:17:07 -06:00
Kittywhiskers Van Gogh
b46521b8a6
merge bitcoin#21142: Add tx_pool fuzz targets 2024-02-06 08:39:52 -06:00
Samuel Dobson
209c48a90a
Merge #15382: util: add RunCommandParseJSON
31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0 [util] add RunCommandParseJSON (Sjors Provoost)
c17f54ee535faaedf9033717403e1f775b5f1530 [ci] use boost::process (Sjors Provoost)
32128ba682033560d6eb2e4848a9f77a842016d2 [doc] include Doxygen comments for HAVE_BOOST_PROCESS (Sjors Provoost)
3c84d85f7d218fa27e9343c5cd1a55e519218980 [build] msvc: add boost::process (Sjors Provoost)
c47e4bbf0b44f2de1278f9538124ec98ee0815bb [build] make boost-process opt-in (Sjors Provoost)
929cda5470f98d1ef85c05b1cad4e2fb9227e3b0 configure: add ax_boost_process (Sjors Provoost)
8314c23d7b39fc36dde8b40b03b6efbe96f85698 [depends] boost: patch unused variable in boost_process (Sjors Provoost)

Pull request description:

  Prerequisite for external signer support in #16546. Big picture overview in [this gist](https://gist.github.com/Sjors/29d06728c685e6182828c1ce9b74483d).

  This adds a new dependency [boost process](https://github.com/boostorg/process/tree/boost-1.64.0). This is part of Boost since 1.64 which is part of `depends`. Because the minimum Boost version is 1.47, this functionality is skipped for older versions of Boost.

  Use `./configure --with-boost-process` to opt in, which checks for the presence of Boost::Process.

  We add `UniValue runCommandParseJSON(const std::string& strCommand)` to `system.{h,cpp}` which calls an arbitrary command and processes the JSON returned by it. This is currently only called by the test suite.

  ~For testing purposes this adds a new regtest-only RPC method `runcommand`, as well as `test/mocks/command.py` used by functional tests.~ (this is no longer the case)

  TODO:
  - [ ] review boost process in #15440

ACKs for top commit:
  achow101:
    ACK 31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0
  hebasto:
    re-ACK 31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0, only rebased (verified with `git range-diff`) and removed an unintentional tab character since the [previous](https://github.com/bitcoin/bitcoin/pull/15382#pullrequestreview-458371035) review.
  meshcollider:
    Very light utACK 31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0, although I am not very confident with build stuff.
  promag:
    Code review ACK 31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0, don't mind the nit.
  ryanofsky:
    Code review ACK 31cf68a3ad1f0a5537c8419e2912b55fbfb88fa0. I left some comments below that could be ignored or followed up later. The current change is clean and comprehensive.

Tree-SHA512: c506e747014b263606e1f538ed4624a8ad7bcf4e025cb700c12cc5739964e254dc04a2bbb848996b170e2ccec3fbfa4fe9e2b3976b191222cfb82fc3e6ab182d
2024-02-01 09:22:03 -06:00
MarcoFalke
5447f9de90
Merge bitcoin/bitcoin#24715: build, test: Fix test logfile name
8b517fae7eb229911a5d41bbe26fbf6cc7de46df build, refactor: Replace tabs with spaces (Hennadii Stepanov)
dc0774cbdfaee5b81085596dbc686036ca9a2d51 build, test: Fix test logfile name (Hennadii Stepanov)

Pull request description:

  Recently merged bitcoin/bitcoin#19385 was flawed as it tries to `cat` a non-existed logfile:
  - https://github.com/bitcoin/bitcoin/pull/19385#discussion_r835300701
  - https://github.com/bitcoin/bitcoin/pull/19385#issuecomment-1082748549

  Closes bitcoin/bitcoin#17224.

ACKs for top commit:
  luke-jr:
    utACK 8b517fae7eb229911a5d41bbe26fbf6cc7de46df

Tree-SHA512: 6c6dab6d7d38b5e949f1159ddff8e431f26d7254157f8308d63383c0642154271107e384c77722b7cf77f0be204bd21d69f3a9e93a8d19cf48954ac673df6c7a
2024-01-01 17:48:20 -06:00
MarcoFalke
706b616312
Merge bitcoin/bitcoin#19385: test: Change default test logging directory
f8cba0d9117fe9b9ac51d7044372b28270c7838b test: Change default test logging directory (Yancy Ribbens)

Pull request description:

  This PR changes the default test log location request here: https://github.com/bitcoin/bitcoin/issues/17224.  Instead of using the location of the makefile [automatic variable](https://www.gnu.org/software/make/manual/make.html#Automatic-Variables) `$<` I extract just the basename and then prepend a new location `./test`.  This is done because `$<` represents the variable name AND location of the prerequisite here.

Top commit has no ACKs.

Tree-SHA512: f0fbc530cf0e14c284b4bbf6671c145b1d7a2e1f5561f5c5d09f0cbe88b98e620e763bbbf2dfa9aeeec3dcc9b0127939e105e14c7e4f6660c7c19663622a393d
2024-01-01 17:48:19 -06:00
Wladimir J. van der Laan
6853849642 Merge #15710: wallet: Catch ios_base::failure specifically
7486e2771e7b5d6fa84df6e954be76350c84e220 Tests: Unit test related to WalletDB ReadKeyValue (Bushstar)
32def8d1c29e0855fe5429687acabd2f29119316 Catch ios_base::failure specifically (Peter Bushnell)

Pull request description:

  In https://github.com/bitcoin/bitcoin/pull/2950 a hash of the pubkey and private was added to speed up key import, this was made backwards compatible by reading the hash in a try block with an ellipses catch all in case the hash was not present.

  CDataStream::read() specifically throws std::ios_base::failure, backwards compatibility expects only that error to be thrown, if something else gets thrown we should not be catching it. The change in this commit is to catch that exception only. If any other exception is thrown other than std::ios_base::failure it will be caught by the wider try block and an error written to the log and/or console.

  CDataStream::read() throwing std::ios_base::failure.
  2c364fde42/src/streams.h (L191)

  Wider catch statements that pick up all others exceptions other than ios_base::failure.
  2c364fde42/src/wallet/walletdb.cpp (L425)

  2c364fde42/src/wallet/walletdb.cpp (L430)

ACKs for top commit:
  laanwj:
    Code review ACK 7486e2771e7b5d6fa84df6e954be76350c84e220

Tree-SHA512: 5364bf935af8ec603bf5b8fef8c23b5cdaa4fe3506090cff988413221f2eaa99f7a91929afb42a35f8881ce2328744a0d32052da51ca0a5b2e65b6809e97f604
2023-12-03 20:32:22 -06:00
Odysseas Gabrielides
112564974d
refactor: deprecate non-deterministic IS support (#5553)
## Issue being fixed or feature implemented
Non-deterministic IS locks aren't used anymore since v18 dip24.
We should drop that support to make code simpler.

## What was done?
Dropped non-deterministic IS code, `evo_instantsend_tests` and
`feature_llmq_is_migration.py` (don't need it anymore), adjusted func
tests.

## How Has This Been Tested?
all tests, synced Testnet

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: Konstantin Akimov <545784+knst@users.noreply.github.com>
2023-11-20 10:17:04 -06:00
fanquake
5a4406ef98 Merge bitcoin/bitcoin#26153: Reduce wasted pseudorandom bytes in ChaCha20 + various improvements
511aa4f1c7508f15cab8d7e58007900ad6fd3d5d Add unit test for ChaCha20's new caching (Pieter Wuille)
fb243d25f754da8f01793b41e2d225b917f3e5d7 Improve test vectors for ChaCha20 (Pieter Wuille)
93aee8bbdad808b7009279b67470d496cc26b936 Inline ChaCha20 32-byte specific constants (Pieter Wuille)
62ec713961ade7b58e90c905395558a41e8a59f0 Only support 32-byte keys in ChaCha20{,Aligned} (Pieter Wuille)
f21994a02e1cc46d41995581b54222abc655be93 Use ChaCha20Aligned in MuHash3072 code (Pieter Wuille)
5d16f757639e2cc6e81db6e07bc1d5dd74abca6c Use ChaCha20 caching in FastRandomContext (Pieter Wuille)
38eaece67b1bc37b2f502348c5d7537480a34346 Add fuzz test for testing that ChaCha20 works as a stream (Pieter Wuille)
5f05b27841af0bed1b6e7de5f46ffe33e5919e4d Add xoroshiro128++ PRNG (Martin Leitner-Ankerl)
12ff72476ac0dbf8add736ad3fb5fad2eeab156c Make unrestricted ChaCha20 cipher not waste keystream bytes (Pieter Wuille)
6babf402130a8f3ef3058594750aeaa50b8f5044 Rename ChaCha20::Seek -> Seek64 to clarify multiple of 64 (Pieter Wuille)
e37bcaa0a6dbb334ab6e817efcb609ccee6edc39 Split ChaCha20 into aligned/unaligned variants (Pieter Wuille)

Pull request description:

  This is an alternative to #25354 (by my benchmarking, somewhat faster), subsumes #25712, and adds additional test vectors.

  It separates the multiple-of-64-bytes-only "core" logic (which becomes simpler) from a layer around which performs caching/slicing to support arbitrary byte amounts. Both have their uses (in particular, the MuHash3072 code can benefit from multiple-of-64-bytes assumptions), plus the separation results in more readable code. Also, since FastRandomContext effectively had its own (more naive) caching on top of ChaCha20, that can be dropped in favor of ChaCha20's new built-in caching.

  I thought about rebasing #25712 on top of this, but the changes before are fairly extensive, so redid it instead.

ACKs for top commit:
  ajtowns:
    ut reACK 511aa4f1c7508f15cab8d7e58007900ad6fd3d5d
  dhruv:
    tACK crACK 511aa4f1c7

Tree-SHA512: 3aa80971322a93e780c75a8d35bd39da3a9ea570fbae4491eaf0c45242f5f670a24a592c50ad870d5fd09b9f88ec06e274e8aa3cefd9561d623c63f7198cf2c7
2023-11-19 10:20:12 -06:00
W. J. van der Laan
c8650ec003 Merge bitcoin/bitcoin#22704: fuzz: Differential fuzzing to compare Bitcoin 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
2023-11-19 10:20:12 -06:00
Kittywhiskers Van Gogh
3b25c5e84e merge bitcoin#19055: Add MuHash3072 implementation
contains:
- b111410914041b72961536c3e4037eba103a8085
- 01297fb3ca57e4b8cbc5a89fc7c6367de33b0bc6

completes:
- c7eb44a911 (from dash#4704)
2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
04fabaa1bd merge bitcoin#19288: Add fuzzing harness for TorController 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
ac5330bf66 merge bitcoin#21380: Add fuzzing harness for versionbits 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
11753e64e7 merge bitcoin#19259: Add fuzzing harness for LoadMempool(...) and DumpMempool(...) 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
dcd7babd80 merge bitcoin#20936: build fuzz tests by default 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
7c77a8c9c4 merge bitcoin#20377: Fill various small fuzzing gaps 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
ed5c750fb6 merge bitcoin#19143: Add fuzzing harnesses for CAutoFile, CBufferedFile, LoadExternalBlockFile and other FILE* consumers
includes:
- ad6c34881dc125c973b6b9ba1daa999d3141b1ae
2023-08-29 21:55:45 -05:00
MarcoFalke
76242f9d8d Merge #18551: Do not clear validationinterface entries being executed
2276339a176f83ffe8ceefb3e41ecca8601aa13b Add test for UnregisterAllValidationInterfaces bug (Russell Yanofsky)
3c61abbbc847d725f30d169278d84655571407c1 Do not clear validationinterface entries being executed (Pieter Wuille)

Pull request description:

  The previous code for MainSignalsInstance::Clear would decrement the reference
  count of every interface, including ones that were already Unregister()ed but
  still being executed.

  This fixes the issue pointed out here: https://github.com/bitcoin/bitcoin/pull/18524/files#r404395685 . It's not currently observable.

ACKs for top commit:
  jonasschnelli:
    utACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b - reviewed code and test (thanks @ryanofsky for adding the test).
  MarcoFalke:
    ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b 🎎
  ryanofsky:
    Code review ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b. No change to bugfix, just rebased and new test commit added since last review

Tree-SHA512: c1d68e7c681a45c6cadc84e407c2266bcb4b12d34264e1232a61c4eadb74b551231c5a3b1d041de39f507aef4dfa7d4589b8bfe1833f069c739c6270d2a05dbe
2023-08-03 11:16:41 -05:00
Kittywhiskers Van Gogh
040cd922f6 merge bitcoin#19521: Coinstats Index 2023-08-02 10:19:02 -05:00
Konstantin Akimov
42dcb3ddca
fix!: making MnEhfTx to comply DIP-0023 (#5505)
## Issue being fixed or feature implemented
Current implementation of MnEhfTx is not matched with DIP-0023, this PR
fixes it. It is a prior work for
https://github.com/dashpay/dash/pull/5469

## What was done?
- requestID is fixed from `clsig{quorumHeight}` to `mnhf{versionBit}` +
fixes for signature validation properly
 - v20 is minimal height to accept MnEHF special transactions
- versionBit is not BLS version - removed unrelated wrong code and
validations
- TxMempool will accept MnEHF transaction even if inputs/outputs are
zeroes and no fee
- implemented python's serialization/deserialization of MnEHF
transactions for future using in functional tests
 

## How Has This Been Tested?
Run functional/unit tests. Beside that there's new functional test in
https://github.com/dashpay/dash/pull/5469 that actually test format of
transaction and signature validation - to be merged later.

## Breaking Changes
Payload of MnEhf tx is changed, related consensus rules are changed.


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-07-25 21:46:55 +03:00
Kittywhiskers Van Gogh
08a6f3f764 merge bitcoin#21387: Refactor sock to add I2P fuzz and unit tests 2023-07-24 20:45:49 +03:00
Konstantin Akimov
8a0e681cea
feat!: add an implementation of DIP 0027 Credit Asset Locks (#5026)
## Issue being fixed or feature implemented
This is an implementation of DIP0027 "Credit Asset Locks".
It's a mechanism to fluidly exchange between Dash and credits.

## What was done?
This pull request includes:
      - Asset Lock transaction
      - Asset Unlock transaction (withdrawal)
      - Credit Pool in coinbase
      - Unit tests for Asset Lock/Unlock tx
      - New functional test `feature_asset_locks.py`

RPC: currently locked amount (credit pool) is available through rpc call
`getblock`.

## How Has This Been Tested?
There added new unit tests for basic checks of transaction validity
(asset lock/unlock).
Also added new functional test "feature_asset_locks.py" that cover
typical cases, but not all corner cases yet.

## Breaking Changes
This feature should be activated as hard-fork because:
- It adds 2 new special transaction and one of them [asset unlock tx]
requires update consensus rulels
 - It adds new data in coinbase tx (credit pool)

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
**To release DIP 0027**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-07-24 11:39:38 -05:00
PastaPastaPasta
cb93f15fae
fix: ./autogen fails due to newline (#5325)
## Issue being fixed or feature implemented
Develop doesn't build: ./autogen.sh fails

## What was done?
remove newline

## How Has This Been Tested?
./autogen.sh

## Breaking Changes
None

## Checklist:
_Go over all the following points, and put an `x` in all the boxes that
apply._
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-04-15 20:41:32 +03:00
fanquake
6ab29f312d Merge bitcoin/bitcoin#22853: fuzz: Remove addrdb fuzz target
fa18553d382a7d8c447cd6698b36e293fb7ecf1f fuzz: Remove addrdb fuzz target (MarcoFalke)

Pull request description:

  The target has several issues:
  * It is named incorrectly (`addrdb`, but it constructs a `CBanEntry`)
  * It doesn't do anything meaningful, other than consuming one integer and passing it to a constructor
  * It consumes CPU time that can be used for the other targets
  * It is redundant with the banman fuzz target

  Fix all by removing it.

ACKs for top commit:
  amitiuttarwar:
    ACK fa18553d382a7d8c447cd6698b36e293fb7ecf1f, thanks for the cleanup

Tree-SHA512: 3f8944d3f80913bf466c03062fed070e96073fb72d0938b2bc9a2586960c86879d6f251e16fd81cfeb4e6685ff9eef6bccb25cd3901b218a100c90f25a3c9240
2023-04-15 20:17:20 +03:00
Kittywhiskers Van Gogh
a262bb888b merge bitcoin#17954: Remove calls to Chain::Lock methods 2023-04-15 12:12:30 -05:00
Samuel Dobson
b89e80b705 Merge #18067: wallet: Improve LegacyScriptPubKeyMan::CanProvide script recognition
a304a3632f0437f4d0f04589a2200e2da91624a7 Revert "Store p2sh scripts in AddAndGetDestinationForScript" (Russell Yanofsky)
eb7d8a5b07e89133a5fb465ad1b793362e7439f7 [test] check for addmultisigaddress regression (Sjors Provoost)
005f8a92ccb5bc10c8daa106d75e1c21390461d3 wallet: Improve LegacyScriptPubKeyMan::CanProvide script recognition (Russell Yanofsky)

Pull request description:

  Make `LegacyScriptPubKeyMan::CanProvide` method able to recognize p2sh scripts when the redeem script is present in the `mapScripts` map without the p2sh script also having to be added to the `mapScripts` map. This restores behavior prior to #17261, which I think broke backwards compatibility with old wallet files by no longer treating addresses created by `addmultisigaddress` calls before #17261 as solvable.

  The reason why tests didn't fail with the CanProvide implementation in #17261 is because of a workaround added in 4a7e43e8460127a40a7895519587399feff3b682 "Store p2sh scripts in AddAndGetDestinationForScript", which masked the problem for new `addmultisigaddress` RPC calls without fixing it for multisig addresses already created in old wallet files.

  This change adds a lot of comments and allows reverting commit 4a7e43e8460127a40a7895519587399feff3b682 "Store p2sh scripts in AddAndGetDestinationForScript", so the `AddAndGetDestinationForScript()` function, `CanProvide()` method, and `mapScripts` map should all be more comprehensible

ACKs for top commit:
  Sjors:
    re-ACK a304a3632f0437f4d0f04589a2200e2da91624a7 (rebase, slight text changes and my test)
  achow101:
    re-ACK a304a3632f0437f4d0f04589a2200e2da91624a7
  meshcollider:
    utACK a304a3632f0437f4d0f04589a2200e2da91624a7

Tree-SHA512: 03b625220c49684c376a8062d7646aeba0e5bfe043f977dc7dc357a6754627d594e070e4d458d12d2291888405d94c1dbe08c7787c318374cedd5755e724fb6e
2023-03-19 11:08:31 -05:00
Kittywhiskers Van Gogh
a55cb7a635 merge bitcoin#20202: Make BDB support optional 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
f42288c984 partial bitcoin#19077: Add sqlite as an alternative wallet database and use it for new descriptor wallets 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
305abe91f9
build/depends: commit dashpay/bls-signatures@66ee820f to source tree as vendored (#5077)
* Squashed 'src/dashbls/' content from commit 66ee820fbc

git-subtree-dir: src/dashbls
git-subtree-split: 66ee820fbc9e3b97370db8c164904af48327a124

* build: stop tracking build-system generated relic_conf.h.in

* build: add support for building bls-signatures from local subtree

* build: add exclusions to linting scripts and filters

* build: drop bls-signatures (bls-dash) from depends
2022-11-22 11:34:46 -06:00
Kittywhiskers Van Gogh
e28c1c3f1b merge bitcoin#19415: Make DNS lookup mockable, add fuzzing harness 2022-11-01 00:28:53 -05:00
Kittywhiskers Van Gogh
9a9bd217ad merge bitcoin#19203: Add regression fuzz harness for CVE-2017-18350. Add FuzzedSocket 2022-11-01 00:28:53 -05:00
Kittywhiskers Van Gogh
f6b2a1722a merge bitcoin#20788: add RAII socket and use it instead of bare SOCKET 2022-11-01 00:28:53 -05:00
Kittywhiskers Van Gogh
32a328cae3
refactor: replace util::Ref with CoreContext (std::variant) (#5055)
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-10-22 12:18:03 -05:00
Kittywhiskers Van Gogh
6851dbf908 merge bitcoin#21882: Fix undefined reference to __mulodi4 2022-10-20 16:08:45 -05:00
Kittywhiskers Van Gogh
c52700f2ef merge bitcoin#20560: Link all targets once 2022-10-02 12:05:30 +05:30
Kittywhiskers Van Gogh
d3f8619b6c merge bitcoin#18994: Add fuzzing harnesses for functions in script/ 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
b4a7d85b49 merge bitcoin#18155: Add harness which fuzzes EvalScript and VerifyScript using a fuzzed signature checker 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
8342fd39dd merge bitcoin#17136: Add fuzzing harness for various PSBT related functions 2022-10-02 12:05:28 +05:30
Kittywhiskers Van Gogh
2cb0d0ed44 merge bitcoin#18528: create test_fuzz library from src/test/fuzz/fuzz.cpp 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
94bcbf588d merge bitcoin#18783: Add fuzzing harness for MessageSign, MessageVerify and other functions in util/message.h 2022-09-24 08:51:05 +05:30
PastaPastaPasta
0f3e00ce03
refactor: create an enum for DKGError, instead of passing around potentially invalid strings (#4998)
* refactor: create an enum for DKGError, instead of passing around potentially invalid strings

This also enables us to utilize an std::array instead of a std::map
This also removes the CCriticalSection and instead utilizes atomic doubles
This also adds safety to the dkgsimerror rpc rejecting invalid types

* test: add some tests for DKGError
2022-09-06 20:32:53 +03:00
Kittywhiskers Van Gogh
c2cb946d5c merge bitcoin#19065: Add fuzzing harness for CAddrMan 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
fb77c47ed4 merge bitcoin#19067: Add fuzzing harness for CNode 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
7241917b6d merge bitcoin#18744: Add fuzzing harnesses for various classes/functions in primitives/ 2022-08-23 21:33:34 +05:30