Commit Graph

30257 Commits

Author SHA1 Message Date
fanquake
86d958262d
test: use f-strings in feature_proxy.py 2021-08-18 12:39:20 +08:00
fanquake
31bdb33dcb
test: use f-strings in feature_segwit.py 2021-08-18 12:39:20 +08:00
fanquake
b166d54c3c
test: use f-strings in feature_versionbits_warning.py 2021-08-18 12:39:19 +08:00
fanquake
cf6d66bf94
test: use f-strings in feature_settings.py 2021-08-18 12:39:19 +08:00
fanquake
6651d77f22
test: use f-strings in feature_pruning.py 2021-08-18 12:39:19 +08:00
fanquake
961f5813ba
test: use f-strings in feature_notifications.py 2021-08-18 12:39:19 +08:00
fanquake
1a546e6f6c
test: use f-strings in feature_minchainwork.py 2021-08-18 12:39:19 +08:00
fanquake
6679eceacc
test: use f-strings in feature_logging.py 2021-08-18 12:39:18 +08:00
fanquake
fb633933ab
test: use f-strings in feature_loadblock.py 2021-08-18 12:39:18 +08:00
fanquake
e9ca8b254d
test: use f-strings in feature_help.py 2021-08-18 12:39:18 +08:00
fanquake
ff7e330999
test: use f-strings in feature_filelock.py 2021-08-18 12:39:18 +08:00
fanquake
d5a6adc5e4
test: use f-strings in feature_fee_estimation.py 2021-08-18 12:39:18 +08:00
fanquake
a2de33cbdc
test: use f-strings in feature_dersig.py 2021-08-18 12:39:17 +08:00
fanquake
a2502cc63f
test: use f-strings in feature_dbcrash.py 2021-08-18 12:39:17 +08:00
fanquake
3e2f84e7a9
test: use f-strings in feature_csv_activation.py 2021-08-18 12:39:17 +08:00
fanquake
e2f1fd8ee9
test: use f-strings in feature_config_args.py 2021-08-18 12:39:17 +08:00
fanquake
36d33d32b1
test: use f-strings in feature_cltv.py 2021-08-18 12:39:17 +08:00
fanquake
dca173cc04
test: use f-strings in feature_blocksdir.py 2021-08-18 12:39:17 +08:00
fanquake
5453e87062
test: use f-strings in feature_backwards_compatibility.py 2021-08-18 12:39:08 +08:00
fanquake
6f3d5ad67a
test: use f-strings in feature_asmap.py 2021-08-18 09:52:25 +08:00
fanquake
b5c468cfe3
Merge bitcoin/bitcoin#22725: MOVEONLY: tests: Move addrman ser/deser tests to addrman_tests.cpp
aaa6ad5455 [MOVEONLY] [tests] Move addrman ser/deser tests to addrman_tests.cpp (John Newbery)

Pull request description:

  Addrman serialization/deserialization tests are currently in net_tests.cpp.
  Move them to addrman_tests.cpp with the rest of the addrman tests.

  Reviewer hint: review using `git diff --color-moved=dimmed-zebra`

ACKs for top commit:
  MarcoFalke:
    review ACK aaa6ad5455 📺
  mjdietzx:
    ACK aaa6ad5455
  Saviour1001:
    Concept ACK <code>[aaa6ad5](aaa6ad5455)</code>

Tree-SHA512: 9a575e63f8830a9dfba30ef63c83ae4b45813add9973308f0d7a2463886438575a2e8a4a23af5b19ed977fbaab1a212ef832f89a25de03920d493e9ebafa9c30
2021-08-18 08:57:34 +08:00
fanquake
62cb4009c2
Merge bitcoin/bitcoin#22215: refactor: Add FoundBlock.found member
5c5d0b6264 Add FoundBlock.found member (Russell Yanofsky)

Pull request description:

  This change lets IPC serialization code handle FoundBlock arguments more simply and efficiently. Without this change there was no way to determine from a FoundBlock object whether a block was found or not. So in order to correctly implement behavior of leaving FoundBlock output variables unmodified when a block was not found, IPC code would have to read preexisting output variable values from the local process, send them to the remote process, receive output values back from the remote process, and save them to output variables unconditionally. With FoundBlock.found method, the process is simpler. There's no need to read or send preexisting local output variable values, just to read final output values from the remote process and set them conditionally if the block was found.

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). The commit was first part of larger PR #10102.

ACKs for top commit:
  fjahr:
    Code review ACK 5c5d0b6264
  theStack:
    Concept and code review ACK 5c5d0b6264
  jamesob:
    ACK 5c5d0b6264 ([`jamesob/ackr/22215.1.ryanofsky.refactor_add_foundblock`](https://github.com/jamesob/bitcoin/tree/ackr/22215.1.ryanofsky.refactor_add_foundblock))
  Zero-1729:
    crACK 5c5d0b6

Tree-SHA512: d906e1b7100ff72c3aa06d80bd77673887b2db670ebd52dce7c4f6f557a23a1744c6109308228a37fda6c6ea74f05ba0efecff0ef235ab06ea8acd861fbb8675
2021-08-18 08:49:48 +08:00
John Newbery
aaa6ad5455 [MOVEONLY] [tests] Move addrman ser/deser tests to addrman_tests.cpp
Addrman serialization/deserialization tests are currently in net_tests.cpp.
Move them to addrman_tests.cpp with the rest of the addrman tests.

Reviewer hint: review using `git diff --color-moved=dimmed-zebra`
2021-08-17 13:44:54 +01:00
fanquake
fdd80b0a53
Merge bitcoin/bitcoin#22688: contrib: use keys.openpgp.org to retrieve builder keys
4c43b7d41d contrib: use hkps://keys.openpgp.org to retrieve builder keys (fanquake)

Pull request description:

  `hkps://hkps.pool.sks-keyservers.net` is essentially no-longer functional,
  and a number of distributions and GPG tools have since switched to using
  the `keys.openpgp.org` key server as their default.

  See this Debian patch for additional context:
  https://salsa.debian.org/debian/gnupg2/-/blob/debian/main/debian/patches/Use-hkps-keys.openpgp.org-as-the-default-keyserver.patch

  Switch to using keys.openpgp.org in the CI as well.

ACKs for top commit:
  MarcoFalke:
    cr ACK 4c43b7d41d
  Zero-1729:
    ACK 4c43b7d41d

Tree-SHA512: e6c72b67778b76f81c659eee0e4195fea9e579587c64921affd35b9d46a077d4e8754b7fb85ca90a9a4bbc5cd5a47b0c6e4c9dbf9a335418a12f774d665e5a19
2021-08-17 16:05:15 +08:00
fanquake
f3dbd1c2b2
Merge bitcoin/bitcoin#22627: [addrman] De-duplicate Add() function
60e0cbdd57 [addrman] Merge the two Add() functions (Amiti Uttarwar)

Pull request description:

  This PR merges the two definitions of this overloaded function to reduce code duplication.

  When these functions were introduced in 5fee401fe1, there were multiple places that invoked `Add()` with a single addr and a vector of addrs each, so it made sense to overload the function. I could see how the small difference in log statement was more meaningful when a peer was added via IRC :)

  Now, the definition of `Add()` that takes in a single address is only invoked from the hidden/test-only RPC `addpeeraddress`. These changes should not cause any observable difference, and are covered by the existing tests that use this RPC endpoint.

ACKs for top commit:
  jnewbery:
    Code review ACK 60e0cbdd57
  Zero-1729:
    crACK 60e0cbd
  fanquake:
    ACK 60e0cbdd57

Tree-SHA512: 782fb2ac6d2d403ba7d7ff543197ca42b610b9a8806952d271e57e2ee3527ad1a94af4ebbad5371b5e95d77df07c56ccc8c1d5a2c82cdecb0d2b5085b3bdd5ee
2021-08-17 10:05:03 +08:00
fanquake
4c43b7d41d
contrib: use hkps://keys.openpgp.org to retrieve builder keys
hkps://hkps.pool.sks-keyservers.net is essentially no-longer functional,
and a number of distributions and GPG tools have since switched to using
this key server as their default.

See this Debian patch for additional context:
https://salsa.debian.org/debian/gnupg2/-/blob/debian/main/debian/patches/Use-hkps-keys.openpgp.org-as-the-default-keyserver.patch

Switch to using keys.openpgp.org in the CI as well.
2021-08-17 08:59:04 +08:00
fanquake
df30375788
Merge bitcoin/bitcoin#22715: wallet: use FormatFullVersion() & PACKAGE_NAME in dumpwallet
2d7534bd93 wallet: use PACKAGE_NAME instead of "Bitcoin" in rpcdump (fanquake)
14b4802405 wallet: use FormatFullVersion instead of CLIENT_BUILD in rpcdump (fanquake)

Pull request description:

  The dumpwallet RPC is the last place we're using CLIENT_BUILD directly, rather FormatFullVersion() (which just returns it), so switch to using that. At the same time, use PACKAGE_NAME (Bitcoin Core), rather than just "Bitcoin".

ACKs for top commit:
  MarcoFalke:
    cr ACK 2d7534bd93
  laanwj:
    Tested ACK 2d7534bd93
  achow101:
    ACK 2d7534bd93
  Zero-1729:
    crACK 2d7534b

Tree-SHA512: b38ee074e317448719d2a628380786ec665413515b38d9ce680c21608bc2acf6a2bf817f78f100a8310477613ae72d6969cc4f595f4f44af0896659d3ebf2671
2021-08-17 08:56:17 +08:00
MarcoFalke
8a40b227a6
Merge bitcoin/bitcoin#22718: doc: Add missing PR 16333 release note
fa76ebd1a6 doc: Add missing PR 16333 release note (MarcoFalke)

Pull request description:

  Missed in commit ad0fc453cc

ACKs for top commit:
  laanwj:
    Documentation review ACK fa76ebd1a6
  Zero-1729:
    ACK fa76ebd1a6
  theStack:
    ACK fa76ebd1a6

Tree-SHA512: 5fc9e3f61d2f8534f537cc14c7518d09babd5ebbedd5f24ad10ca9aff69d499f3daa0c45eb548eec94cdbf25bf53c9f0158ec2ee7aa5c3f653f7670c68d1d24c
2021-08-16 21:06:52 +02:00
MarcoFalke
b935abb9eb
Merge bitcoin/bitcoin#22684: test: check for invalid -prune parameters
e2ff385e13 test: check for invalid `-prune` parameters (Sebastian Falbesoner)

Pull request description:

  This small PR adds missing test coverage for invalid `-prune` parameter values / combinations:

  77e23ca945/src/init.cpp (L926-L928)

  77e23ca945/src/init.cpp (L935-L937)

  77e23ca945/src/init.cpp (L844-L849)

  Not sure if the tests fit into `feature_config_args.py` or should rather be moved into `feature_pruning.py`; the latter though seems to be run less often due to being very memory-hungry.

ACKs for top commit:
  laanwj:
    Code review ACK e2ff385e13

Tree-SHA512: bb0db98090058ecac9f8a01301634e9dba9a65fd56b6a0b770f88da28c4f01e240e22b1225f0d231e28bdd4b5b51bff0e6853cccc46ed0190e91b84f7954a9db
2021-08-16 18:15:21 +02:00
MarcoFalke
fa76ebd1a6
doc: Add missing PR 16333 release note 2021-08-16 18:00:38 +02:00
Sebastian Falbesoner
e2ff385e13 test: check for invalid -prune parameters 2021-08-16 16:36:48 +02:00
MarcoFalke
42b00a3758
Merge bitcoin/bitcoin#22649: fuzz: Avoid OOM in system fuzz target
fa7718344d fuzz: Avoid OOM in system fuzz target (MarcoFalke)

Pull request description:

  If the inputs size is unlimited, the target may consume unlimited memory, because the argsmanager stores the argument names. Limiting the size should fix this issue.

  Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36906

ACKs for top commit:
  practicalswift:
    cr ACK fa7718344d

Tree-SHA512: 6edfcf324ee9d94e511038ee01340f02db50bcb233af3f1a1717c3602164c88528d9d987e971ec32f1a4593b868019bea0102c53c9b02bfefec3dfde959483cf
2021-08-16 10:47:58 +02:00
fanquake
2d7534bd93
wallet: use PACKAGE_NAME instead of "Bitcoin" in rpcdump 2021-08-16 16:04:53 +08:00
fanquake
14b4802405
wallet: use FormatFullVersion instead of CLIENT_BUILD in rpcdump 2021-08-16 16:04:47 +08:00
Amiti Uttarwar
60e0cbdd57 [addrman] Merge the two Add() functions
Merge the two definitions of this overloaded function to reduce code
duplication.
2021-08-15 22:35:13 -07:00
fanquake
3facf0a8ae
Merge bitcoin/bitcoin#22685: clientversion: No suffix #if CLIENT_VERSION_IS_RELEASE
5100deee58 clientversion: No suffix #if CLIENT_VERSION_IS_RELEASE (Carl Dong)

Pull request description:

  ```
  Previously, building from a release source tarball would result in a
  version string like v22.0.0-<commithash>, but we expect just v22.0.0.
  This commit solves this problem.

  Also use PACKAGE_VERSION instead of reconstructing it.
  ```

  Fixes the underlying problem of #22623

ACKs for top commit:
  achow101:
    ACK 5100deee58
  fanquake:
    ACK 5100deee58 - tested that prior the output of `src/bitcoind -version` on the `22.x` branch was `Bitcoin Core version v22.0.0-d3bd5410f64e`, and with this commit cherry-picked it is `Bitcoin Core version v22.0.0rc2`.

Tree-SHA512: 78705e285ff1271d5012e888837049044db4d11d66c252c6b964685892ef078c56fe122f12daa87c71532f4352f695d1e88a228665adcd7afe3ddce3f209b49f
2021-08-16 12:17:24 +08:00
fanquake
820129aee9
Merge bitcoin/bitcoin#22686: wallet: Use GetSelectionAmount in ApproximateBestSubset
92885c4f69 test: Test for ApproximateBestSubset edge case with too little fees (Andrew Chow)
d9262324e8 wallet: Assert that enough was selected to cover the fees (Andrew Chow)
2de222c401 wallet: Use GetSelectionAmount for target value calculations (Andrew Chow)

Pull request description:

  The `m_value` used for the target calculation in `ApproximateBestSubset` is incorrect, it should be `GetSelectionAmount`. This causes a bug that is only apparent when the minimum relay fee is set to be very high.

  A test case is added for this, in addition to an assert in `CreateTransactionInternal` that would have also caught this issue if someone were able to hit the edge case.

  Fixes #22670

ACKs for top commit:
  instagibbs:
    utACK 92885c4f69

Tree-SHA512: bd61fa61ffb60873e097737eebea3afe8a42296ba429de9038b3a4706763b34de9409de6cdbab21ff7f51f4787b503f840873182d9c4a1d6e12a54b017953547
2021-08-16 11:23:53 +08:00
fanquake
11c7d001a9
Merge bitcoin/bitcoin#22700: builder-keys: Add dongcarl
7d95777417 builder-keys: Add dongcarl (Carl Dong)

Pull request description:

  https://keys.openpgp.org/search?q=04017A2A6D9A0CCDC81D8EC296AB007F1A7ED999

  This is my master key, will be bumping the expiration of subkeys or rotating when necessary.

ACKs for top commit:
  fanquake:
    ACK 7d95777417 - matches what I've got.

Tree-SHA512: 3a76b8eda81821b3221402501cf8191bce73118624b932aa80a7fc1a32a91e3825aeb2b03ed261bbf284b088e927c384f92e08eadddf7f94ed4de579d9f6d2b7
2021-08-16 10:58:55 +08:00
Samuel Dobson
502d22ceed
Merge bitcoin/bitcoin#22541: Add a new RPC command: restorewallet
5fe8100ff3 Change the wallet_backup.py test to use the restorewallet RPC command instead of restoring wallets manually. (lsilva01)
ae23faba6f Add a new RPC command: restorewallet (lsilva01)

Pull request description:

  As far as I know, there is no command to restore the wallet from a backup file.
  The only way to do this is to replace the `wallet.dat` of a newly created wallet with the backup file, which is hardly an intuitive way.

  This PR implements the `restorewallet` RPC command which restores the wallet from the backup file.

  To test:
  First create a backup file:
  `$ bitcoin-cli -rpcwallet="wallet-01" backupwallet /home/Backups/wallet-01.bak`

  Then restore it in another wallet:
  `$ bitcoin-cli  restorewallet "restored-wallet-01" /home/Backups/wallet-01.bak`

ACKs for top commit:
  achow101:
    re-ACK 5fe8100ff3
  prayank23:
    tACK 5fe8100ff3
  meshcollider:
    utACK 5fe8100ff3

Tree-SHA512: 9639df4d8ad32f255f5b868320dc69878bd9aceb3b471b49dfad500b67681e2d354292b5410982fbf18e25a44ed0c06fd4a0dd010e82807c2e00ff32e84047a1
2021-08-15 16:58:05 +12:00
fanquake
be499aa07f
Merge bitcoin/bitcoin#22692: builder-keys: add jamesob
45babb2788 builder-keys: add jamesob (James O'Beirne)

Pull request description:

  http://keyserver.ubuntu.com/pks/lookup?search=0x25F27A38A47AD566&fingerprint=on&hash=on&op=vindex

  This is also the key I sign GitHub commits with.

ACKs for top commit:
  fanquake:
    ACK 45babb2788 - matches the key I've got for you.
  Zero-1729:
    ACK 45babb2788

Tree-SHA512: 53d7d70542a7e5caee748447ed3ada48c30935c5ca9b0b85ecee6c17389928c3601bec3a30893d70d7ff3e86d2696f57a9c880a52ba5d2c681c1a14b1f67b7a0
2021-08-15 11:29:18 +08:00
fanquake
adf9bcfc37
Merge bitcoin/bitcoin#22696: p2p: log addrman consistency checks
4844b74ba7 p2p: log addrman consistency checks (Jon Atack)

Pull request description:

  This mini-patch picks up #22479 to log addrman consistency checks in the `BCLOG::ADDRMAN` category when they are enabled with the `-checkaddrman=<n>` configuration option for values of n greater than 0.

  ```
  $ ./src/bitcoind -signet -checkaddrman=20 -debug=addrman
  ...
  2021-08-13T11:14:45Z Addrman checks started: new 3352, tried 89, total 3441
  2021-08-13T11:14:45Z Addrman checks completed successfully
  ```

  This allows people to
  - verify the checks are running
  - see when and how often they are being performed
  - see the number of new/tried/total addrman entries per check
  - see the start/end of the checks

  Thanks to John Newbery for ideas to improve this logging.

ACKs for top commit:
  jnewbery:
    Code review ACK 4844b74ba7
  Zero-1729:
    tACK 4844b74ba7
  theStack:
    Concept and code-review ACK 4844b74ba7 ♟️

Tree-SHA512: 10b51c480d52a753ea8a59dbdd1e2c4f49067e7f4afe59d58426a8fb438f52447fe3a6090fa52132bc382d876927fa338b229c906d85668086f7f8f5bd8ed38a
2021-08-14 14:22:52 +08:00
fanquake
4c87665707
Merge bitcoin/bitcoin#22604: p2p, rpc, test: address rate-limiting follow-ups
d930c7f5b0 p2p, rpc, test: address rate-limiting follow-ups (Jon Atack)

Pull request description:

  Incorporates review feedback in #22387.

  Edit, could be considered separately: should a release note (or two) be added for 22.0? e.g. the new getpeerinfo fields in `Updated RPCs` and the rate-limiting itself in `P2P and network changes`.

ACKs for top commit:
  MarcoFalke:
    review ACK d930c7f5b0
  theStack:
    re-ACK d930c7f5b0 🌮
  Zero-1729:
    crACK d930c7f

Tree-SHA512: b2101cad87f59c238603f38bd8e8df7a4d48929794e4de9e0e0ff2afa935a68475c2d369aa669d124a0bec2f50280fb47e8b980bde6ad812db08cf67b71c066a
2021-08-14 13:33:47 +08:00
Carl Dong
7d95777417 builder-keys: Add dongcarl 2021-08-13 15:43:53 -04:00
Jon Atack
4844b74ba7
p2p: log addrman consistency checks 2021-08-13 13:16:55 +02:00
fanquake
803ef70fd9
Merge bitcoin/bitcoin#20233: addrman: Make consistency checks a runtime option
a4d78546b0 [addrman] Make addrman consistency checks a runtime option (John Newbery)
10aac24145 [tests] Make deterministic addrman use nKey = 1 (John Newbery)
fa9710f62c [addrman] Add deterministic argument to CAddrMan ctor (John Newbery)
ee458d84fc Add missing const to CAddrMan::Check_() (MarcoFalke)

Pull request description:

  CAddrMan has internal consistency checks. Currently, these are only run when the program is compiled with the  `DEBUG_ADDRMAN` option. This option is not enabled on any of our CI builds, and it's likely that no-one is running them at all.

  This PR makes consistency checks a (hidden) runtime option that can be enabled with `-checkaddrman`, where `-checkaddrman=n` will result in the consistency checks running every n operations (similar to `-checkmempool=n`). We set the ratio to 1/100 for our unit tests, and leave it disabled by default for all networks. Additionally, a consistency check failure now asserts, rather than logging and continuing. This matches the behavior of CTxMemPool and TxRequestTracker, where a failed consistency check asserts.

ACKs for top commit:
  jonatack:
    ACK a4d78546b0 per `git diff 00fd089 a4d7854`, tested by adding logging similar to #22479 and running with `-checkaddrman=<n>` for various values 0/1/10/100 etc, tested the updated docs with `bitcoind -help-debug | grep -A2 "checkaddrman\|checkmempool"` and verified rebased on master that compiling with `CPPFLAGS="-DDEBUG_ADDRMAN"` no longer causes the build to error.
  mzumsande:
    Code-review ACK a4d78546b0
  theStack:
    Code-review ACK a4d78546b0

Tree-SHA512: eaee003f7a99154822c5b5efbc62008d32c1efbecc6fec6e183427f6b2ae5d30b3be7924e3a7271b1a1de91517f5bd2a70011d45358c3105c6a0702f12b70f7c
2021-08-13 17:03:01 +08:00
Andrew Chow
92885c4f69 test: Test for ApproximateBestSubset edge case with too little fees
ApproximateBestSubset had an edge case (due to not using
GetSelectionAmount) where it was possible for it to return success but
fail to select enough to cover transaction fees. A test is added that
could trigger this failure prior to the fix being implemented.
2021-08-13 00:34:47 -04:00
Andrew Chow
d9262324e8 wallet: Assert that enough was selected to cover the fees
When the fee is not subtracted from the outputs, the amount that has
been reserved for the fee (change_and_fee - change_amount) must be
enough to cover the fee that is needed. It would be a bug to not do so,
so use an assert to make this obvious if such a situation were to occur.
2021-08-13 00:34:47 -04:00
Andrew Chow
2de222c401 wallet: Use GetSelectionAmount for target value calculations
For target value calculations, GetSelectionAmount should be used, not
m_effective_value or m_value.

Specifically, ApproximateBestSubset mistakenly uses m_value when
calculating whether the target value has been met. This has been changed
to use GetSelectionAmount.
2021-08-13 00:34:02 -04:00
James O'Beirne
45babb2788
builder-keys: add jamesob
http://keyserver.ubuntu.com/pks/lookup?search=0x25F27A38A47AD566&fingerprint=on&hash=on&op=vindex

This is also the key I sign GitHub commits with.
2021-08-12 16:16:56 -04:00
Hennadii Stepanov
439e58c4d8
Merge bitcoin-core/gui#360: Unregister wallet notifications before unloading wallets
93cc53a2b2 gui: Unregister wallet notifications before unloading wallets (Russell Yanofsky)

Pull request description:

  This change was originally part of both bitcoin/bitcoin#10102 and bitcoin/bitcoin#19101 and is required for both because it avoids the IPC wallet implementation in bitcoin/bitcoin#10102 and the WalletContext implementation in bitcoin/bitcoin#19101 needing to deal with notification objects that have stale pointers to deleted wallets.

ACKs for top commit:
  promag:
    Code review ACK 93cc53a2b2.
  hebasto:
    ACK 93cc53a2b2

Tree-SHA512: 805f50a493291ad0f7c48725fbc5058d58ebbdb0770befd51d8aa241209a13f8a46f5982481336ab8338cdc83e9017668089a71deccf1587308e841cf8697825
2021-08-12 20:03:00 +03:00