Commit graph

592 commits

Author SHA1 Message Date
Andrew Poelstra
b431cfa2d7 Merge 532b134cb0 into merged_master (Bitcoin PR #19373) 2020-11-26 01:09:12 +00:00
Andrew Poelstra
fa10c4dfe5 Merge bd331bd745 into merged_master (Bitcoin PR #17938)
Also re-`static`'d a method in src/script/standard.cpp which we had made globally
visible for some historical reason, but which I noticed diffing that file against
upstream.
2020-11-26 01:09:10 +00:00
Andrew Poelstra
f60e6990c7 Merge 5f72ddb7ee into merged_master (Bitcoin PR #18863) 2020-11-26 01:09:09 +00:00
Andrew Poelstra
2468108f7b Merge b8740d6737 into merged_master (Bitcoin PR #18468) 2020-11-26 01:09:07 +00:00
Andrew Poelstra
195eb8a243 Merge 4ede05d421 into merged_master (Bitcoin PR #18758) 2020-11-26 01:08:58 +00:00
Andrew Poelstra
4d1d393cd6 Merge 9e8bd217cd into merged_master (Bitcoin PR #13204) 2020-11-26 01:08:56 +00:00
Andrew Poelstra
11afdcc66a Merge 9ccaee1d5e into merged_master (Bitcoin PR #19004) 2020-11-26 01:08:51 +00:00
Andrew Poelstra
4678564918 Merge cffbf1eb9a into merged_master (Bitcoin PR #19073) 2020-11-26 01:08:51 +00:00
Andrew Poelstra
f89b990b78 Merge 448bdff263 into merged_master (Bitcoin PR #18317) 2020-11-26 01:08:46 +00:00
Andrew Poelstra
530a413055 Merge 219c55da75 into merged_master (Bitcoin PR #16710) 2020-11-26 01:08:42 +00:00
Andrew Poelstra
7c5fd66303 Merge eb2ffbb7c1 into merged_master (Bitcoin PR #18914) 2020-11-26 01:08:41 +00:00
Andrew Poelstra
9ea76b54aa Merge 68ef9523d1 into merged_master (Bitcoin PR #18413) 2020-11-26 01:08:36 +00:00
Andrew Poelstra
1c12ae1719 Merge eef90c14ed into merged_master (Bitcoin PR #16528)
This is the 43-commit descriptor wallet PR. It was remarkably easy to merge, given
its magnitude. With this commit Elements supports importing Bitcoin descriptors
and deriving (Bitcoin) addresses, though of course it does not support blinding
yet. That is a post-rebase project.

The material changes were:

1. Changing constants in the tests (super annoying but nothing surprising)

2. Adding a missing "skip if this coin is not ours" check in src/script/sign.cpp
   which was causing us to erroneously remove existing witnesses from transactions.
   This wasn't a problem before this commit since we would only ask specific
   scriptpubkeymans to sign, and we'd never ask any to sign inputs we didn't
   own. Andy simplified the logic here to always try every scriptpubkeyman,
   which means they have to play a bit more nicely with each other.

Other than that, this was a big diff with many conflicts but literally all of
them were "we both added code" and the resolution was to take both sides.
2020-11-26 01:08:31 +00:00
Andrew Poelstra
ba95deb36c Merge 19032c750c into merged_master (Bitcoin PR #18612) 2020-11-26 01:08:27 +00:00
Andrew Poelstra
fd37b7c5d6 Merge 54f812d9d2 into merged_master (Bitcoin PR #18673) 2020-11-26 01:08:23 +00:00
Andrew Poelstra
1b585cf0c3 Merge e16718a8b3 into merged_master (Bitcoin PR #18401) 2020-11-26 01:08:21 +00:00
Andrew Poelstra
8df275dcb1 Merge 903be99ee6 into merged_master (Bitcoin PR #18621) 2020-11-26 01:08:19 +00:00
Andrew Poelstra
8e0d668350 Merge a9213bbe75 into merged_master (Bitcoin PR #18422) 2020-11-26 01:08:16 +00:00
Andrew Poelstra
8fe96f415e Merge 54646167db into merged_master (Bitcoin PR #18388) 2020-11-26 01:08:03 +00:00
Andrew Poelstra
61ff799bb3 Merge 94d3063c93 into merged_master (Bitcoin PR #18412) 2020-11-26 01:08:02 +00:00
Andrew Poelstra
ed5795f10a Merge 67dfd18f44 into merged_master (Bitcoin PR #16902) 2020-11-26 01:07:55 +00:00
Andrew Poelstra
9d88b4ecdf Merge 7f8176a1eb into merged_master (Bitcoin PR #18204) 2020-11-26 01:07:55 +00:00
Andrew Poelstra
414c7a2229 Merge e5cb0dffd5 into merged_master (Bitcoin PR #18002) 2020-11-26 01:07:55 +00:00
Andrew Poelstra
5b9f316537 Merge dcf2ccbfde into merged_master (Bitcoin PR #18115)
I really like this PR, but it wound up being pretty nontrivial to merge.
The crux is that it pulls PSBT signing logic into scriptpubkey manager,
which is where it belongs, but for us this means reasoning about pegins
inside script/sign.cpp.

However, sign.cpp is part of libbitcoin_common, which does not include
anything for reasoning about PoW or RPC (lol) or anything heavy about
that. This means that some pegin validation had to remain split between
the wallet/rpc layer and sign.cpp. I added a new file script/pegins.cpp
which has the (one) method we actually need in sign.cpp.

Aside from that, this diff is very large but is mostly just moving our
code changes to wallet/psbtwallet.* into wallet/wallet.* where those
functions now live. As far as review, it's probably not worthwhile to
spend too much too much time on this since it's going to be change
again in #16528 and others. The test coverage is pretty extensive.
2020-11-26 01:07:51 +00:00
Andrew Poelstra
0c1829049e Merge 9dd7bd47be into merged_master (Bitcoin PR #18034) 2020-11-26 01:07:44 +00:00
Andrew Poelstra
36b191b752 Merge 68e841e0af into merged_master (Bitcoin PR #18067) 2020-11-26 01:07:44 +00:00
Andrew Poelstra
91e195d7cd Merge 2d6e76af24 into merged_master (Bitcoin PR #17261)
Moved GetOnlinePakKey to the scriptpubkey manager; the other blinding
stuff remains in the CWallet. At some point after the rebase we should
consider whether there's a better separation to be had between the PAK
related stuff now that we have wallet boxes.
2020-11-14 17:16:10 +00:00
Andrew Poelstra
65f6fc64e9 Merge 5d2ff75e20 into merged_master (Bitcoin PR #17945) 2020-11-14 16:52:09 +00:00
Andrew Poelstra
f1535dde72 Merge f018d0c9cd into merged_master (Bitcoin PR #17924) 2020-11-14 16:52:08 +00:00
Andrew Poelstra
7c53615bb6 Merge af05bd9e1e into merged_master (Bitcoin PR #17891) 2020-11-14 16:52:07 +00:00
Andrew Poelstra
c4e2622681 Merge 3f8dbcd655 into merged_master (Bitcoin PR #16658) 2020-11-14 16:52:03 +00:00
Andrew Poelstra
009bc2fdfb Merge 99813a9745 into merged_master (Bitcoin PR #17829) 2020-11-14 16:52:02 +00:00
Andrew Poelstra
381cd9cd01 Merge 4ee8a58ce7 into merged_master (Bitcoin PR #17373)
This PR associates OutputType::BECH32 to PAK online keys, where before we
were able to directly access keys from the keypool. In a future refactoring
we should give PAK keys their own output type (and own scriptpubkey manager)
so that the wallet won't accept payments "to the PAK key".

Also changes `ReserveDestination::SetBlindingPubKey` to use a visitor pattern
to apply a blinding pubkey to a destination directly, rather than using the
old hacky method of regenerating the destination by pulling its key (which
is no longer contained in the class) out and giving it to a new constructor.
This was a long-overdue refactoring and the minimal-diff way to get the code
compiling (and it's not bad, maybe 10LOC to add a new visitor class) but
nonetheless I apologize for sticking this into a merge commit.
2020-11-14 16:51:54 +00:00
Andrew Poelstra
c7bf5baf96 Merge 526e802d69 into merged_master (Elements PR #755)
This Elements PR includes components of Core PR #17211, which since the
refactors to use effective value landed, no longer provides the right
error message when a user provides an unowned input from a wallet tx.
See https://github.com/bitcoin/bitcoin/pull/17211#pullrequestreview-528389011

This breaks a functional test which was included in this PR, but which
conveniently has been changed in the current version of the Core PR. I
fixed the behavior (commented, in SelectCoins) rather than updating the
test to the most recent version.
2020-11-14 16:51:53 +00:00
Andrew Poelstra
01f4eb2404 Merge 5ff798c39b into merged_master (Bitcoin PR #17439) 2020-11-09 23:10:13 +00:00
Andrew Poelstra
38f8a01825 Merge 36191a8bb5 into merged_master (Bitcoin PR #12461) 2020-11-09 23:10:13 +00:00
Andrew Poelstra
c82f65f262 Merge 73b26e38d7 into merged_master (Bitcoin PR #17351) 2020-11-09 21:20:50 +00:00
Andrew Poelstra
e910b15aa8 Merge 6a97e8a060 into merged_master (Bitcoin PR #17260) (multiple commits)
This is the start of some nontrivial wallet refactoring by achow. See
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes
for a high-level design.

This PR moves some stuff out of CWallet into a dummy "box" LegacyScriptPubKeyMan
which is (currently) very tightly coulped to CWallet. Because of the coupling there
are currently null-checks that cannot fail, things which assume non-nullness which
will eventually be wrong, and a plethora of currently-equivalent ways to get from
a CWallet to a provider or back.

Our approach is basically to ignore the refactoring; leave the blinding key stuff
in CWallet and have it call into the wallet's provider when we are obtaining the
underlying keys.

Later, probably in a post-rebase PR, we should rethink how we manage blinding keys
to more closely match Core's "all keys go into providers" model.
2020-11-09 21:20:47 +00:00
Andrew Poelstra
fdb06a8ceb Merge 4c1090c882 into merged_master (Bitcoin PR #17279) 2020-11-09 21:20:46 +00:00
Andrew Poelstra
4749945d77 Merge 0ff7cd7d0c into merged_master (Bitcoin PR #16889) 2020-11-09 21:20:42 +00:00
Andrew Poelstra
75e090ffc0 Merge 4daadce36c into merged_master (Bitcoin PR #17162) 2020-11-09 21:20:41 +00:00
Andrew Poelstra
821f5256a5 Merge 46d6930f8c into merged_master (Bitcoin PR #16659) 2020-11-09 21:20:41 +00:00
Andrew Poelstra
d8efec9501 Merge 561a7d3047 into merged_master (Bitcoin PR #16947) 2020-11-09 21:20:38 +00:00
Andrew Poelstra
f3f736f76d Merge befdef8aee into merged_master (Bitcoin PR #16887) 2020-11-09 21:20:37 +00:00
Andrew Poelstra
382e167ab3 Merge 520d140e6e into merged_master (Bitcoin PR #17056)
Recreated addresses for functional tests using `hal elements address create --script`
with the given script from data/rpc_bip67.json, taking the P2SH output
2020-11-09 21:20:35 +00:00
Andrew Poelstra
ccdb481c55 Merge 752debdbdb into merged_master (Bitcoin PR #13266) 2020-11-09 21:20:32 +00:00
Andrew Poelstra
b8a1b9df4d Merge ed03bfc899 into merged_master (Elements PR #726) 2020-11-09 21:20:31 +00:00
Andrew Poelstra
a3139d9501 Merge 280c33f865 into merged_master (Elements PR #723) 2020-11-09 21:20:29 +00:00
Andrew Poelstra
ca7b7f3810 Merge feb162d500 into merged_master (Bitcoin PR #14696) 2020-11-09 21:20:26 +00:00
Andrew Poelstra
9cc26a716a Merge 5b2fe5563b into merged_master (Elements PR #642)
FIXME: we disable standardness checks for the non-PAK node in the PAK tests.
This is because of a bug in Elements which causes non-PAK nodes to reject
pegouts for standardness reasons. Need to fix it after the rebase.
2020-11-09 21:20:21 +00:00