Commit Graph

34487 Commits

Author SHA1 Message Date
S3RK
25e4762ae7 wallet: more accurate tx_noinputs_size 2022-06-29 09:02:20 +02:00
MacroFake
72d6469ab4
Merge bitcoin/bitcoin#25496: build: Clean up build_msvc/libsecp256k1_config.h
1d1546e4c2 build: Clean up `build_msvc/libsecp256k1_config.h` (Hennadii Stepanov)

Pull request description:

  Unused since bitcoin/bitcoin#19944:
  - `USE_FIELD_10X26`
  - `USE_FIELD_5X52`
  - `USE_SCALAR_4X64`
  - `USE_SCALAR_8X32`

  Unused since bitcoin/bitcoin#20147:
  - `USE_ENDOMORPHISM`

  Unused since bitcoin/bitcoin#21573:
  - `USE_FIELD_INV_BUILTIN`
  - `USE_FIELD_INV_NUM`
  - `USE_NUM_GMP`
  - `USE_NUM_NONE`
  - `USE_SCALAR_INV_BUILTIN`
  - `USE_SCALAR_INV_NUM`

ACKs for top commit:
  sipa:
    utACK 1d1546e4c2 (if CI is happy)

Tree-SHA512: 7c4946c1bddd86cb71ea5c881aca94c1e4be3fc7ebd26962f025c65acdff65937e8c51ff6e87a89f9c0c0c59fef8285fc16f63b912ce2a4e76f8ca01fd4c4522
2022-06-29 07:11:29 +02:00
Hennadii Stepanov
1b4d660a34
Merge bitcoin-core/gui#617: Reset options, notify user about backup creation
ac4fb3bbbe gui: reset options, notify user about the backup creation (furszy)

Pull request description:

  Quick follow-up to first point of https://github.com/bitcoin-core/gui/pull/602#pullrequestreview-1002780997

ACKs for top commit:
  ryanofsky:
    Code review ACK ac4fb3bbbe, just fixing displayed backup directory since last review
  jarolrod:
    tACK ac4fb3bbbe

Tree-SHA512: cfeca5cd6d6d3d69bbd81211cf1bfd490de13ac96bf53be081a5ceb88611afa57dff2be35f8e0a41b1088b7b892f75a21a9abf47f2e1d77e9e316467eb7c12be
2022-06-29 00:35:06 +02:00
Hennadii Stepanov
1d1546e4c2
build: Clean up build_msvc/libsecp256k1_config.h
Unused since bitcoin/bitcoin#19944:
- `USE_FIELD_10X26`
- `USE_FIELD_5X52`
- `USE_SCALAR_4X64`
- `USE_SCALAR_8X32`

Unused since bitcoin/bitcoin#20147:
- `USE_ENDOMORPHISM`

Unused since bitcoin/bitcoin#21573:
- `USE_FIELD_INV_BUILTIN`
- `USE_FIELD_INV_NUM`
- `USE_NUM_GMP`
- `USE_NUM_NONE`
- `USE_SCALAR_INV_BUILTIN`
- `USE_SCALAR_INV_NUM`
2022-06-28 23:48:49 +02:00
fanquake
480d8069d7
Merge bitcoin/bitcoin#24924: bench: Make WalletLoading benchmark run faster
e673d8b475 bench: Enable loading benchmarks depending on what's compiled (Andrew Chow)
4af3547eba bench: Use mock wallet database for wallet loading benchmark (Andrew Chow)
49910f255f sqlite: Use in-memory db instead of temp for mockdb (Andrew Chow)
a1080802f8 walletdb: Create a mock database of specific type (Andrew Chow)
7c0d34476d bench: reduce the number of txs in wallet for wallet loading bench (Andrew Chow)
f85b54ed27 bench: Add transactions directly instead of mining blocks (Andrew Chow)
d94244c4bf bench: reduce number of epochs for wallet loading benchmark (Andrew Chow)
817c051364 bench: use unsafesqlitesync in wallet loading benchmark (Andrew Chow)
9e404a9831 bench: Remove minEpochIterations from wallet loading benchmark (Andrew Chow)

Pull request description:

  `minEpochIterations` is probably unnecessary to set, so removing it makes the runtime much faster.

ACKs for top commit:
  Rspigler:
    tACK e673d8b475
  furszy:
    Code review ACK e673d8b4, nice PR.
  glozow:
    Concept ACK e673d8b475. For each commit, verified that there was a performance improvement without negating the purpose of the bench, and made some effort to verify that the code is correct.

Tree-SHA512: 9337352ef846cf18642d5c14546c5abc1674b4975adb5dc961a1a276ca91f046b83b7a5e27ea6cd26264b96ae71151e14055579baf36afae7692ef4029800877
2022-06-28 18:34:10 +01:00
fanquake
2364d17a31
Merge bitcoin/bitcoin#25480: Replace CountSecondsDouble with Ticks<SecondsDouble>
fa956e7508 Replace CountSecondsDouble with Ticks<SecondsDouble> (MacroFake)

Pull request description:

  Seems odd to have two ways to say exactly the same thing when one is sufficient.

ACKs for top commit:
  fanquake:
    ACK fa956e7508
  shaavan:
    ACK fa956e7508
  w0xlt:
    ACK fa956e7508

Tree-SHA512: b599470e19b693da1ed1102d1e86b08cb03adaddf2048752b6d050fdf86055be117ff0ae10b6953d03e00eaaf7b0cfa350137968b67d6c5b3ca68c5aa50ca6aa
2022-06-28 18:18:19 +01:00
fanquake
bace615ba3
Merge bitcoin/bitcoin#24565: Remove LOCKTIME_MEDIAN_TIME_PAST constant
fa1fe2e500 Remove LOCKTIME_MEDIAN_TIME_PAST constant (MarcoFalke)

Pull request description:

  The constant is exposed in policy code, which doesn't make sense:
  * Wallet and mempool need to assume the flag to be always active to function properly.
  * Setting (or unsetting) the flag has no effect on policy code.

  The constant is only used in `ContextualCheckBlock` (consensus code) to set a flag and then read the flag again. I think this can be better achieved by using a `bool`. If there is a need to use a flag in the future, it will be trivial to do so then.

  (The previous use for the constant was removed in df562d698a)

ACKs for top commit:
  Sjors:
    utACK fa1fe2e500
  glozow:
    code review ACK fa1fe2e500, AFAICT this is safe and makes sense as `SequenceLocks` doesn't use it, wallet/ATMP no longer need it since #24080, and `ContextualCheckBlock` effectively uses it as a roundabout boolean.
  instagibbs:
    utACK fa1fe2e500

Tree-SHA512: de1972498c545d608a09630d77d8c7e38ed50a6ec40d6c0d720310a1647ed5b48b4ace0078c80db10e7f97aacc552fffae251fe3256e9a19a908b933ba2dc552
2022-06-28 18:16:53 +01:00
laanwj
5bf65ec66e
Merge bitcoin/bitcoin#22558: psbt: Taproot fields for PSBT
b80de4c505 test: Test signing psbts without explicitly having scripts (Andrew Chow)
a73b56888a wallet: also search taproot pubkeys in FillPSBT (Andrew Chow)
6cff82722f sign: Use sigdata taproot spenddata when signing (Andrew Chow)
5f12fe3f36 psbt: Implement merge for Taproot fields (Andrew Chow)
1ece9a3715 psbt, test: Check for taproot fields in taproot psbt test (Andrew Chow)
496a1bbe5e taproot: Use pre-existing signatures if available (Andrew Chow)
0ad21e7c55 tests: Test taproot fields for PSBT (Andrew Chow)
103c6fd279 psbt: Remove non_witness_utxo for segwit v1+ (Andrew Chow)
7dccdd3157 Implement decodepsbt for Taproot fields (Andrew Chow)
ac7747585f Fill PSBT Taproot output data to/from SignatureData (Andrew Chow)
25b6ae46e7 Assert that TaprootBuilder is Finalized during GetSpendData (Andrew Chow)
3ae5b6af21 Store TaprootBuilder in SigningProviders instead of TaprootSpendData (Andrew Chow)
4d1223e512 Fetch key origins for Taproot keys (Andrew Chow)
52e3f2f88e Fill PSBT Taproot input data to/from SignatureData (Andrew Chow)
05e2cc9a30 Implement de/ser of PSBT's Taproot fields (Andrew Chow)
d557eff2ad Add serialization methods to XOnlyPubKey (Andrew Chow)
d43923c381 Add TaprootBuilder::GetTreeTuples (Andrew Chow)
ce911204e4 Move individual KeyOriginInfo de/ser to separate function (Andrew Chow)

Pull request description:

  Implements the Taproot fields for PSBT described in [BIP 371](https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki).

ACKs for top commit:
  laanwj:
    Code review ACK b80de4c505

Tree-SHA512: 50b79bb44f353c9ec2ef4c98aac08a81eba560987e5264a5684caa370e9c4e7a8255c06747fc47749511be45b32d01492e015f92b82be8d22bc8bf192073bd26
2022-06-28 16:44:03 +02:00
furszy
ac4fb3bbbe
gui: reset options, notify user about the backup creation 2022-06-28 10:29:08 -03:00
laanwj
55c9e2d790
Merge bitcoin/bitcoin#24378: refactor: make bind() and listen() mockable/testable
b2733ab6a8 net: add new method Sock::Listen() that wraps listen() (Vasil Dimov)
3ad7de225e net: add new method Sock::Bind() that wraps bind() (Vasil Dimov)

Pull request description:

  _This is a piece of #21878, chopped off to ease review._

  Add new methods `Sock::Bind()` and `Sock::Listen()` that wrap `bind()` and `listen()`.
  This will help to increase `Sock` usage and make more code mockable.

ACKs for top commit:
  pk-b2:
    ACK b2733ab6a8
  laanwj:
    Code review ACK b2733ab6a8

Tree-SHA512: c6e737606703e2106fe60cc000cfbbae3a7f43deadb25f70531e2cac0457e0b0581440279d14c76c492eb85c12af4adde52c30baf74542c41597e419817488e8
2022-06-28 15:10:00 +02:00
laanwj
ba29911e21
Merge bitcoin/bitcoin#25426: net: add new method Sock::GetSockName() that wraps getsockname() and use it in GetBindAddress()
a8d6abba5e net: change GetBindAddress() to take Sock argument (Vasil Dimov)
748dbcd9f2 net: add new method Sock::GetSockName() that wraps getsockname() (Vasil Dimov)

Pull request description:

  _This is a piece of #21878, chopped off to ease review._

  Wrap the syscall `getsockname()` in `Sock::GetSockName()` and change `GetBindAddress()` to take a `Sock` argument so that it can use the wrapper.

  This further encapsulates syscalls inside the `Sock` class and makes the callers mockable.

ACKs for top commit:
  laanwj:
    Code review ACK a8d6abba5e

Tree-SHA512: 3a73463258c0057487fb3fd67215816b03a1c5160f45e45930eaeef86bb3611ec385794cdb08339aa074feba8ad67cd2bfd3836f6cbd40834e15d933214a05dc
2022-06-28 13:40:05 +02:00
fanquake
1b5610852e
Merge bitcoin/bitcoin#25488: doc: Fix typo in macdeploy
e410144fc4 doc: Fix typo in macdeploy (Jeremy Rand)

Pull request description:

  The text of the link used an underscore, while the URL used a space.  The latter is correct; the former yields zero results on Apple's website.

ACKs for top commit:
  shaavan:
    ACK e410144fc4

Tree-SHA512: b242aa7a9e93cf2609f13247d6efe2a5ec9c8b20c95b11a4c22e98be1afd4beba49041d397432ddbfeeeb6b95a2be23db8a3bbe3bce088eb402c7947e64f6ffd
2022-06-28 10:14:29 +01:00
MacroFake
78957e71e8
Merge bitcoin/bitcoin#25486: test: fix failing test interface_usdt_utxocache.py
f665c6ecda test: fix failing test interface_usdt_utxocache.py (Sebastian Falbesoner)

Pull request description:

  The `from_node` argument doesn't exist anymore for `MiniWallet.create_self_transfer` since PR #25435 (commit fa8421bc5b), leading to an error on master:

  ```
  $ sudo ./test/functional/interface_usdt_utxocache.py
  2022-06-27T17:45:35.585000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_7s1djjo1
  2022-06-27T17:45:36.515000Z TestFramework (INFO): testing the utxocache:uncache tracepoint API
  2022-06-27T17:45:36.517000Z TestFramework (ERROR): Unexpected exception caught during testing
  Traceback (most recent call last):
    File "/home/honeybadger/bitcoin/test/functional/test_framework/test_framework.py", line 133, in main
      self.run_test()
    File "/home/honeybadger/bitcoin/./test/functional/interface_usdt_utxocache.py", line 149, in run_test
      self.test_uncache()
    File "/home/honeybadger/bitcoin/./test/functional/interface_usdt_utxocache.py", line 172, in test_uncache
      invalid_tx = self.wallet.create_self_transfer(
  TypeError: create_self_transfer() got an unexpected keyword argument 'from_node'
  2022-06-27T17:45:36.568000Z TestFramework (INFO): Stopping nodes
  [...]
  ```
  Fix this by removing the argument. (Unfortunately, the USDT tests don't seem to run on any CI target, I guess that's due to missing permissions to hook into the kernel.)

ACKs for top commit:
  MarcoFalke:
    cr ACK f665c6ecda

Tree-SHA512: 74f8e398739a25ab5518ff71b998d03d4e529a786ba5b424509de81a511ad3e2e1cd38a5b7bb9f1f5a21340391d6807f4951ff39fa3a2ad65a3b11b989eebea6
2022-06-28 08:31:20 +02:00
MacroFake
ee3ba5a76f
Merge bitcoin/bitcoin#25485: rpc: Use enum instead of string for filtertype_name
baf4efe02f rpc: use enum instead of string for filter type (w0xlt)

Pull request description:

  This PR changes the `getblockfilter` RPC to use `BlockFilterType` enum instead of a repeated string for `filtertype_name`.

ACKs for top commit:
  furszy:
    ACK baf4efe0
  brunoerg:
    ACK baf4efe02f

Tree-SHA512: 31c79c0a5f0b17fd69b399bb026f523003b656733d6b7d5ffe665921a8cc0f1e0334d2e465145cd89fbd85e196059cf56f4f11563bbc92948b0606080ca76524
2022-06-28 08:17:32 +02:00
Jeremy Rand
e410144fc4
doc: Fix typo in macdeploy
The text of the link used an underscore, while the URL used a space.
The latter is correct; the former yields zero results on Apple's
website.
2022-06-28 03:37:18 +00:00
Andrew Chow
b80de4c505 test: Test signing psbts without explicitly having scripts 2022-06-27 16:48:04 -04:00
Andrew Chow
a73b56888a wallet: also search taproot pubkeys in FillPSBT
When filling a PSBT, we search the listed pubkeys in order to determine
whether the current DescriptorScriptPubKeyMan could sign the transaction
even if it is not watching the scripts. With Taproot, the taproot
pubkeys need to be searched as well.
2022-06-27 16:47:48 -04:00
Andrew Chow
6cff82722f sign: Use sigdata taproot spenddata when signing
The taproot spenddata stored in a sigdata is the combination of data
existing previously (e.g. in a PSBT) and the data stored in a
SigningProvider. In order to use the external data when signing, we need
to be using the sigdata's spenddata.
2022-06-27 16:47:48 -04:00
Andrew Chow
5f12fe3f36 psbt: Implement merge for Taproot fields 2022-06-27 16:47:48 -04:00
Andrew Chow
1ece9a3715 psbt, test: Check for taproot fields in taproot psbt test 2022-06-27 16:47:48 -04:00
Andrew Chow
496a1bbe5e taproot: Use pre-existing signatures if available
Actually use pre-existing signatures in CreateTaprootScriptSig if a
signature is found for the given key and leaf hash.
2022-06-27 16:47:48 -04:00
Andrew Chow
0ad21e7c55 tests: Test taproot fields for PSBT 2022-06-27 16:47:48 -04:00
Andrew Chow
103c6fd279 psbt: Remove non_witness_utxo for segwit v1+
If all inputs are segwit v1+, the non_witness_utxos can be removed.
2022-06-27 16:47:48 -04:00
Andrew Chow
7dccdd3157 Implement decodepsbt for Taproot fields 2022-06-27 16:47:48 -04:00
Andrew Chow
ac7747585f Fill PSBT Taproot output data to/from SignatureData 2022-06-27 16:47:48 -04:00
Andrew Chow
25b6ae46e7 Assert that TaprootBuilder is Finalized during GetSpendData
GetSpendData needs to be finalized in order to be used. To avoid future
bugs, assert `!m_output_key.IsNull()` as m_output_key is only set during
Finalize.
2022-06-27 16:47:48 -04:00
Andrew Chow
3ae5b6af21 Store TaprootBuilder in SigningProviders instead of TaprootSpendData
TaprootSpendData can be gotten from TaprootBuilder, however for PSBT, we
also need TaprootBuilders directly (for the outputs). So we store the
TaprootBuilder in the FlatSigningProvider and when the TaprootSpendData
is needed, we generate it on the fly using the stored builder.
2022-06-27 16:47:48 -04:00
Andrew Chow
4d1223e512 Fetch key origins for Taproot keys 2022-06-27 16:47:48 -04:00
Andrew Chow
52e3f2f88e Fill PSBT Taproot input data to/from SignatureData 2022-06-27 16:47:48 -04:00
Andrew Chow
05e2cc9a30 Implement de/ser of PSBT's Taproot fields 2022-06-27 16:47:48 -04:00
Andrew Chow
d557eff2ad Add serialization methods to XOnlyPubKey
It is useful to have serialzation methods for XOnlyPubKey. These will
serialize the internal uint256, so it is not prefixed with the length as
CPubKey does.
2022-06-27 16:47:48 -04:00
Andrew Chow
d43923c381 Add TaprootBuilder::GetTreeTuples
GetTreeTuples returns the leaves in DFS order as tuples of depth, leaf
version, and script. This is a representation of the tree that can be
serialized.
2022-06-27 16:47:48 -04:00
Andrew Chow
ce911204e4 Move individual KeyOriginInfo de/ser to separate function
To make it easier to de/serialize individual KeyOriginInfo for PSBTs,
separate the actual de/serialization of KeyOriginInfo to its own
function.

This is an additional separation where any length prefix is processed by
the caller.
2022-06-27 16:47:48 -04:00
Sebastian Falbesoner
f665c6ecda test: fix failing test interface_usdt_utxocache.py
The `from_node` argument doesn't exist anymore for
`MiniWallet.create_self_transfer` since PR #25435 (commit
fa8421bc5b).
2022-06-27 19:40:28 +02:00
w0xlt
baf4efe02f rpc: use enum instead of string for filter type 2022-06-27 14:33:10 -03:00
fanquake
2111f32f2a
Merge bitcoin/bitcoin#25483: Revert "ci: Increase CPU number for "Win64 native" task"
b1d2fb4ceb Revert "ci: Increase CPU number for "Win64 native" task" (Hennadii Stepanov)

Pull request description:

  This reverts commit 849cf967a3.

  It seems this should [improve](https://github.com/bitcoin/bitcoin/pull/25460#discussion_r907268911) the total CI throughput.

ACKs for top commit:
  MarcoFalke:
    review ACK b1d2fb4ceb

Tree-SHA512: 833665bbea00b695dd1c600c6a47943d47b1a2a3560886b2056544cf62542d6f91b1f2e157ad082b02b67922f1fff14029da35b1a9d85339c2bf526f41b41836
2022-06-27 15:09:17 +01:00
fanquake
2fe27029f5
Merge bitcoin/bitcoin#25404: p2p, doc: Use MAX_BLOCKS_TO_ANNOUNCE consistently
e357c89538 p2p, doc: Use MAX_BLOCKS_TO_ANNOUNCE consistently (Martin Zumsande)

Pull request description:

  Block announcements via headers may have up to `MAX_BLOCKS_TO_ANNOUNCE = 8` entries according to the definition of this constant.
  However, there are a few spots saying they should have a size _less than_ `MAX_BLOCKS_TO_ANNOUNCE`. Fix these.
  I don't think that this is critical (this only changes behavior when we get a headers announcement with exactly `MAX_BLOCKS_TO_ANNOUNCE` blocks which we can't connect), but it would be nice to handle this limit consistently.

ACKs for top commit:
  dergoegge:
    utACK e357c89538 - This PR makes the usage and docs of `MAX_BLOCKS_TO_ANNOUNCE` consistent with its description.

Tree-SHA512: f3772026ab0f402e3a551127ef6e4a98fa9e7af250715fe317c05988b5b33f2f3e098a00e03960d4d28c8bd2b7a97231f7f99f22f1c152c000b2e27b658cf8f2
2022-06-27 14:21:49 +01:00
MacroFake
c8261026a4
Merge bitcoin/bitcoin#25445: test: Return new_utxo from create_self_transfer in MiniWallet
fa83c0c44f test: Remove unused call to generate in rpc_mempool_info (MacroFake)
fa13375aa3 test: Sync MiniWallet utxo state after each generate call (MacroFake)
dddd7c4d39 test: Drop spent utxos in MiniWallet scan_tx (MacroFake)
fa04ff61b6 test: Return new_utxos from create_self_transfer_multi in MiniWallet (MacroFake)
fa34e44e98 test: Return new_utxo from create_self_transfer in MiniWallet (MacroFake)

Pull request description:

  I need this for some stuff, but it also makes sense on its own to:

  * unify the flow with a private `_create_utxo` helper
  * simplify the flow by giving the caller ownership of the utxo right away

ACKs for top commit:
  kouloumos:
    re-ACK fa83c0c44f 🚀

Tree-SHA512: 381f0e814864ba207363a56859a6c0519e4a86d0562927f16a610a5b706c9fc942c1b5e93388cda0fa0b3cacd58f55bc2ffcc60355858a580263e5bef33c2f4b
2022-06-27 14:50:45 +02:00
Hennadii Stepanov
b1d2fb4ceb
Revert "ci: Increase CPU number for "Win64 native" task"
This reverts commit 849cf967a3.
2022-06-27 14:01:08 +02:00
MacroFake
50a3921c96
Merge bitcoin/bitcoin#25144: refactor: Pass Peer& to Misbehaving()
fa8aa0aa81 Pass Peer& to Misbehaving() (MacroFake)

Pull request description:

  `Misbehaving` has several coding related issues (ignoring the conceptual issues here for now):
  * It is public, but it is not supposed to be called from outside of net_processing. Fix that by making it private and creating a public `UnitTestMisbehaving` method for unit testing only.
  * It doesn't do anything if a `nullptr` is passed. It would be less confusing to just skip the call instead. Fix that by passing `Peer&` to `Misbehaving()`.
  * It calls `GetPeerRef`, causing `!m_peer_mutex` lock annotations to be propagated. This is harmless, but verbose. Fix it by removing the no longer needed call to `GetPeerRef` and the no longer needed lock annotations.

ACKs for top commit:
  vasild:
    ACK fa8aa0aa81
  w0xlt:
    Code Review ACK fa8aa0aa81

Tree-SHA512: e60a6b317f2b826f9e0724285d00b632d3e2a91ded9fa5ba01c80766c5d39270b719be234c01302d46eaba600910032693836aa116ff05ee1b590c7530881cd3
2022-06-27 11:21:08 +02:00
laanwj
fffff0abb9
Merge bitcoin/bitcoin#25436: build: GCC-12 build improvements
880d4aaf81 build: use BOOST_NO_CXX98_FUNCTION_BASE to suppress warnings (fanquake)
1bdbbbdc46 build: suppress array-bounds errors in libxkbcommon (fanquake)

Pull request description:

  2 changes to better support building with GCC 12, which out of the box, is currently broken if you want to build using depends.
  Prevent `-Warray-bounds` errors when building libxkbcommon. i.e:
  ```bash
  src/xkbcomp/ast-build.c:82:27: error: array subscript 'ExprDef[0]' is partly outside array bounds of 'unsigned char[32]' [-Werror=array-bounds]
     82 |     expr->expr.value_type = type;
        |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
  src/xkbcomp/ast-build.c:75:21: note: object of size 32 allocated by 'malloc'
     75 |     ExprDef *expr = malloc(size);
        |                     ^~~~~~~~~~~~
  ```

  It might be the case that these would be fixed by updating the
  package, but that would also require installing new build tools (meson),
  as well as potentially more dependencies (wayland), and it'd need
  testing with Qt. For now, just turn the errors into wanrings.

  Define `BOOST_NO_CXX98_FUNCTION_BASE` to prevent GCC warning about the use of `std::unary_function`. i.e:
  ```bash
  /bitcoin/depends/aarch64-unknown-linux-gnu/include/boost/container_hash/hash.hpp:131:33:
  warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
    131 |         struct hash_base : std::unary_function<T, std::size_t> {};
        |                                 ^~~~~~~~~~~~~~
  In file included from /usr/include/c++/12/bits/unique_ptr.h:37,
                   from /usr/include/c++/12/memory:76,
                   from ./init.h:10,
                   from init.cpp:10:
  /usr/include/c++/12/bits/stl_function.h:117:12: note: declared here
    117 |     struct unary_function
  ```

  Boost `container_hash` (included via functional -> multi_index) uses
  [`std::unary_function`, which was deprecated in C++11](https://en.cppreference.com/w/cpp/utility/functional/unary_function), and "removed" in
  C++17. It's use causes warnings with newer compilers, i.e GCC 12.1.

  Use the MACRO outlined in https://github.com/boostorg/container_hash/issues/22, and added to Boost Config for GCC 12 in https://github.com/boostorg/config/pull/430, to prevent it's use.

  [BOOST_NO_CXX98_FUNCTION_BASE](https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html):
  > The standard library no longer supports std::unary_function and std::binary_function.
  > They were deprecated in C++11 and is removed from C++14.

  Guix Build (x86_64):
  ```bash

  ```

  Guix Build (arm64):
  ```bash

  ```

ACKs for top commit:
  laanwj:
    Code review ACK 880d4aaf81

Tree-SHA512: 10c4679c3eb788e9279acc4960731c55ae1568bd3df525d3c46f97d8b0319e7d8450b1638b6777d98111b5991dba5c787e95d80b1ac932e0b4779d4b8e74875e
2022-06-27 11:13:01 +02:00
MacroFake
fa83c0c44f
test: Remove unused call to generate in rpc_mempool_info
There are already enough blocks
2022-06-27 11:09:01 +02:00
MacroFake
fa13375aa3
test: Sync MiniWallet utxo state after each generate call 2022-06-27 11:08:50 +02:00
MacroFake
dddd7c4d39
test: Drop spent utxos in MiniWallet scan_tx 2022-06-27 11:08:29 +02:00
MacroFake
fa04ff61b6
test: Return new_utxos from create_self_transfer_multi in MiniWallet 2022-06-27 11:07:34 +02:00
MacroFake
fa34e44e98
test: Return new_utxo from create_self_transfer in MiniWallet 2022-06-27 11:07:29 +02:00
MacroFake
fa956e7508
Replace CountSecondsDouble with Ticks<SecondsDouble> 2022-06-27 09:34:09 +02:00
MacroFake
dde7205c57
Merge bitcoin/bitcoin#23418: Fix signed integer overflow in prioritisetransaction RPC
fa07f84e31 Fix signed integer overflow in prioritisetransaction RPC (MarcoFalke)
fa52cf8e11 refactor: Replace feeDelta by m_modified_fee (MarcoFalke)

Pull request description:

  Signed integer overflow is UB in theory, but not in practice. Still,
  it would be nice to avoid this UB to allow Bitcoin Core to be
  compiled with sanitizers such as `-ftrapv` or ubsan.

  It is impossible to predict when and if an overflow occurs, since
  the overflow caused by a prioritisetransaction RPC might only be
  later hit when descendant txs are added to the mempool.
  Since it is impossible to predict reliably, leave it up to the user
  to use the RPC endpoint responsibly, considering their mempool
  limits and usage patterns.

  Fixes: #20626
  Fixes: #20383
  Fixes: #19278
  Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34146 / https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47132

  ## Steps to reproduce

  Build the code without the changes in this pull.

  Make sure to pass the sanitizer flag:

  ```
  ./autogen.sh && ./configure --with-sanitizers=signed-integer-overflow && make clean && make -j $(nproc)
  ```

  ### Reproduce on RPC

  ```
  ./src/bitcoind -chain=regtest -noprinttoconsole &
  ./src/bitcoin-cli -chain=regtest prioritisetransaction 00000000deadbeef00000000deadbeef00000000deadbeef00000000deadbeef 0 9123456789123456789
  ./src/bitcoin-cli -chain=regtest prioritisetransaction 00000000deadbeef00000000deadbeef00000000deadbeef00000000deadbeef 0 9123456789123456789
  |> txmempool.cpp:920:15: runtime error: signed integer overflow: 9123456789123456789 + 9123456789123456789 cannot be represented in type 'long int'

  ./src/bitcoin-cli -chain=regtest stop
  ```

  ### By fuzzing

  ```
  wget https://github.com/bitcoin/bitcoin/files/8921302/clusterfuzz-testcase-minimized-validation_load_mempool-5599531390074880.bin.txt
  FUZZ=validation_load_mempool ./src/test/fuzz/fuzz ./clusterfuzz-testcase-minimized-validation_load_mempool-5599531390074880.bin.txt
  |> txmempool.cpp:920:15: runtime error: signed integer overflow: 7214801925397553184 + 2314885530818453536 cannot be represented in type 'long int'
  |> validation_load_mempool: succeeded against 1 files in 0s.

ACKs for top commit:
  vasild:
    ACK fa07f84e31
  dunxen:
    ACK fa07f84
  LarryRuane:
    ACK fa07f84e31

Tree-SHA512: 4a357950af55a49c9113da0a50c2e743c5b752f0514dd8d16cd92bfde2f77dd0ef56aa98452626df6f7f7a5b51d1227021f6bc94091201a179f0d488ee32a0df
2022-06-27 08:25:19 +02:00
laanwj
aaeb315ff0
Merge bitcoin/bitcoin#25357: guix: drop -z,noexecstack for PPC64
5f082ad4e4 guix: patch LIEF to fix PPC64 NX default (fanquake)
0b5adfda87 guix: use LIEF 0.12.1 (fanquake)
4b6b4fc537 guix: remove usage of -Wl,-z,noexecstack for PPC64 HOST (fanquake)

Pull request description:

  The PPC64 ELF ABI has a non-executable stack by default, so passing `-Wl,-z,noexecstack` to force the creation of a `GNU_STACK` segment, just so we can assert that it doesn't have the exectable permission, is awkward. Now that LIEF has been fixed upstream, https://github.com/lief-project/LIEF/pull/718, we can temporarily patch our LIEF build to include the (simple) patch, and drop it the next time we update LIEF.

  See the relevant Linux kernel [documentation for powerpc](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/asm/page_64.h#n92) (and discussion in #25313):
  ```c
  /*
   * This is the default if a program doesn't have a PT_GNU_STACK
   * program header entry. The PPC64 ELF ABI has a non executable stack
   * stack by default, so in the absence of a PT_GNU_STACK program header
   * we turn execute permission off.
   */
  #define VM_STACK_DEFAULT_FLAGS32VM_DATA_FLAGS_EXEC
  #define VM_STACK_DEFAULT_FLAGS64VM_DATA_FLAGS_NON_EXEC

  #define VM_STACK_DEFAULT_FLAGS \
  (is_32bit_task() ? \
   VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
  ```

  Guix Build (x86_64):
  ```bash
  0df3f7a716b8c58c29990b0fbad17dbddb7a14d8e348bdabec7593771accaa2c  guix-build-5f082ad4e4cc/output/aarch64-linux-gnu/SHA256SUMS.part
  f235d9fb0255a0dd3cca7005e4ee09623b01224372585a49be8f94569bd52617  guix-build-5f082ad4e4cc/output/aarch64-linux-gnu/bitcoin-5f082ad4e4cc-aarch64-linux-gnu-debug.tar.gz
  8d870b415dcd30abc889c47f5313cb6a30ec7d0a29bab11394a90c612171a09d  guix-build-5f082ad4e4cc/output/aarch64-linux-gnu/bitcoin-5f082ad4e4cc-aarch64-linux-gnu.tar.gz
  1f37b3ba87ab9f3aedc8f23251b423b146c1db9cc93d7cbe1ccb22a818cb597f  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/SHA256SUMS.part
  515e13725241fe889208df0c4a678da83e06dfa77e0b47125b2bfd46cf784b11  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/bitcoin-5f082ad4e4cc-arm-linux-gnueabihf-debug.tar.gz
  d6051bde21d3b17c44af6925efcb68fcda5e0ae0bc42f167a36bea79205bd0f7  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/bitcoin-5f082ad4e4cc-arm-linux-gnueabihf.tar.gz
  3c12359285baa0d1696d855d220f235d5db44c1989e3e13d89cb555ca8f2bc01  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/SHA256SUMS.part
  74853e41c40a7d12d08c83b8e77d0a007bb19465c1206b7b78d85e5dc4f08df1  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin-unsigned.dmg
  570d3f9578715784c729acdaafaf67ebcefbf48c1da3f322813292803f275ccf  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin-unsigned.tar.gz
  670e1f4b2825679d8e92b76f0a253dd11a9d8c484bf8a453068e63d99df7e1dd  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin.tar.gz
  935deb771d847aab5feda557902225c49b6f2547f271072853f5a94a501885fd  guix-build-5f082ad4e4cc/output/dist-archive/bitcoin-5f082ad4e4cc.tar.gz
  dce5d37e13ddc2482333fe5b0f6b3d5f29a2bfc38446088afeb3b2e3345c0753  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/SHA256SUMS.part
  b65de56a98b6bd9dbdfa7cb4c92517804b936c7ed101475f2764283d1f3c0b6d  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64-linux-gnu-debug.tar.gz
  9d3cb775a467df2d653fc1670008bcf344303dd20f740e727c927ec5f9015aa8  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64-linux-gnu.tar.gz
  7f6cbaef349ed129a769bdae2adcff7f65d856f52f2caf25f4da44272058fbf0  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/SHA256SUMS.part
  56435b4da1e96beefe0e2093f5c1cafac19d911fe3df667b6652e6641786a582  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64le-linux-gnu-debug.tar.gz
  75a43ecdcd374d15543458251e4d7275551e08cff308483d3f54130fa18008a4  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64le-linux-gnu.tar.gz
  a555d0164046d47ec32c5924657c74a3d481165096dd1b74050871e438563442  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/SHA256SUMS.part
  fc4c430f34bea975f14b755574f4507b9972b873056d9cf55a165b1e2902ddae  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/bitcoin-5f082ad4e4cc-riscv64-linux-gnu-debug.tar.gz
  a25a0fe2c5cf08fa8af588fe4e8c74276db5386ab44118ed6226de575b50cacd  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/bitcoin-5f082ad4e4cc-riscv64-linux-gnu.tar.gz
  811fd6d62e02b6a3bf1a0e39d8721034398c1710649f080c81e514eb34e70500  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/SHA256SUMS.part
  1a43bf4e0b56f9e724c45a7f5cc8f1641e038c450a62ab9baa68f6fe2f60da8a  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin-unsigned.dmg
  8c2508bdf0256177b05fff4cd613b735deaacee844f74ae075dabdc911b35204  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin-unsigned.tar.gz
  7cb121072661dc224914d6777135d51aa60f16c8dc890f840f81d39cc55ee7ed  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin.tar.gz
  4ff472b2f9e786e620c449563c33f032795dada20701e9da9126997b2f9605e7  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/SHA256SUMS.part
  1e0e4662a38f5df3027b4c062a18c6255fb59640afc69dd2e23a1dc47f278a74  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/bitcoin-5f082ad4e4cc-x86_64-linux-gnu-debug.tar.gz
  0d02f5689b008818467d5fe14a10503738e0e6c96f34591771cb8fb0f2cd3763  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/bitcoin-5f082ad4e4cc-x86_64-linux-gnu.tar.gz
  bff9e2893998b1880850f0195a8282564c4bf46d2bfaaf3358ddd7f1812370f1  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/SHA256SUMS.part
  11e0835f989d86c6c39a8dfa60e7129262e098ef80720d0de6acfdcd8995fd92  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-debug.zip
  491038e48288863860a3adf229a138d1b74a24004dcb1e07b28d207f866e7d15  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-setup-unsigned.exe
  5c8cbbd00a0cb5fcb00478bd05cbb7fa38f97126c677538389173cf71f64f647  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-unsigned.tar.gz
  a6ee1e220e8d91192ee6f36ef33a0c5a1348aba2f84fd42d228f04ab927f3feb  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  17ec23ec07289eb00eec401385aca7e194d366f86778bd747ca17ad2bdded16f  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/SHA256SUMS.part
  34b997bba0ec8c6f66bde5cd8d08cf2fbf6e5cb04d1825a4ef4b850c059841fa  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/bitcoin-5f082ad4e4cc-arm-linux-gnueabihf-debug.tar.gz
  93666cc53fd3a6cdfe3528f42a8250bc82bd7a1ab5936d99052bef49142e06c9  guix-build-5f082ad4e4cc/output/arm-linux-gnueabihf/bitcoin-5f082ad4e4cc-arm-linux-gnueabihf.tar.gz
  c142bd730e1a564f9c0f65818fa3a0e3d20d41a95c419ce52b11ef33420d03ad  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/SHA256SUMS.part
  afcf76d9807173a1dceb6c9933997f1cbac76fb9b683b6ad65af93069dbe7344  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin-unsigned.dmg
  f1a6f2b8a01543b3f5926e880619c54317fdcb2e93ed860df5e0bb642a8e6d4c  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin-unsigned.tar.gz
  e423a0cb964177d6ad97cebd288666460a902d45f51bacba23b019644ddeea18  guix-build-5f082ad4e4cc/output/arm64-apple-darwin/bitcoin-5f082ad4e4cc-arm64-apple-darwin.tar.gz
  935deb771d847aab5feda557902225c49b6f2547f271072853f5a94a501885fd  guix-build-5f082ad4e4cc/output/dist-archive/bitcoin-5f082ad4e4cc.tar.gz
  e01cf090da155bc7626d221a87a177b2dd1cdb8d9c2954e2423ab0268976e513  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/SHA256SUMS.part
  08afcfc256bd8f29d1dad90709828ef800b2ea3d22b834dc78af27b5d10d20b5  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64-linux-gnu-debug.tar.gz
  cf861876542e8b27e9335ce9432107a402e8cc4b177d2db1649b54d7e269081e  guix-build-5f082ad4e4cc/output/powerpc64-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64-linux-gnu.tar.gz
  0840ae94ea6830d842043d4a8ed17893e3f58917113bcf2e2e3ee247bd8db249  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/SHA256SUMS.part
  072251112d709f1c2a3b38065f5fb5a435f3cefbc788e46fa1ff9d96d746ea4d  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64le-linux-gnu-debug.tar.gz
  a8507446c9a69a0c7fe1020e30d6f0334d0f6c0c96263298bafd502c2ce2c7c4  guix-build-5f082ad4e4cc/output/powerpc64le-linux-gnu/bitcoin-5f082ad4e4cc-powerpc64le-linux-gnu.tar.gz
  d3cf62ebabb062276dd1615774c7ee231b62a92ba1a9515f13c1f0454d84c6e5  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/SHA256SUMS.part
  0b738e9f973d2ed4031fd81465ea65bc9d17e983e48c892ca89582da9d8afcd5  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/bitcoin-5f082ad4e4cc-riscv64-linux-gnu-debug.tar.gz
  28e84d55aa048be871776cd62c7dcbb6286d2f42ac1ce59772ea65217eb86ec2  guix-build-5f082ad4e4cc/output/riscv64-linux-gnu/bitcoin-5f082ad4e4cc-riscv64-linux-gnu.tar.gz
  811fd6d62e02b6a3bf1a0e39d8721034398c1710649f080c81e514eb34e70500  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/SHA256SUMS.part
  1a43bf4e0b56f9e724c45a7f5cc8f1641e038c450a62ab9baa68f6fe2f60da8a  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin-unsigned.dmg
  8c2508bdf0256177b05fff4cd613b735deaacee844f74ae075dabdc911b35204  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin-unsigned.tar.gz
  7cb121072661dc224914d6777135d51aa60f16c8dc890f840f81d39cc55ee7ed  guix-build-5f082ad4e4cc/output/x86_64-apple-darwin/bitcoin-5f082ad4e4cc-x86_64-apple-darwin.tar.gz
  6463d3502cb839e50aaa2063f3ea1e4c874904e4745836411603e4cf0b5da946  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/SHA256SUMS.part
  dae5e82e1a32312fb417aabeef750cb4317a853af142ec0a7125dcb6f66e7930  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/bitcoin-5f082ad4e4cc-x86_64-linux-gnu-debug.tar.gz
  2434199cc24b8b463d3efda8a053d21324c02d1b06afaa3e08af7cdffa7b05d4  guix-build-5f082ad4e4cc/output/x86_64-linux-gnu/bitcoin-5f082ad4e4cc-x86_64-linux-gnu.tar.gz
  8195c14785b4f553eb05fb8c25516d1b337b3ca8fc9d7cf6ad6d2bd3bc6d2093  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/SHA256SUMS.part
  95b674ae6d9ddff652feeb5280e6a600803f78f685cde62f94332876c4039357  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-debug.zip
  491038e48288863860a3adf229a138d1b74a24004dcb1e07b28d207f866e7d15  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-setup-unsigned.exe
  5c8cbbd00a0cb5fcb00478bd05cbb7fa38f97126c677538389173cf71f64f647  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64-unsigned.tar.gz
  3e5fbbe50d266e6e03ae0976ccef74cf1024d107629223e655c672e2b8d73187  guix-build-5f082ad4e4cc/output/x86_64-w64-mingw32/bitcoin-5f082ad4e4cc-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Tested ACK 5f082ad4e4

Tree-SHA512: c62f2ba949553edada6631e21e7fa50af9e328cf62b5b45c90290e388b3670852bd08100802ca1a8ea1e55979799be61908fd34542f6fcc20d6845f3d8c2a28f
2022-06-27 08:21:36 +02:00
MacroFake
f52d074363
Merge bitcoin/bitcoin#25439: rpc: Return incrementalrelayfee in getmempoolinfo
fafee78188 rpc: Return incrementalrelayfee in getmempoolinfo (MacroFake)

Pull request description:

  Seems odd to return other policy info, but not the incremental relay fee

ACKs for top commit:
  1440000bytes:
    ACK fafee78188
  w0xlt:
    Code Review ACK fafee78188
  jarolrod:
    tACK fafee78188

Tree-SHA512: faad0af6c039b8257acbeac913bc5dcdb2ea2db304c95e52601536c8de60eb1186e9fbb4a64a68adf476605f18022aeda16a5644a0d7912592b0977e4c029638
2022-06-27 08:19:14 +02:00