Commit graph

29779 commits

Author SHA1 Message Date
fanquake
bfd910cae4
Merge bitcoin/bitcoin#18568: doc: Clarify developer notes about constant naming
05f9770c1f doc: Clarify developer notes about constant naming (Russell Yanofsky)

Pull request description:

  I'm pretty sure developer notes were intended to say constants should be upper case and variables should be lower case, but right now they are ambiguous about whether to write:

  ```c++
  extern const int SYMBOL;
  ```

  or:

  ```c++
  extern const int g_symbol;
  ```

  First convention above is better than the second convention because it tells you without having to look anything up that the value of `SYMBOL` won't change at runtime. Also I haven't seen other c++ projects using the second convention.

ACKs for top commit:
  MarcoFalke:
    cr ACK 05f9770c1f
  practicalswift:
    ACK 05f9770c1f
  jarolrod:
    ACK 05f9770c1f 🥃

Tree-SHA512: 766d0e25d9db818d45df4ad6386987014f2053584cbced4b755ceef8bda6b7e2cfeb34eb8516423bd03b140faaf577614d5e3be2799f7eed0eb439187ab85323
2021-06-30 09:23:15 +08:00
Anthony Towns
e48826ad87 tests: remove ComputeBlockVersion shortcut from versionbits tests 2021-06-30 08:19:12 +10:00
Anthony Towns
c5f36725e8 [refactor] Move ComputeBlockVersion into VersionBitsCache
This also changes ComputeBlockVersion to take the versionbits cache
mutex once, rather than once for each versionbits deployment.
2021-06-30 08:19:12 +10:00
Anthony Towns
4a69b4dbe0 [move-only] Move ComputeBlockVersion from validation to versionbits 2021-06-30 08:19:12 +10:00
Anthony Towns
0cfd6c6a8f [refactor] versionbits: make VersionBitsCache a full class
Moves the VersionBits* functions to be methods of the cache class,
and makes the cache and its lock private to the class.
2021-06-30 08:19:12 +10:00
Anthony Towns
8ee3e0bed5 [refactor] rpc/blockchain.cpp: SoftForkPushBack
Rename BIP9SoftForkPushBack and BuriedSoftForkPushBack to SoftForkPushBack
and have the compiler figure out which one to use based on the deployment
type. Avoids the need to update the file when burying a deployment.
2021-06-30 08:19:12 +10:00
Anthony Towns
92f48f360d deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
Anthony Towns
ea68b3a572 [move-only] Rename versionbitsinfo to deploymentinfo 2021-06-30 08:19:12 +10:00
Anthony Towns
c64b2c6a0f scripted-diff: rename versionbitscache
-BEGIN VERIFY SCRIPT-
sed -i -e 's/versionbitscache/g_versionbitscache/g' $(git grep -l versionbitscache)
-END VERIFY SCRIPT-
2021-06-30 08:19:12 +10:00
Anthony Towns
de55304f6e [refactor] Add versionbits deployments to deploymentstatus.h
Adds support for versionbits deployments to DeploymentEnabled,
DeploymentActiveAfter and DeploymentActiveAt. Also moves versionbitscache
from validation to deploymentstatus.
2021-06-30 08:18:58 +10:00
Anthony Towns
2b0d291da8 [refactor] Add deploymentstatus.h
Provides DeploymentEnabled, DeploymentActiveAt, and DeploymentActiveAfter
helpers for checking the status of buried deployments. Can be overloaded
so the same syntax works for non-buried deployments, allowing future
soft forks to be changed from signalled to buried deployments without
having to touch the implementation code.

Replaces IsWitnessEnabled and IsScriptWitnessEnabled.
2021-06-29 17:11:12 +10:00
Anthony Towns
eccd736f3d versionbits: Use dedicated lock instead of cs_main 2021-06-29 17:11:12 +10:00
Anthony Towns
36a4ba0aaa versionbits: correct doxygen comments 2021-06-29 17:11:12 +10:00
MarcoFalke
a000cb013c
Merge bitcoin/bitcoin#22361: refactor: Make httpserver work queue a unique_ptr
fa92e60f38 refactor: Make httpserver work queue a unique_ptr (MarcoFalke)

Pull request description:

  This simplifies the code a bit because `if (p) { delete p; p = nullptr; }` can be replaced by a call to the `reset()` member.

ACKs for top commit:
  promag:
    Core review ACK fa92e60f38.
  jonatack:
    ACK fa92e60f38 code review, debug build clean, ran test/functional/interface*.py tests locally as a sanity check
  hebasto:
    ACK fa92e60f38, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 6b122162317dd4ad6889341745c7ac1903a3ee510f6548f46dc356308442a6eff13eb8dc604c38ba18783e7a66d2b836d641a8594ff980a010c12c97f3856684
2021-06-29 08:24:26 +02:00
S3RK
6084d2caed wallet: do not spam about non-existent spk managers 2021-06-29 08:16:39 +02:00
fanquake
e0face9235
Merge bitcoin/bitcoin#22358: Remove unused wallet pointer from wallet signals
8888cf45f5 Remove unused wallet pointer from NotifyAddressBookChanged (MarcoFalke)
faf3640303 Remove unused wallet pointer from NotifyTransactionChanged signal (MarcoFalke)

Pull request description:

  The signals are members of the wallet, so passing the pointer would be redundant even if it was used.

  Also, fix `with` -> `without`, which was forgotten in commit ca4cf5cff6.

ACKs for top commit:
  jonatack:
    Code review ACK 8888cf45f5 also verified with/without lock cs_wallet status for each of the two functions and debian clang 11 debug build clean
  promag:
    Code review ACK 8888cf45f5.
  theStack:
    Code review ACK 8888cf45f5

Tree-SHA512: e3b80931ce9bcb05213619f5435ac7c21d3c7848643950a70db610902bd1803c92bb75e501d46b0e519bc576901f160e088e8882c4f1adce892a80df565f897b
2021-06-29 12:41:06 +08:00
fanquake
8071ec179d
Merge bitcoin/bitcoin#21789: refactor: Remove ::Params() global from CChainState
fa0d9211ef refactor: Remove chainparams arg from CChainState member functions (MarcoFalke)
fa38947125 refactor: Remove ::Params() global from inside CChainState member functions (MarcoFalke)

Pull request description:

  The `::Params()` global is verbose and confusing. Also it makes tests a bit harder to write because they'd have to mock a global.

  Fix all issues by simply using a member variable that points to the right params.

  (Can be reviewed with `--word-diff-regex=.`)

ACKs for top commit:
  jnewbery:
    ACK fa0d9211ef
  kiminuo:
    utACK fa0d9211
  theStack:
    ACK fa0d9211ef 🍉

Tree-SHA512: 44676b19c9ed471ccb536331d3029bad192d7d50f394fd7b8527ec431452aeec8c4494164b9cf8e16e0123c4463b16be864366c6b599370032c17262625a0356
2021-06-29 11:22:57 +08:00
S3RK
3efaf83c75 wallet: deactivate descriptor 2021-06-28 21:44:50 +02:00
S3RK
6737d9655b test: wallet importdescriptors update existing 2021-06-28 21:44:50 +02:00
S3RK
586f1d53d6 wallet: maintain SPK consistency on internal flag change 2021-06-28 21:44:50 +02:00
S3RK
f1b7db1474 wallet: don't mute exceptions in importdescriptors 2021-06-28 21:37:44 +02:00
S3RK
bf68ebc1cd wallet: allow to import same descriptor twice 2021-06-28 21:37:37 +02:00
Hennadii Stepanov
986bf78d7e
qt: Emit dataChanged signal to dynamically re-sort Peers table 2021-06-28 17:38:01 +03:00
MarcoFalke
3f56ef7bef
Merge bitcoin/bitcoin#22146: Reject invalid coin height and output index when loading assumeutxo
fa9ebedec3 Reject invalid coin height and output index when loading assumeutxo (MarcoFalke)

Pull request description:

  It should be impossible to have a coin at a height higher than the height of the snapshot block, so reject those early to avoid integer wraparounds and hash collisions later on.

  Same for the outpoint index.

  Both issues were found by fuzzing:

  * The height issue by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34793
  * The outpoint issue by my fuzz server: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34793#c2

ACKs for top commit:
  practicalswift:
    cr ACK fa9ebedec3: patch looks correct
  jamesob:
    crACK fa9ebedec3
  theStack:
    Code review ACK fa9ebedec3
  benthecarman:
    crACK fa9ebedec3

Tree-SHA512: dae7caee4b3862b23ebdf2acb7edec4baf75b0dbf1409b370b1a73aa6b632b317ebfac596dcbaf4edfb1301b513f45465ea75328962460f35e2af0d7e547c9ac
2021-06-28 16:11:44 +02:00
MarcoFalke
fa92e60f38
refactor: Make httpserver work queue a unique_ptr 2021-06-28 11:47:05 +02:00
MarcoFalke
fa051d3e5e
doc: Remove unused section from release process 2021-06-28 11:17:24 +02:00
Hennadii Stepanov
cd46c11577
qt: Draw "eye" sign at the beginning of watch-only addresses 2021-06-28 12:09:42 +03:00
Hennadii Stepanov
9ea1da6fc9
qt: Do not extend recent transaction width to address/label string 2021-06-28 12:05:15 +03:00
MarcoFalke
8888cf45f5
Remove unused wallet pointer from NotifyAddressBookChanged 2021-06-28 10:39:49 +02:00
MarcoFalke
faf3640303
Remove unused wallet pointer from NotifyTransactionChanged signal 2021-06-28 10:38:32 +02:00
Tushar Singla
057750c09d ci: Upgrading pip version in macos environment
During each CI run, for macos native environment, python packages lief
and zmq are rebuilt everytime which wastes a lot of resources and time.
The latest version of pip directly fetches pre-built binaries. Through
this commit pip version is upgraded in macos environment before
installation of these packages.
2021-06-28 11:57:19 +05:30
MarcoFalke
8cdf91735f
Merge bitcoin/bitcoin#22349: doc: repository IRC updates
dd49f1b52e doc: doc/README.md IRC updates (Jon Atack)

Pull request description:

  Follow-up to https://github.com/bitcoin/bitcoin/pull/22109:

  - update remaining link and reference from Freenode to Libera
  - remove defunct #bitcoin-dev channel
  - other minor fixups

ACKs for top commit:
  fanquake:
    ACK dd49f1b52e

Tree-SHA512: de20a8f3889028def7139be1cd0fa15daa3351ca987a16090d0caa6b4cd397e370400e2b3033ec776e270aa3a1ab085ada20fbdcc063ac88e2ad3b8351a596e7
2021-06-28 08:00:47 +02:00
fanquake
ac238f76bf
Merge bitcoin/bitcoin#22339: doc: Document minimum required libc++ version
18c2027c76 doc: Document minimum required libc++ version (Hennadii Stepanov)

Pull request description:

  The minimum required libc++ version to compile the current master is 7.0.

  See #22324.

ACKs for top commit:
  fanquake:
    ACK 18c2027c76

Tree-SHA512: a2811236a600caea5b9fd156993a0195fc3f1c231b48d0e369250ebb759f7153fd974390de388b91b367d9dc5e115922a2cab9d3b8ad872a2724c07b63b9fcf4
2021-06-28 11:06:02 +08:00
Hennadii Stepanov
18c2027c76
doc: Document minimum required libc++ version 2021-06-28 05:10:56 +03:00
Jon Atack
dd49f1b52e
doc: doc/README.md IRC updates
- update remaining link and reference from freenode to libera
- remove no-longer-existing #bitcoin-dev IRC channel
- other minor fixups
2021-06-27 21:26:03 +02:00
MarcoFalke
9c3751a0c9
Merge bitcoin/bitcoin#22342: Avoid the use of P0083R3 std::set::merge
6cf4ea7187 Avoid the use of P0083R3 std::set::merge (Pieter Wuille)

Pull request description:

  This use was introduced in #21365, but as pointed out in #22339, this causes compatibility problems.

  Just avoid its use for now.

ACKs for top commit:
  jonatack:
    re-ACK 6cf4ea7187
  benthecarman:
    ACK 6cf4ea7187
  hebasto:
    ACK 6cf4ea7187, successfully compiled on the following systems:

Tree-SHA512: 2b3fdcadb7de98963ebb0b192bd956aa68526457fe5b374c74a69ea10d5b68902763148f11abbcc471010bcdc799e0804faef5f8e8ff8a509b3a053c0cb0ba39
2021-06-26 10:02:36 +02:00
Pieter Wuille
6cf4ea7187 Avoid the use of P0083R3 std::set::merge 2021-06-25 10:42:05 -07:00
MarcoFalke
3e306ee1d5
Merge bitcoin/bitcoin#19362: rpc/blockchain: Reset scantxoutset progress before inferring descriptors
8c4129b454 rpc: reset scantxoutset progress on finish (Pavol Rusnak)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/19361 by moving resetting the `g_scan_progress` variable **before** inferring the descriptors

ACKs for top commit:
  achow101:
    Code review ACK 8c4129b454

Tree-SHA512: 2b81e5c930b9c201a1b9cc742c37e0617582326acd9adbd6b14991d33c05d51b1d5ff6a26f3accab7d274dc8c6a48bc8cbccf0811b60c1f76dd805f9b31482c0
2021-06-25 11:21:33 +02:00
MarcoFalke
246daf1f53
Merge bitcoin/bitcoin#22322: fuzz: Check banman roundtrip
fa485d06ec fuzz: Check banman roundtrip (MarcoFalke)

Pull request description:

ACKs for top commit:
  practicalswift:
    cr ACK fa485d06ec
  vasild:
    ACK fa485d06ec

Tree-SHA512: 84e297c0b90ef68d72afd2053bfda2888496c1b180233516a8caaf76d6c03403f1e4ed59f1eb32d799873fc34009634b4ce372244b9d546d04626af41ac4d1d7
2021-06-25 10:07:58 +02:00
Andrew Chow
e6cf0ed92d wallet, rpc: listdescriptors does not need unlocked
With the last hardened xpub cache, we don't neeed to have the wallet be
unlocked for listdescriptors.
2021-06-24 14:08:46 -04:00
Andrew Chow
3280704886 Pass in DescriptorCache to ToNormalizedString
Use the descriptor xpub cache in ToNormalizedString so that the wallet
does not need to be unlocked in order to get the normalized descriptor.
2021-06-24 14:08:45 -04:00
Andrew Chow
7a26ff10c2 Change DescriptorImpl::ToStringHelper to use an enum
Instead of having multiple, possibly conflicting, bools controlling the
flow of ToStringHelper, use an enum.
2021-06-24 14:08:30 -04:00
Andrew Chow
75530c93a8 Remove priv option for ToNormalizedString 2021-06-24 13:49:22 -04:00
Andrew Chow
74fede3b8b wallet: Upgrade existing descriptor caches
Add functions to upgrade existing descriptor caches to support the use
of last hardened xpub caching.
2021-06-24 13:49:22 -04:00
Andrew Chow
432ba9e543 wallet: Store last hardened xpub cache 2021-06-24 13:49:22 -04:00
Andrew Chow
d87b544b83 descriptors: Cache last hardened xpub
Cache the last hardenex xpub in the DescriptorCache
2021-06-24 13:49:22 -04:00
Andrew Chow
cacc391098 Move DescriptorCache writing to WalletBatch
Instead of adhoc writing of the items in DescriptorCache, move it all
into WalletBatch.
2021-06-24 13:49:22 -04:00
Andrew Chow
0b4c8ef75c Refactor Cache merging and writing
Instead of having a large blob of cache merging code in TopUp, refactor
this into DescriptorCache so that it can merge and provide a diff
(another DescriptorCache containing just the items that were added).
Then TopUp can just write everything that was in the diff.
2021-06-24 13:49:22 -04:00
Andrew Chow
976b53b085 Revert "Cache parent xpub inside of BIP32PubkeyProvider"
This reverts commit 09e25071f4.

The changes made in this commit have turned out to be unnecessary and
confusing, so it is being reverted.
2021-06-24 13:49:15 -04:00
MarcoFalke
b2f5c38333
Merge bitcoin/bitcoin#22327: cli: Avoid truncating -rpcwaittimeout
fa34cb8024 cli: Avoid truncating -rpcwaittimeout (MarcoFalke)

Pull request description:

  `seconds` is not enough precision to "exactly" store a timestamp n seconds into the future. Improve the precision by using `microseconds`. Fixes #22325

  Also, use chrono literals.

ACKs for top commit:
  jonatack:
    ACK fa34cb8024 review, debug-built, tested
  theStack:
    Tested ACK fa34cb8024

Tree-SHA512: 7158da8545f9998a82bcc8636e04564efdb1e1be43b4288298c151b4df29ad47a2760259eefadd4a01db92ea18a1e017f3febc1cd8c69a4b28c86180229d8c90
2021-06-24 16:01:21 +02:00