Commit graph

4053 commits

Author SHA1 Message Date
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
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
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
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
029b6799d1 test: Fix intermittent issue in mempool_compatibility
(cherry picked from commit fa05d19bd6)
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
d1a1d19113 test: add decodepsbt and analyzepsbt tests for blinding proofs 2021-09-21 21:59:16 +00:00
Andrew Poelstra
71c9e90fa0 test: add another functional test for rangeproofs in issuances 2021-09-20 22:10:50 +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
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
7d39e430c7 test: check that signrawtransaction does not erase RANGEPROOF signatures 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
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
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
bc0494cc39
Merge ElementsProject/elements#1040: regtest: change network magic away from liquid v1
e57b4c51ad regtest: change network magic away from liquid v1 (Andrew Poelstra)

Pull request description:

  We don't want connectivity issues between Liquid and custom test networks.

ACKs for top commit:
  stevenroose:
    ACK e57b4c51ad

Tree-SHA512: 3ddd626496d7877551c41b089932784bcb752962089fd3e6baa5e9ea6acac44b1b4c5c915b061892b712849d12455fae00347885cecb0e0a3b59a134d91d4014
2021-09-15 22:36:31 +00:00
Andrew Poelstra
b456b72353
Merge ElementsProject/elements#1039: claimpegin: sanity-check fee in case fallbackfee is disabled, throw explicit exception
fc8bfc1f2c claimpegin: add regression test for behavior when fallbackfee is disabled (Andrew Poelstra)
fd520079a1 claimpegin: sanity-check fee in case fallbackfee is disabled, throw explicit exception (Andrew Poelstra)

Pull request description:

  Produce a much less confusing error message in `claimpegin` in the case that estimatesmartfee fails and no fallbackfee is set.

ACKs for top commit:
  stevenroose:
    ACK fc8bfc1f2c

Tree-SHA512: 2ae658ab3dc90b7319d047c192401a0dcc97e015e45b5b0db71db1d89d63605ba107312d8b4cf1c4aaef72437aa20aa33b442744f64fc08535b15610e6f4a526
2021-09-15 22:36:08 +00:00
Steven Roose
47d43f14ad
Support supplying contract hash to issueasset RPC 2021-09-15 16:23:32 -01:00
Andrew Poelstra
250c8e59d5
Merge ElementsProject/elements#1030: [forward port] When validation is waiting for parent chain daemon, "stall"
b2e1cc38de Regression test for pegin validation issues during sync (Glenn Willen)
d5042b41c8 Finish removing 'recheckpeginblockinterval'; move MainchainRPCCheck (Glenn Willen)
313f73d5b2 When validation is waiting for parent chain daemon, "stall". (Andrew Poelstra)

Pull request description:

  Forward-port of #1022

ACKs for top commit:
  gwillen:
    utACK b2e1cc38de, verified that it contains only the requested changes from da11d7b6fd.

Tree-SHA512: 971b6a137efdc54f84995b17595346bf3d3ebd5a04eef1676225c664923e0b52393550bc51ea366c4d3010aa35a9de16da0643bb5bfb40c7eb788a180c99b1a0
2021-09-14 20:48:05 +00:00
Andrew Chow
3ac7e78a84 pset, rpc: Better error messages for imbalance failure conditions
Instead of not failing and silently allowing bad PSETs to be created,
provide error messages that explain why the operation the user did was
wrong. Specifically for combining PSETs such that they would become
fully blinded but have imbalanced values and blinders, and for blinding
a PSET when the wallet has a blind input but no outputs to blind (would
result in an imbalance).
2021-09-13 18:36:38 -04:00
Glenn Willen
b2e1cc38de Regression test for pegin validation issues during sync
Add a regression test for https://github.com/ElementsProject/elements/issues/891 .

This checks that we can sync successfully when making a bunch of new blocks
just as we have transient loss of parent daemon connectivity. This reliably
fails without the fix, and reliably succeeds with it. (It stands in for the
situation, more common in production, where we sync faster than the parent
daemon can keep up after a long outage.)
2021-09-13 22:10:36 +00:00
Andrew Poelstra
313f73d5b2 When validation is waiting for parent chain daemon, "stall".
Currently, if -validatepegin is given, and block validation can't proceed
because the parent chain is not synced, we mark the block invalid and put
it in a queue to be "revalidated" later. Unfortunately, marking a block
invalid has downstream consequences, in particular causing descendant blocks
to be marked invalid, which are not currently fixed by the queue.

Instead, we'll use a different strategy: if the mainchain daemon isn't
sufficiently synced to validate a block, we will "stall" connecting that
block to the chain, and have ActivateBestChain simply keep the tip at the
previous block until we're ready.

We can still download and validate (partly) blocks past this point while
we're waiting. They will be connected once the parent chain daemon catches
up.
2021-09-13 22:10:09 +00:00
Andrew Chow
a7ef9f325d pset, test: Test a PSET coinjoin workflow 2021-09-11 21:02:22 -04:00
Andrew Chow
59f65a3f73 rpc, pset: Include blinded value and asset proofs in decodepsbt 2021-09-11 20:58:40 -04:00
Andrew Poelstra
e57b4c51ad regtest: change network magic away from liquid v1
We don't want connectivity issues between Liquid and custom test networks.
2021-09-10 17:20:20 +00:00
Andrew Poelstra
fc8bfc1f2c claimpegin: add regression test for behavior when fallbackfee is disabled 2021-09-09 22:49:04 +00:00
Andrew Poelstra
e88f0b7045
Merge ElementsProject/elements#1034: A couple minor PSET cleanups
6f428ecf8a ci: fix intermittent failure in feature_block_subsidy.py (Andrew Poelstra)
abb52c861c rpc: specify that `witnessScript` is optional for `signblock` and `combineblocksigs` RPC call (Andrew Poelstra)
88edb9f9ff rpc: correct type in `calculateasset` (Andrew Poelstra)
b4369c06a2 rpc: change walletprocesspsbt help text to match upstream (Andrew Poelstra)

Pull request description:

  .

ACKs for top commit:
  achow101:
    ACK 6f428ecf8a

Tree-SHA512: 38afb0d1f3e4a7839ecea7dccb996f1d996d037e14f630d8cc943bd5f34fbc7d510f9c2d4fbb5fb1eb3435f4a9a602a9ff9635ecd8c2a8d8adcccf7dd4b7c0cb
2021-09-07 17:43:33 +00:00
Andrew Poelstra
6f428ecf8a ci: fix intermittent failure in feature_block_subsidy.py 2021-09-07 13:18:33 +00:00
Andrew Poelstra
a3d23c94de wallet: regression test for the previous bugfix 2021-09-06 20:06:48 +00:00
Andrew Poelstra
c0936ba2a3 test: fix surjectionproof overflow functional test for new RPC changes
This fixes an undetected merge conflict between #1014 and #900.
2021-08-31 16:00:47 +00:00
Andrew Poelstra
d973e1105d
Merge ElementsProject/elements#1014: Fix crash when creating large inputs
f7e1fb6708 blind: add functional test that attempting to spend more than 256 inputs fails "gracefully" (Andrew Poelstra)
ba538cbe2a blind.cpp: refuse to create surjection proofs that would trigger an assertation failure (Andrew Poelstra)

Pull request description:

  There isn't really any reasonable way to recover from this situation but we can at least gracefully fail instead of triggering an assertation failure.

  Fixes #979

  Fixes #880

ACKs for top commit:
  gwillen:
    utACK f7e1fb6.

Tree-SHA512: 6f95732964503e5ac6fc85fd6b45958f1b1719b1f9ecf3d6295d571489112837cdb4429a02a389da82e8d5fcd55527241cba50bceff00bb4facd8be037c7dcab
2021-08-30 20:56:31 +00:00
Andrew Poelstra
64194498cf
Merge ElementsProject/elements#1025: Introduce blech32m format for v1+ witness programs
c72c949d29 blech32: copy ubsan suppression for bech32 to blech32 (Andrew Poelstra)
d13fb4994b blech32: add test vectors for blech32 and blech32m (Andrew Poelstra)
15a826ea27 blech32: add functional tests for blech32m (Andrew Poelstra)
c01e09e8c3 blech32: add blech32m format and use it to decode witness v1+ addresses (Andrew Poelstra)
18fcec8714 naming nits (Fabian Jahr)
8515f40fed Add signet support to gen_key_io_test_vectors.py (Pieter Wuille)
b3df66f82e Use Bech32m encoding for v1+ segwit addresses (Pieter Wuille)
42f43a1bcb Add Bech32m test vectors (Pieter Wuille)
b1d1d94e01 Implement Bech32m encoding/decoding (Pieter Wuille)
c607835bad Better error messages for invalid addresses (Bezdrighin)

Pull request description:

  Includes backports of https://github.com/bitcoin/bitcoin/pull/20832 (1 commit) and https://github.com/bitcoin/bitcoin/pull/20861 (5 commits)

ACKs for top commit:
  gwillen:
    utACK c72c949.

Tree-SHA512: af96a6ef31b1cab72b0350197dcb34761e9ffb2ec43685084408b5fafcda0adee1945045003194600372652f7cca65d721bda3ed9b6be7e9543d3199e2cbe145
2021-08-30 18:59:25 +00:00
sanket1729
2c5c7eb87b Update tapscript leaf version 2021-08-27 19:24:07 +00:00
sanket1729
937343c75c Add tests for crypto opcodes 2021-08-27 19:24:07 +00:00
sanket1729
3e7b8c6aed Test arithmetic opcodes 2021-08-26 20:28:01 +00:00
sanket1729
6092d94c1d Add tests for introspection 2021-08-26 20:28:01 +00:00
sanket1729
007912eea4 Implement tests for sha256 streaming opcodes 2021-08-26 20:28:01 +00:00
Andrew Poelstra
c72c949d29 blech32: copy ubsan suppression for bech32 to blech32 2021-08-18 15:54:23 +00:00
Andrew Poelstra
15a826ea27 blech32: add functional tests for blech32m 2021-08-18 15:54:22 +00:00
Pieter Wuille
b3df66f82e Use Bech32m encoding for v1+ segwit addresses
This also includes updates to the Python test framework implementation,
test vectors, and release notes.

https://github.com/bitcoin/bitcoin/pull/20861 (3/5)
2021-08-17 22:32:47 +00:00
Bezdrighin
c607835bad Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.

https://github.com/bitcoin/bitcoin/pull/20832 (1/1)

ELEMENTS: Merge conflicts resolved based on d6c85c5620 (from 22.0 rebase)
2021-08-17 22:32:47 +00:00
Andrew Poelstra
1c883db83e test: update createrawtransaction call in feature_taphash_pegins_issuances.py
Should describe the outputs as an array rather than as an object. (The old
behavior has long been deprecated but was eliminated entirely in #900.)
2021-07-09 20:31:24 +00:00
Andrew Poelstra
1ba24fe9b3
Merge ElementsProject/elements#1002: Implement Taproot Sighash
14f93579a5 Add pegins and issuance test (sanket1729)
edf8455fe4 Fix bug in CAssetIssuance decoding (sanket1729)
cdd75d4251 Update OP_SUCCESS for elements with allowed opcodes (sanket1729)
4618097ab4 Implement taphash for elements (sanket1729)
6c985308d7 Implement Taphash in test framework (sanket1729)
a26f6fead6 Expose only blockchain hash twice in header (sanket1729)
afb9e7b727 taproot: feed genesis hash and parent pegged asset to sighash function (Andrew Poelstra)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK 14f93579a5

Tree-SHA512: f0a3f6ef9f8958bc948cc42375600767f39aadc0dac096fe8e7823dc69ddc4204360e504af7801d05bb19ae4e6ace6a271842531c192e330167381cf2690c856
2021-07-07 20:58:41 +00:00