Commit graph

4401 commits

Author SHA1 Message Date
laanwj
b223c3c21e test: Add functional test for symlinked blocks directory 2022-02-17 12:33:30 +01:00
MarcoFalke
1e8aa02ec5
Merge bitcoin/bitcoin#24117: index: make indices robust against init aborts
bfcd60f5d5 test: activate all index types in feature_init.py (Martin Zumsande)
0243907fae index: Don't commit without valid m_best_block_index (Martin Zumsande)

Pull request description:

  When an index thread receives an interrupt during init before it got to index anything (so `m_best_block_index == nullptr` still), it will still try to commit previous "work" before stopping the thread. That means that `BaseIndex::CommitInternal()` calls `GetLocator(nullptr)`, which returns an locator to the tip ([code](06b6369766/src/chain.cpp (L31-L32))), and saves it to the index DB.
  On the next startup, this locator will be read and it will be assumed that we have successfully synced the index to the tip, when in reality we have indexed nothing.
  In the case of coinstatsindex, this would lead to a shutdown of bitcoind without any indication what went wrong. For the other indexes, there would be no immediate shutdown, but the index would be corrupt.

  This PR fixes this by not committing when `m_best_block_index==nullptr`, and it also adds an error log message to the silent coinstatsindex shutdown path.

  This is another small bug found by `feature_init.py` - the second commit enables blockfilterindex and coinstatsindex for this test, enabling coinstatsindex without the first commit would have led to frequent failures.

ACKs for top commit:
  fjahr:
    reACK bfcd60f5d5
  shaavan:
    reACK bfcd60f5d5

Tree-SHA512: 8e2bac0fc40cde209518a9e59b597ae0a5a875a2a90898673987c91733718d40e528dada942bf552b58bc021bf46e59da2d0cc5a61045f48f9bae2b1baf6033b
2022-02-15 19:57:25 +01:00
MarcoFalke
7164e00e1b
Merge bitcoin/bitcoin#24324: test: refactor: remove unneeded bytes<->hex conversions in byte_to_base58
f11dad22a5 test: refactor: remove unneeded bytes<->hex conversions in `byte_to_base58` (Sebastian Falbesoner)

Pull request description:

  It seems like the only reason for using hex strings in this method was to have a convenient way to convert to an integer from the input data interpreted as big-endian. In Python3 we have `int.from_bytes(..., 'big')` for that purpose, hence there is no need for that anymore and we can simply operate on bytes only.

ACKs for top commit:
  laanwj:
    Code review ACK f11dad22a5

Tree-SHA512: 9b1563010066ca74d85139c3b9259e9a5bb49e1f141c30b6506a0445afddb2bde7fd421fdd917dc516956e66f93610e2c21d720817640daee8f57f803be76ee4
2022-02-15 09:31:58 +01:00
brunoerg
460fa8e0d9 test: remove import socket in test_ipv6_local 2022-02-14 19:27:33 -03:00
Sebastian Falbesoner
f11dad22a5 test: refactor: remove unneeded bytes<->hex conversions in byte_to_base58
It seems like the only reason for using hex strings in this
method was to have a convenient way to convert to an integer
from the input data interpreted as big-endian.
In Python3 we have `int.from_bytes(..., 'big')` for that
purpose, hence there is no need for that anymore and we can
simply operate on bytes only.
2022-02-14 12:48:43 +01:00
fanquake
e0367e84b3
Merge bitcoin/bitcoin#24301: build: header-only Boost
5d399f9f3d build: remove native B2 package (fanquake)
2037a3b6c1 build: header-only Boost (fanquake)
39e66e938f build: use header-only Boost unit test (fanquake)

Pull request description:

  This PR converts our Boost usage to header only. We switch from using our last remaining Boost lib (unit test), to using it's header-only implementation (see https://www.boost.org/doc/libs/1_78_0/libs/test/doc/html/boost_test/adv_scenarios/single_header_customizations/multiple_translation_units.html).

  Also related to #24291.

  Guix build:
  ```bash
  ```

ACKs for top commit:
  hebasto:
    re-ACK 5d399f9f3d
  MarcoFalke:
    approach ACK 5d399f9f3d 📞

Tree-SHA512: e60835ee9c11aa941a64679616da2002d6cd86e464895372fafdd42ad6499d7eb1dde6f0013c60adaeb97bd191198430cb158a7a7417b38080dd7106b28e3ba5
2022-02-14 10:04:17 +00:00
MarcoFalke
fd25d3493d
Merge bitcoin/bitcoin#24319: refactor: Avoid unsigned integer overflow in core_write
fa6065661a refactor: Avoid unsigned integer overflow in core_write (MarcoFalke)

Pull request description:

  Also, I find the new code a bit easier to understand.

ACKs for top commit:
  shaavan:
    Code Review ACK fa6065661a

Tree-SHA512: cd751e3b4dc97ef525eb8be8d0a49e9629389cb114df18d59a06e05388822af2939078e937f01494e6b317d601743b1a433ba47aa40c4dc602372d1f0fd0dc11
2022-02-14 10:08:38 +01:00
fanquake
39e66e938f
build: use header-only Boost unit test 2022-02-13 20:59:02 +00:00
Andrew Chow
2d7ea201fc
Merge bitcoin/bitcoin#24307: RPC: Return external_signer in getwalletinfo
b75f4c89ec RPC: Return external_signer in getwalletinfo (Kristaps Kaupe)

Pull request description:

  Add `external_signer` to the result object of `getwalletinfo` RPC which indicates whether `WALLET_FLAG_EXTERNAL_SIGNER` flag is set for the wallet.

ACKs for top commit:
  S3RK:
    utACK b75f4c89ec
  achow101:
    ACK b75f4c89ec
  prayank23:
    utACK b75f4c89ec
  brunoerg:
    utACK b75f4c89ec

Tree-SHA512: 066ccb97541fd4dc3d9728834645db714a3c8c93ccf29142811af4d79cfb9440a97bbb6c845434a909bc6e1775ef3737fcbb368c1f0582bc63973f6deb17a45f
2022-02-11 12:20:22 -05:00
MarcoFalke
fa6065661a
refactor: Avoid unsigned integer overflow in core_write 2022-02-11 17:21:44 +01:00
Kristaps Kaupe
b75f4c89ec
RPC: Return external_signer in getwalletinfo 2022-02-10 03:23:47 +02:00
MarcoFalke
fa2807ef19
test: Remove unused integer sanitizer suppressions 2022-02-09 21:26:25 +01:00
MarcoFalke
8ac79973f8
Merge bitcoin/bitcoin#24196: Fix integer sanitizer suppressions in validation.cpp
fac62056b5 Fix integer sanitizer suppressions in validation.cpp (MarcoFalke)

Pull request description:

  It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.

  Fix it with a refactor and remove the suppression.

ACKs for top commit:
  hebasto:
    ACK fac62056b5, I have reviewed the code and it looks OK, I agree it can be merged.
  prayank23:
    Code Review ACK fac62056b5

Tree-SHA512: efc5b9887cb2e207033b264ebf425bae5ff013e909701c049aea5d79a21f10495826e962d171b3d412717cbf0a4723e5124133b5401b35a73915212e85e91020
2022-02-09 08:30:38 +01:00
fanquake
87b5b002ad
Merge bitcoin/bitcoin#24259: test: Remove unused valgrind suppressions
fa4b61911d test: Remove unused valgrind suppressions (MarcoFalke)
faccb2d7fe test: Exclude broken feature_init for now (MarcoFalke)
fa086d891b test: Properly skip feature_syscall_sandbox in valgrind (MarcoFalke)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK fa4b61911d

Tree-SHA512: 5be1a8f288182d386531a033ae7258f753dd655dfa1746a52b65622a0359c2b7143a25b49c0747538308eed606a691847d2f59a5a0382b7751b8de7172adf0d3
2022-02-08 13:19:49 +00:00
MarcoFalke
eca694a4e7
Merge bitcoin/bitcoin#24239: test: fix ceildiv division by using integers
d1fab9d5d2 test: Call ceildiv helper with integer (Martin Zumsande)

Pull request description:

  On master,

  `assert_fee_amount(Decimal("0.00000993"), 217, Decimal("0.00004531"))` passes
  `assert_fee_amount(Decimal("0.00000993"), Decimal("217"), Decimal("0.00004531"))` fails.

  the reason is that the // operator in  `ceildiv(a,b) = -(-a//b)`  has a different behavior for Decimals, see [doc](https://docs.python.org/3/library/decimal.html#decimal-objects).

  `wallet_send.py` calls this function with Decimals, and I think this is the reason for the failure reported in the OP of #24151 (`wallet_send.py --legacy-wallet` line 332, the numbers used in the example above are from there). However, the other failures reported there cannot be explained by this, so this is just a partial fix.

ACKs for top commit:
  ryanofsky:
    Code review ACK d1fab9d5d2. Tracking down this problem was a good find, and code seems safer and easier to understand now

Tree-SHA512: 5bf0568cd1a0824f6b1a15a03580b6e9391b4f51112a97c1d00469d255bf6dda45c49a36fa567a5ba9b9973efe1d9cdd480db91965c9f4c2aa963629a8a32cba
2022-02-07 17:08:26 +01:00
MarcoFalke
9392e1350c
Merge bitcoin/bitcoin#24195: test: Fix failfast option for functional test runner
a036358994 test: Repair failfast option for test runner (Martin Zumsande)

Pull request description:

  Fixes #23990

  After #23799, the `--failfast` option in the test runner for the functional tests stopped working, because a second outer loop was introduced, which would have needed a `break` too for the test runner to fail immediately. This also led to the errors reported in #23990.

  This provides a straightforward fix for that.
  There is also #23995 which is a larger refactor, but that hasn't been updated in a while to fix the failfast issue.

ACKs for top commit:
  pg156:
    Tested ACK a036358994. I agree adding the `all_passed` flag to break out of the outer loop when needed makes sense. The "failfast" option works after this change.

Tree-SHA512: 3e2f775e36c13d180d32a05cd1cfe0883274e8615cdbbd4e069a9899e9b9ea1091066cf085e93f1c5326bd8ecc6ff524e0dad7c638f60dfdb169fefcdb26ee52
2022-02-07 16:57:50 +01:00
Martin Zumsande
d1fab9d5d2 test: Call ceildiv helper with integer
It returns an incorrect result when called with a Decimal,
for which the "//" operator works differently.
Also drop unnecessary call to satoshi_round.
2022-02-07 15:35:43 +01:00
MarcoFalke
fac62056b5
Fix integer sanitizer suppressions in validation.cpp 2022-02-07 15:20:36 +01:00
MarcoFalke
fa65f26f4d
Merge bitcoin/bitcoin#24237: test: Avoid testing negative block heights
fad81548fa test: Avoid testing negative block heights (MarcoFalke)

Pull request description:

  A negative chain height is only used to denote an empty chain, not the height of any block.

  So stop testing that and remove a suppression.

ACKs for top commit:
  brunoerg:
    crACK fad81548fa

Tree-SHA512: 0f9e91617dfb6ceda99831e6cf4b4bf0d951054957c159b1a05a178ab6090798fae7368edefe12800da24585bcdf7299ec3534f4d3bbf5ce6a6eca74dd3bb766
2022-02-07 14:03:56 +01:00
MarcoFalke
fa086d891b
test: Properly skip feature_syscall_sandbox in valgrind
Follow up to commit fa9c26ab3a
2022-02-04 16:33:05 +01:00
Kiminuo
41d7166c8a
refactor: replace boost::filesystem with std::filesystem
Warning: Replacing fs::system_complete calls with fs::absolute calls
in this commit may cause minor changes in behaviour because fs::absolute
no longer strips trailing slashes; however these changes are believed to
be safe.

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-02-03 18:35:52 +08:00
MarcoFalke
fad81548fa
test: Avoid testing negative block heights 2022-02-02 15:32:06 +01:00
MarcoFalke
219d728fcb
Merge bitcoin/bitcoin#24219: Fix implicit-integer-sign-change in bloom
fad84a2595 refactor: Fixup uint64_t-cast style in touched line (MarcoFalke)
fa041878de Fix implicit-integer-sign-change in bloom (MarcoFalke)

Pull request description:

  Signed values don't really make sense when using `std::vector::operator[]`.

  Fix that and remove the suppression.

ACKs for top commit:
  PastaPastaPasta:
    utACK fad84a2595
  theStack:
    Code-review ACK fad84a2595

Tree-SHA512: 7139dd9aa098c41e4af1b6e63dd80e71a92b0a98062d1676b01fe550ffa8e21a5f84a578afa7a536d70dad1b8a5017625e3a9e2dda6f864b452ec77b130ddf2a
2022-02-02 15:00:22 +01:00
MarcoFalke
a41976ab77
Merge bitcoin/bitcoin#24223: test: use MiniWallet for interface_rest.py
438e6f4c33 test: speedup interface_rest.py by whitelisting peers (immediate tx relay) (Sebastian Falbesoner)
11b9684dfd test: use MiniWallet for rest_interface.py (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (interface_rest.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in #20078.

  Note that the original test sent funds from one node to another and checked node's balances, but the state of a node's wallet is not relevant to any of the REST endpoints, i.e. the replacement is quite stright-forward. In an additional commit, the test is further sped up by using the good ol' immediate tx relay trick (parameter `-whitelist=noban@127.0.0.1`).

ACKs for top commit:
  brunoerg:
    ACK 438e6f4c33

Tree-SHA512: eac351c5fb7e043c36c193d51545f20f563be9aaa04f3429a2bfb452ae4aa72294d2552800d6cac55c9a3ec2b4f30bcda2abcd74736dec3ed75e7d83c5af437f
2022-02-02 09:07:54 +01:00
Andrew Chow
02e1d8d06f
Merge bitcoin/bitcoin#24083: Revert "Add to spends only transcations from me"
3ee6d0788e test: add more wallet conflicts assertions (S3RK)
3b98bf9c43 Revert "Add to spends only transcations from me" (S3RK)

Pull request description:

  This reverts commit d04566415e from #22929.

  This commit was based on invalid assumption that `mapTxSpends` should contain only outgoing txs and broke wallet conflicts feature.

ACKs for top commit:
  achow101:
    ACK 3ee6d0788e

Tree-SHA512: bf5a77ced6bac57d5eb85771d9189c53e1edc295d179ed5a1bdce18e365794a9101b4cecf35387b27f67260db3b47f7214e7876e490494529b748cceeb95632d
2022-02-01 14:46:11 -05:00
MarcoFalke
36f8e99d24
Merge bitcoin/bitcoin#24218: zmq: Fix implicit-integer-sign-change
fa2406a50a zmq: Fix implicit-integer-sign-change (MarcoFalke)

Pull request description:

  uint256::begin() returns unsigned data, so there is no reason to make it signed.

  Fix that and remove the sanitizer suppression.

ACKs for top commit:
  hebasto:
    ACK fa2406a50a
  PastaPastaPasta:
    utACK fa2406a50a, I have reviewed the code and think it makes sense

Tree-SHA512: 150ebcf3fdc3e0f60b6fd8e5fe638737b01e8a0863296bd545fb5ed17d33ab23b2ff94204996aa7b4617650b7383bd86ed2d2bf46746b410feae449de179a2bd
2022-02-01 10:18:53 +01:00
MarcoFalke
fcac16fff8
Merge bitcoin/bitcoin#24190: test: Fix sanitizer suppresions in streams_tests
faa630aa15 test: Fix sanitizer suppresions in streams_tests (MarcoFalke)

Pull request description:

  Two changes (that also make sense on their own) to remove the file-wide sanitizer suppression:

  * `FindByte` no longer takes a `char`, but an `uint8_t`, after commit 196b459920.
  * The `key` vector of unsigned chars can be removed and inlined as initializer-list. This avoids a bunch of verbose code like `clear()` and `push_back` of `char`s.

ACKs for top commit:
  PastaPastaPasta:
    utACK faa630aa15, I have reviewed the changes and agree it makes sense to merge

Tree-SHA512: 747b9d4676fad6d07f3955668639c93333625e69199ff4c499f01167de3875990d93db85e775a7f5b1b684575dceaec8aa000b4db15525fc47b699bac1c85e3d
2022-02-01 09:42:34 +01:00
Sebastian Falbesoner
438e6f4c33 test: speedup interface_rest.py by whitelisting peers (immediate tx relay)
By whitelisting the peers via -whitelist, the inventory is transmissioned
immediately rather than on average every 5 seconds, speeding up the test by at
least a factor of two:

before:
$ time ./interface_rest.py
...
0m14.82s real     0m01.44s user     0m01.19s system

with this commit:
$ time ./interface_rest.py
...
0m05.67s real     0m01.07s user     0m01.35s system
2022-01-31 22:56:34 +01:00
Sebastian Falbesoner
11b9684dfd test: use MiniWallet for rest_interface.py
This test can now be run even with the Bitcoin Core wallet disabled.
2022-01-31 22:47:40 +01:00
Martin Zumsande
bfcd60f5d5 test: activate all index types in feature_init.py 2022-01-31 21:21:39 +01:00
MarcoFalke
8f137e69ca
Merge bitcoin/bitcoin#24192: test: Fix feature_init intermittent issues
fa7b07571f test: Fix feature_init intermittent issues (MarcoFalke)
fa4595deb3 test: Remove random line number feature from feature_init.py (MarcoFalke)

Pull request description:

  The test doesn't work currently because the log might be finalized before `wait_for_debug_log` is started, in which case it will assume the log is empty and fail to detect any line.

  Fix this by calling `wait_for_debug_log` first. Fixes #24060.

  Also, remove the "random line number" part of the test, because it doesn't really test anything novel. `wait_for_debug_log` is inherently racy, so will randomly terminate at the exact point or later. So the randomization is already sufficiently covered.

ACKs for top commit:
  jamesob:
    ACK fa7b07571f
  mzumsande:
    Code Review ACK fa7b07571f

Tree-SHA512: f107a04926270a1d9ac8f53b6e5254566d1827ba7d27fd74f9ce909319f8794f8bd46da9c42256bf41b6df26c0bad8b9a0d54e4e148695189af09f31e3948330
2022-01-31 18:05:01 +01:00
MarcoFalke
fa041878de
Fix implicit-integer-sign-change in bloom 2022-01-31 17:23:54 +01:00
MarcoFalke
fa2406a50a
zmq: Fix implicit-integer-sign-change 2022-01-31 16:53:12 +01:00
MarcoFalke
fa7b07571f
test: Fix feature_init intermittent issues 2022-01-31 10:10:25 +01:00
MarcoFalke
fa4595deb3
test: Remove random line number feature from feature_init.py
This is needed for the next commit.

Also, it doesn't really test anything novel. wait_for_debug_log is
inherently racy, so will randomly terminate at the exact point or later.
So the randomization is already sufficiently covered by the existing
test.
2022-01-31 10:09:11 +01:00
MarcoFalke
1111d33532
refactor: Make MessageBoxFlags enum underlying type unsigned 2022-01-31 09:27:12 +01:00
MarcoFalke
b25a752dfd
Merge bitcoin/bitcoin#24146: Avoid integer sanitizer warnings in chain.o
fa832103aa Avoid integer sanitizer warnings in chain.o (MarcoFalke)

Pull request description:

  The two changes make the code more self-documenting and also allow to remove 5 file-wide suppressions for the module

ACKs for top commit:
  PastaPastaPasta:
    utACK fa832103aa
  jonatack:
    ACK fa832103aa

Tree-SHA512: d32a06099c56eed9f69130a3209f989872acc593f849528acd7746ee6caa96688cc32de37e8e59ad5d25dcb8912e341f1a43e50642dadeff6ca7624d0873ad10
2022-01-31 09:23:54 +01:00
brunoerg
58ccc88541 lint: add creat and ba into ignore-words for lint-spelling 2022-01-30 16:16:18 -03:00
Martin Zumsande
a036358994 test: Repair failfast option for test runner 2022-01-28 15:46:51 +01:00
MarcoFalke
1245c62fef
Merge bitcoin/bitcoin#24139: Avoid unsigned integer overflow in bitcoin-tx
faa75fa193 Avoid unsigned integer overflow in bitcoin-tx (MarcoFalke)

Pull request description:

  While `npos` means "largest unsigned value" and adding `1` to it yields `0`, it may be clearer to just assign `0` to it and only increment otherwise.

  This also allows to remove a file-wide suppression for `unsigned-integer-overflow`.

ACKs for top commit:
  hebasto:
    ACK faa75fa193, I have reviewed the code and it looks OK, I agree it can be merged.
  theStack:
    Code-review ACK faa75fa193

Tree-SHA512: c24436641e5d801341c948b812c7f711d5dff70efdf04af00fd3221f4b81d93f25608dddaa36230ba81ca7ab0d18bdd957095d4561e22621e4d69017934f0a16
2022-01-28 15:26:24 +01:00
MarcoFalke
faa630aa15
test: Fix sanitizer suppresions in streams_tests 2022-01-28 10:23:42 +01:00
MarcoFalke
d4e92d8436
Merge bitcoin/bitcoin#23508: Add getdeploymentinfo RPC
a380922891 Release notes for getdeploymentinfo rpc (Anthony Towns)
240cad09ba rpc: getdeploymentinfo: include signalling info (Anthony Towns)
376c0c6dae rpc: getdeploymentinfo: include block hash/height (Anthony Towns)
a7469bcd35 rpc: getdeploymentinfo: change stats to always refer to current period (Anthony Towns)
7f15c1841b rpc: getdeploymentinfo: allow specifying a blockhash other than tip (Anthony Towns)
fd826130a0 rpc: move softfork info from getblockchaininfo to getdeploymentinfo (Anthony Towns)

Pull request description:

  The aim of this PR is to improve the ability to monitor soft fork status. It first moves the softfork section from getblockchaininfo into a new RPC named getdeploymentinfo, which is then also able to query the status of forks at an arbitrary block rather than only at the tip. In addition, bip9 status is changed to indicate the status of the given block, rather than just for the next block, and an additional field is included to indicate whether each block in the signalling period signaled.

ACKs for top commit:
  laanwj:
    Code review and lightly tested ACK a380922891
  Sjors:
    tACK a380922891
  fjahr:
    tACK a380922891

Tree-SHA512: 7417d733b47629f229c5128586569909250481a3e94356c52fe67a03fd42cd81745246e384b98c4115fb61587714c879e4bc3e5f5c74407d9f8f6773472a33cb
2022-01-28 08:46:03 +01:00
Andrew Chow
3d223712d3
Merge bitcoin/bitcoin#16795: rpc: have raw transaction decoding infer output descriptors
6498ba151b transaction decoding infer output descriptors (Gregory Sanders)

Pull request description:

  Following discussion in #16725 this is complementary data to expose. All outputs are inferred.

ACKs for top commit:
  achow101:
    ACK 6498ba151b
  meshcollider:
    utACK 6498ba151b

Tree-SHA512: 36664117ddbe46d5fdde7ed6541ef2c9d8dfb7a3636b97f363bf1c325096fe00d9d2acea2d1917ea19fdb82f1ea296c12e440c5c703d6a9bfc1a02fba028bcd8
2022-01-26 17:52:51 -05:00
MarcoFalke
2935bd9d67
Merge bitcoin/bitcoin#24113: test, bugfix: fix intermittent failure in getrawtransaction_tests
449dffc610 test, bugfix: fix intermittent failure in getrawtransaction_tests (Jon Atack)

Pull request description:

  Easiest to review with `colorMoved = dimmed-zebra` and `colorMovedWs = allow-indentation-change`.

  Resolves #23991

Top commit has no ACKs.

Tree-SHA512: a50c597857e45c52dae1b6fc5988ea077c09f2b32ffe3605f0c64bd780f5dd2635755cb26c4981233bf925c5ea9f7310163349a549239dc85657558f253ffb7b
2022-01-26 11:04:17 +01:00
MarcoFalke
dd405add6e
Merge bitcoin/bitcoin#24154: test: add functional test for -maxtipage parameter
75656adfd2 test: add functional test for `-maxtipage` parameter (Sebastian Falbesoner)

Pull request description:

  This PR adds a missing test for the `-maxtipage` parameter which controls what is the allowed maximum tip age for leaving IBD:
  792d0d8d51/src/init.cpp (L540)

  Relevant code path in the `CChainState::IsInitialBlockDownload` method:
  792d0d8d51/src/validation.cpp (L1479-L1480)

  The test is pretty simple and should be self-explanatory.

ACKs for top commit:
  MarcoFalke:
    review ACK 75656adfd2

Tree-SHA512: 0a10dca13cb18c29e64fc8412f4c8f2bcaff1bab8645bd85266c242ba88ce036a150c03cbbe9810c3bb44649810af0aa9cb3584dbae886a7bdb16b72150d08de
2022-01-26 07:36:07 +01:00
fanquake
01beb46f8d
Merge bitcoin/bitcoin#24153: test: remove unused sanitizer suppressions
fa3bdbd37b test: remove unused sanitizer suppressions (MarcoFalke)

Pull request description:

  Looks like those are not needed (anymore)

ACKs for top commit:
  fanquake:
    ACK fa3bdbd37b

Tree-SHA512: 4bedb6363aba8ea7763291ee0cd074e6bfd77e691bb32999c3959393864dc396bacba1eced2b10d9d600b66e8b83b91f7bc6692331dbd113bbaa87e72d11e2e8
2022-01-26 10:13:57 +08:00
Gregory Sanders
6498ba151b transaction decoding infer output descriptors 2022-01-26 09:56:51 +08:00
Andrew Chow
e30b6ea194
Merge bitcoin/bitcoin#24067: wallet: Actually treat (un)confirmed txs as (un)confirmed
fac8165443 Remove unused checkFinalTx (MarcoFalke)
fa272eab44 wallet: Avoid dropping confirmed coins (MarcoFalke)
888841ea8d interfaces: Remove unused is_final (MarcoFalke)
dddd05e7a3 qt: Treat unconfirmed txs as unconfirmed (MarcoFalke)

Pull request description:

  The wallet has several issues:

  ## Unconfirmed txs in the GUI

  The GUI clumsily attempts to guess if unconfirmed txs are locked until a future time. This is currently based on the locktime only, not nSequence, thus wrong. Fix this by removing the clumsy code and treat all unconfirmed txs as unconfirmed. The GUI already prints whether a tx is in the mempool, in which case the user knows that the tx wasn't locked until a future time. If the tx is not in the mempool, it might be better to report the exact reject reason from the mempool instead of using incorrect heuristics.

  ## Confirmed txs in the wallet

  The wallet drops coins that it incorrectly assumes to be locked until a future time, even if they are already confirmed in the chain. This is because the wallet is using the wrong time (adjusted network time) instead of MTP, due to the `-1` default argument of `CheckFinalTx`.

  The issues are fixed in separate commits and there is even a test.

ACKs for top commit:
  achow101:
    ACK fac8165443
  prayank23:
    reACK fac8165443
  glozow:
    code review ACK fac8165443, I understand now how this fixes both issues.

Tree-SHA512: 210afb855f4c6d903fee49eba6b1a9735d699cf0168b669eabb38178e53b3a522258b7cc669f52489c6cd3e38bf358afde12eef3ba2e2f2ffaeb06b8f652ccd0
2022-01-25 16:17:51 -05:00
MarcoFalke
39d9bbe4ac
Merge bitcoin/bitcoin#23706: rpc: getblockfrompeer followups
923312fbf6 rpc: use peer_id, block_hash for FetchBlock (Sjors Provoost)
34d5399211 rpc: more detailed errors for getblockfrompeer (Sjors Provoost)
60243cac72 rpc: turn already downloaded into error in getblockfrompeer (Sjors Provoost)
809d66bb65 rpc: clarify getblockfrompeer behavior when called multiple times (Sjors Provoost)
0e3d7c5ee1 refactor: drop redundant hash argument from FetchBlock (Sjors Provoost)
8d1a3e6498 rpc: allow empty JSON object result (Sjors Provoost)
bfbf91d0b2 test: fancier Python for getblockfrompeer (Sjors Provoost)

Pull request description:

  Followups from #20295.

ACKs for top commit:
  jonatack:
    ACK 923312fbf6 📦
  fjahr:
    tested ACK 923312fbf6

Tree-SHA512: da9eca76e302e249409c9d7f0d16cca668ed981e2ab6ca2d1743dad0d830b94b1bc5ffb9028a00764b863201945c273cc8f4409a4c9ca3817830007dffa2bc20
2022-01-25 18:48:41 +01:00
laanwj
b94d0c7af1
Merge bitcoin/bitcoin#23201: wallet: Allow users to specify input weights when funding a transaction
3866272c45 tests: Test specifying input weights (Andrew Chow)
6fa762a372 rpc, wallet: Allow users to specify input weights (Andrew Chow)
808068e90e wallet: Allow user specified input size to override (Andrew Chow)
4060c50d7e wallet: add input weights to CCoinControl (Andrew Chow)

Pull request description:

  When funding a transaction with external inputs, instead of providing solving data, a user may want to just provide the maximum signed size of that input. This is particularly useful in cases where the input is nonstandard as our dummy signer is unable to handle those inputs.

  The input weight can be provided to any input regardless of whether it belongs to the wallet and the provided weight will always be used regardless of any calculated input weight. This allows the user to override the calculated input weight which may overestimate in some circumstances due to missing information (e.g. if the private key is not known, a maximum size signature will be used, but the actual signer may be doing additional work which reduces the size of the signature).

  For `send` and `walletcreatefundedpsbt`, the input weight is specified in a `weight` field in an input object. For `fundrawtransaction`,  a new `input_weights` field is added to the `options` object. This is an array of objects consisting of a txid, vout, and weight.

  Closes #23187

ACKs for top commit:
  instagibbs:
    reACK 3866272c45
  glozow:
    reACK 3866272 via range-diff
  t-bast:
    ACK 3866272c45

Tree-SHA512: 2c8b471ee537c62a51389b7c4e86b5ac1c3a223b444195042be8117b3c83e29c0619463610b950cbbd1648d3ed01ecc5bb0b3c4f39640680da9157763b9b9f9f
2022-01-25 17:51:05 +01:00