Commit graph

4695 commits

Author SHA1 Message Date
Andrew Poelstra
97ea1dabe4 Merge 07ededa30c into merged_master (Bitcoin PR bitcoin/bitcoin#22050) 2021-07-21 21:08:21 +00:00
Andrew Poelstra
d28106be65 Merge d331e262f5 into merged_master (Bitcoin PR bitcoin/bitcoin#22138) 2021-07-21 14:14:29 +00:00
Andrew Poelstra
e0e20ba06f Merge 2fccd9cf30 into merged_master (Bitcoin PR bitcoin/bitcoin#22082) 2021-07-20 17:12:16 +00:00
Andrew Poelstra
f46e4fdf55 Merge 7e83e74e7f into merged_master (Bitcoin PR bitcoin/bitcoin#21178) 2021-07-20 12:32:17 +00:00
Andrew Poelstra
ef32d80f95 Merge 0b9ed3f6e7 into merged_master (Bitcoin PR bitcoin/bitcoin#22113) 2021-07-20 06:39:59 +00:00
Andrew Poelstra
01b1d5f844 Merge c5ee0cc11a into merged_master (Bitcoin PR bitcoin/bitcoin#21989) 2021-07-19 13:07:08 +00:00
Andrew Poelstra
ec674d3ecb Merge d7a6bba949 into merged_master (Bitcoin PR bitcoin/bitcoin#22103) 2021-07-19 06:12:28 +00:00
Andrew Poelstra
3d6a5a2182 Merge 55a156fca0 into merged_master (Bitcoin PR bitcoin/bitcoin#21207)
git diff --color-moved=zebra is your friend
2021-07-19 03:15:44 +00:00
Andrew Poelstra
8a669eccfb Merge 7257e50dba into merged_master (Bitcoin PR bitcoin/bitcoin#20833) 2021-07-18 18:11:25 +00:00
Andrew Poelstra
5f8081db1a Merge ecddd12482 into merged_master (Bitcoin PR bitcoin/bitcoin#18418) 2021-07-18 03:10:21 +00:00
Andrew Poelstra
e0383d5a59 Merge 8600934018 into merged_master (Bitcoin PR bitcoin/bitcoin#22057) 2021-07-17 13:01:19 +00:00
Andrew Poelstra
8b34c974c3 Merge 6b254814c0 into merged_master (Bitcoin PR bitcoin/bitcoin#17331)
This removes a lot of the craziness that was added during the 0.21
rebase 240f03f586 (Bitcoin PR #17290)
as well as a lot of other upstream craziness. It's a very positive
change but will probably be a bear to review.

There are two places where I (purposely) nontrivially changed the
logic beyond what the upstream PR did:

    1. When setting the change output positions, I used a uniform
       distribution for all change outputs and also obeyed the user's
       `change_position` choice. The old code was non-uniform and
       had a bug where it would offset the change position.

       For non-policy assets, I do not create zero-sized change
       since we would just remove them later. For the policy asset,
       I do sometimes create zero-sized change since the upstream
       logic expects it to exist.

    2. Rather than "reblinding whenever something changes" we blind
       once for size/fee estimation purposes and then again at the
       end after all potential adjustments have been made. The
       resulting code should be closer to upstream.

       We should really redo this code though because our use of the
       `BlindDetails` structure is very confusing and stateful.

    3. We consider whether or not we're using CT/CA when estimating
       the size of change outpust. This is because we now use branch
       and bound far more often (yay!) which selects coins such that
       there will be no change output. This is implemented however
       by adding a change output then dumping it to fees ... meaning
       that if we dramatically overestimate the size of a change out
       then we'll end up dramatically dumping too many coins to fees.

There are another couple small things, which I apologize for .. this
PR took me 2 hours to get compiling and 11 hours to get working(!!)
and some things got away from me.

One fun thing is that I changed CWallet::SelectCoinsMinConf to gate
an addition on coin_selection_params.m_subtract_fee_outputs ... this
is actually an upstream bug that I'll file whenever I get around to
producing a test that triggers it. (A bit hard as I have to gin up
a scenario where branch-and-bound fails to hit this codepath.)

Also, in test/functional/wallet_bumpfee.py I had to change the feerate
required to force selection to add another input from 500 to 800. I
don't know why and I don't care to figure it out.
2021-07-17 02:42:16 +00:00
Andrew Poelstra
76bb76c18c Merge 40f7a2891f into merged_master (Bitcoin PR bitcoin/bitcoin#22043) 2021-07-13 00:24:44 +00:00
Andrew Poelstra
ff5c2de782 Merge 0a909073dc into merged_master (Bitcoin PR bitcoin/bitcoin#22048) 2021-07-12 21:04:54 +00:00
Andrew Poelstra
11548bb33c Merge 778b920179 into merged_master (Bitcoin PR bitcoin/bitcoin#21945) 2021-07-12 12:52:18 +00:00
Andrew Poelstra
bae18ea9ed Merge 37e9f07996 into merged_master (Bitcoin PR bitcoin/bitcoin#21843) 2021-07-11 17:21:19 +00:00
Andrew Poelstra
a7702d6ab5 Merge 6b49d88a5d into merged_master (Bitcoin PR bitcoin/bitcoin#21905) 2021-07-09 18:45:07 +00:00
Andrew Poelstra
e56472be53 Merge d2ec37221a into merged_master (Bitcoin PR bitcoin/bitcoin#21796) 2021-07-09 17:38:32 +00:00
Andrew Poelstra
7447a3b352 Merge d8ae29ec8f into merged_master (Bitcoin PR bitcoin/bitcoin#21900) 2021-07-08 18:04:18 +00:00
Andrew Poelstra
d56bdbd28f Merge 32692d2681 into merged_master (Bitcoin PR bitcoin/bitcoin#21359)
I hacked up rpc_fundrawtransaction.py a little bit because our `get_address`
method here depends on nobody having called `createwallet` on a particular
node ... the "correct" fix for this would be to redo the Elements changes
to this functional test for the 0.20+ createwallet changes, but because
there will be big future changes to this test (in Elements #900 (PSET))
I did the quick/hacky thing, and will defer cleanups to a separate
post-rebase PR.
2021-07-08 16:08:49 +00:00
Andrew Poelstra
c7b124ac91 Merge 1a60c547fd into merged_master (Bitcoin PR bitcoin/bitcoin#21749) 2021-07-08 05:07:57 +00:00
Andrew Poelstra
9c4837db05 Merge adf7843410 into merged_master (Bitcoin PR bitcoin/bitcoin#21786) 2021-07-08 02:57:17 +00:00
Andrew Poelstra
b7ec414b10 Merge 5925f1e652 into merged_master (Bitcoin PR bitcoin/bitcoin#21872) 2021-07-07 21:11:33 +00:00
Andrew Poelstra
45fdf8809b Merge a33f360fcd into merged_master (Bitcoin PR bitcoin/bitcoin#21873) 2021-07-07 15:10:12 +00:00
Andrew Poelstra
bf5cf2b070 Merge 06d573f053 into merged_master (Bitcoin PR bitcoin/bitcoin#21867) 2021-07-07 13:00:25 +00:00
Andrew Poelstra
b2376cfef6 Merge 1fcf66af68 into merged_master (Bitcoin PR bitcoin/bitcoin#21798) 2021-07-07 06:18:42 +00:00
Andrew Poelstra
7b25418b9c Merge 128b98fce3 into merged_master (Bitcoin PR bitcoin/bitcoin#21681) 2021-07-07 03:49:35 +00:00
Andrew Poelstra
6ce592d7cd Merge 1b9a5236e9 into merged_master (Bitcoin PR bitcoin/bitcoin#21740) 2021-07-07 01:15:58 +00:00
Andrew Poelstra
ad61a8e5bf Merge a0f46028fc into merged_master (Bitcoin PR bitcoin/bitcoin#21814) 2021-07-06 23:36:32 +00:00
Andrew Poelstra
87c10268ee Merge 3275c6e578 into merged_master (Bitcoin PR bitcoin/bitcoin#21727) 2021-07-06 21:07:44 +00:00
Andrew Poelstra
a61038a299 Merge fb43d7cb1e into merged_master (Bitcoin PR bitcoin/bitcoin#21787) 2021-07-06 18:06:39 +00:00
Andrew Poelstra
ab1e80eb09 Merge 779aaa7f03 into merged_master (Bitcoin PR bitcoin/bitcoin#21754)
What a pain in the ass. This changes the `feature_cltv` functional test
to use the `MiniWallet`, an internal Pythonic wallet that produces
"signatures" consisting of several OP_NOPs in a row, so that this test
can be used when the wallet is disabled.

This means that the functions in feature_cltv which add a CLTV check and
change the locktime/sequence number no longer need to re-sign when they
change the txid, so they don't...HOWEVER, our Elements-specific
`feature_block_v4` test calls these functions with a real transaction
and depended on the re-signing behavior.

After several attempts at min-effort min-diff fixes I landed on this,
which simply sets the locktime at transaction creation and avoids having
to re-sign at all.

Also, I had to change the number of NOPs in the fake wallet code to make
a vsize assertion pass, presumably because of differences in Bitcoin/Elements
transaction serialization.
2021-07-06 13:53:02 +00:00
Andrew Poelstra
e64f03b7d4 Merge bf5e6a7771 into merged_master (Bitcoin PR bitcoin/bitcoin#21846) 2021-07-05 08:36:03 +00:00
Andrew Poelstra
fb60da4597 Merge 60132382a7 into merged_master (Bitcoin PR bitcoin/bitcoin#20867) 2021-07-29 13:40:05 +00:00
Andrew Poelstra
3c9222f410 Merge 59869704c0 into merged_master (Bitcoin PR bitcoin/bitcoin#21818) 2021-07-05 01:03:56 +00:00
Andrew Poelstra
27eff4ad45 Merge d22e7ee933 into merged_master (Bitcoin PR bitcoin/bitcoin#21822)
Adding an iteration cap to a fuzztest in this PR, not because it
has anything to do with this PR, but because this is where the
merge script happened to be when I was done investigating 100+
minute fuzzer runs.

Added a comment explaining the rationale for the iteration cap.
2021-07-04 23:52:11 +00:00
Andrew Poelstra
c4182106af Merge 2b45cf0bcd into merged_master (Bitcoin PR bitcoin/bitcoin#19521)
This is part of the "UTXO Set Statistics" project in Core, which aims
to make things like "checking coin supply" faster. This stuff, and
related things in coinstats.cpp, have always been broken for Elements
in the sense that we consider only explicit outputs and we ignore
assets (so everything just gets added together to get a meaningless
total). It probably wouldn't be too hard to restrict this to only
consider policyAsset, but it's out of scope for a rebase IMO.

Also, I think this situation is fine .. I don't understand the motivation
for this or why Core is merging this when they refuse to merge an address
index .. but I guess we'll see if there are users who care about this data
and who care about it being meaningful on Elements.

Also, apologies for the big diff -- there were some mechanical changes
to deal with CT amounts, but most of the changes related to the difference
in how fees are accounted for. While I'm not thrilled with this PR, its
functional test is really good! So I think what I eventually came up with
is internally consistent.
2021-07-04 19:51:38 +00:00
Andrew Poelstra
4485d3c785 Merge 40310f5e8c into merged_master (Bitcoin PR bitcoin/bitcoin#21792) 2021-07-03 22:18:16 +00:00
Andrew Poelstra
16e3fcba46 Merge a7a193789e into merged_master (Bitcoin PR bitcoin/bitcoin#21804) 2021-07-03 17:11:33 +00:00
Andrew Poelstra
e300bdf641 Merge 1daca9f9a9 into merged_master (Bitcoin PR bitcoin/bitcoin#21738) 2021-07-03 15:30:12 +00:00
Andrew Poelstra
6b565b9878 Merge fb66dbe786 into merged_master (Bitcoin PR bitcoin/bitcoin#21762) 2021-07-03 13:46:53 +00:00
Andrew Poelstra
a02abbc35a Merge 7f37a1d560 into merged_master (Bitcoin PR bitcoin/bitcoin#21785) 2021-07-03 08:56:11 +00:00
Andrew Poelstra
ac9594fd74 Merge bd2e2d5c64 into merged_master (Elements PR ElementsProject/elements#1012)
Took the non-backported version of base_encode_decode from https://github.com/bitcoin/bitcoin/pull/22279
2021-07-02 03:42:38 +00:00
Andrew Poelstra
5f0c45b568 Merge ac219dcbcc into merged_master (Bitcoin PR bitcoin/bitcoin#19160) 2021-07-01 13:29:36 +00:00
Andrew Poelstra
95ab1aa7cb Merge 19a56d1519 into merged_master (Bitcoin PR bitcoin/bitcoin#21009) 2021-07-01 04:00:30 +00:00
Andrew Poelstra
e8fbb8c8bd Merge 683dda2a70 into merged_master (Bitcoin PR bitcoin/bitcoin#21777) 2021-07-01 03:35:37 +00:00
Andrew Poelstra
11f8520ec2 Merge 0a0a95b9d6 into merged_master (Bitcoin PR bitcoin/bitcoin#21707) 2021-07-01 02:52:46 +00:00
Andrew Poelstra
827081b134 Merge 4b5659c6b1 into merged_master (Bitcoin PR bitcoin/bitcoin#19801) 2021-07-01 01:35:09 +00:00
Andrew Poelstra
b791c544d7 Merge 83c715415a into merged_master (Bitcoin PR #20857) 2021-06-30 21:04:37 +00:00
Andrew Poelstra
2905d3d747 Merge a47ae618a0 into merged_master (Bitcoin PR #21718) 2021-06-30 19:33:08 +00:00