Commit graph

29729 commits

Author SHA1 Message Date
Andrew Poelstra
e5ecee8d2d reduce cache sizes so that default maxsigcache size is same as Bitcoin
Bitcoin allocates 32M for signature caching by default, split
between a signature cache and a script validity cache (see
Core #10192). Since 0.14 we have added an additional 32M for
rangeproof caching *and* an additional 32M for surjectionproof
caching.

These cache entries cost a bit over 32 bytes, so these are room
for a million entries....or 4Gb of rangeproofs and 300M of
surjection proofs.

Presumably we did not intend to triple memory usage relative to
Core to deal with some champagne problem in which our mempool is
overfilled ten times with pure rangeproofs. So put the total
default cache size back to 32M. This should have no performance
hit under realistic circumstances and should reduce CI OOM failures.

On my system we now use 50M rather than 110M during the fedpeg
test; we still use 18M that Core does not by having three additional
global secp contexts (one in blind.cpp, one in pegins.cpp, one in
confidential_validation.cpp) but we can settle that in a future
commit.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
1670bdfa0b ci: fix benchmarks, fuzztests and unit tests
Includes a memory leak in the checkqueue unit test (but not in
the actual code). WE really need to switch our checkqueue to use
std::unique_pointer rather than bare pointers. But this would be
invasive enough that I want to do it in a followup PR.

Also pretty-much disable the validation_flush_cache unit test.
This is a stupid and irritating test which tries to unit-test
exact memory usage of std containers. It already has at least
one "remove wrong assumptions" update upstream and after many
tries I was unable to change all the magic numbers in a way
that'd consistently pass CI for Elements.

Also adds a couple ubsan suppressions about perfectly-legitimate
conversions of integer types.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
697cd77985 ci: disable broken feature_pruning test
It may be that we just need to recompute some numbers because our
block limits are different. But this test takes 20 minutes to
fail and it would take some time to understand what the expected
behavior is.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
0c98d2f5d4 ci: fix address in signet test so that the test works with wallet disabled 2021-03-26 17:33:05 +00:00
Andrew Poelstra
47885e97bf ci: tighten locking in signblock to ensure consistent main/wallet locking order 2021-03-26 17:33:05 +00:00
Andrew Poelstra
2f5c624b18 ci: eliminate a bunch of build warnings
Includes removing some variables from qt/intro.cpp that've been
unused since #13216 and ought to have been removed in the 0.17
rebase, but our linters were not so agressive then. Similarly
fix the BITCOIN_PID_FILE, whose value was incorrectly changed
in the 0.18 rebase.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
a1bac6d8a6 build: drop the rendered icon stuff
This is broken in multiple ways, does not exist in 0.14, appears in an
unreviewed mega-PR "porting" from a version of liquid-qt that I cannot
track down, and apparently has caused a fair bit of follow-on trouble
with icon integration.

Just put the icons in the repo like upstream does.

The committed icons were built using the Makefile prior to this
commit, starting from ./share/pixmaps/nsis-wizard.svg and
./src/qt/res/src/bitcoin.svg. They should be recreated manually
if they need to be changed in the future.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
ee5d4e3256 ci: temporarily disable qa-assets unit tests
These "pass" locally but in CI they download pre-signed transactions
from https://github.com/bitcoin-core/qa-assets/ which we need to
fork and recreate.

Essentially these files are the output of the Taproot functional
test (which passes), so I am not too worried about actual failures
here. But we should wait until after the Taproot sighash is finalized
to recreate these assets.
2021-03-26 17:33:04 +00:00
Andrew Poelstra
db64bd5276 ci: change bitcoin- paths to elements- paths since that's where autotools puts stuff 2021-03-26 17:33:04 +00:00
Andrew Poelstra
f1642283f5 travis: temporarily remove bitcoin_functional tests from Python linter 2021-03-26 17:33:04 +00:00
Andrew Poelstra
848c597959 (temporarily?) delete Liquid gitian descriptors
We should just reconstruct these from the Elements ones after the fact. They did
not get updated throughout the rebase.
2021-03-26 17:33:04 +00:00
Andrew Poelstra
79bab21c58 ci: reduce secp test iterations from default 64 to 16
The reduced secp iterations should prevent test timeouts on arm.
Also reduce MAKEJOBS to avoid OOM/load failures in other jobs.
2021-03-26 17:33:04 +00:00
Andrew Poelstra
68bfd70b43 ci: various linter / CI compiler error fixes
Includes changing TRUE to OP_TRUE for anyone-can-spend output name,
to avoid symbol conflict on win64 builds, which is really obnoxious.
2021-03-26 17:33:04 +00:00
Andrew Poelstra
1e98c9fa9e fix RPC linter issues 2021-03-26 17:33:02 +00:00
Andrew Poelstra
29ab3fdda1 travis: temporarily disable lint-git-commit-check.sh
This fails on upstream commit messages which are incorrectly formatted
and there is obviously nothing we can do about this. Re-enable this
check after the rebase is merged.
2021-03-26 01:34:49 +00:00
Andrew Poelstra
ae064874bc travis: temporarily blacklist a specific commit in the scripted-diff filter
Commit f471a3be00 currently has the text "scripted diff"
rather than "scripted-diff", which causes the scripted-diff linter to fail, saying
that it sees a script but not the magic words.

Changing the linter to detect "scripted diff" causes it to fail on this commit,
because the included script does not work. (For reference, the script is

    r() { sed -i 's/vout must be positive/vout cannot be negative/g' $1 }
    r $(git grep -l 'vout must be positive')

Bet you can't guess why bash rejects this without running it!)

We should remember to change this back.
2021-03-26 01:34:49 +00:00
Andrew Poelstra
0699c4d5aa Merge 277cbb2dc8 into merged_master (Elements PR #969) 2021-03-26 01:26:01 +00:00
Andrew Poelstra
48dc78db0c Merge 9d35590935 into merged_master (Elements PR #964) 2021-03-26 00:58:03 +00:00
Andrew Poelstra
0118851154 Merge b9ee263ef6 into merged_master (Elements PR #966)
of course a one-line PR manages to conflict..
2021-03-26 00:30:30 +00:00
Andrew Poelstra
59076ca8f3 Merge 0c82c2743b into merged_master (Elements PR #970) 2021-03-26 00:27:13 +00:00
Andrew Poelstra
05e221374e Merge 8c834f7da1 into merged_master (Elements PR #959) 2021-03-26 00:24:13 +00:00
Andrew Poelstra
d89112072c Merge 3b8e4070c8 into merged_master (Elements PR #958)
Conflicts due to change of error state formatting upstream.
2021-03-26 00:21:11 +00:00
Andrew Poelstra
22cf380984 Merge a993a7c675 into merged_master (Elements PR #960)
Several conflicts in the C++ code related to the new `flags` parameter
to `CheckSignature` and the corresponding function being renamed upstream
to `CheckSignatureECDSA`.

Several conflicts in the test harness as Steven sorta pulled the new
upstream ECKey module into the Python code, and the actual upstream
code was slightly different. Also needed to update the feature_taproot
code to always use the non-RANGEPROOF sighash since dynafed is not
enabled in the Taproot test.

Also had to pull the `set_wif` method out of `ECKey` and inline it because
otherwise it triggers a "circular inclusion" error between script.py (which
would pull in `base58_to_bytes` from address.py) and address.py (which now
pulls in some taproot EC related stuff from script.py).

Noticed that #960 does not test the "sighash rangeproof flag set but no
witnesses" case.
2021-03-25 23:46:21 +00:00
Steven Roose
277cbb2dc8
Merge #969: Test duration of fedpeg validity in dynafed test
7aaf01e02f Test duration of fedpeg validity in dynafed test (Steven Roose)

Pull request description:

  I noticed this scenario was not really tested in the test

Tree-SHA512: 05b112b8d2859b1ea718b473c80b6bf0e75fed4f0441cbfafa673b44c2c4d4dad7e932568983ecba6c124baeddbc350193a5c0a0079696a6a67cee1cadb1a586
2021-03-24 15:12:20 +00:00
Steven Roose
9d35590935
Merge #964: Process for elements upstream tracking / merging
2f40d80b01 Further revisions in response to comments (Glenn Willen)
7207226d9c Update elements branching proposal based on chat with apoelstra (Glenn Willen)
115f622a6e Proposals/ideas for elements tracking of upstream bitcoin git branches (Glenn Willen)

Pull request description:

  This goes along with #954 (which is a tool for assisting the review process) and #935 (which was created using approximately this process.)

  It's already had some internal review inside Blockstream, and probably should just get merged now, as a description of the process we're currently trying out; then we can have followup PRs once we know how we feel about it / if we want to revise it.

  @stevenroose ?

Tree-SHA512: 7ec57d5bf9dba191565b6403d64638ff9bb43bc4e3ab0c54c85ffcc384ff9602e01f0af4c6208a22d0987d3c24fc1b1f8a57e9f48686cfa03cde10072923b1e1
2021-03-16 17:17:13 +00:00
Steven Roose
b9ee263ef6
Merge #966: Update the copyright year to 2021
77349c16a5 Update the copyright year to 2021 (Philippe McLean)

Pull request description:

Tree-SHA512: edb5bab1bc9a06aea52eb71bc889a51da75ef213a1ae7c6e0cd1fe56a51cc5213b7a730a223db76f1d9ad3de9ec9c5a4c755b8312510b876469966736e708ddb
2021-03-15 17:28:41 +00:00
Steven Roose
0c82c2743b
Merge #970: Specify the dynafed epoch length for liquidv1
70390ee638 Specify the dynafed epoch length for liquidv1 (Steven Roose)

Pull request description:

Tree-SHA512: edea8187c41a7ecfd8e3dea58dc28ede6fa34082b2ff74bdadcd67ac53b5f4fb165dbd5d1776e8d3c811b3bd49cabf1abb037236def1f7372e794d459ed44de4
2021-03-15 17:27:25 +00:00
Steven Roose
70390ee638
Specify the dynafed epoch length for liquidv1 2021-03-11 17:34:37 +00:00
Steven Roose
7aaf01e02f
Test duration of fedpeg validity in dynafed test 2021-03-10 17:00:33 +00:00
Philippe McLean
77349c16a5 Update the copyright year to 2021 2021-03-04 07:57:00 -08:00
Steven Roose
8c834f7da1
Merge #959: Make it clear that the CRangeCheck is not called on explicit values
a8a1a933d Make it clear that the CRangeCheck is not called on explicit values (Steven Roose)

Pull request description:

  That is enforced by the `VerifyAmounts` method for regular transactions
  and by the `VerifyIssuanceAmounts` method for issuance values.

Tree-SHA512: 69064ca21dbe3a574f38ba8ea9a13cc2d4b6d0ac2b306fad59ff6fa92e63e08c8f4607da82c31731dcf91044eb47c8d79ced2ff49c7c0843343f438eb8bac943
2021-03-02 16:26:55 +00:00
Steven Roose
3b8e4070c8
Merge #958: Some minor dynafed improvements
14a42a018 Add two missing dynafed fields to getblockchaininfo (Steven Roose)
fe0372933 dynafed: Support changing mainnet dynafed activation (Steven Roose)
ce7a93d93 dynafed: Only verify proposed parameters if they differ from current (Steven Roose)

Pull request description:

  - support blocksigners specifying their own activation to make coordination a bit more flexible
  - don't force fedpeg script to change in order to change the block signing script

Tree-SHA512: 8dd66440261f910b083f7ed461e1930c9380350e3648f6aca44726c39dcca3bb7e62c36d36ae56c2717827fbaee2b9046c6ce0b05441c1d8d1b54f3c284bc4d7
2021-03-02 16:25:46 +00:00
Steven Roose
a993a7c675
Merge #960: Add SIGHASH_RANGEPROOF support
b888f4227 tests: Add test feature_sighash_rangeproof.py (Steven Roose)
691040a63 Add SIGHASH_RANGEPROOF support (Steven Roose)
236f0b176 tests: Replace CECKey with new ECKey impl from Bitcoin master (Steven Roose)

Pull request description:

  Add a new sighash flag that includes the rangeproof information in the signature. This avoids certain kinds of malleability in PSBT scenarios.

Tree-SHA512: 60b52ca88a64d81a38f5c70bae810e477f69e6402553b24fa22e59b9a8491c077168576187e7da88e525591933907ea77e937242af6d248908bfedbb8532bb33
2021-03-02 15:37:50 +00:00
Glenn Willen
2f40d80b01 Further revisions in response to comments 2021-02-26 01:00:16 -08:00
Steven Roose
14a42a0187
Add two missing dynafed fields to getblockchaininfo 2021-02-24 15:23:09 +00:00
Steven Roose
b888f42270
tests: Add test feature_sighash_rangeproof.py 2021-02-22 15:19:10 +00:00
Steven Roose
691040a63d
Add SIGHASH_RANGEPROOF support 2021-02-22 15:19:09 +00:00
Steven Roose
236f0b1762
tests: Replace CECKey with new ECKey impl from Bitcoin master
Somehow the CECKey impl is really broken if you want to set
a raw private key. Core master already has a new impl so I just
took that one and replaces the usages. This will probably be equivalent
with what would be rebased in at a later stage.
2021-02-22 13:45:37 +00:00
Steven Roose
a8a1a933dc
Make it clear that the CRangeCheck is not called on explicit values
That is enforced by the `VerifyAmounts` method for regular transactions
and by the `VerifyIssuanceAmounts` method for issuance values.
2021-02-18 11:12:59 +00:00
Steven Roose
fe03729338
dynafed: Support changing mainnet dynafed activation
This should obviously only be done by blocksigners. The flag used is not
documented.
2021-02-10 14:07:06 +01:00
Steven Roose
ce7a93d933
dynafed: Only verify proposed parameters if they differ from current
This allows the initial relaxed restriction on non-segwit fedpeg
programs to be extended as long as the fedpeg program is not changed
while the block signing parameters can be changed.
2021-02-10 14:07:05 +01:00
Andrew Poelstra
81e75abb2f Merge 831675c8dc into merged_master (Bitcoin PR #20401) 2020-12-02 18:07:08 +00:00
Andrew Poelstra
5b89a9fc92 Merge 80e32e120e into merged_master (Bitcoin PR #20305) 2020-12-02 17:53:59 +00:00
Andrew Poelstra
50dafece94 Merge e7986c51bc into merged_master (Bitcoin PR bitcoin-core/gui#96) 2020-12-02 16:29:47 +00:00
Andrew Poelstra
94f7b7ba64 Merge c463f70fb0 into merged_master (Bitcoin PR #20139) 2020-12-02 16:13:18 +00:00
Andrew Poelstra
6a1fadf8a6 Merge 3457054c61 into merged_master (Bitcoin PR #20346) 2020-12-02 16:06:54 +00:00
Andrew Poelstra
46e7d18b8f Merge 7c0d412a74 into merged_master (Bitcoin PR #20405) 2020-12-02 16:00:31 +00:00
Andrew Poelstra
29c7f63764 Merge c48e788246 into merged_master (Bitcoin PR #18836) 2020-12-02 15:51:02 +00:00
Andrew Poelstra
8712faa87c Merge 1e17114917 into merged_master (Bitcoin PR #20238) 2020-12-02 15:44:44 +00:00
Andrew Poelstra
1d5afb0544 Merge 37a4634811 into merged_master (Bitcoin PR #20390) 2020-12-02 15:32:30 +00:00