Commit Graph

21582 Commits

Author SHA1 Message Date
PastaPastaPasta
2197786843
Merge pull request #4704 from kittywhiskers/muhash
merge bitcoin#17319...19601: muhash implementation
2022-04-28 10:30:09 -05:00
PastaPastaPasta
f56b7fcf81
Merge pull request #4812 from Munkybooty/misc-backports
Misc backports v17
2022-04-28 10:13:43 -05:00
PastaPastaPasta
b421cfacae
perf: enable more multi-threading and caching in linters (#4807)
* perf: enable more multi-threading and caching in linters

20s -> 6s

* ci: add multiprocess to ci dockerfile

* Update test/lint/lint-cppcheck-dash.sh

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-27 21:14:40 +03:00
UdjinM6
4d70755155 more of/followup 13177 2022-04-27 10:45:51 -04:00
Kittywhiskers Van Gogh
ef18d0858d merge bitcoin#19145: Add hash_type MUHASH for gettxoutsetinfo 2022-04-27 20:05:13 +05:30
Kittywhiskers Van Gogh
c7eb44a911 partial bitcoin#19055: Add MuHash3072 implementation
Excludes b111410914041b72961536c3e4037eba103a8085 and 01297fb3ca57e4b8cbc5a89fc7c6367de33b0bc6
2022-04-27 20:05:13 +05:30
Kittywhiskers Van Gogh
5afca7f73c merge bitcoin#19105: Add Muhash3072 implementation in Python 2022-04-27 20:05:13 +05:30
Kittywhiskers Van Gogh
5680bbdbf3 merge bitcoin#18576: use unittest for test_framework unit testing 2022-04-27 20:05:13 +05:30
Kittywhiskers Van Gogh
0a7ce77c7e merge bitcoin#19601: Refactoring CHashWriter & Get{Prevouts,Sequence,Outputs}Hash to SHA256 2022-04-27 19:58:39 +05:30
UdjinM6
ba4a7b1d07
tests: make inv replies in interface_zmq_dash.py stricter, fix a bug (#4813)
* only reply to the correct inv type in on_getdata

* send_tx should send invs with the right type

the bug was introduced in 3852
2022-04-27 17:16:52 +03:00
Kittywhiskers Van Gogh
2b1e71526f merge bitcoin#18378: Bugfix & simplify bn2vch using int.to_bytes 2022-04-27 19:23:36 +05:30
Kittywhiskers Van Gogh
11bcc750f7 merge bitcoin#17319: remove bignum module 2022-04-27 19:23:36 +05:30
Kittywhiskers Van Gogh
87ab86c459 merge bitcoin#19328: Add gettxoutsetinfo hash_type option 2022-04-27 19:23:36 +05:30
PastaPastaPasta
1e3c35e6bd
chore: bump develop to 18.1.0.0 (#4811) 2022-04-26 21:03:29 +03:00
Wladimir J. van der Laan
87112fd95f Merge #13177: GCC-7 and glibc-2.27 back compat code
253f5929097548fb10ef995002dedbb8dadb6a0d Add stdin, stdout, stderr to ignored export list (Chun Kuan Lee)
fc6a9f2ab18ca8466d65d14c263c4f78f9ccebbf Use IN6ADDR_ANY_INIT instead of in6addr_any (Cory Fields)
908c1d7745f0ed117b0374fcc8486f83bf743bfc GCC-7 and glibc-2.27 compat code (Chun Kuan Lee)

Pull request description:

  The `__divmoddi4` code was modified from https://github.com/gcc-mirror/gcc/blob/master/libgcc/libgcc2.c . I manually find the older glibc version of log2f by objdump, use `.symver` to specify the certain version.

Tree-SHA512: e8d875652003618c73e019ccc420e7a25d46f4eaff1c7a1a6bfc1770b3b46f074b368b2cb14df541b5ab124cca41dede4e28fe863a670589b834ef6b8713f9c4
2022-04-26 13:41:49 -04:00
MarcoFalke
c68f422bd9 Merge #13928: qa: blocktools enforce named args for amount
cf9ed307e6 qa: blocktools enforce named args for amount (MarcoFalke)

Pull request description:

  Since  #13669 changed some signatures, I think it might be worthwhile to enforce named args for primitive types such as amounts.

Tree-SHA512: 2733e7b6a20590b54bd54e81a09e3f5e2fadf4390bed594916b70729bcf485b048266012c1203369e0968032a2c6a2719107ac17ee925d8939af3df916eab1a6
2022-04-26 13:39:19 -04:00
UdjinM6
47ab180d04
rpc: fix and simplify quorum rotationinfo (#4808)
Issues with current implementation: params list is not mentioning `baseBlockHashes`, `baseBlockHashesNb` looks excessive, no default values, handling of baseBlockHash-es is off by 1 (`3 + i` should be `4 + i`).

before:
```
> help quorum rotationinfo

quorum rotationinfo "blockRequestHash" baseBlockHashesNb extraShare
Get quorum rotation information

Arguments:
1. blockRequestHash     (string, required) The blockHash of the request.
2. baseBlockHashesNb    (numeric, required) Number of baseBlockHashes
3. extraShare           (boolean, required) Extra share
```

after:
```
> help quorum rotationinfo

quorum rotationinfo "blockRequestHash" ( extraShare "baseBlockHash..." )
Get quorum rotation information

Arguments:
1. blockRequestHash    (string, required) The blockHash of the request.
2. extraShare          (boolean, optional, default=false) Extra share
3. baseBlockHash...    (string, optional, default=) baseBlockHashes
```
2022-04-26 20:28:57 +03:00
Wladimir J. van der Laan
089cabbd2d Merge #13719: Avoid creating a temporary vector for size-prefixed elements
84547fa6d408bdda1685f6d5972232bb19d97a7d Avoid creating a temporary vector for size-prefixed elements (Pieter Wuille)

Pull request description:

  This is a simple improvement to the PSBT serialization code, avoiding the need for temporary vectors everywhere.

Tree-SHA512: 9f7243b7169ec8ba00ffad31af03c016ab84e4f76ebac810167f91f5e8008f3827ad59fbcee0cb2bd2334fc26466eb222404af24e7fb6ec040fd78229ebe0fd1
2022-04-26 13:27:11 -04:00
Odysseas Gabrielides
fafb1b2ac8
Correct returned variable (#4809)
* Correct returned variable

* Fix
2022-04-26 20:23:52 +03:00
UdjinM6
b8c9eec34f
llmq: Avoid endless loop in GetQuorumRelayMembers (#4796)
* llmq: Avoid endless loop in GetQuorumRelayMembers

regtest quorums can be tiny

* minimize changes, add a note
2022-04-26 20:22:56 +03:00
UdjinM6
cb75351543
Merge pull request #4581 from kittywhiskers/monterey_patch
merge bitcoin#17227...#23580: Qt 5.12.10
2022-04-26 20:21:15 +03:00
Pieter Wuille
3285e21cfd Merge #12686: Add -ftrapv to CFLAGS and CXXFLAGS when --enable-debug is used. Enable -ftrapv in Travis.
98d842cb52 travis: Build with --enable-debug (x86_64-unknown-linux-gnu) (practicalswift)
94e52d13db Add -ftrapv to DEBUG_CXXFLAGS when --enable-debug is used (practicalswift)

Pull request description:

  By generating a trap for signed overflow on addition, subtraction, multiplication operations in the Travis testing we are more likely to identify problematic code prior to merging it.

Tree-SHA512: 47712da53b4ff451b8f22f16ddc3b53100a09060a3b04cda4b8fbbb74e6f666fc07a9cc7abc64cacb87a0aa3f62dc8e3c91a1a0ed12bf82bb2a5624a5d104389
2022-04-26 13:16:11 -04:00
UdjinM6
4db1397927 fix glibc compatibility issues 2022-04-26 20:37:31 +05:30
UdjinM6
c6e724bf21 partial bitcoin#22244: Add xkb version to symbol-check 2022-04-26 20:37:20 +05:30
UdjinM6
dfa16fc05d merge bitcoin#22054: Bump Qt version to 5.12.11 2022-04-26 20:37:20 +05:30
UdjinM6
e3dbd51296 merge bitcoin#21423: Cleanups and follow ups after bumping Qt to 5.12.10 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
59b9725d23 merge bitcoin#20641: Use Qt top-level build facilities 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
627a2d66ff merge bitcoin#21497: Do not opt-in unused CoreWLAN stuff in depends for macOS 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
1658dc4d67 merge bitcoin#20520: Do not force Precompiled Headers (PCH) for building Qt on Linux 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
65f779489d partial bitcoin#21694: Use XLIFF file to provide more context to Transifex translators
Excludes 35d52397e72f3ab96a7797148666b501d50b445d
2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
7b69a4cb42 merge bitcoin#21654: Make Qt rcc output always deterministic 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
b9b9473f55 merge bitcoin#21655: No longer need to set QT_RCC_TEST=1 for determinism 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
6bfd84a929 merge bitcoin#21708: Drop pointless sed commands 2022-04-26 20:36:54 +05:30
Kittywhiskers Van Gogh
dfe84d6552 merge bitcoin#23580: patch qt to explicitly define previously implicit header include 2022-04-26 20:36:53 +05:30
Kittywhiskers Van Gogh
0ab6ab79e4 merge bitcoin#21495: Fix static builds on macOS Big Sur 2022-04-26 20:36:08 +05:30
Kittywhiskers Van Gogh
ae45b570c2 partial bitcoin#17227: Add Android packaging support 2022-04-26 20:36:08 +05:30
UdjinM6
f108947cec
Translations 202202 (#4691)
* make translate

* ru

* fi

* 100%: es, fi, fr, it, ja, ko, nl, pl, pt, sk, th, tr, zh_TW
2022-04-26 11:21:57 +03:00
PastaPastaPasta
80d97381c2
refactor: implement irange::range and use it (#4788)
* refactor: implement irange::range and use it

* misc fixes

* Apply suggestions from code review

* compilation fixes

* suggestions

* fix: fix linter

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-26 02:40:41 +03:00
PastaPastaPasta
80a4360389
fix: bump dkgBadVotesThreshold to 80% (#4806) 2022-04-26 01:57:11 +03:00
UdjinM6
fd7786e04b
Merge pull request #4804 from PastaPastaPasta/develop-trivial-2022-04-25
trivial backports 2022 04 25
2022-04-26 00:51:36 +03:00
PastaPastaPasta
4a209adb1f
refactor(coinjoin): add GUARDED_BY annotation to mapDSTX (#4789) 2022-04-25 23:43:30 +03:00
Kittywhiskers Van Gogh
1763f727b5 merge bitcoin#21376: Qt 5.12.10 2022-04-26 00:54:10 +05:30
UdjinM6
40c320cad8
trivial/lint: tweak lint-spelling.sh and fix typos (#4802)
* lint: exclude 3-rd party libs from spell-checks

* trivial: fix typos
2022-04-25 22:13:24 +03:00
UdjinM6
7fc9ced96d
tests: various fixes/cleanups (#4797)
* tests: move `move_to_next_cycle` to `DashTestFramework`

* tests: set correct defaults for `mine_cycle_quorum`

* tests: use correct quorum type in `create_islock`

* tests: fix `rpc_verifyislock.py`

* tests: fix `feature_llmq_is_cl_conflicts.py`

* tests: isolate zmq subscribers in `interface_zmq_dash.py`

this lets us call `test_*_publishers()` in any order and any number of times

* tests: check zmq for both deterministic and non-deterministic islocks
2022-04-25 22:12:04 +03:00
Odysseas Gabrielides
a2e1f46cf4
Edge case fix for Rotation (#4803)
* Edge case fix

* Simpler syntax

* add a bit of documentation, and adjust scopes

* use a switch statment

* adjust how returning happens

Co-authored-by: pasta <pasta@dashboost.org>
2022-04-25 22:11:44 +03:00
MarcoFalke
9a01bb32fe Merge #20760: test: Set correct nValue for multi-op-return policy check
fad140e311028f904635126e3c77352afac1b75e test: Set correct nValue for multi-op-return policy check (MarcoFalke)

Pull request description:

  `CTxOut::nValue` is default-initialized to `-1`. The dust-threshold for `OP_RETURN` outputs is `0`. Thus, the policy failure would be `dust` instead of `multi-op-return`. The test only passes because the dust check is currently not run.

  Avoid that confusion by setting the value to `0`, to ensure the dust check passes.

ACKs for top commit:
  theStack:
    ACK fad140e311028f904635126e3c77352afac1b75e

Tree-SHA512: f0c7a68eb2c573d6595b2b129fa8fa2a34fa35c17691f448bf1c54ccf66059c37562e7480cde7b51c4de677038d7717873da4257147a5f60acc8bbcd25fb7e3f
2022-04-25 14:02:48 -05:00
Wladimir J. van der Laan
49e8ca6966 Merge #20469: build: Avoid secp256k1.h include from system
e95aaefe2540cb76969818fcc2ff77d33448ed5a build: Avoid secp256k1.h include from system (Niklas Gögge)

Pull request description:

  While building i ran into an error because i had a version of `secp256k1.h` under `/usr/local/include` that was incompatible with the secp256k1 code in the repository. This caused a problem because `$(BOOST_CPPFLAGS)` contained `-I/usr/local/include` and the include paths are searched by the compiler in order from left to right, so in the end `$(BITCOIN_INCLUDES)` contained `-I/usr/local/include` before `-I$(srcdir)/secp256k1/include` which caused the compiler to find  `secp256k1.h` under `/usr/local/include`.

  Looking at git blame i am wondering how this has not happened to anyone else in several years: cb89e18845/src/Makefile.am (L25)

  I am on macOS 10.15.

ACKs for top commit:
  laanwj:
    Code review ACK e95aaefe2540cb76969818fcc2ff77d33448ed5a
  hebasto:
    ACK e95aaefe2540cb76969818fcc2ff77d33448ed5a, tested on macOS 11 Big Sur by adding `#error` into `/usr/local/include/secp256k1.h`.

Tree-SHA512: 1f0b395725936c179ab60dee3582ec7b21e2f9c0f1895e160d84a487cf0db16d0c7aa47d05800e0aded31685b4362056cac9b9ecca1bb8c308a4c5a810e8dc1d
2022-04-25 14:02:48 -05:00
Wladimir J. van der Laan
a193964e0e Merge #20358: src/randomenv.cpp: fix build on uclibc
330cb33985d0ce97c20f4a0f0bbda0fbffe098d4 src/randomenv.cpp: fix build on uclibc (Fabrice Fontaine)

Pull request description:

  Check for HAVE_STRONG_GETAUXVAL or HAVE_WEAK_GETAUXVAL before using
  getauxval to avoid a build failure on uclibc

  Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

ACKs for top commit:
  laanwj:
    Code review ACK 330cb33985d0ce97c20f4a0f0bbda0fbffe098d4

Tree-SHA512: 94fbbdb0e859f0220d64b2d04565f575b410327f080125fec7fb74205d0bea0e8133561c83a696033d6dc377871133871b72c1aad19aca61e972ce67e0fdf707
2022-04-25 14:02:48 -05:00
fanquake
0f79a4002b Merge #20082: [bugfix] random: fixes read buffer to use min rather than max
bd5215103eb3985c1622eddea45a040e6173829c random: fixes read buffer resizing in RandAddSeedPerfmon (Ethan Heilman)

Pull request description:

  As shown below when resizing the read buffer `vData` `std::max((vData.size() * 3) / 2, nMaxSize)` is used. This means that the buffer size immediately jumps to `nMaxSize`. I believe the intend of this code is to grow the buffer size through several steps rather than immediately resize it to the max size.

  ```cpp
      std::vector<unsigned char> vData(250000, 0);
      long ret = 0;
      unsigned long nSize = 0;
      const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data
      while (true) {
          nSize = vData.size();
          ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", nullptr, nullptr, vData.data(), &nSize);
          if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize)
              break;
          vData.resize(std::max((vData.size() * 3) / 2, nMaxSize)); // Grow size of buffer exponentially
      }
  ```

  vData always starts at size 250,000 and nMaxSize is always 10,000,000 so the first time this line is reached:
  ```cpp
  vData.resize(std::max((vData.size() * 3) / 2, nMaxSize));
  ```
  the effect will always be to resize vData to nMaxSize. Then because the loop terminates when vData.size >= 10,000,000 only one resize operation will take place.

  To fix this issue we replace `std::min` with `std::max`

  This PR also adds a comment clarifying the behavior of this function the first time it is called.

ACKs for top commit:
  fanquake:
    ACK bd5215103eb3985c1622eddea45a040e6173829c - thanks for taking a look at this Ethan. Swapping from `std::max` to `std::min` here certainly seems correct.

Tree-SHA512: 7c65f700e5bbe44bc2f1ffdcdc99ec19c542894c95b5ee9791facd09d02afae88d1f8f35af129719e4860db94bc790856e7adb1d218a395381e7c2913b95f1d0
2022-04-25 14:02:48 -05:00
Wladimir J. van der Laan
b582fbb9a6 Merge #18359: build: fix sysctl() detection on macOS
e90e3e684ffa7b25f0dfb5b45e70bb0c358261fb build: fix sysctl() detection on macOS (fanquake)

Pull request description:

  [`sysctl()` on *BSD](https://www.unix.com/man-page/FreeBSD/3/sysctl/) takes a "const int *name", whereas [`sysctl()` on macOS](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html)
  it takes an "int *name". So our configure check and `sysctl()` detection on
  macOS currently fails:

  ```bash
  /usr/include/sys/sysctl.h:759:9: note: candidate function not viable:
  	no known conversion from 'const int [2]' to 'int *' for 1st argument
  int     sysctl(int *, u_int, void *, size_t *, void *, size_t);
  ```

  The simplest change seems to be to change the param to a "int *name", which
  will work during configure on macOS and *BSD systems.

  For consistency I've changed both calls, but note that macOS doesn't
  have `KERN_ARND`, so that check will always fail regardless. We can revert/add
  documentation if preferred.

ACKs for top commit:
  laanwj:
    Re-ACK e90e3e684ffa7b25f0dfb5b45e70bb0c358261fb

Tree-SHA512: 29e9348136fc72882f63079bf10d2490e845d7656aae2c003e282bea49dd2778204a7776a67086bd88c2852af9a07dd04ba358eede7e37029e1c10f73c85d6a5
2022-04-25 14:02:48 -05:00