Commit graph

22456 commits

Author SHA1 Message Date
Glenn Willen
f035196ceb Merge 586e5c7dd7 into merged_master (Elements PR ElementsProject/elements#1062) 2022-04-20 21:51:53 -07:00
Glenn Willen
dea074b88a Merge b707a6f00f into merged_master (Elements PR ElementsProject/elements#1069) 2022-04-20 20:51:37 -07:00
Glenn Willen
ef37d6a609 Merge 3c4e4ada12 into merged_master (Elements PR ElementsProject/elements#1066) 2022-04-20 20:26:58 -07:00
Glenn Willen
c2aaa7cada Merge 9cc56b87fb into merged_master (Elements PR ElementsProject/elements#1070) 2022-04-20 20:08:44 -07:00
Glenn Willen
19307ddeb3 Merge fec996403a into merged_master (Elements PR ElementsProject/elements#1072) 2022-04-20 19:29:07 -07:00
Glenn Willen
63f92662df Merge 04cedf3f6b into merged_master (Elements PR ElementsProject/elements#1057) 2022-04-20 19:11:57 -07:00
Glenn Willen
04fd3d8dab Fix dropped '&' from merge of #1022
When PR 1022 was merged, an & got dropped from the declarations of the two
"fStall" out-parameters, rendering them unused (and triggering a compiler
warning.) Restore them, restoring the functionality of #1022.
2022-04-20 18:35:06 -07:00
Steven Roose
586e5c7dd7
Merge ElementsProject/elements#1062: Implement vbparams equivalent for elements
85c3c2b819 Deprecate con_dyna_deploy_start in favor of evbparams (Pablo Greco)
d15d08c605 Dynafed is already activated in liquidv1, remove start argument parsing (Pablo Greco)
a06aac152a Make dynafed signaling opt-out instead of opt-in (Pablo Greco)
19f54eb5e0 Make sure command line takes precedence when processing evbparams (Pablo Greco)
24cafa50cf Implement vbparams for Elements (evbparams) (Pablo Greco)

Pull request description:

  Fixes: https://github.com/ElementsProject/elements/issues/1061

ACKs for top commit:
  stevenroose:
    Looks good, utACK 85c3c2b

Tree-SHA512: 124a25d762e8c5053d388153374ac629779df5dc8af09308cb5f794c707c890fd379e81b72ecc9892e5a02e414bc6539082d95fb69dcb2512e7f91b3f8bcffdd
2021-11-26 15:07:18 +00:00
Steven Roose
b707a6f00f
Merge ElementsProject/elements#1069: Fix elements multiple-header-download issue.
cdfb4c9c6c Fix elements multiple-header-download issue. (Glenn Willen)

Pull request description:

  This fixes an issue which causes Elements to download the blockchain headers
  multiple times during initial block download.

  In particular: each time we receive an INV P2P message with a new block
  (about once a minute), we start downloading the headers, again, in parallel
  with any existing download(s) in progress.

  With this change, after we receive each batch of headers, we check whether
  any of the headers in it were new to us. If not (they were all duplicates),
  we stop there, and do not ask the peer for another batch. This reduces the
  maximum amount of duplication to about 2x, which is not ideal, but a HUGE
  improvement.

  With luck, this may help with #1013. But it's primarily directed at fixing slow initial block download, which I can't immediately find an open issue for on this repo, but has been a long-standing problem.

ACKs for top commit:
  stevenroose:
    looks good, utACK cdfb4c9c6c

Tree-SHA512: 693a8f89cae1819292146b5bc676e34cd9045bf3a771d78959d8f704072020d5ccb073d6d5b89786598129fd9fd4f80d2c207a2db29597984fcae774cbfacadb
2021-11-26 11:57:53 +00:00
Steven Roose
3c4e4ada12
Merge ElementsProject/elements#1066: Reevaluate descriptor post parse
6c1d0d3ca8 Re-evaluate peg-out descriptor if wallet is reparsed (Jeff Frontz)

Pull request description:

  In `sendtomainchain_pak()` a check is made if the associated `descriptor` is null and an attempt to remedy is made -- but the remedy is never applied to `descriptor` (which results in a SEGV later).  This code fixes that.

  Note: unfortunately it also removes the `const` qualifier.  I'm not sure what/if there are conventions for dealing with that (e.g., creating a new `const` of, like, `sanitized_descriptor` for subsequent use in the function?).

Top commit has no ACKs.

Tree-SHA512: 8fb4a28ebd0d76647c1b0ecf98f3e18905c880a9562caa1b02ca66647dcbe00b2a6bd91da7ce6a61bd34bb3096030714417170badccdaeaa4c0a03e8704f8ca1
2021-11-26 11:52:48 +00:00
Steven Roose
9cc56b87fb
Merge ElementsProject/elements#1070: Mark pegin-related args to createrawtransaction as optional.
e72544da90 Mark pegin-related args to createrawtransaction as optional. (Glenn Willen)

Pull request description:

  Fixes #1064 .

  <!--
  *** Please remove the following help text before submitting: ***

  Pull requests without a rationale and clear improvement may be closed
  immediately.

  GUI-related pull requests should be opened against
  https://github.com/bitcoin-core/gui
  first. See CONTRIBUTING.md
  -->

  <!--
  Please provide clear motivation for your patch and explain how it improves
  Bitcoin Core user experience or Bitcoin Core developer experience
  significantly:

  * Any test improvements or new tests that improve coverage are always welcome.
  * All other changes should have accompanying unit tests (see `src/test/`) or
    functional tests (see `test/`). Contributors should note which tests cover
    modified code. If no tests exist for a region of modified code, new tests
    should accompany the change.
  * Bug fixes are most welcome when they come with steps to reproduce or an
    explanation of the potential issue as well as reasoning for the way the bug
    was fixed.
  * Features are welcome, but might be rejected due to design or scope issues.
    If a feature is based on a lot of dependencies, contributors should first
    consider building the system outside of Bitcoin Core, if possible.
  * Refactoring changes are only accepted if they are required for a feature or
    bug fix or otherwise improve developer experience significantly. For example,
    most "code style" refactoring changes require a thorough explanation why they
    are useful, what downsides they have and why they *significantly* improve
    developer experience or avoid serious programming bugs. Note that code style
    is often a subjective matter. Unless they are explicitly mentioned to be
    preferred in the [developer notes](/doc/developer-notes.md), stylistic code
    changes are usually rejected.
  -->

  <!--
  Bitcoin Core has a thorough review process and even the most trivial change
  needs to pass a lot of eyes and requires non-zero or even substantial time
  effort to review. There is a huge lack of active reviewers on the project, so
  patches often sit for a long time.
  -->

Top commit has no ACKs.

Tree-SHA512: a901c4bd65fbd7fceebe39cca9f8e377741e61ef2968bc3c955e26bffb2b371a342b49a09f76696ac45f047d8c410500f5872fb722007fb92b17d0bca97d69dc
2021-11-26 11:50:57 +00:00
Pablo Greco
85c3c2b819 Deprecate con_dyna_deploy_start in favor of evbparams 2021-11-23 14:36:03 +00:00
Pablo Greco
d15d08c605 Dynafed is already activated in liquidv1, remove start argument parsing 2021-11-23 14:36:03 +00:00
Pablo Greco
a06aac152a Make dynafed signaling opt-out instead of opt-in 2021-11-23 14:36:03 +00:00
Pablo Greco
19f54eb5e0 Make sure command line takes precedence when processing evbparams 2021-11-23 14:36:03 +00:00
Pablo Greco
24cafa50cf Implement vbparams for Elements (evbparams) 2021-11-23 14:36:03 +00:00
Glenn Willen
b2dd758ce4 Remove redundant log message in IsValidPeginWitness 2021-11-22 13:37:31 -08:00
Glenn Willen
e72544da90 Mark pegin-related args to createrawtransaction as optional. 2021-11-17 17:02:14 -08:00
Glenn Willen
cdfb4c9c6c Fix elements multiple-header-download issue.
This fixes an issue which causes Elements to download the blockchain headers
multiple times during initial block download.

In particular: each time we receive an INV P2P message with a new block
(about once a minute), we start downloading the headers, again, in parallel
with any existing download(s) in progress.

With this change, after we receive each batch of headers, we check whether
any of the headers in it were new to us. If not (they were all duplicates),
we stop there, and do not ask the peer for another batch. This reduces the
maximum amount of duplication to about 2x, which is not ideal, but a HUGE
improvement.
2021-11-17 09:06:38 -08:00
Jeff Frontz
6c1d0d3ca8 Re-evaluate peg-out descriptor if wallet is reparsed 2021-11-11 16:10:58 -05:00
Andrew Poelstra
6ab7760cac test: add dynafed params for testnet (only used in unit tests, fix needed for uninit mem linter) 2021-10-15 00:20:23 +00:00
Andrew Poelstra
ba8273ac94 lint: fix non-pylint linter errors
Includes fixing all the spelling mistakes that are our fault,
but not those present upstream in Core.
2021-10-15 00:20:20 +00:00
Andrew Poelstra
f71e68f75d lint: replace tabs with spaces 2021-10-14 23:55:20 +00:00
Andrew Poelstra
fad6c8a526 ci: change a couple bitcoins to elementss 2021-10-14 23:55:17 +00:00
Andrew Poelstra
a1f0aea3d7 Merge 43665e3ca0 into merged_master (Elements PR ElementsProject/elements#1055) 2021-10-14 19:32:30 +00:00
Glenn Willen
cfed38503e Make error messages when talking to parent chain daemon more useful. 2021-10-13 02:22:52 -07:00
Andrew Poelstra
43665e3ca0
Merge ElementsProject/elements#1055: minor PSET fix
0e1007fa7b minor PSET fix (Andrew Poelstra)

Pull request description:

  Noticed because it triggered a compiler warning.

  No test -- we will add one in a future "end-to-end issuance via PSET" tutorial script which is out of scope for the 0.21 release.

ACKs for top commit:
  achow101:
    ACK 0e1007fa7b

Tree-SHA512: c90427fd74c84bdee6940d2148818793e4641e6dd12dd4855a229afb6b725313c6074fc14171c911e5a541e252dd4027e65521c7fe5c62e265fb38076c1d5ca4
2021-10-06 23:09:09 +00:00
Andrew Poelstra
5fedc912ba Merge dfb3c4647a into merged_master (Elements PR ElementsProject/elements#1054) 2021-10-06 19:23:55 +00:00
Andrew Poelstra
0e1007fa7b minor PSET fix 2021-10-06 19:10:15 +00:00
Glenn Willen
a4b66a24b7 Update hardcoded PAK list for Liquid v1 2021-10-06 14:57:10 +00:00
Andrew Poelstra
b64ca7f411 Merge 6eed792d43 into merged_master (Elements PR ElementsProject/elements#1050)
Conflicts were mostly obvious, except for those in CreateTransactionInternal.
(This function was moved from wallet.cpp to spend.cpp, and substantially
rewritten, between 0.21 and 22.0.) For those I manually applied the changes
from the diff, which wound up taking a slightly different form.

Also had to update the new test because the `addresses` field of the RPC
output was removed.
2021-10-04 15:13:47 +00:00
Andrew Poelstra
6eed792d43
Merge ElementsProject/elements#1050: wallet: fix a pile of bugs in transaction funding logic
a67a2df330 pset: remove one more intermediate-zero check from the blinding logic (Andrew Poelstra)
9eb285c19d test: add test for confidential non-wallet-owned change (Andrew Poelstra)
185d473fe8 walletcreatefundedpsbt: add functional test for blinding edge cases (Andrew Poelstra)
533da12c2c wallet: make sure extra OP_RETURN output is blinded when called from fundraw (Andrew Poelstra)
b09b63bd1b pset: allow input blinding factors to sum to zero, or value to be 0 (Andrew Poelstra)
9afcb83baf wallet: correctly handle blinding of manually-set change addresses (Andrew Poelstra)
9813c3e74a wallet: fix "cannot unblind IsMine output" check in SignPSBT (Andrew Poelstra)
7103471fd5 walletcreatefundedpsbt: signal blinding data correctly to `FundTransaction` (Andrew Poelstra)

Pull request description:

  Fixes #1049

  Needs backport to 0.21 (and a new rc).

  Although there are several bugs here, none affect the functionaries. There is a more thorough summary in the second-to-last commit message.

ACKs for top commit:
  achow101:
    ACK a67a2df330

Tree-SHA512: 25066c29f080e43cd00c5b33c60a986a8cb5bbf4ca01ceb3b4182c5b8f61979a1d6d946b8f28fa871ec90f44bdb6fc22014b5c11280cf081181db102cd588cdf
2021-10-02 15:13:45 +00:00
Andrew Poelstra
ea62009330 Merge 4798e8ee2c into merged_master (Elements PR ElementsProject/elements#1052) 2021-10-02 14:06:41 +00:00
Andrew Poelstra
7b69a940eb Merge 846ab81794 into merged_master (Elements PR ElementsProject/elements#1051) 2021-10-02 13:27:49 +00:00
Andrew Poelstra
4798e8ee2c
Merge ElementsProject/elements#1052: chainparams: change magic bytes for liquidv1test
0628311b53 chainparams: change magic bytes for liquidv1test (Andrew Poelstra)

Pull request description:

  This is basically a Liquid-prod-ish version of regtest. Its default magic should not collide with that for Liquid prod.

ACKs for top commit:
  psgreco:
    UTACK 0628311b53

Tree-SHA512: 50c387ffeb62d42ffd0b42d0f43335966feb64a50140159c615474b9c864222e2a7510bb3b07aa95f62a977d0e7472d905bc97a06a3ace80aae0a519031c446e
2021-10-02 13:23:55 +00:00
Andrew Poelstra
a67a2df330 pset: remove one more intermediate-zero check from the blinding logic 2021-10-01 23:30:58 +00:00
Andrew Poelstra
fec0b59112 pset: make sure combinepsbt doesn't crash when explicit values are missing
I accidentally dropped this check (and its test) in the previous
commits. Restore both.
2021-10-01 20:10:27 +00:00
Andrew Poelstra
187c8094bb combinepsbt: only use explicit values if the corresponding proofs pass 2021-10-01 17:17:41 +00:00
Andrew Poelstra
533da12c2c wallet: make sure extra OP_RETURN output is blinded when called from fundraw
This is a followup to https://github.com/ElementsProject/elements/pull/588
2021-09-30 21:54:40 +00:00
Andrew Poelstra
b09b63bd1b pset: allow input blinding factors to sum to zero, or value to be 0
There are a number of special cases (and inconsistencies with wallet.cpp)
in the blinding logic that can prevent blinding from succeeding when various
intermediate values are zero. This fixes two of them.

A proper fix would involve adding new APIs to secp-zkp and then overhauling
all of the wallet blinding code. But for now let's get the tests working.
2021-09-30 21:54:40 +00:00
Andrew Poelstra
9afcb83baf wallet: correctly handle blinding of manually-set change addresses
When the user specifies a change address manually, use the change address
to obtain blinding parameters (either extract the blinding key from the
address or don't blind the change).

The previous behavior would assume that the change address was owned by
the wallet and always generate a blinding key internally. If the user
were to pass a non-wallet-owned change address, the result would be an
output that could not be unblinded by its owner.
2021-09-30 21:54:40 +00:00
Andrew Poelstra
9813c3e74a wallet: fix "cannot unblind IsMine output" check in SignPSBT 2021-09-30 21:54:40 +00:00
Andrew Poelstra
7103471fd5 walletcreatefundedpsbt: signal blinding data correctly to FundTransaction 2021-09-30 21:54:10 +00:00
Andrew Poelstra
0628311b53 chainparams: change magic bytes for liquidv1test
This is basically a Liquid-prod-ish version of regtest. Its default magic
should not collide with that for Liquid prod.
2021-09-28 17:29:13 +00:00
Andrew Poelstra
daa471ddd2 Merge 4c7dc0620a into merged_master (Elements PR ElementsProject/elements#1046) 2021-09-22 02:26:13 +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