Commit graph

975 commits

Author SHA1 Message Date
Andrew Poelstra
3b07a0813a Merge 34d7030063 into merged_master (Bitcoin PR #21202) 2021-06-24 19:34:45 +00:00
Andrew Poelstra
4268df69bc Merge 828bb776d2 into merged_master (Bitcoin PR #20750) 2021-06-24 17:22:15 +00:00
Andrew Poelstra
5a654c9bab Merge 9017d55e7c into merged_master (Bitcoin PR #15946) 2021-06-24 02:56:40 +00:00
Andrew Poelstra
61a241c5ca Merge 92fee79dab into merged_master (Bitcoin PR #19806)
Looks like James hardcoded a couple hashes in hard-to-find places, which
caused a unit test to fail. I just changed the hash (which covers UTXO
data which naturally will be different for us on account of our differently
formatted CTxOuts).

TODO: determine how Assumeutxo interacts with the fact that we don't save
out nonces in our normal UTXO serialization. Probably we will need to remove
the nonce from the CCoinStats serialization to avoid having inconsistent
hashes across nodes, since these hashes are now checked in assumeutxo?
2021-06-23 23:36:26 +00:00
Andrew Poelstra
283eff1475 Merge 937dfa8398 into merged_master (Bitcoin PR #21041) 2021-06-22 23:04:36 +00:00
Andrew Poelstra
f250da483b Merge 8e1913ae02 into merged_master (Bitcoin PR #21062) 2021-06-22 22:39:50 +00:00
Andrew Poelstra
e66b70d884 Merge f1239b70d1 into merged_master (Bitcoin PR #21025) 2021-06-21 00:03:36 +00:00
Andrew Poelstra
2885d86bf7 Merge 44f4bcd302 into merged_master (Bitcoin PR #20749)
More-or-less mechanical fixes to conflicts (checking upstream diff and chasing
compiler errors).
2021-06-20 14:54:25 +00:00
Andrew Poelstra
1594d797c4 Merge 87394b6741 into merged_master (Bitcoin PR #20868) 2021-06-20 14:13:18 +00:00
Andrew Poelstra
a7f2499713 Merge b386d37360 into merged_master (Bitcoin PR #18710) 2021-06-18 19:12:18 +00:00
Andrew Poelstra
653212c39e Merge f91587f050 into merged_master (Bitcoin PR #20834) 2021-06-17 22:28:24 +00:00
Andrew Poelstra
e5cb4cb00e Merge f13e03cda2 into merged_master (Bitcoin PR #20584) 2021-06-16 20:58:56 +00:00
Andrew Poelstra
549c9b182e Merge c37600777e into merged_master (Bitcoin PR #20854) 2021-06-16 18:11:34 +00:00
Andrew Poelstra
7a7791e879 Merge 03b1db6114 into merged_master (Bitcoin PR #18766) 2021-06-11 16:59:19 +00:00
Andrew Poelstra
34db56ae3a Merge 9385549a31 into merged_master (Bitcoin PR #20581) 2021-06-11 13:09:57 +00:00
Andrew Poelstra
406e81efb5 Merge 0a13d15c14 into merged_master (Bitcoin PR #20530) 2021-06-10 23:32:14 +00:00
Andrew Poelstra
2d31b7300e Merge f17e8ba3a1 into merged_master (Bitcoin PR #20207) 2021-06-10 20:35:12 +00:00
Andrew Poelstra
96df4cbd72 Merge ffd5e7a856 into merged_master (Bitcoin PR #20519) 2021-05-08 01:23:53 +00:00
Andrew Poelstra
74ec32907f Merge 848d66519c into merged_master (Bitcoin PR #20054) 2021-05-06 21:38:12 +00:00
Andrew Poelstra
882fd6628a Merge a64ff1c4d3 into merged_master (Bitcoin PR #19905) 2021-05-06 16:40:36 +00:00
Andrew Poelstra
39112e1eaa correct copy/paste error in error message 2021-04-15 16:46:45 +00:00
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
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
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
691040a63d
Add SIGHASH_RANGEPROOF support 2021-02-22 15:19:09 +00:00
MarcoFalke
34d7030063
Merge #21202: [validation] Two small clang lock annotation improvements
25c57d6409 [doc] Add a note about where lock annotations should go. (Amiti Uttarwar)
ad5f01b960 [validation] Move the lock annotation from function definition to declaration (Amiti Uttarwar)

Pull request description:

  Based on reviewing #21188

  the first commit switches the lock annotations on `CheckInputScripts` to be on the function declaration instead of on the function definition. this ensures that all call sites are checked, not just ones that come after the definition.

  the second commit adds a note to the developer-notes section to clarify where the annotations should be applied.

ACKs for top commit:
  MarcoFalke:
    ACK 25c57d6409 🥘
  promag:
    Code review ACK 25c57d6409.

Tree-SHA512: 61b6ef856bf6c6016d535fbdd19daf57b9e59fe54a1f30d47282a071b9b9d60b2466b044ee57929e0320cb1bdef52e7a1687cacaa27031bbc43d058ffffe22ba
2021-02-22 09:47:15 +01:00
Carl Dong
e8ae1db864 style-only: Make AcceptToMemoryPool signature readable 2021-02-18 14:49:10 -05:00
Carl Dong
8f5c100064 style-only: Make CheckSequenceLock signature readable 2021-02-18 14:49:10 -05:00
Carl Dong
8c824819c8 validation: Use *this in CChainState::LoadMempool 2021-02-18 14:49:10 -05:00
Carl Dong
0a9a24d8c7 validation: Pass in chainstate to UpdateMempoolForReorg 2021-02-18 14:49:10 -05:00
Carl Dong
7142018812 validation: Pass in chainstate to CTxMemPool::removeForReorg
Several other parameters are now redundant since they can be safely
obtained from the chainstate given that ::cs_main is locked. These are
now removed.
2021-02-18 14:49:10 -05:00
Carl Dong
71734c65dc validation: Pass in chain to ::TestLockPointValidity 2021-02-18 14:49:10 -05:00
Carl Dong
417dafc1ee validation: Remove old AcceptToMemoryPool w/o chainstate param 2021-02-18 14:49:10 -05:00
Carl Dong
229bc37b5f validation: Pass in chainstate to ::AcceptToMemoryPool 2021-02-18 14:43:28 -05:00
Carl Dong
d0da7ea57a validation: Pass in chainstate to ::LoadMempool 2021-02-18 14:43:28 -05:00
Carl Dong
3a205c43dc validation: Pass in chainstate to AcceptToMemoryPoolWithTime 2021-02-18 14:43:28 -05:00
Carl Dong
d8a816329c validation: Add chainstate member to MemPoolAccept 2021-02-18 14:43:28 -05:00
Carl Dong
4c15942b79 validation: Pass in chainstate to ::CheckSequenceLocks 2021-02-18 14:43:28 -05:00
Carl Dong
577b774d0c validation: Remove old CheckFinalTx w/o chain tip param 2021-02-18 14:43:28 -05:00
Carl Dong
d015eaa550 validation: Pass in chain tip to ::CheckFinalTx 2021-02-18 14:43:28 -05:00
Carl Dong
252b489c9f validation: Pass in coins tip to CheckInputsFromMempoolAndCache 2021-02-18 14:43:28 -05:00
Carl Dong
73a6d2b7be validation: Pass in chainstate to IsCurrentForFeeEstimation 2021-02-18 14:43:28 -05:00
Carl Dong
d1f932b0b0 validation: Pass in coins cache to ::LimitMempoolSize 2021-02-18 14:43:28 -05:00
Jonas Schnelli
9017d55e7c
Merge #15946: Allow maintaining the blockfilterindex when using prune
84716b134e Add "index/blockfilterindex -> validation -> index/blockfilterindex" to expected circular dependencies (Jonas Schnelli)
ab3a0a2fb9 Add functional test for blockfilterindex in prune-mode (Jonas Schnelli)
c286a22f7b Add debug startup parameter -fastprune for more effective pruning tests (Jonas Schnelli)
5e112269c3 Avoid pruning below the blockfilterindex sync height (Jonas Schnelli)
00d57ff768 Avoid accessing nullpointer in BaseIndex::GetSummary() (Jonas Schnelli)
6abe9f5b11 Allow blockfilter in conjunction with prune (Jonas Schnelli)

Pull request description:

  Maintaining the blockfilterindexes in prune mode is possible and may lead to efficient p2p based rescans of wallets (restore backups, import/sweep keys) beyond the prune height (rescans not part of that PR).

  This PR allows running the blockfilterindex(es) in conjunction with pruning.
  * Bitcoind/Qt will shutdown during startup when missing block data has been detected ([re]enable `-blockfilterindex` when we already have pruned)
  * manual block pruning is disabled during blockfilterindex sync
  * auto-pruning is delayed during blockfilterindex sync

  ToDos:
  * [x] Functional tests

ACKs for top commit:
  fjahr:
    Code review ACK 84716b1
  ryanofsky:
    Code review ACK 84716b134e. Only changes since last review were suggested new FindFilesToPrune argument and test.
  benthecarman:
    tACK 84716b134e

Tree-SHA512: 91d832c6c562c463f7ec7655c08956385413a99a896640b9737bda0183607fac530435d03d87c3c0e70c61ccdfe73fe8f3639bc7d26d33ca7e60925ebb97d77a
2021-02-18 09:40:42 +01:00
Amiti Uttarwar
25c57d6409 [doc] Add a note about where lock annotations should go. 2021-02-17 15:58:23 -08:00
Amiti Uttarwar
ad5f01b960 [validation] Move the lock annotation from function definition to declaration
When the annotation is on the definition, it does not check call sites between
the declaration and the definition.
2021-02-17 15:45:11 -08:00
Jonas Schnelli
c286a22f7b Add debug startup parameter -fastprune for more effective pruning tests 2021-02-16 10:26:17 +01:00
Jonas Schnelli
5e112269c3 Avoid pruning below the blockfilterindex sync height 2021-02-16 10:26:15 +01:00
James O'Beirne
f6e2da5fb7
simplify ChainstateManager::SnapshotBlockhash() return semantics
Don't return null snapshotblockhash values to avoid caller complexity/confusion.
2021-02-12 07:53:29 -06:00