Commit graph

35116 commits

Author SHA1 Message Date
Hennadii Stepanov
a2e733b946
doc: Remove no longer needed comments
Co-authored-by: fanquake <fanquake@gmail.com>
2022-08-13 14:08:04 +01:00
fanquake
9546b3a2a3
Update crc32c subtree to latest upstream master 2022-08-13 13:55:38 +01:00
fanquake
08269e54a9 Squashed 'src/crc32c/' changes from 0d624261ef..0bac72c455
0bac72c455 Merge bitcoin-core/crc32c-subtree#5: local, bugfix: Define `CRC32C_HAVE_CONFIG_H` macro for all targets
002cfa280e local, bugfix: Define `CRC32C_HAVE_CONFIG_H` macro for all targets

git-subtree-dir: src/crc32c
git-subtree-split: 0bac72c4552baf1cc9fe03ee30d6542cb7af2e04
2022-08-13 13:55:38 +01:00
Hennadii Stepanov
968ea66537
build: Adjust qt/guix_cross_lib_path.patch 2022-08-13 13:45:22 +01:00
fanquake
aca0200e94
Merge bitcoin/bitcoin#25817: build: fix cross-arch macOS M1 build reproducibility
08bd338277 build: optimise arm64 darwin qt build using -O1 (fanquake)

Pull request description:

  Building the macOS M1 bitcoin-qt binary at a optimisation level higher than `-O1` causes reproducibility issues when building on different architectures.

  Proposing somewhat of a hammer.

  This would fix 1 of the 2 remaining HOSTS in #21194.

  Guix Build (x86_64):
  ```bash
  1b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
  0e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
  1feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
  641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
  9d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
  e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
  dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
  85e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
  ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
  ```

  Guix Build (arm64):
  ```bash
  1b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
  0e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
  1feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
  641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
  9d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
  e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
  dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
  85e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
  ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
  ```

ACKs for top commit:
  hebasto:
    ACK 08bd338277
  jarolrod:
    ACK 08bd338277

Tree-SHA512: 48da4acb1799c3153cdaf674f287c81c3da230a3476183616b74f318baa595af45b313136eb228ba13c63e0b8206a78064734f9fd0488e1e839c9e4e1d92ba25
2022-08-13 13:41:18 +01:00
Suhas Daftuar
f6a916683d Add functional test for block announcements during initial headers sync 2022-08-12 17:13:00 -04:00
Suhas Daftuar
05f7f31598 Reduce bandwidth during initial headers sync when a block is found
If our headers chain is behind on startup, then if a block is found we'll try
to catch up from all peers announcing the block, in addition to our initial
headers-sync peer. This commit changes behavior so that in this situation,
we'll choose at most one peer announcing a block to additionally sync headers
from.
2022-08-12 17:05:04 -04:00
furszy
4584d300a4
GUI: remove now unneeded 'm_balances' field from overviewpage 2022-08-12 13:06:10 -03:00
furszy
050e8b1391
GUI: 'getAvailableBalance', use cached balance if the user did not select UTXO manually
No need to walk through the entire wallet's tx map. Used for 'walletModel::prepareTransaction' and 'useAvailable' flow in sendcoinsdialog.
2022-08-12 13:06:05 -03:00
furszy
96e3264a82
GUI: use cached balance in overviewpage and sendcoinsdialog
Plus, calculate the cached balance right when the wallet model, so the wallet widgets don't need to redo the same balance calculation multiple times when they are waiting for the model balance polling timer.

----------------------------------------------------------------------

test wise: `WalletTests` now need to trigger the walletModel balance changed manually. So the model updates its internal state and can be used by the widgets.

This is because the test does not start the balance polling timer, in the same way as does not initialize several parts of the GUI workflow. All the objects (wallet, models, views, etc) that are used on this test are manually created instead of using the `WalletController` class flow.

Rationale is that this unit test is focused on verifying the GUI widgets/views behavior only: update the presented information, etc. when they receive different signals and/or function calls from outside (in other words, focus is on the signal slots/receiver side). It's not about whether the wallet balance polling timer is functioning as expected or not (which we definitely create a new test case for it in a follow-up work).
2022-08-12 13:06:05 -03:00
furszy
321335bf02
GUI: add getter for WalletModel::m_cached_balances field
No need to guard it as it is/will only be accessed from the main thread for now
2022-08-12 13:05:57 -03:00
furszy
e62958dc81
GUI: sendCoinsDialog, remove duplicate wallet().getBalances() call
Inside setModel, we call 'wallet().getBalances()', to set the view balance,
right before calling 'updateDisplayUnit' which calls 'wallet().getBalances()'
internally and re-sets the view balance again.
2022-08-12 13:05:47 -03:00
fanquake
08bd338277
build: optimise arm64 darwin qt build using -O1
Building at higher optimisation levels causes reproducibility issues
when building on different architectures.
2022-08-12 16:38:29 +01:00
MacroFake
fa3f15f2dd
refactor: Avoid copies in FlatSigningProvider Merge 2022-08-12 17:19:16 +02:00
MacroFake
bf3f05f41d
Merge bitcoin/bitcoin#25785: bench: Add a benchmark for descriptor expansion
478695982b bench: Add a benchmark for descriptor expansion (Ben Woosley)

Pull request description:

  Taken from https://github.com/bitcoin/bitcoin/pull/16116 , as requested here: https://github.com/bitcoin/bitcoin/pull/25748#issuecomment-1205441706

ACKs for top commit:
  achow101:
    ACK 478695982b

Tree-SHA512: f2efdf8f84e1783c7c298abe65123191d25cab0a9da2d0ff5957a60acc2d10e356151d7ecec0d98d28c456f42ddef50efd70c7edc0c9012df2a977e080515b9d
2022-08-12 13:00:06 +02:00
MacroFake
89b2194124
Merge bitcoin/bitcoin#25814: net: simplify GetLocalAddress()
daabd41211 net: simplify GetLocalAddress() (Vasil Dimov)

Pull request description:

  There is no need to use two variables `ret` and `addr` of the same type
  `CService` and assign one to the other in a strange way like
  `ret = CService{addr}`.

ACKs for top commit:
  jarolrod:
    ACK daabd41211
  aureleoules:
    ACK daabd41211.
  w0xlt:
    ACK daabd41211

Tree-SHA512: 4bbd3746bc30fbc05bb32b58bb122c938acd849c0f72f1d3e8170557c1999ec26a888e06e874c3fc22562a2becddc7d817db7d174e0e1b383e8d74c39aa1e898
2022-08-12 10:52:42 +02:00
MacroFake
27724c23f7
Merge bitcoin/bitcoin#25677: refactor: make active_chain_tip a reference
9376a6dae4 refactor: make active_chain_tip a reference (Aurèle Oulès)

Pull request description:

  This PR fixes a TODO introduced in #21055.

  Makes `active_chain_tip` argument in `CheckFinalTxAtTip` function a reference instead of a pointer.

ACKs for top commit:
  dongcarl:
    ACK 9376a6dae4

Tree-SHA512: c36d1769e0b9598b7f79334704b26b73e958d54caa3bd7e4eff954f3964fcf3f5e3a44a5a760497afad51b76e1614c86314fe035e4083c855e3574a620de7f4d
2022-08-12 08:32:15 +02:00
Andrew Chow
5d294bccba
Merge bitcoin/bitcoin#25825: wallet: consolidate CoinSelectionParams::m_change_target and m_min_change_target
acda7e8686 [coin selection] consolidate m_change_target and m_min_change_target (glozow)

Pull request description:

  These values are both intended for the same thing. Their divergence seems to be the result of an incomplete rename.

ACKs for top commit:
  achow101:
    ACK acda7e8686
  Xekyo:
    ACK acda7e8686
  furszy:
    ACK acda7e86
  aureleoules:
    ACK acda7e8686.

Tree-SHA512: 4b86171af5d893f7172373bb404bad12c49588ad1e22eb0544c242173f4bc4dede2ff1270c93c9f02f503ab8d9f66b841a8319d0ecb5e896d0fe8727cf03dbf4
2022-08-11 15:04:13 -04:00
MacroFake
e5d8b65423
Merge bitcoin/bitcoin#25815: test: Use existing {Chainstate,Block}Man
2e79fb6585 validation tests: Use existing {Chainstate,Block}Man (Carl Dong)

Pull request description:

  This is split up because it is needed for two changes:
  * https://github.com/bitcoin/bitcoin/pull/25781
  * https://github.com/bitcoin/bitcoin/pull/25623

ACKs for top commit:
  adam2k:
    ACK tested 2e79fb6585
  aureleoules:
    ACK 2e79fb6585.

Tree-SHA512: 2cd6a2fec19545f8ffc77e37ccb793aa6cb5815bb1b5e560c0345af6e0f890fd500ae3297b044d3f6f613b8dd7fd4553f5fc2824013342b9e25af1fe2b624967
2022-08-11 19:48:07 +02:00
Andrew Chow
e078ee9d9d
Merge bitcoin/bitcoin#25664: refactor: Redefine IsSolvable() using descriptors
b16f93cadd script/sign: remove needless IsSolvable() utility (Antoine Poinsot)
c232ef20c0 outputtype: remove redundant check for uncompressed keys in AddAndGetDestinationForScript (Antoine Poinsot)

Pull request description:

  Now that we have descriptors there is no need to try to sign for a scriptPubKey using dummy signatures, and using a mocked verification of this witness against the interpreter, just to make sure we know how to spend such a Script. Just try to infer a solvable descriptor: any scriptPubKey that we can sign for can be inferred as such.

  This came up in #24149 but i think it's worth it on its own.

ACKs for top commit:
  instagibbs:
    ACK b16f93cadd
  achow101:
    re-ACK b16f93cadd
  furszy:
    ACK b16f93ca, only change is the `IsSolvable` helper function removal.

Tree-SHA512: 137068157ce90210b710b1bf9ac3c400e2ff5af1112f892094b69875ea473d6a899f52adb51e5030cb907dee517602059cd1661107808558efa5de842ba12b41
2022-08-11 13:41:47 -04:00
MacroFake
29c195cf6a
Merge bitcoin/bitcoin#25792: test: add tests for datacarrier and datacarriersize options
8b3d2bbd0d test: add tests for `datacarrier` and `datacarriersize` options (w0xlt)

Pull request description:

  As suggested in https://github.com/bitcoin/bitcoin/issues/25787, this PR adds tests for `datacarrier` and `datacarriersize` initialization options.

  Close https://github.com/bitcoin/bitcoin/issues/25787.

ACKs for top commit:
  theStack:
    re-ACK 8b3d2bbd0d
  stickies-v:
    re-ACK 8b3d2bbd0d

Tree-SHA512: 962638ac9659f9d641bc5d1eff0571a08085dc7d4981b534b7ede03e4c702abd7048d543c199a588e2f94567b6d2393280e686629b19d7f4b24d365662be5e40
2022-08-11 18:04:30 +02:00
Andrew Chow
243d7bde78
Merge bitcoin/bitcoin#25798: build: fix cleanup of test logs
5474f5c356 build: fix cleanup of test logs (fanquake)

Pull request description:

  `make clean` currently looks for `test_name.cpp.log`, when it should be `test_name.log`, meaning .log files are left after running `make clean`.

  Also fixes #21705. `make distcheck` seems to work fine after the logs files are properly cleaned up:
  ```bash
  ./autogen.sh && ./configure && make distcheck -j9
  ....
  make[1]: Leaving directory '/home/ubuntu/bitcoin/bitcoin-23.99.0/_build/sub'
  if test -d "bitcoin-23.99.0"; then find "bitcoin-23.99.0" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "bitcoin-23.99.0" || { sleep 5 && rm -rf "bitcoin-23.99.0"; }; else :; fi
  =================================================
  bitcoin-23.99.0 archives ready for distribution:
  bitcoin-23.99.0.tar.gz
  =================================================
  ```

  Probably broken in #19385 / #24715.

  Guix Build (x86_64):
  ```bash
  c33306c2ae55bc0e037a1050bd0813fd7654f21fefd0e7df089a541118b629bc  guix-build-5474f5c356c5/output/aarch64-linux-gnu/SHA256SUMS.part
  f3cf5b8366e27155f3a369ab0d017074912506c43b4010054a72e5c3ae8cab2c  guix-build-5474f5c356c5/output/aarch64-linux-gnu/bitcoin-5474f5c356c5-aarch64-linux-gnu-debug.tar.gz
  48f618300f63533c50c31395959737103bb0279972b989cc5417adbf338a5c9f  guix-build-5474f5c356c5/output/aarch64-linux-gnu/bitcoin-5474f5c356c5-aarch64-linux-gnu.tar.gz
  6b3e0ceefc84dfad48aec3a9ea8ae98a427775242370234709605855f593dc88  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/SHA256SUMS.part
  36a38f4d0d2d0fee51256ee9c610cde014055cf18b5b852c8b3235ef218b461e  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/bitcoin-5474f5c356c5-arm-linux-gnueabihf-debug.tar.gz
  3acb46a786323068fe34eaa8b2f7bff428d35367677e456b78fc00db09da8adf  guix-build-5474f5c356c5/output/arm-linux-gnueabihf/bitcoin-5474f5c356c5-arm-linux-gnueabihf.tar.gz
  aaeb126cca3cbbb1d21be2cbb36b3e16a8c110199a5e61172ee55c9c913fb717  guix-build-5474f5c356c5/output/arm64-apple-darwin/SHA256SUMS.part
  0135d47c34dfbfbcd68181292fc810a1be4efaa0ff9fab05f9f33415167fc82c  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin-unsigned.dmg
  261ae9f70238ecbd8fedf9b3e02f34601abe42c4a23b25d0571d04d0881fdaba  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin-unsigned.tar.gz
  de716e0f425bae38cfda2690e86dbfa6831b6d37dd8a7638ca14334eecbddf99  guix-build-5474f5c356c5/output/arm64-apple-darwin/bitcoin-5474f5c356c5-arm64-apple-darwin.tar.gz
  2e2e1d5cd009ec5c69ce22124afe90ff8c15e9cb546df818b2305ff96efa9c81  guix-build-5474f5c356c5/output/dist-archive/bitcoin-5474f5c356c5.tar.gz
  85dd41584a2c7715b16508dff0f51bbb20b3891a1901a1781ecc37bc1cfd97c8  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/SHA256SUMS.part
  49ae951e9acb34fede0ead4d53679ddc041bfb6d60646efaca2a99cf87972be9  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/bitcoin-5474f5c356c5-powerpc64-linux-gnu-debug.tar.gz
  2efcb3fbb6702bff30bbf05d83b9849f390c67a1c363c883d71f365f4bee7ef6  guix-build-5474f5c356c5/output/powerpc64-linux-gnu/bitcoin-5474f5c356c5-powerpc64-linux-gnu.tar.gz
  cea9e8e2499932ef6e20bba7a6b3408e2cca6fcd1875c1890293dd745add6942  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/SHA256SUMS.part
  7616659242a1f15b7d6f9f54382dfb52d0bbdca701e1fb3d48fbe7bb590e6213  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/bitcoin-5474f5c356c5-powerpc64le-linux-gnu-debug.tar.gz
  d9d4eeaf6f9d1272000aa598c8461afc330a8e65f263d45b0eab222f8ddfec71  guix-build-5474f5c356c5/output/powerpc64le-linux-gnu/bitcoin-5474f5c356c5-powerpc64le-linux-gnu.tar.gz
  f83ee11c35001d34f9fba7d1e9e201a4cc6fa5e44bd51e13dabffcb35324348c  guix-build-5474f5c356c5/output/riscv64-linux-gnu/SHA256SUMS.part
  c441e56f23f224122ed064cdb57364fb129f5c9d50c5e8173952ce649b46bdb8  guix-build-5474f5c356c5/output/riscv64-linux-gnu/bitcoin-5474f5c356c5-riscv64-linux-gnu-debug.tar.gz
  319db8af21a4d3c7bbdf54c315ad70bacf7fba1f2559408188d90c9ba60ca63c  guix-build-5474f5c356c5/output/riscv64-linux-gnu/bitcoin-5474f5c356c5-riscv64-linux-gnu.tar.gz
  9ac536a04d7e500f87b1f7dfb60e1e84cde2c192d3dffb89c308b864e9b9d583  guix-build-5474f5c356c5/output/x86_64-apple-darwin/SHA256SUMS.part
  19e70f13fb4bf82375f7ca882a23e831f84729278e643cf5911182bdababa893  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin-unsigned.dmg
  673a20e9457af3d0a89ea6721f84c6136132d3fbe469b7371bf14ce688b567d0  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin-unsigned.tar.gz
  74162d53faffc4372ae4587cde395fe078b5c440c43c5a4ad8b8b890e9546255  guix-build-5474f5c356c5/output/x86_64-apple-darwin/bitcoin-5474f5c356c5-x86_64-apple-darwin.tar.gz
  d751d50427d7abcbe9ac1daf087dc3addb7e4e6b90bb4c3ef6c31f8e54cac25e  guix-build-5474f5c356c5/output/x86_64-linux-gnu/SHA256SUMS.part
  49951b53172d4fe193d7ffc15b04a4bc058a3209653982b65912f2b221305dd4  guix-build-5474f5c356c5/output/x86_64-linux-gnu/bitcoin-5474f5c356c5-x86_64-linux-gnu-debug.tar.gz
  93d4c4b07202a9171a72b6887e3931e53b3a8c22433b26521e2cb2a0c942f52a  guix-build-5474f5c356c5/output/x86_64-linux-gnu/bitcoin-5474f5c356c5-x86_64-linux-gnu.tar.gz
  b4b79e3578b6ffbb3075aacff969fb201b386e35a2d9d597047b61ff14bdfbfb  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/SHA256SUMS.part
  8260f5c9a38cc577dff2143f00c465d117aa9835b3633365289d6807d7e46e7c  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-debug.zip
  b20fbf02ddf617b86e5d5f88346ed97f9d169cd56904684ba3ca5f03ea85f008  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-setup-unsigned.exe
  16e9d1b817a832bfb0be2b9065440245a5d04b3aae8e34ff0f43f20c5dd7047f  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64-unsigned.tar.gz
  da766e257d10cf8890a530babc6100039c69ae7ed8e4f969eb612b4a411dd88f  guix-build-5474f5c356c5/output/x86_64-w64-mingw32/bitcoin-5474f5c356c5-win64.zip
  ```

ACKs for top commit:
  adam2k:
    ACK 5474f5c356
  achow101:
    ACK 5474f5c356
  jarolrod:
    ACK 5474f5c356

Tree-SHA512: d5595c96d0386b5ee9b98d9499770a00d8b751500020bf92f75c88e688640a50cfa5ebe7c26dea8cc5473b16a6adb83ec39891dd18d32ef59df5cf48d7091d6c
2022-08-11 11:57:12 -04:00
w0xlt
8b3d2bbd0d
test: add tests for datacarrier and datacarriersize options
Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2022-08-11 12:05:09 -03:00
glozow
acda7e8686
[coin selection] consolidate m_change_target and m_min_change_target
These values are both intended for the same thing. Their divergence
seems to be the result of an incomplete rename.
2022-08-11 15:23:21 +01:00
Antoine Poinsot
b16f93cadd
script/sign: remove needless IsSolvable() utility
It was used back when we didn't have a concept of descriptor. Now we
can check for solvability using descriptors.
2022-08-11 15:43:40 +02:00
fanquake
dd62721ba9
Merge bitcoin/bitcoin#25820: [test] make tx6 child of tx5, not tx3, in rbf_tests
49db42cdf5 [test] make tx6 child of tx5, not tx3, in rbf_tests (glozow)

Pull request description:

  A small overlooked oopsie from #25674.
  There is no effect on the test results because tx3 and tx5 pay the same fee, but this was the intended configuration, as the comment suggests.

ACKs for top commit:
  instagibbs:
    ACK 49db42cdf5
  darosior:
    Github diff ACK 49db42cdf5. Should have catched this. :/

Tree-SHA512: 2f54337ac3edc38707115cde5b466a85b8a6ac0a0a507effa0e9fecb12c9be196ecd1b16702bc23ba617cfb6a3b5db27d3b71616b3c2dadb186c699c4609831e
2022-08-11 14:29:23 +01:00
glozow
49db42cdf5
[test] make tx6 child of tx5, not tx3, in rbf_tests
There is no effect on the test results because tx3 and tx5 pay the say
fee, but this was the intended configuration, as the comment suggests.
2022-08-11 12:48:09 +01:00
fanquake
0094ff3947
Merge bitcoin/bitcoin#25812: psbt: Avoid unsigned int overflow in PSBT_IN_TAP_BIP32_DERIVATION
70a55c059b psbt: Avoid unsigned int overflow in PSBT_IN_TAP_BIP32_DERIVATION (Andrew Chow)

Pull request description:

  Fixes #25749

ACKs for top commit:
  instagibbs:
    ACK 70a55c059b
  darosior:
    re-utACK 70a55c059b
  jonatack:
    Review ACK 70a55c059b, this should avoid the issue reported in https://github.com/bitcoin/bitcoin/issues/25749

Tree-SHA512: 6bb58e1cda9a5baa50fcd24f818b5b27ed94f0d33da3f71f6e457618176611bf2a84e1864e9a48d9303c301252bc4c1dee8b19a67dd713e849fb9442851ca341
2022-08-11 10:12:20 +01:00
MacroFake
cd230f3281
Merge bitcoin/bitcoin#25816: msvc: Drop _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
9f9339c692 msvc: Drop `_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING` (Hennadii Stepanov)

Pull request description:

  It is no longer needed.

ACKs for top commit:
  sipsorcery:
    tACK 9f9339c692.

Tree-SHA512: 7bcb9df4629726ddb8b23e73b186635be54a5e5379928ce250ba2fba7a6d6f1dda98429b8329790e34fcb3861a8b00c6954746ea78e99693b86c51017c4713e0
2022-08-11 09:09:53 +02:00
Andrew Chow
93999a5fbe
Merge bitcoin/bitcoin#25642: Don't wrap around when deriving an extended key at a too large depth
fb9faffae3 extended keys: fail to derive too large depth instead of wrapping around (Antoine Poinsot)
8dc6670ce1 descriptor: don't assert success of extended key derivation (Antoine Poinsot)
50cfc9e761 (pubk)key: mark Derive() as nodiscard (Antoine Poinsot)
0ca258a5ac descriptor: never ignore the return value when deriving an extended key (Antoine Poinsot)
d3599c22bd spkman: don't ignore the return value when deriving an extended key (Antoine Poinsot)

Pull request description:

  We would previously  silently wrap the derived child's depth back to `0`. Instead, explicitly fail when trying to derive an impossible depth, and handle the error in callers.

  An extended fuzzing corpus of `descriptor_parse` triggered this behaviour, which was reported by MarcoFalke.

  Fixes #25751.

ACKs for top commit:
  achow101:
    re-ACK fb9faffae3
  instagibbs:
    utACK  fb9faffae3

Tree-SHA512: 9f75c23572ce847239bd15e5497df2960b6bd63c61ea72347959d968b5c4c9a4bfeee284e76bdcd7bacbf9eeb70feee85ffd3e316f353ca6eca30e93aafad343
2022-08-10 14:25:43 -04:00
MacroFake
251c535800
Merge bitcoin/bitcoin#25810: scripted-diff: test: rename MAX_{ANCESTORS,DESCENDANTS} to DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT
b4a5ab96b4 test: refactor: deduplicate `DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT` constants (Sebastian Falbesoner)
0fda1c7df6 scripted-diff: test: rename `MAX_{ANCESTORS,DESCENDANTS}` to `DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT` (Sebastian Falbesoner)

Pull request description:

  This PR renames the default in-mempool max ancestors/descendants constants `MAX_ANCESTORS`/`MAX_DESCENDANTS` in the functional tests to match the ones in the codebase:
  c012875b9d/src/policy/policy.h (L58-L59)
  c012875b9d/src/policy/policy.h (L62-L63)
  The custom limit constants `MAX_ANCESTORS_CUSTOM`/`MAX_DESCENDANTS_CUSTOM` are also renamed accordingly to better fit to this naming style. In the second commit, the default constants are deduplicated by moving them into the `messages.py` module. (Not sure if this module is really appropriate, as it doesn't have a connection to messages. If someone has a good suggestion, would be glad to hear it.)

ACKs for top commit:
  w0xlt:
    ACK b4a5ab96b4
  glozow:
    utACK b4a5ab96b4
  fanquake:
    ACK b4a5ab96b4

Tree-SHA512: a15c8256170afce3e383fceddcb562f588a02be97ce4202c84a2ebf22d73ab843f5e5a7d7c98e9ea044d8bcb7a4aeae0081d0e84c53e8fc0edffbcca00460139
2022-08-10 19:23:35 +02:00
MacroFake
f89ce1fdb5
Merge bitcoin/bitcoin#25811: doc: test: suggest multi-line imports in functional test style guide
4edc689382 doc: test: suggest multi-line imports in functional test style guide (Sebastian Falbesoner)

Pull request description:

  As long as I remember contributing to functional tests (~2-3 years), it was always kind of an unwritten rule that multi-line imports are preferred over single-line imports in order to reduce the possibility of potential merge conflicts -- at least if more than one symbol from a module is imported. This PR adds this rule to the style guide and adapts the example test accordingly. (Inspired by https://github.com/bitcoin/bitcoin/pull/25792#discussion_r941180819).

ACKs for top commit:
  kouloumos:
    ACK 4edc689382
  1440000bytes:
    ACK 4edc689382
  w0xlt:
    ACK 4edc689382
  fanquake:
    ACK 4edc689382

Tree-SHA512: c7b6ff62f601f4e57cc8334d291662987d6737ebca8d81c063280409f4412302172f1404ec16afc9a13007bcdba55bdab66b9b80363287e287888929cb386584
2022-08-10 19:22:14 +02:00
MacroFake
deb7ad35e6
Merge bitcoin/bitcoin#25813: build: move raw rule into Makefile.am
d8b26abed9 build: move raw rule into Makefile.am (fanquake)

Pull request description:

  The same rule is used by the tests and benchmarks to generate headers,
  and currently causes #25501. Just deduplicate the code into Makefile.am.

  Fixes: #25501.

ACKs for top commit:
  hebasto:
    ACK d8b26abed9, tested on Ubuntu 22.04, the moved code was verified using `git diff --color-moved=dimmed-zebra HEAD~1..HEAD`.
  jarolrod:
    tACK d8b26abed9

Tree-SHA512: 249813318c92f992a89002fb9b96e70fca6ca97b2136ba0a7f5cc312e9abe24fbbe9a8faddb3bc1c0d775ae901bc91eab63ba564810bb2e3b9d56a2b1a107eb1
2022-08-10 19:20:03 +02:00
MacroFake
f5e96ecef5
Merge bitcoin/bitcoin#25616: refactor: Return util::Result from WalletLoader methods
07df6cda14 wallet: Return `util::Result` from WalletLoader methods (w0xlt)

Pull request description:

  This PR adds a method that implement common logic to WalletLoader methods and change them to return `BResult<std::unique_ptr<Wallet>>`.

  Motivation: #25594 changed `restoreWallet` to return `BResult` but this method shares a common pattern with  `createWallet` and `loadWallet`. This PR keeps the same pattern to all WalletLoader methods.

ACKs for top commit:
  jonatack:
    Review ACK 07df6cda14
  theStack:
    Code-review ACK 07df6cda14

Tree-SHA512: 2fe321134883f7cce60206888113800afef0fa168dab184e1a8692cd21a231970eb9c25c7220ea39e5d457134002d47f0974463925db76abbf8dfcd421629c63
2022-08-10 19:08:02 +02:00
Andrew Chow
70a55c059b psbt: Avoid unsigned int overflow in PSBT_IN_TAP_BIP32_DERIVATION 2022-08-10 11:58:17 -04:00
Hennadii Stepanov
9f9339c692
msvc: Drop _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
It is no longer needed.
2022-08-10 15:48:10 +01:00
Carl Dong
2e79fb6585 validation tests: Use existing {Chainstate,Block}Man
Use {Chain,}TestingSetup's existing {Chainstate,Block}Manager and avoid
unnecessarily creating a local one.

This also helps reduce the code diff for a later commit where we change
{Chainstate,Block}Manager's constructor signature.
2022-08-10 16:40:59 +02:00
w0xlt
07df6cda14 wallet: Return util::Result from WalletLoader methods 2022-08-10 11:14:53 -03:00
josibake
8cd21bb279
refactor: improve readability for AttemptSelection
it was pointed out by a few reviewers that the code block at the end
of attempt selection was difficult to follow and lacked comments.

refactor to get rid of triple nested if statement and improve
readibility.
2022-08-10 15:19:32 +02:00
josibake
f47ff71761
test: only run test for descriptor wallets
since this test uses bech32m, we skip unless sqlite is used, which is the
same as checking if we are using descriptor wallets or not
2022-08-10 15:19:32 +02:00
josibake
0760ce0b9e
test: add missing BOOST_ASSERT
this was missed in the original PR
2022-08-10 15:19:32 +02:00
josibake
db09aec937
wallet: switch to new shuffle, erase, push_back
switch to new methods, remove old code. this also
updates the Size, All, and Clear methods to now use
the coins map.

this commit is not strictly a refactor because previously
coin selection was never run over the UNKNOWN type until the last
step when being run over all. now that we are iterating over each,
it is run over UNKNOWN but this is expected to be empty most of the time.

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2022-08-10 15:19:31 +02:00
josibake
b6b50b0f2b
scripted-diff: Uppercase function names
Change `CoinsResult` functions to uppercase to be consistent with
the style guide.

-BEGIN VERIFY SCRIPT-
git grep -l "available_coins" | grep -v mempool_stress.cpp | xargs sed -i "s/available_coins\.\(size\|all\|clear\)/available_coins\.\u\1/"
git grep -l AvailableCoins | xargs sed -i "/AvailableCoins/ s/\(all()\|size()\|clear()\)/\u\1/"
sed -i "s/\(clear()\|all()\|size()\)/\u&/g" src/wallet/spend.h
sed -i "/CoinsResult::/ s/\(clear()\|all()\|size()\)/\u&/" src/wallet/spend.cpp
sed -i "s/result.size/result.Size/" src/wallet/spend.cpp
sed -i "s/this->size/this->Size/" src/wallet/spend.cpp
-END VERIFY SCRIPT-
2022-08-10 15:19:31 +02:00
josibake
3f27a2adce
refactor: add new helper methods
add Shuffle, Erase, and Add to CoinsResult struct
add a helper function for mapping TxoutType to OutputType

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2022-08-10 15:19:18 +02:00
Vasil Dimov
daabd41211
net: simplify GetLocalAddress()
There is no need to use two variables `ret` and `addr` of the same type
`CService` and assign one to the other in a strange way like
`ret = CService{addr}`.
2022-08-10 15:09:29 +02:00
fanquake
d8b26abed9
build: move raw rule into Makefile.am
The same rule is used by the tests and benchmarks to generate headers,
and currently causes #25501. Just deduplicate the code into Makefile.am.
2022-08-10 13:36:33 +01:00
MacroFake
a6fc293c0a
Merge bitcoin/bitcoin#25656: refactor: wallet: return util::Result from GetReservedDestination methods
76b3c37fcb refactor: wallet: return util::Result from `GetReservedDestination` methods (Sebastian Falbesoner)

Pull request description:

  This PR is a follow-up to #25218, as suggested in comment https://github.com/bitcoin/bitcoin/pull/25218#discussion_r907710067. The interfaces of the methods `ReserveDestination::GetReservedDestination`, `{Legacy,Descriptor,}ScriptPubKeyMan::GetReservedDestination` are improved by returning `util::Result<CTxDestination>` instead of `bool` in order to get rid of the two `CTxDestination&` and `bilingual_str&` out-parameters.

ACKs for top commit:
  furszy:
    ACK 76b3c37f

Tree-SHA512: bf15560a88d645bcf8768024013d36012cd65caaa4a613e8a055dfd8f29cb4a219c19084606992bad177920cdca3a732ec168e9b9526f9295491f2cf79cc6815
2022-08-10 14:19:17 +02:00
MacroFake
aac200801b
Merge bitcoin/bitcoin#25794: test, tracing: don't rely on block_connected USDT event order in tests
0532aa7444 test: don't rely on usdt block_conn event order (0xb10c)

Pull request description:

  Relying on block_connected event order in the USDT interface tests turned out to be brittle.

  Closes https://github.com/bitcoin/bitcoin/issues/25793
  Closes https://github.com/bitcoin/bitcoin/issues/25764

Top commit has no ACKs.

Tree-SHA512: 40b5012ac80a8eac9d2f374cd39304488009c29adb474dc5e8c03b96c354be358298d2ddee8de480afecc187e1bf42ee119b7aa6216b086a8bf77b7e1310213c
2022-08-10 14:04:40 +02:00
MacroFake
ebf094ff3a
Merge bitcoin/bitcoin#25731: test: negative/unknown rpcserialversion should throw an init error
155344960b test: negative/unknown `rpcserialversion` should throw an init error (brunoerg)

Pull request description:

  This PR adds test coverage for the following init errors:
  41205bf442/src/init.cpp (L1025-L1030)

Top commit has no ACKs.

Tree-SHA512: 4456949e9a13908a5a59b13ed57bc3002b7ffd626e8dfb0346aa2600937ba1ef1b69cbae45cdb6bbc1c019dbcd64844e736a2ddd671a4704e53804355b6ea9f9
2022-08-10 13:51:44 +02:00
josibake
f5649db9d5
refactor: add UNKNOWN OutputType
add to enum, array and handle UNKNOWN in various case statements
2022-08-10 10:17:54 +02:00