Commit graph

30049 commits

Author SHA1 Message Date
Hennadii Stepanov
09ca7bbf4e doc: Update wallet database installation guide for macOS
Github-Pull: #20527
Rebased-From: c932e0d67e
(cherry picked from commit 48134a09ad)
2021-09-22 02:05:01 +00:00
Hennadii Stepanov
fdd69bf902 build: Use Homebrew's sqlite package if it is available
Github-Pull: #20527
Rebased-From: ee7b84e63c
(cherry picked from commit f51e1cb291)
2021-09-22 02:05:01 +00:00
Hennadii Stepanov
92b1189afc build, refactor: Check that Homebrew's qt5 package is actually installed
This change unifies Homebrew packages workflow, and does not change
behavior.

Github-Pull: #20527
Rebased-From: c96d1f65a5
(cherry picked from commit 48f8929aad)
2021-09-22 02:05:01 +00:00
Hennadii Stepanov
29b0796eb9 build: Check that Homebrew's berkeley-db4 package is actually installed
Github-Pull: #20563
Rebased-From: d3ef947524
(cherry picked from commit 96124a2041)
2021-09-22 02:05:01 +00:00
Jonas Schnelli
b52bac2c39 Don't set BDB flags when configuring without
Github-Pull: #20478
Rebased-From: 982e548a9a
(cherry picked from commit 61e316e661)
2021-09-22 02:05:01 +00:00
Pieter Wuille
e45e7c15e7 Add regression test for incorrect decoding
Github-Pull: #20595
Rebased-From: 0f949cde3d
(cherry picked from commit ce13b99020)
2021-09-22 02:05:01 +00:00
Pieter Wuille
3bfce85eaf Improve heuristic hex transaction decoding
Whenever both encodings are permitted, try both, and if only one succeeds,
return that one. Otherwise prefer the one for which the heuristic sanity
check passes. If that is the case for neither or for both, return the
extended-permitting deserialization.

Github-Pull: #20595
Rebased-From: 39c42c4420
(cherry picked from commit 1caa32e3f2)
2021-09-22 02:05:01 +00:00
Jon Atack
e48a9793b2 test: add coverage for passing fee rate as a string
Github-Pull: #20573
Rebased-From: 6fa72ceb80
(cherry picked from commit 0d3c140c4d)
2021-09-22 02:05:01 +00:00
Jon Atack
b4eb953986 wallet, bugfix: allow send to take string fee rate values
Github-Pull: #20573
Rebased-From: ce207d6b93
(cherry picked from commit 06c84232b3)
2021-09-22 02:05:01 +00:00
Pieter Wuille
f15c72cbd2 Send and require SENDADDRV2 before VERACK
See the corresponding BIP change: https://github.com/bitcoin/bips/pull/1043

Github-Pull: #20564
Rebased-From: 1583498fb6
(cherry picked from commit bead935470)
2021-09-22 02:05:01 +00:00
Pieter Wuille
c117c6c125 Don't send 'sendaddrv2' to pre-70016 software
Github-Pull: #20564
Rebased-From: c5a8919660
(cherry picked from commit 9e806887a8)
2021-09-22 02:05:01 +00:00
Jon Atack
a97c53172a Use the correct incremental fee constant in bumpfee help
and remove redundant units ("Must be at least 1.000 sat/vB sat/vB" -> "1.00 sat vB")

Github-Pull: #20426
Rebased-From: 9f08780dd7
(cherry picked from commit 6313362553)
2021-09-22 02:05:01 +00:00
Jon Atack
d635fc743a Update feeRate (BTC/kvB) to fee_rate (sat/vB) in wallet_bumpfee
as the feeRate argument should soon be deprecated.

Also loosen one test (and a similar one) that caused a one-off CI failure with:
expected message
'Insufficient total fee 0.00000141, must be at least 0.00001704 (oldFee 0.00000999 + incrementalFee 0.00000705)'
actual message
'Insufficient total fee 0.00000141, must be at least 0.00001712 (oldFee 0.00001007 + incrementalFee 0.00000705)'

Github-Pull: #20426
Rebased-From: 3f1e10b2b1
(cherry picked from commit 6e4969f76f)
2021-09-22 02:05:01 +00:00
Jon Atack
765c2b4d17 Allow zero-fee fundrawtxn and walletcreatefundedpsbt calls
A check to raise an error on zero-fee txns was mistakenly extended in commit
a0d4957 from the bumpfee and send{toaddress, many} RPCs to also include
fundrawtransaction and walletcreatefundedpsbt.

This commit overrides zero fee rate checking for these two RPCs, not only for
the feeRate (BTC/kvB) arg to return to previous behavior, but also for the new
fee_rate (sat/vB) arg.

Github-Pull: #20426
Rebased-From: 1b3d700928
(cherry picked from commit 54e1edcc2b)
2021-09-22 02:05:01 +00:00
Niklas Gögge
2ca3943fdf build: Avoid secp256k1.h include from system
GitHub-Pull: #20469
Rebase-From: e95aaefe25
(cherry picked from commit 01b647b1a2)
2021-09-22 02:05:01 +00:00
Jon Atack
df1bd79314 wallet: fix and improve upgradewallet error responses
(cherry picked from commit ca8cd893bb)
2021-09-22 02:05:01 +00:00
Jon Atack
77627d8efd wallet: fix and improve upgradewallet result responses
(cherry picked from commit 99d56e3571)
2021-09-22 02:05:01 +00:00
Andrew Chow
92251542e5 Don't upgrade to HD split if it is already supported
It is unnecessary to upgrade to FEATURE_HD_SPLIT if this feature is
already supported by the wallet. Because upgrading to FEATURE_HD_SPLIT
actually requires upgrading to FEATURE_PRE_SPLIT_KEYPOOL, users would
accidentally be upgraded to FEATURE_PRE_SPLIT_KEYPOOL instead of nothing
being done.

Fixes the issue described at
https://github.com/bitcoin/bitcoin/pull/20403#discussion_r526063920

(cherry picked from commit 2498b04ce8)
2021-09-22 02:05:01 +00:00
Jon Atack
9c3df80c40 wallet: refactor GetClosestWalletFeature()
(cherry picked from commit c46c18b788)
2021-09-22 02:05:01 +00:00
MarcoFalke
ae26ff27a9 wallet: Do not treat default constructed types as None-type
(cherry picked from commit fa69c2c784)
2021-09-22 02:05:01 +00:00
MarcoFalke
2fe52979ea refactor: Change pointer to reference because it can not be null
(cherry picked from commit fac4e136fa)
2021-09-22 02:05:01 +00:00
MarcoFalke
029b6799d1 test: Fix intermittent issue in mempool_compatibility
(cherry picked from commit fa05d19bd6)
2021-09-22 02:05:01 +00:00
Andrew Chow
ae8a5a5baa Fix QPainter non-determinism on macOS
Aplies a patch to Qt that fixes the non-determinism by modifying Qt. The
source of the non-determinism is how LLVM 8 optimizes qt_intersect_spans
when compiling. The particular optimization that seems to be causing the
problems is that a temp variable is being added for spans->y. For some
reason, when it does this, it chooses different instructions to use when
making that variable. We bypass this problem by patching
qt_intersect_spans to always make and use this local variable.

Github-Pull: #20447
Rebased-From: 8f7d1b39ef
Tree-SHA512: 558da5c2bb0373e2a89f2c219170f802036e0e87cc8e808336b23d074152cb893007a440f46ec957156b0921355cd18502710f2d224f27bc26e934c50ebebc41
(cherry picked from commit ab23a83400)
2021-09-22 02:05:01 +00:00
Luke Dashjr
4f36e4cfc6 RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC endpoint and wallet_name parameter specify a wallet
(cherry picked from commit b1f59d55d9)
2021-09-22 02:05:01 +00:00
Anthony Towns
5412789739 tests: shrink feature_taproot transfer of funds tx
(cherry picked from commit 7ffac12545)
2021-09-22 02:05:01 +00:00
Andrew Poelstra
4c7dc0620a
Merge ElementsProject/elements#1046: PSET: change sanity checks for blinding
d1a1d19113 test: add decodepsbt and analyzepsbt tests for blinding proofs (Andrew Poelstra)
03b835c887 PSET: output warnings in decodepsbt and analyzepsbt about blinding status (Andrew Poelstra)
694ec795e4 PSET: fix asset proof generation and verification (Andrew Poelstra)
c6f801d4ce PSET: encapsulate blind proof checks into one method (Andrew Poelstra)
35cfda73b9 PSET: do not assume in GetUnsignedTx that explicit amounts/assets are available (Andrew Poelstra)
c88eb96e74 pset: check that we can get the blinding factors from any IsMine outputs before signing (Andrew Poelstra)
9c55d0a175 pset: only check asset/amount proofs in case both explicit+blinded values are provided (Andrew Poelstra)

Pull request description:

  After conversation with @stepansnigirev in #1026 I realize we need to adjust our sanity checks on asset proofs. In particular,

  * Rather than enforcing that all confidential values have corresponding explicit values with proofs, we should only check that **if** both confidential and explicit values are present, they are connected by a proof.
  * Further, the wallet should check before signing that any `IsMine` scripts have confidential values that we are actually able to spend (i.e. rewinding works).

  This PR implements these two things, and also extends the `analyzepsbt` and `decodepsbt` RPC calls to provide more information if the amount/asset proofs are missing or invalid. It adds tests for these and also demonstrates that `combinepsbt` does not really work without explicit data present.

  `walletprocesspsbt`, when blinding, will still produce these proofs and there is currently no way to disable this behavior.

ACKs for top commit:
  achow101:
    ACK d1a1d19113

Tree-SHA512: 472ee0fe285308e803cbc3f5885e513ec91d1b3f18a2973772cd5a88d29fa4dba9441d9b3bd58847564e43d9a7478bbc75af62d9326c727709b5ff2dc646714a
2021-09-22 02:01:39 +00:00
Andrew Poelstra
d1a1d19113 test: add decodepsbt and analyzepsbt tests for blinding proofs 2021-09-21 21:59:16 +00:00
Andrew Poelstra
03b835c887 PSET: output warnings in decodepsbt and analyzepsbt about blinding status 2021-09-21 21:59:16 +00:00
Andrew Poelstra
694ec795e4 PSET: fix asset proof generation and verification
A couple issues with this -- one is that it was verifying the asset
commitment against itself, rather than against the explicit asset,
and the other is that the verification logic had an extra `== 0` at
the end which inverted the verification check.

Both pretty embarassing to have not caught in review..
2021-09-21 21:59:10 +00:00
Andrew Poelstra
c6f801d4ce PSET: encapsulate blind proof checks into one method 2021-09-21 20:33:31 +00:00
Andrew Poelstra
35cfda73b9 PSET: do not assume in GetUnsignedTx that explicit amounts/assets are available 2021-09-21 20:33:31 +00:00
Andrew Poelstra
c88eb96e74 pset: check that we can get the blinding factors from any IsMine outputs before signing
Arguably we should do this for signrawtransaction too but it'd be a
lot of duplicated code for a deprecated workflow.
2021-09-21 20:33:31 +00:00
Andrew Poelstra
9c55d0a175 pset: only check asset/amount proofs in case both explicit+blinded values are provided 2021-09-21 20:33:28 +00:00
Andrew Poelstra
a1726c555b
Merge ElementsProject/elements#1045: Fix SIGHASH_RANGEPROOF bugs
71c9e90fa0 test: add another functional test for rangeproofs in issuances (Andrew Poelstra)
cf4136b3b0 SIGHASH_RANGEPROOF and asset issuance rangeproofs (Andrew Poelstra)
d4a0b6285a test: check asset issuances with SIGHASH_RANGEPROOF (Andrew Poelstra)
1b23ad7093 pset: fix encoding of blinded asset issuances (Andrew Poelstra)
0907fa0f6f test: support asset issuance in test framework sighashes (Andrew Poelstra)
34eafaf761 test: sign using the PSET interface and SIGHASH_RANGEPROOF (Andrew Poelstra)
9c3c61aa0a psbt: make sure rangeproofs are present in the confidential version of the unsigned tx (Andrew Poelstra)
7d39e430c7 test: check that `signrawtransaction` does not erase RANGEPROOF signatures (Andrew Poelstra)
7a3cbda848 sign.cpp: turn on SIGHASH_SCRIPT_RANGEPROOF when checking already-existing signatures (Andrew Poelstra)
ac54a2f765 test: check that signing with the RANGEPROOF flag works (Andrew Poelstra)
ab5b376b72 SignatureHash: fix rangeproof hash for SIGHASH_RANGEPROOF (Andrew Poelstra)

Pull request description:

  Fixes #1026

  Supercedes #932

ACKs for top commit:
  achow101:
    ACK 71c9e90fa0

Tree-SHA512: ddc8074b6783344aa8b04de9e0a3d9320f70aa5f2bccd05d7e329110d861e46b2730b230a1b89ddb414dec8e9d31d04ab66e589d3f9648692fd990d03c369e81
2021-09-21 12:32:03 +00:00
Andrew Poelstra
71c9e90fa0 test: add another functional test for rangeproofs in issuances 2021-09-20 22:10:50 +00:00
Andrew Poelstra
cf4136b3b0 SIGHASH_RANGEPROOF and asset issuance rangeproofs 2021-09-20 22:10:47 +00:00
Andrew Poelstra
d4a0b6285a test: check asset issuances with SIGHASH_RANGEPROOF
Asset issuance rangeproofs are not actually covered by SIGHASH_RANGEPROOF
so this test serves more as a sanity check that our various signing
mechanisms still work with issuances. Sure enough, it uncovered a PSET
bug (fixed) and a blindrawtransaction bug (left a FIXME).
2021-09-19 20:58:07 +00:00
Andrew Poelstra
1b23ad7093 pset: fix encoding of blinded asset issuances 2021-09-19 20:58:07 +00:00
Andrew Poelstra
0907fa0f6f test: support asset issuance in test framework sighashes
Replaces #932
2021-09-19 20:58:07 +00:00
Andrew Poelstra
34eafaf761 test: sign using the PSET interface and SIGHASH_RANGEPROOF 2021-09-19 14:52:47 +00:00
Andrew Poelstra
9c3c61aa0a psbt: make sure rangeproofs are present in the confidential version of the unsigned tx
These rangeproofs are covered by signature in both Taproot and
SIGHASH_RANGEPROOF signatures, so they need to be present.
2021-09-19 14:52:47 +00:00
Andrew Poelstra
7d39e430c7 test: check that signrawtransaction does not erase RANGEPROOF signatures 2021-09-19 14:18:13 +00:00
Andrew Poelstra
7a3cbda848 sign.cpp: turn on SIGHASH_SCRIPT_RANGEPROOF when checking already-existing signatures
Currently when a user uses `signrawtransaction` on a transaction that is
already partially signed with SIGHASH_RANGEPROOF signatures, the existing
signatures will be deleted because they are not recognized as valid. This
makes it impossible to collabratively sign transactions using this RPC.
Fix this.
2021-09-19 14:18:13 +00:00
Andrew Poelstra
ac54a2f765 test: check that signing with the RANGEPROOF flag works 2021-09-19 14:10:21 +00:00
Andrew Poelstra
ab5b376b72 SignatureHash: fix rangeproof hash for SIGHASH_RANGEPROOF
The logic for computing the uncached version of the sighash changed during
the 0.21 rebase, such that it no longer matched the cached version. As the
changed hash is used during signing (not verification!), this was not a
forking change (and our existing functional test would have caught such a
forking change since it uses Python to independently compute the hash).
But it still broke signing.

Test in next commit.
2021-09-19 14:08:56 +00:00
Andrew Poelstra
f7f9555792
Merge ElementsProject/elements#1044: Define Taproot activation parameters for Liquid
3cb9612faa test: add test for Taproot activation (Andrew Poelstra)
5291c0d9d9 chainparams: add undocumented regtest/testnet only -con_taproot_signal_start option (Andrew Poelstra)
cc6b933478 add missing taproot activation params for Liquid v1 (Andrew Poelstra)
bec6bcf31b versionbits: allow specific deployments to override the signalling/threshold values (Andrew Poelstra)

Pull request description:

  Sets Taproot to start signalling around noon (California time) on Nov 1, 2021, assuming 95% of blocks are produced between now and then.

  Will activate after one week of 100% signalling. If we can pull this off on the first or second try, we will beat Bitcoin which currently looks like it will activate on Nov 16.

  **Edit:** actually, even without Speedy Trial, there is one full period (week) where Taproot will be "locked in" but not "active". So it will activate on Nov 15 at the earliest.

ACKs for top commit:
  achow101:
    ACK 3cb9612faa

Tree-SHA512: c3a80d39ba86a0d762a3057cb9c45e379c70c2daee8ff2e54978a4c32118c935c8909d872ac9f873e283441c52c1974c06268f10dc7bf9e9e000c21063ac84d7
2021-09-18 03:22:30 +00:00
Andrew Poelstra
3cb9612faa test: add test for Taproot activation 2021-09-18 00:50:17 +00:00
Andrew Poelstra
ade32378c1
Merge ElementsProject/elements#1041: re-enable fallbackfee by default
1204b91c2d re-enable fallbackfee by default (Andrew Poelstra)

Pull request description:

  Upstream disabled the default `fallbackfee` option in 0.17, which caused us some user error reports in 0.18. Re-enable the option in 0.21.

ACKs for top commit:
  stevenroose:
    utACK 1204b91c2d

Tree-SHA512: 62d053405c00f5ca31ae3fb24ab8def2c9e3bd52909dfac57e65224947295a56f0b8a322ffeb0dfcdcb3103fcaf310a9554f3ed3a8490859ca82aaeae26c7fb2
2021-09-16 23:51:19 +00:00
Andrew Poelstra
388d47f9a3
Merge ElementsProject/elements#1010: Support supplying contract hash to issueasset RPC
47d43f14ad Support supplying contract hash to issueasset RPC (Steven Roose)

Pull request description:

  forward port of https://github.com/ElementsProject/elements/pull/993.
  Closes https://github.com/ElementsProject/elements/issues/985.

ACKs for top commit:
  apoelstra:
    ACK 47d43f14ad

Tree-SHA512: e29cda86291c8fe4650595129af477c6dc8648465a5305002ae521bac21a114d6a1c44738786351ac4355eafdcb0da3e4e42c8f204137f9e31e03df20a91db64
2021-09-16 23:06:23 +00:00
Andrew Poelstra
1204b91c2d re-enable fallbackfee by default 2021-09-15 22:39:33 +00:00