Commit graph

25988 commits

Author SHA1 Message Date
fanquake
f07fb5a55e
build: patch qt libpng to fix powerpc build
This is an alternative to #19751 that fixes the build without requiring
splitting out libpng. This patch can be dropped once we are building qt
5.12.0 or later.
2020-09-15 21:48:59 +08:00
Wladimir J. van der Laan
62e3eb9888
Merge #19241: help: Generate checkpoint height from chainparams
916d3596c4 help: Generate checkpoint height from chainparams (Luke Dashjr)

Pull request description:

  Not sure if this is worth putting in Core, but might as well until checkpoints are removed entirely.

ACKs for top commit:
  laanwj:
    re-ACK 916d3596c4

Tree-SHA512: d8eb26b570ee730fdd75ca916507134db5f2f68987a911e33544b7f1c9ccfd1c76b9c9db63056971956b6daf16910f17ecfc197481c2f7b0773afdfbf7d381cf
2020-09-15 15:46:08 +02:00
Wladimir J. van der Laan
48a9968e50
Merge #19558: build: split pthread flags out of ldflags and dont use when building libconsensus
fc9278d162 build: AX_PTHREAD serial 27 (fanquake)
15c27c4441 build: split PTHREAD_* flags out of AM_LDFLAGS (fanquake)
68e3e22944 scripted-diff: add FUZZ_SUITE_LDFLAGS_COMMON (fanquake)
afecde8046 build: add PTHREAD_LIBS to LDFLAGS configure output (fanquake)

Pull request description:

  TLDR: Split pthread flags out of ldflags, and stop using them when building libconsensus.

  Building libconsensus on Linux using Clang currently warns. i.e:
  ```bash
  ./autogen.sh
  ./configure --disable-tests --disable-bench --with-utils=no --with-daemon=no --with-gui=no --disable-wallet --with-libs=yes CC=clang CXX=clang++
  make V=1 -j6
  ... -Wl,-z -Wl,relro -Wl,-z -Wl,now   -pthread -Wl,-soname -Wl,libbitcoinconsensus.so.0 -o .libs/libbitcoinconsensus.so.0.0.0
  clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
  ```

  Besides wanting to quiet the warnings, after digging into this it seemed we could clean up how we are passing around the pthread flags. I also learnt a bit more about how libtools builds shared libraries, and that passing `-pthread` on the link line wouldn't be enough to link against pthreads anyways, due to libtools usage of -nostdlib (see [related discussion where we build DLLs](476436b2de/configure.ac (L603))).

  This can be demonstrated with a patch to libconsensus:
  ```patch
  diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp
  index 15e204062..10bf3582f 100644
  --- a/src/script/bitcoinconsensus.cpp
  +++ b/src/script/bitcoinconsensus.cpp
  @@ -10,6 +10,8 @@
   #include <script/interpreter.h>
   #include <version.h>

  +#include <pthread.h>
  +
   namespace {

   /** A class that deserializes a single CTransaction one time. */
  @@ -127,3 +129,10 @@ unsigned int bitcoinconsensus_version()
       // Just use the API version for now
       return BITCOINCONSENSUS_API_VER;
   }
  +
  +void *func_pthread(void *x) { return x; }
  +
  +void f() {
  +	pthread_t t;
  +	pthread_create(&t,0,func_pthread,0);
  +}
  ```

  After building,  you'll find you have a `libbitcoinconsensus.so` using pthread symbols, but which isn't linked against libpthread:
  ```bash
  ldd -r src/.libs/libbitcoinconsensus.so
  	linux-vdso.so.1 (0x00007ffe49378000)
  	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f553cee7000)
  	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f553cda2000)
  	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f553cd88000)
  	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f553cbc5000)
  	/lib64/ld-linux-x86-64.so.2 (0x00007f553d15d000)
  undefined symbol: pthread_create	(src/.libs/libbitcoinconsensus.so)
  ```

  This libtool behaviour has been known about for some time, i.e this [thread from 2005](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460),  describes the same issue. The suggestion from libtool maintainers at the time is to add `-lpthread` to LDFLAGS.

  Also worth noting is that some of the users in those threads were also using the `AX_PTHREADS` macro, same as us, to determine how to compile with/link against pthreads. This macro has [recently been updated](https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=2fb904589643eb6ca6122f834891b58d1d51b347), with reference to this issue. You can compare the output from the version we currently use, to the new version:
  ```bash
  # our ax_pthread macro:
    PTHREAD_CFLAGS = -pthread
    PTHREAD_LIBS  =
    PTHREAD_CC    = gcc / clang

  # the new ax_pthread macro
    PTHREAD_CFLAGS = -pthread
    PTHREAD_LIBS  = -lpthread
    PTHREAD_CC    = gcc / clang
  ```

  Note that as part of this PR I've also added `PTHREAD_LIBS` to the split out flags. Although we weren't using it anywhere previously (and wouldn't have seemed to matter for the most part, given it was likely empty for most builders), the macro assumes it's use. i.e:
  > NOTE: You are assumed to not only compile your program with these flags,
  > but also to link with them as well. For example, you might link with
  > $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS

ACKs for top commit:
  laanwj:
    Code review ACK fc9278d162
  hebasto:
    re-ACK fc9278d162, only rebased and renamed s/`AM_PTHREAD_FLAGS`/`PTHREAD_FLAGS`/ since my [previous](https://github.com/bitcoin/bitcoin/pull/19558#pullrequestreview-473487730) review..
  kallewoof:
    ACK fc9278d162

Tree-SHA512: 7c0a5b0f0de4f54b1d7dce0e69020b341c37a383bb7c715867cc96c648774a557b1ddb42eb1b676f7bb2b822b69795bec14dc6272362d80662a21f10cb80331c
2020-09-15 13:03:02 +02:00
Daniel Kraft
6fe2ef2acb scripted-diff: Rename SendMessage to SendZmqMessage.
Windows headers define SendMessage as a macro, which leads to problems
with the method name "SendMessage".  To circumvent this, we rename the
method to "SendZmqMessage".

-BEGIN VERIFY SCRIPT-
sed -i 's/SendMessage/SendZmqMessage/g' src/zmq/zmqpublishnotifier.*
-END VERIFY SCRIPT-
2020-09-15 09:38:56 +02:00
fanquake
a33651866c
Merge #19643: Add -netinfo peer connections dashboard
bf1f913c44 cli -netinfo: display multiple levels of details (Jon Atack)
077b3ac928 cli: change -netinfo optional arg from bool to int (Jon Atack)
4e2f2ddd64 cli: add getpeerinfo last_{block,transaction} to -netinfo (Jon Atack)
644be659ab cli: add -netinfo server version check and error message (Jon Atack)
ce57bf6cc0 cli: create peer connections report sorted by dir, minping (Jon Atack)
f5edd66e5d cli: create vector of Peer structs for peers data (Jon Atack)
3a0ab93e1c cli: add NetType enum struct and NetTypeEnumToString() (Jon Atack)
c227100919 cli: create local addresses, ports, and scores report (Jon Atack)
d3f77b736e cli: create inbound/outbound peer connections report (Jon Atack)
19377b2fd2 cli: start dashboard report with chain and version header (Jon Atack)
a3653c159e cli: tally peer connections by type (Jon Atack)
54799b66b4 cli: add ipv6 and onion address type detection helpers (Jon Atack)
12242b17a5 cli: create initial -netinfo option, NetinfoRequestHandler class (Jon Atack)

Pull request description:

  This PR is inspired by laanwj's python script mentioned in #19405, which it turns out I ended up using every day and extending because I got hooked on using it to monitor Bitcoin peer connections.

  For the full experience, run `./src/bitcoin-cli -netinfo 4`

  On Linux, try it with watch `watch ./src/bitcoin-cli -netinfo 4`

  Help doc
  ```
  $ ./src/bitcoin-cli -help | grep -A3 netinfo
    -netinfo
         Get network peer connection information from the remote server. An
         optional integer argument from 0 to 4 can be passed for different
         peers listings (default: 0).
  ```

ACKs for top commit:
  vasild:
    ACK bf1f913
  0xB10C:
    ACK bf1f913c44
  practicalswift:
    ACK bf1f913c44 -- patch looks correct and is limited to `src/bitcoin-cli.cpp`

Tree-SHA512: b9d18e5cc2ffd2bb9f0295b5ac7609da8a9bbecaf823a26dfa706b5f07d5d1a8343081dad98b16aa9dc8efd8f41bc1a4acdc40259727de622dc7195ccf59c572
2020-09-15 15:01:50 +08:00
fanquake
5d5e335f96
Merge #19903: Update build-openbsd.md with GUI support
d11020019a Add OpenBSD instructions for building the Qt GUI (grubles)

Pull request description:

  Using OpenBSD as a desktop OS is prevalent enough IMO to warrant updating the documentation for building the GUI.

ACKs for top commit:
  fanquake:
    ACK d11020019a - looks fine. Have not tested.

Tree-SHA512: a8078334fdd35438bcf87c3f5eae851c2a1ce961eb48ae50770bf2c556489da86b6ee198fe9fb732dcaddb2e0f2f4f55a3126971aae8f7d4e2e320dbb024e204
2020-09-15 12:05:21 +08:00
Samuel Dobson
ffaac6e614
Merge #16378: The ultimate send RPC
92326d8976 [rpc] add send method (Sjors Provoost)
2c2a1445dc [rpc] add snake case aliases for transaction methods (Sjors Provoost)
1bc8d0fd59 [rpc] walletcreatefundedpsbt: allow inputs to be null (Sjors Provoost)

Pull request description:

  `walletcreatefundedpsbt` has some interesting features that `sendtoaddress` and `sendmany` don't have:
  * manual coin selection
  * outputting a PSBT (it was controversial to add this, see #18201)
  * create a transaction without adding to wallet (which leads to broadcasting, unless `-walletbroadcast=0`)

  At the same time `walletcreatefundedpsbt` can't broadcast a transaction, which is inconvenient for simple use cases.

  This PR introduces a new `send` RPC method which creates a PSBT, signs it if possible and adds it to the wallet by default. If it can't sign all inputs, it outputs a PSBT. If `add_to_wallet` is set to `false` it will return the transaction in both PSBT and hex format.

  Because it uses a PSBT internally, it will much easier to add hardware wallet support to this method (see #16546).

  For `bitcoin-cli` users, it tries to keep the simplest use case easy to use:

  ```sh
  bitcoin-cli -regtest send '{"ADDRESS": 0.1}' 1 sat/b
  ```

  This paves the way for deprecating `sendtoaddress` and `sendmany` though there's no rush. The only missing feature compared to these older methods is adding labels to a destination address.

  Depends on:
  - [x] #16377 (`[rpc] don't automatically append inputs in walletcreatefundedpsbt`)
  - [x] #11413 (`[wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option`)
  - [x] #18244 (`[rpc] have lockUnspents also lock manually selected coins`)

ACKs for top commit:
  meshcollider:
    Light re-utACK 92326d8976
  achow101:
    ACK 92326d8976 Reviewed code and test, ran tests.
  kallewoof:
    utACK 92326d8976

Tree-SHA512: 7552ef1b193d4c06e381c44932fdb0d54f64383e4c7d6b988f49d059c7d4bba45ce6aa7813e03df86360ad9dad6f3010eb76ee7da480551742d5fd98c2251c0f
2020-09-15 14:49:08 +12:00
Carl Dong
4668ded6d6
validation: Move ~CMainCleanup logic to ~BlockManager
~CMainCleanup:
1. Is vestigial
2. References the g_chainman global (we should minimize g_chainman refs)
3. Only acts on g_chainman.m_blockman
4. Does the same thing as BlockManager::Unload
2020-09-14 10:42:45 -04:00
Antoine Poinsot
a3abeec33a
policy/fees: remove a floating-point division by zero
Reported-by: practicalswift <practicalswift@users.noreply.github.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-09-14 16:23:23 +02:00
Antoine Poinsot
c36869bbf6
policy/fees: unify some duplicated for loops
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-09-14 15:28:27 +02:00
Antoine Poinsot
569d92a4d2
policy/fees: small readability improvements
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-09-14 15:26:44 +02:00
Antoine Poinsot
5b8cb35621
policy/fee: remove requireGreater parameter in EstimateMedianVal()
It was always passed as true, and complicates the (already complex)
logic of the function.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-09-14 15:11:30 +02:00
Antoine Poinsot
dba8196b44
policy/fees: correct decay explanation comments
This was confusing: which one is the good one ? After testing the value
is right but not the comment, so fix it.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-09-14 15:11:25 +02:00
fanquake
fc9278d162
build: AX_PTHREAD serial 27 2020-09-14 16:35:09 +08:00
fanquake
15c27c4441
build: split PTHREAD_* flags out of AM_LDFLAGS
Note that with this change we are no-longer including PTHREAD_* flags
when building libbitcoinconsensus.

Also note that we are including PTHREAD_LIBS in AM_PTHREAD_FLAGS
2020-09-14 16:35:09 +08:00
fanquake
68e3e22944
scripted-diff: add FUZZ_SUITE_LDFLAGS_COMMON
-BEGIN VERIFY SCRIPT-
sed -i -e 's/\$(RELDFLAGS) \$(AM_LDFLAGS) \$(LIBTOOL_APP_LDFLAGS)$/\$(FUZZ_SUITE_LDFLAGS_COMMON)/' src/Makefile.test.include
patch -p1 << "EOF"
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -323,6 +323,8 @@ endif

 if ENABLE_FUZZ

+FUZZ_SUITE_LDFLAGS_COMMON = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
+
 test_fuzz_addition_overflow_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
 test_fuzz_addition_overflow_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
 test_fuzz_addition_overflow_LDADD = $(FUZZ_SUITE_LD_COMMON)
EOF
-END VERIFY SCRIPT-
2020-09-14 16:35:00 +08:00
fanquake
06dbbe76dd
Merge #19931: Change CSipHasher's count variable to uint8_t
812037cb80 Change CSipHasher's count variable to uint8_t (Pieter Wuille)

Pull request description:

  SipHash technically supports arbitrarily long inputs (at least, I couldn't find a limit in the [paper](https://eprint.iacr.org/2012/351.pdf)), but only the low 8 bits of the length matter. Because of that we should use an unsigned type to track the length (as any signed type could overflow, which is UB). `uint8_t` is sufficient, however.

  Fixes #19930.

ACKs for top commit:
  laanwj:
    anyhow re-ACK 812037cb80
  elichai:
    utACK 812037cb80
  practicalswift:
    ACK 812037cb80
  theStack:
    ACK 812037cb80

Tree-SHA512: 5b1440c9e4591460da198991fb421ad47d2d96def2014e761726ce361aa9575752f2c4085656e7e9badee3660ff005cc76fbd1afe4848faefe4502f3412bd896
2020-09-14 16:30:17 +08:00
fanquake
afecde8046
build: add PTHREAD_LIBS to LDFLAGS configure output
Also moves $PTHREAD_CFLAGS to the CFLAGS.
2020-09-14 16:12:36 +08:00
fanquake
ba4b3fbcf2
Merge #19944: Update secp256k1 subtree (including BIP340 support)
b9c1a76481 Squashed 'src/secp256k1/' changes from 2ed54da18a..8ab24e8dad (Pieter Wuille)

Pull request description:

  This updates our src/secp256k1 subtree to the latest libsecp256k1 upstream version.

  As it adds BIP340 support (see https://github.com/bitcoin-core/secp256k1/pull/558), this is a prerequisite for #17977. In particular, it contains:
  * A few generic library improvements
  * Support for x-only public keys as used by BIP340.
  * Support for "key pair" objects, making signing more efficient by using a precomputed public key.
  * Signing support for BIP340 Schnorr (single-party) signatures.
  * Verification support for BIP340 Schnorr signatures.
  * Support for verifying tweaked x-only keys, as used by BIP341's Taproot construction.

  Things that are not included:
  * MuSig, nor any kind of multisignatures, threshold signatures, ... on top.
  * Batch verification.
  * Support for variable-length messages in BIP340 (which are still being discussed, but won't affect BIP341, or Bitcoin Core).
  * A few more generic improvements that are still in the pipeline, including faster modular inversions.

ACKs for top commit:
  instagibbs:
    ACK 894fb33f4c
  fanquake:
    ACK 894fb33f4c. Any Valgrind concerns will be addressed upstream, see discussion in https://github.com/bitcoin-core/secp256k1/pull/813, and if necessary, can be pulled into our tree prior to the 0.21.0 branch off. They are not a blocker for merging this PR in it's current state.
  benthecarman:
    ACK `894fb33`

Tree-SHA512: 6dc992f4477069b7fbd223316f1be955750923be1479c38adad2312649fdca1f316edb375c42ef9d97cea2407caaef49fb8c93abd6c037fe1a522910cbbc2479
2020-09-14 11:52:24 +08:00
Gregory Sanders
e1fdd2963b Test batch rpc with params 2020-09-13 13:43:03 -04:00
Samuel Dobson
be375b2206
Merge #19919: bugfix: make LoadWallet assigns status always
8b39a87558 bugfix: make LoadWallet assigns status always (Akio Nakamura)

Pull request description:

  In my enviroment, ```test/functional/wallet_multiwallet.py``` failed in line 237 for master( 147d50d63 ).
  It got an expected rpc-error-message, but error code was not (-4) but (-18).

  This is because that although loadwallet() in rpcwallet.cpp assumes LoadWallet() always assign some value to the 'status', but LoadWallet() does not do so in some situation.

  This PR intends to fix above and prevends loadwallet() returns ambiguous error code.

ACKs for top commit:
  hebasto:
    re-ACK 8b39a87558, that is the same as 1728059730abef04f3fa84de0b6e20044be7a9d6.
  ryanofsky:
    Code review ACK 8b39a87558 (same as previous)
  meshcollider:
    utACK 8b39a87558

Tree-SHA512: a75d8240f60325bfdb69a07d392269fec97de743f38fe108371eb63a0aba5d8ce3cc484ecc69e81febf8040f5ab64f3a9450b98f8e07a0c17803784bb6f342bf
2020-09-13 12:04:43 +12:00
Pieter Wuille
894fb33f4c Update src/secp256k1 subtree to upstream libsecp256k1 2020-09-11 12:44:08 -07:00
Pieter Wuille
b9c1a76481 Squashed 'src/secp256k1/' changes from 2ed54da18a..8ab24e8dad
8ab24e8dad Merge #558: Add schnorrsig module which implements BIP-340 compliant signatures
f3733c5433 Merge #797: Fix Jacobi benchmarks and other benchmark improvements
cb5524adc5 Add benchmark for secp256k1_ge_set_gej_var
5c6af60ec5 Make jacobi benchmarks vary inputs
d0fdd5f009 Randomize the Z coordinates in bench_internal
c7a3424c5f Rename bench_internal variables
875d68b95f Merge #699: Initialize field elements when resulting in infinity
54caf2e74f Merge #799: Add fallback LE/BE for architectures with known endianness + SHA256 selftest
f431b3f28a valgrind_ctime_test: Add schnorrsig_sign
16ffa9d97c schnorrsig: Add taproot test case
8dfd53ee3f schnorrsig: Add benchmark for sign and verify
4e43520026 schnorrsig: Add BIP-340 compatible signing and verification
7332d2db6b schnorrsig: Add BIP-340 nonce function
7a703fd97d schnorrsig: Init empty experimental module
eabd9bc46a Allow initializing tagged sha256
6fcb5b845d extrakeys: Add keypair_xonly_tweak_add
58254463f9 extrakeys: Add keypair struct with create, pub and pub_xonly
f0010349b8 Separate helper functions for pubkey_create and seckey_tweak_add
910d9c284c extrakeys: Add xonly_pubkey_tweak_add & xonly_pubkey_tweak_add_test
176bfb1110 Separate helper function for ec_pubkey_tweak_add
4cd2ee474d extrakeys: Add xonly_pubkey with serialize, parse and from_pubkey
f49c9896b0 Merge #806: Trivial: Add test logs to gitignore
aabf00c155 Merge #648: Prevent ints from wrapping around in scratch space functions
f5adab16a9 Merge #805: Remove the extremely outdated TODO file.
bceefd6547 Add test logs to gitignore
1c325199d5 Remove the extremely outdated TODO file.
47e6618e11 extrakeys: Init empty experimental module
3e08b02e2a Make the secp256k1_declassify argument constant
8bc6aeffa9 Add SHA256 selftest
670cdd3f8b Merge #798: Check assumptions on integer implementation at compile time
5e5fb28b4a Use additional system macros to figure out endianness
7c068998ba Compile-time check assumptions on integer types
02b6c87b52 Add support for (signed) __int128
979961c506 Merge #787: Use preprocessor macros instead of autoconf to detect endianness
887bd1f8b6 Merge #793: Make scalar/field choice depend on C-detected __int128 availability
0dccf98a21 Use preprocessor macros instead of autoconf to detect endianness
b2c8c42cf1 Merge #795: Avoid linking libcrypto in the valgrind ct test.
57d3a3c64c Avoid linking libcrypto in the valgrind ct test.
79f1f7a4f1 Autodetect __int128 availability on the C side
0d7727f95e Add SECP256K1_FE_STORAGE_CONST_GET to 5x52 field
805082de11 Merge #696: Run a Travis test on s390x (big endian)
39295362cf Test travis s390x (big endian)
6034a04fb1 Merge #778: secp256k1_gej_double_nonzero supports infinity
f60915906d Merge #779: travis: Fix argument quoting for ./configure
9e49a9b255 travis: Fix argument quoting for ./configure
18d36327fd secp256k1_gej_double_nonzero supports infinity
214cb3c321 Merge #772: Improve constant-timeness on PowerPC
40412b1930 Merge #774: tests: Abort if malloc() fails during context cloning tests
2e1b9e0458 tests: Abort if malloc() fails during context cloning tests
67a429f31f Suppress a harmless variable-time optimization by clang in _int_cmov
5b196338f0 Remove redundant "? 1 : 0" after comparisons in scalar code
3e5cfc5c73 Merge #741: Remove unnecessary sign variable from wnaf_const
66bb9320c0 Merge #773: Fix some compile problems on weird/old compilers.
1309c03c45 Fix some compile problems on weird/old compilers.
2309c7dd4a Merge #769: Undef HAVE___INT128 in basic-config.h to fix gen_context compilation
22e578bb11 Undef HAVE___INT128 in basic-config.h to fix gen_context compilation
3f4a5a10e4 Merge #765: remove dead store in ecdsa_signature_parse_der_lax
f00d6575ca remove dead store in ecdsa_signature_parse_der_lax
dbd41db16a Merge #759: Fix uninitialized variables in ecmult_multi test
2e7fc5b537 Fix uninitialized variables in ecmult_multi test
37dba329c6 Remove unnecessary sign variable from wnaf_const
6bb0b77e15 Fix test_constant_wnaf for -1 and add a test for it.
47a7b8382f Clear field elements when writing infinity
61d1ecb028 Added test with additions resulting in infinity
60f7f2de5d Don't assume that ALIGNMENT > 1 in tests
ada6361dec Use ROUND_TO_ALIGN in scratch_create
8ecc6ce50e Add check preventing rounding to alignment from wrapping around in scratch_alloc
4edaf06fb0 Add check preventing integer multiplication wrapping around in scratch_max_allocation

git-subtree-dir: src/secp256k1
git-subtree-split: 8ab24e8dad9d43fc6661842149899e3cc9213b24
2020-09-11 12:44:08 -07:00
Wladimir J. van der Laan
f2d9934381
Merge #19922: test: Run rpc_txoutproof.py even with wallet disabled
faf251d854 test: gettxoutproof duplicate txid (João Barbosa)
faf5eb45c4 test: Test empty array in gettxoutproof (MarcoFalke)
fa56e866e8 test: Run rpc_txoutproof.py even with wallet disabled (MarcoFalke)
faba790bd4 test: MiniWallet: Default fee_rate in send_self_transfer, Pass in utxo_to_spend (MarcoFalke)
fa65a11d0c test: bugfix: Actually pick largest utxo (MarcoFalke)

Pull request description:

  Run the consensus test even when the wallet was not compiled. Also:

  * Minor bugfix in MiniWallet
  * Two new test cases (one cherry-picked from #19847)

ACKs for top commit:
  jnewbery:
    utACK faf251d854. Thanks Marco!
  kristapsk:
    ACK faf251d854

Tree-SHA512: a5ab33695c88cfb3c369021d4506069c08ce298e24e891db55159130693ed3817444c72f6aad3f472235aa4597b2c601010af714411c2ec8ad9c2d2e0b00ecbc
2020-09-11 16:16:48 +02:00
Vasil Dimov
d2bb681f96
util: move HasPrefix() so it can be reused
Move the function `HasPrefix()` from `netaddress.cpp` to `util/string.h`
so it can be reused by `CNetAddr` methods (and possibly others).
2020-09-11 13:35:39 +02:00
fanquake
9366a73d69
Merge #19916: build: allow user to specify DIR_FUZZ_SEED_CORPUS for cov_fuzz
fb3bacce69 .gitignore: ignore qa-assets/ folder (eugene)
a9f201439a build: use DIR_FUZZ_SEED_CORPUS if specified for cov_fuzz target (eugene)

Pull request description:

  This PR contains two commits:
  - The cov_fuzz target now uses `DIR_FUZZ_SEED_CORPUS` as the seed directory instead of the hard-coded `qa-assets/fuzz_seed_corpus`. Otherwise, running it requires me to copy the corpus to the bitcoin directory first. In case `DIR_FUZZ_SEED_CORPUS` is not specified, the original default is used.
  - add qa-assets folder to gitignore

  Example usage:
  `make cov_fuzz DIR_FUZZ_SEED_CORPUS=~/workspace/qa-assets/fuzz_seed_corpus`

  It can also just be an environment variable.

ACKs for top commit:
  fanquake:
    ACK fb3bacce69 - looks fine.
  practicalswift:
    ACK fb3bacce69 - patch looks correct

Tree-SHA512: 19ad7c6a2b0c088df14fb71a217d956e66a69eea78f016cd1e914d39c5d7cc196766a637e6c941c6706322663010e7162e85f57e888b8f3b05d0c37d44740847
2020-09-11 14:22:12 +08:00
fanquake
dffefda21d
Merge #19870: doc: update PyZMQ install instructions, fix zmq_sub.py file permissions
062e6699c4 script: fix zmq_sub.py file permissions (Jon Atack)
36f8e0cce7 doc: update PyZMQ installation instructions, ZeroMQ link (Jon Atack)

Pull request description:

  Seen while reviewing #19572.

ACKs for top commit:
  theStack:
    ACK 062e6699c4 🧷
  fanquake:
    ACK 062e6699c4

Tree-SHA512: 2210d92385377d066984d0a83882c3ece9f0f41c901b7eb375af9cdb57296f50f227c68193ccf35926073c2b788d58976442791a9fce2fc0f76452804d5cee6a
2020-09-11 13:12:54 +08:00
Pieter Wuille
812037cb80 Change CSipHasher's count variable to uint8_t 2020-09-10 09:04:53 -07:00
practicalswift
fc7f84a9ca tests: Add fuzzing harness for Keccak and SHA3_256 2020-09-10 14:54:30 +00:00
gzhao408
10d61505fe [test] remove confusing p2p property 2020-09-10 07:39:14 -07:00
gzhao408
549d30faf0 scripted-diff: replace p2p with p2ps[0] in p2p_invalid_tx
-BEGIN VERIFY SCRIPT-
sed -i 's/\.p2p\./.p2ps[0]./g' test/functional/p2p_invalid_tx.py
-END VERIFY SCRIPT-
2020-09-10 07:39:01 -07:00
gzhao408
7a0de46aea [doc] sample code for test framework p2p objects 2020-09-10 07:38:28 -07:00
Wladimir J. van der Laan
a47e596486
Merge #19841: Implement Keccak and SHA3_256
ab654c7d58 Unroll Keccak-f implementation (Pieter Wuille)
3f01ddb01b Add SHA3 benchmark (Pieter Wuille)
2ac8bf9583 Implement keccak-f[1600] and SHA3-256 (Pieter Wuille)

Pull request description:

  Add a simple (and initially unoptimized) Keccak/SHA3 implementation based on https://github.com/mjosaarinen/tiny_sha3/blob/master/sha3.c, as one will be needed for TORv3 support (the conversion from BIP155 encoding to .onion notation uses a SHA3-based checksum). In follow-up commits, a benchmark is added, and the Keccakf function is unrolled for a (for me) 4.9x speedup.

  Test vectors are taken from https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing#sha3vsha3vss.

ACKs for top commit:
  practicalswift:
    ACK ab654c7d58 -- patch looks correct and no sanitizer complaints when doing some basic fuzz testing of the added code (remember: **don't trust: fuzz!**) :)
  laanwj:
    re-ACK ab654c7d58
  vasild:
    ACK ab654c7

Tree-SHA512: 8a91b18c46e8fb178b7ff82046cff626180362337e515b92fbbd771876e795da2ed4e3995eb4849773040287f6e687237f469a90474ac53f521fc12e0f5031d9
2020-09-10 16:37:21 +02:00
gzhao408
784f757994 [refactor] clarify tests by referencing p2p objects directly
Use object returned from add_p2p_connection to refer to
p2ps. Add a test class attribute if it needs to be used across
many methods. Don't use the p2p property.
2020-09-10 07:37:14 -07:00
grubles
d11020019a Add OpenBSD instructions for building the Qt GUI 2020-09-10 16:02:10 +02:00
Antoine Riard
d76925478e [doc] Clarify semantic of peer's m_protect w.r.t to outbound eviction logics
The field m_protect is used to protect from eviction both by bad/lagging
chain and extra outbound peers logics. Outbound block-relay peers are
always excluded from this protection.
2020-09-10 09:51:03 -04:00
Sjors Provoost
92326d8976
[rpc] add send method 2020-09-10 13:44:53 +02:00
Karl-Johan Alm
404682b7cd
add signet basic support (signet.cpp)
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2020-09-10 10:47:40 +09:00
Karl-Johan Alm
a2147d7dad
validation: move GetWitnessCommitmentIndex to consensus/validation 2020-09-10 10:47:40 +09:00
nthumann
62dba9628d
log: print unexpected version warning in validation log category
Instead of printing "<n> of the last 100 blocks have unexpected version"
as a warning appended to UpdateTip, it is now printed in the validation
log category.
2020-09-09 20:57:06 +02:00
Akio Nakamura
8b39a87558 bugfix: make LoadWallet assigns status always
Although loadwallet() in rpcwallet.cpp assumes LoadWallet() always
assign some value to the 'status', but LoadWallet() does not do so
in some situation.

This fixes above and prevends loadwallet() returns ambiguous error code.
2020-09-10 00:47:31 +09:00
João Barbosa
faf251d854
test: gettxoutproof duplicate txid 2020-09-09 11:27:35 +02:00
MarcoFalke
faf5eb45c4
test: Test empty array in gettxoutproof 2020-09-09 11:27:33 +02:00
MarcoFalke
fa56e866e8
test: Run rpc_txoutproof.py even with wallet disabled 2020-09-09 11:27:28 +02:00
MarcoFalke
faba790bd4
test: MiniWallet: Default fee_rate in send_self_transfer, Pass in utxo_to_spend
Adds two new features to MiniWallet:

* The fee rate is irrelevant sometimes, so just set an arbitrary default
* The utxo to spend needs to be selected manually sometimes
2020-09-09 10:39:05 +02:00
MarcoFalke
fa65a11d0c
test: bugfix: Actually pick largest utxo 2020-09-09 10:38:50 +02:00
MarcoFalke
564e1ab0f3
Merge #19800: test: Mockwallet
fa188c9c59 test: Use MiniWalet in p2p_feefilter (MarcoFalke)
fa39c62eb7 test: inline hashToHex (MarcoFalke)

Pull request description:

  This introduces a minimalistic test wallet, which can be used as a drop in replacement for the Bitcoin Core wallet to create dummy transactions with a given fee rate.

ACKs for top commit:
  jnewbery:
    utACK fa188c9c59

Tree-SHA512: 0aad9cb14eea4f0055bd6a47cc8c8f82a16941b152598c3bf1e083aae84cca4ffa23f0b854a362a68be1b917deba1b5ec7c0207b63b0805d747ba9a7d1d82efe
2020-09-09 09:06:22 +02:00
Andrew Chow
d26f0648f1 Tell users how to load or create a wallet when no wallet is loaded 2020-09-08 21:02:53 -04:00
Andrew Chow
1bee1e6269 Do not create default wallet
No longer create a default wallet. The default wallet will still be
loaded if it exists and not other wallets were specified (anywhere,
including settings.json, bitcoin.conf, and command line).

Tests are updated to be started with -wallet= if they need the default
wallet.

Added test to wallet_startup.py testing that no default wallet is
created and that it is loaded if it exists and no other wallets were
specified.
2020-09-08 21:02:53 -04:00
MarcoFalke
4f229d8904
Merge #19914: refactor: Do not pass chain params to CheckForStaleTipAndEvictPeers twice
fa7e407b50 Do not pass chain params to CheckForStaleTipAndEvictPeers twice (MarcoFalke)

Pull request description:

  `PeerManager` already keeps a reference to the chain params as a member variable. No need to pass it in once again as a function parameter.

ACKs for top commit:
  naumenkogs:
    utACK fa7e407b50
  jnewbery:
    code review ACK fa7e407b50
  epson121:
    Code review ACK fa7e407b50

Tree-SHA512: 640c2d8adf9f1d54d0bfbdf81989064be2f5ba4b534d07d42258b372dc130f7b9c3fd087c7d28f0439678d124127f5d6f82f3139b1766f59f5ed661e7ac2a923
2020-09-08 22:13:39 +02:00