Skip to content

Elements 0.21: backports from Core 0.21.0#1029

Merged
apoelstra merged 84 commits intoElementsProject:elements-0.21from
apoelstra:2021-08--0.21rc1
Sep 22, 2021
Merged

Elements 0.21: backports from Core 0.21.0#1029
apoelstra merged 84 commits intoElementsProject:elements-0.21from
apoelstra:2021-08--0.21rc1

Conversation

@apoelstra
Copy link
Member

@apoelstra apoelstra commented Sep 1, 2021

This is a cherry-pick of all the commits from Bitcoin Core 0.21.1 that are not on master, except those related to bech32m and Speedy Trial.

TODO (will do each in a separate additional commit, no need to delay review)

  • regenerate manpages
  • bump version in configure.ac

@apoelstra apoelstra changed the title Elements 0.21 release candidate 1 Elements 0.21: backports from Core 0.21.0 Sep 1, 2021
@apoelstra
Copy link
Member Author

Rebased.

cc @gwillen this is ready for review

@apoelstra apoelstra added this to the 0.21 milestone Sep 20, 2021
ajtowns and others added 24 commits September 22, 2021 02:05
…nt and wallet_name parameter specify a wallet

(cherry picked from commit b1f59d5)
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: 8f7d1b3
Tree-SHA512: 558da5c2bb0373e2a89f2c219170f802036e0e87cc8e808336b23d074152cb893007a440f46ec957156b0921355cd18502710f2d224f27bc26e934c50ebebc41
(cherry picked from commit ab23a83)
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
bitcoin/bitcoin#20403 (comment)

(cherry picked from commit 2498b04)
GitHub-Pull: #20469
Rebase-From: e95aaef
(cherry picked from commit 01b647b)
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: 1b3d700
(cherry picked from commit 54e1edc)
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: 3f1e10b
(cherry picked from commit 6e4969f)
and remove redundant units ("Must be at least 1.000 sat/vB sat/vB" -> "1.00 sat vB")

Github-Pull: #20426
Rebased-From: 9f08780
(cherry picked from commit 6313362)
Github-Pull: #20564
Rebased-From: c5a8919
(cherry picked from commit 9e80688)
See the corresponding BIP change: bitcoin/bips#1043

Github-Pull: #20564
Rebased-From: 1583498
(cherry picked from commit bead935)
Github-Pull: #20573
Rebased-From: ce207d6
(cherry picked from commit 06c8423)
Github-Pull: #20573
Rebased-From: 6fa72ce
(cherry picked from commit 0d3c140)
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: 39c42c4
(cherry picked from commit 1caa32e)
Github-Pull: #20595
Rebased-From: 0f949cd
(cherry picked from commit ce13b99)
Github-Pull: #20478
Rebased-From: 982e548
(cherry picked from commit 61e316e)
Github-Pull: #20563
Rebased-From: d3ef947
(cherry picked from commit 96124a2)
This change unifies Homebrew packages workflow, and does not change
behavior.

Github-Pull: #20527
Rebased-From: c96d1f6
(cherry picked from commit 48f8929)
Github-Pull: #20527
Rebased-From: ee7b84e
(cherry picked from commit f51e1cb)
fanquake and others added 8 commits September 22, 2021 02:05
Github-Pull: #21486
Rebased-From: 4783115
(cherry picked from commit 1a9a2cb)
Introduces a DeferringSignatureChecker which simply takes a
BaseSignatureChecker and passes through everything.
SignatureExtractorChecker now subclasses DeferringSignatureChecker. This
allows for all BaseSignatureChecker functions to be implemented for
SignatureExtractorChecker, while allowing for future signature checkers
which opreate similarly to SignatureExtractorChecker.

Github-Pull: #21166
Rebased-From: 6965456
(cherry picked from commit 7de019b)
Github-Pull: #21166
Rebased-From: a97a929
(cherry picked from commit f79189c)
During each loop of CreateTransaction, instead of constantly getting a
new feerate, use the feerate that we have already fetched for all
fee calculations. Thix fixes a race condition where the feerate required
changes during each iteration of the loop.

This commit changes behavior as the "Fee estimation failed" error will
now take priority over "Signing transaction failed".

Github-Pull: #21083
Rebased-From: 1a6a0b0
(cherry picked from commit 48fc675)
Make sure that all fee calculations use the same feerate.
coin_selection_params.effective_fee is the variable we use for all fee
calculations, so get rid of remaining nFeeRateNeeded usages and just
directly set coin_selection_params.effective_fee.

Does not change behavior.

Github-Pull: #21083
Rebased-From: e2f429e
(cherry picked from commit 34c89f9)
Instead of setting the long term feerate for each SelectCoinsMinConf
iteration, set it once during CreateTransaction and let it be shared
with each SelectCoinsMinConf through
coin_selection_params.m_long_term_feerate.

Does not change behavior.

Github-Pull: #21083
Rebased-From: 448d04b
(cherry picked from commit bcd7166)
Instead of fetching the discard feerate for each SelectCoinsMinConf
iteration, fetch and cache it once during CreateTransaction so that it
is shared for each SelectCoinsMinConf through
coin_selection_params.m_discard_feerate.

Does not change behavior.

Github-Pull: #21083
Rebased-From: bdd0c29
(cherry picked from commit 5fc381e)
It's a feerate, not a fee. Also follow the style guide for member names.

Github-Pull: #21083
Rebased-From: f9cd2bf
(cherry picked from commit d61fb07)
@gwillen
Copy link
Contributor

gwillen commented Sep 22, 2021

Checked that all the commits (up to 321ff88) are the thing they claim to be. (I reviewed the git range-diff from the commit here, against the (cherry-picked from commit X) commit ID from upstream's release branch (I assume); except for the last four commits which were missing that line, and I instead diffed against the upstream Rebased-From: X commit ID, presumably referring to the original pull request.)

I didn't check yet that the things they claim to be are reasonable.

@gwillen
Copy link
Contributor

gwillen commented Sep 22, 2021

Oh, except e45e7c1, where our diff is empty, whereas upstream's diff is adding a test case for transaction decoding (ambiguity between segwit and pre-segwit encoding format.) Possibly the offending issue just doesn't exist in elements, and you did that on purpose?

@apoelstra
Copy link
Member Author

Thank you! Let me redo the last four commits. I forgot to use -x with git-cherry-pick. And I will double-check the empty diff -- most likely the code was already in Elements due to an earlier backport. (These can't happen by accident, git commit won't work unless you explicitly give it --allow-empty-commit, so I definitely was aware of this at the time that I did it..)

vasild and others added 4 commits September 22, 2021 16:34
This is a non-functional change that replaces the `CNode` on-stack
variables with `CNode` pointers.

The reason for this is that it would allow us to add those `CNode`s
to `CConnman::vNodes[]` which in turn would allow us to check that they
are disconnected properly - a `CNode` object must be in
`CConnman::vNodes[]` in order for its `fDisconnect` flag to be set.

If we store pointers to the on-stack variables in `CConnman` then it
would crash at the end, trying to `delete` them.

Github-Pull: #21571
Rebased-From: 4d6e246
(cherry picked from commit dfeb6c1)
Use `CConnmanTest` instead of `CConnman` and add the nodes to it
so that their `fDisconnect` flag is set during disconnection.

Github-Pull: #21571
Rebased-From: 637bb6d
(cherry picked from commit b765f41)
Github-Pull: #21571
Rebased-From: 81747b2
(cherry picked from commit 79cdb4a)
Github-Pull: #21489
Rebased-From: aa7f418
(cherry picked from commit b8af67e)
@apoelstra
Copy link
Member Author

Replaced last four commits.

@apoelstra
Copy link
Member Author

Added doc update and release version

@apoelstra apoelstra force-pushed the 2021-08--0.21rc1 branch 2 times, most recently from 8e6ca1f to b6fccab Compare September 22, 2021 19:08
Basically I just ran

for bin in elements-cli elementsd elements-tx elements-wallet
do
    help2man ./src/$bin > ./doc/man/$bin.1
    echo "Done $bin"
done
@gwillen
Copy link
Contributor

gwillen commented Sep 22, 2021

Rechecked that last four cherry-picks now look good (they match what they say they were cherry-picked from.)

Checked that the set of cherry-picked commits matches the non-merge commits in:

git log v0.21.1 --not 831675c8dcc --graph

after manually excluding the speedy trial ones, the bech32 ones, and the one-off ones by Wladimir doing release activities.

@gwillen
Copy link
Contributor

gwillen commented Sep 22, 2021

utACK 3168f2c

@gwillen
Copy link
Contributor

gwillen commented Sep 22, 2021

There's a small issue I spotted in the manpages, probably implying the same issue exists in the help text, which we're going to leave for -rc2. (The port looks wrong.)

-Connect to JSON\-RPC on <port> (default: 8332, testnet: 18332, regtest:
-18443)
+Connect to JSON\-RPC on <port> (default: 7041, testnet: 18332, signet:
+38332, regtest: 18443)

@apoelstra apoelstra merged commit d04207f into ElementsProject:elements-0.21 Sep 22, 2021
@apoelstra apoelstra deleted the 2021-08--0.21rc1 branch September 22, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.