Commit graph

40284 commits

Author SHA1 Message Date
furszy
342c45f80e
wallet: addressbook migration, batch db writes
Optimizing the process performance and consistency.
2024-02-07 18:15:38 -03:00
furszy
595bbe6e81
refactor: wallet, simplify addressbook migration
Same process written in a cleaner manner.
Removing code duplication.
2024-02-07 18:15:38 -03:00
furszy
d0943315b1
refactor: SetAddressBookWithDB, minimize number of map lookups 2024-02-07 18:15:38 -03:00
furszy
bba4f8dcb5
refactor: SetAddrBookWithDB, signal only if write succeeded 2024-02-07 18:15:38 -03:00
furszy
97b0753923
wallet: clean redundancies in DelAddressBook
1) Encode destination only once (instead of three).
2) Fail if the entry's linked data cannot be removed.
3) Don't remove entry from memory if db write fail.
4) Notify GUI only if removal succeeded
2024-02-07 18:11:51 -03:00
Hennadii Stepanov
60ac503800
Merge bitcoin-core/gui#497: Enable users to configure their monospace font specifically
a17fd33edd GUI: OptionsDialog: Replace verbose two-option font selector with simple combobox with Custom... choice (Luke Dashjr)
98e9ac5199 GUI: Use FontChoice type in OptionsModel settings abstraction (Luke Dashjr)
3a6757eed9 GUI: Load custom FontForMoney from QSettings (Luke Dashjr)
49eb97eff9 GUI: Add possibility for an explicit QFont for FontForMoney in OptionsModel (Luke Dashjr)
f2dfde80b8 GUI: Move "embedded font or not" decision into new OptionsModel::getFontForMoney method (Luke Dashjr)

Pull request description:

  This replaces the overly-verbose radio-button font setting (which only allows embedded or autodetected from system) with a simple combobox providing both existing options as well as a custom option to allow the user to select any font of their choice/style.

ACKs for top commit:
  pablomartin4btc:
    tested ACK  a17fd33edd
  hebasto:
    ACK a17fd33edd, I have reviewed the code and tested it on Ubuntu 22.04. This is a UX improvement. https://github.com/bitcoin-core/gui/pull/497#issuecomment-1341222673 might be addressed in a follow-up.

Tree-SHA512: 2f0a8bc1242a374c4b7dc6e34014400428b6d36063fa0b01c9f62a8bd6078adfbbca93d95c87e4ccb580d982fe10173e1d9a28bcec586591dd3f966c7b90fc5d
2024-02-07 19:28:37 +00:00
Hennadii Stepanov
7b39702513
Merge bitcoin-core/gui#553: Change address / amount error background
fe7c81e34e qt: change QLineEdit error background (w0xlt)

Pull request description:

  This PR proposes a small change in QLineEdit when there is an error in the input.

  master |
  --- |
  ![image](https://user-images.githubusercontent.com/94266259/154762427-b816267e-ec70-4a8f-a7fb-1317ebacf1a4.png)

  PR |
  --- |
  ![image](https://user-images.githubusercontent.com/94266259/154761933-15eb3d81-ca81-4498-b8ec-cf1139ae2f8a.png) |

  This also shows good results when combined with other open PRs.

  #537 |
  --- |
  ![image](https://user-images.githubusercontent.com/94266259/154763411-6266a283-2d8a-4365-b3f2-a5cb545e773e.png)

  #533 |
  --- |
  ![image](https://user-images.githubusercontent.com/94266259/154765638-f38b13d6-a4f8-4b46-a470-f882668239f3.png) |

ACKs for top commit:
  GBKS:
    ACK fe7c81e
  jarolrod:
    ACK fe7c81e34e
  shaavan:
    ACK fe7c81e34e

Tree-SHA512: eccc53f42d11291944ccb96efdbe460cb10af857f1d4fa9b5348ddcb0796c82faf1cdad9040aae7a25c5d8f4007d6284eba868d7af14acf56280f6acae170b91
2024-02-07 18:03:11 +00:00
fanquake
6737331c4c
Merge bitcoin/bitcoin#29363: test: Fix CPartialMerkleTree.nTransactions signedness
facafa90f7 test: Fix CPartialMerkleTree.nTransactions signedness (MarcoFalke)

Pull request description:

  It is unsigned in Bitcoin Core, so the tests should match it:

  aa9231fafe/src/merkleblock.h (L59)

  Large positive values, or "negative" values, are rejected anyway, but it still seems fine to fix this.

  The bug was introduced when the code was written in d280617bf5.

  (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters)

ACKs for top commit:
  theStack:
    LGTM ACK facafa90f7
  Empact:
    ACK facafa90f7

Tree-SHA512: 35ac11bb5382dffe132bfae6097efc343ef6c06b1b4b1545130ca27b228ca6894679004862fee921b095172abaddbef5972c24d9bc195ce970f35643bd4a0f09
2024-02-07 15:08:02 +00:00
MarcoFalke
fab15723b0
test: Fix SegwitV0SignatureMsg nLockTime signedness 2024-02-07 12:07:44 +01:00
MarcoFalke
fa0ceae970
test: Fix utxo set hash serialisation signedness 2024-02-07 11:47:17 +01:00
Hennadii Stepanov
71927b24e5
qt: Update translation source file
The diff is generated by executing `make -C src translate`.
2024-02-07 09:40:41 +00:00
Hennadii Stepanov
4d0b0bf225
qt: Bump Transifex slug for 27.x 2024-02-07 09:24:32 +00:00
Hennadii Stepanov
42cbf561a7
qt: Translation updates from Transifex
The diff is generated by executing the `update-translations.py` script.
2024-02-07 09:23:42 +00:00
Ryan Ofsky
5b8990a1f3
Merge bitcoin/bitcoin#29388: fuzz: remove unused args and context from FuzzedWallet
b14298c5bc fuzz: remove unused `args` and `context` from `FuzzedWallet` (brunoerg)

Pull request description:

  `ArgsManager args` and `WalletContext context` were previously used to create the wallet into `FuzzedWallet`. After fa15861763, they are not used anymore. This PR removes them.

ACKs for top commit:
  maflcko:
    lgtm ACK b14298c5bc
  epiccurious:
    utACK b14298c5bc
  ryanofsky:
    Code review ACK b14298c5bc

Tree-SHA512: 164e6a66ba05e11176a0cf68db6257f0ac07459cf7aa01ec4302b303c156c205a68128373a0b8daba0a6dfbff990af7fa14465a6341a296312fb20ea778c7a8c
2024-02-06 19:45:04 -05:00
Martin Zumsande
6e9e39da43 test: Don't use v2transport when it's too slow.
Sending multiple large messages is rather slow with the non-optimized python
implementation of ChaCha20.
Apart from the slowness, these tests would also run successfully with v2.
2024-02-06 16:11:21 -05:00
Martin Zumsande
87549c8f89 test: enable p2p_invalid_messages.py with v2transport
by disabling some sub-tests that test v1-specific features,
and adapting others to v2.
2024-02-06 15:59:17 -05:00
Martin Zumsande
5fc9db504b test: enable p2p_sendtxrcncl.py with v2transport
By adding to the test framework a wait until the v2 handshake
is completed, so that p2p_sendtxrcncl.py (which doesn't need
to be changed itself) doesnt't send out any other messages before that.
2024-02-06 15:59:17 -05:00
Ava Chow
592e01398e
Merge bitcoin/bitcoin#28833: wallet: refactor: remove unused SignatureData instances in spkm's FillPSBT methods
e2ad343f69 wallet: remove unused `SignatureData` instances in spkm's `FillPSBT` methods (Sebastian Falbesoner)

Pull request description:

  These are filled with signature data from a PSBT input, but not used anywhere after, hence they can be removed. Note that the same code is in the `SignPSBTInput` function where the `sigdata` result is indeed used.

ACKs for top commit:
  achow101:
    ACK e2ad343f69
  brunoerg:
    crACK e2ad343f69

Tree-SHA512: f0cabcc000bcea6bc7d7ec9d3be2e2a8accbdbffbe35252250ea2305b65a5813fde2b8096fbdd2c7cccdf417ea285183dc325fc2d210d88bce62978ce642930e
2024-02-06 13:35:41 -05:00
Ava Chow
03d95cc630
Merge bitcoin/bitcoin#29375: wallet: remove unused 'accept_no_keys' arg from decryption process
2bb25ce502 wallet: remove unused 'accept_no_keys' arg from decryption process (furszy)

Pull request description:

  Found it while reviewing other PR. Couldn't contain myself from cleaning it up.

  The wallet decryption process (`CheckDecryptionKey()` and `Unlock()`)
  contains an arg 'accept_no_keys,' introduced in #13926, that has
  never been used.
  Additionally, this also removes the unimplemented `SplitWalletPath`
  function.

ACKs for top commit:
  delta1:
    ACK 2bb25ce502
  epiccurious:
    utACK 2bb25ce502.
  achow101:
    ACK 2bb25ce502
  theStack:
    Code-review ACK 2bb25ce502

Tree-SHA512: e0537c994be19ca0032551d8a64cf1755c8997e04d21ee0522b31de26ad90b9eb02a8b415448257b60bced484b9d2a23b37586e12dc5ff6e35bdd8ff2165c6bf
2024-02-06 13:02:47 -05:00
furszy
cfcb9b1ecf test: wallet, coverage for concurrent db transactions
Verifying that a database handler can't commit/abort changes
occurring in a different database handler.
2024-02-06 12:24:36 -05:00
Ava Chow
548ecd1155 tests: Test for concurrent writes with db tx
There are occasions where a multi-statement tx is begun in one batch,
and a second batch is created which does a normal write (without a
multi-statement tx). These should not conflict with each other and all
of the data should end up being written to disk.
2024-02-06 12:24:36 -05:00
Ava Chow
395bcd2454 sqlite: Ensure that only one SQLiteBatch is writing to db at a time
A SQLiteBatch need to wait for any other batch to finish writing before
it can begin writing, otherwise db txn state may be incorrectly
modified. To enforce this, each SQLiteDatabase has a semaphore which
acts as a lock and is acquired by a batch when it begins a write, erase,
or a transaction, and is released by it when it is done.

To avoid deadlocking on itself for writing during a transaction,
SQLiteBatch also keeps track of whether it has begun a transaction.
2024-02-06 12:24:36 -05:00
glozow
4de84557d6
Merge bitcoin/bitcoin#29356: test: make v2transport arg in addconnection mandatory and few cleanups
e7fd70f4b6 [test] make v2transport arg in addconnection mandatory and few cleanups (stratospher)

Pull request description:

  - make `v2transport` argument in `addconnection` regression-testing only RPC mandatory. https://github.com/bitcoin/bitcoin/pull/24748#discussion_r1470738750
  - previously it was an optional arg with default `false` value.
  - only place this RPC is used is in the [functional tests](11b436a66a/test/functional/test_framework/test_node.py (L742)) where we always pass the appropriate `v2transport` option to the RPC anyways. (and that too just for python dummy peer(`P2PInterface`) and bitcoind(`TestNode`) interactions)
  - rename `v2_handshake()` to `_on_data_v2_handshake()` https://github.com/bitcoin/bitcoin/pull/24748#discussion_r1466958424
  - more compact return statement in `wait_for_reconnect()` https://github.com/bitcoin/bitcoin/pull/24748#discussion_r1466979708
  - assertion to check that empty version packets are received from `TestNode`.

ACKs for top commit:
  glozow:
    ACK e7fd70f4b6
  theStack:
    Code-review ACK e7fd70f4b6
  mzumsande:
    Code Review ACK e7fd70f4b6

Tree-SHA512: e66e29baccd91e1e4398b91f7d45c5fc7c2841d77d8a6178734586017bf2be63496721649da91848dec71da605ee31664352407d5bb896e624cc693767c61a1f
2024-02-06 11:02:36 +00:00
glozow
4572f48fd5
Merge bitcoin/bitcoin#29353: test: p2p: adhere to typical VERSION message protocol flow
c340503b67 test: p2p: adhere to typical VERSION message protocol flow (Sebastian Falbesoner)
7ddfc28309 test: p2p: process post-v2-handshake data immediately (Sebastian Falbesoner)
b198b9c2ce test: p2p: introduce helper for sending prepared VERSION message (Sebastian Falbesoner)

Pull request description:

  This PR addresses a quirk in the test framework's p2p implementation regarding the version handshake protocol:

  Currently, the VERSION message is sent immediately after an inbound connection (i.e. TestNode outbound connection) is made. This doesn't follow the usual protocol flow where the initiator sends a version first, the responder processes that and only then responds with its own version message. Change that accordingly by only sending immediate VERSION message for outbound connections (or after v2 handshake for v2 connections, respectively), and sending out VERSION message as response for incoming VERSION messages (i.e. in the function `on_version`) for inbound connections.

  I first stumbled upon this issue through reading comment https://mirror.b10c.me/bitcoin-bitcoin/24748/#discussion_r1465420112 (see last paragraph) and recently again in the course of working on a v2-followup for #29279, where this causes issues for TestNode outbound connections that disconnect *before* sending out their own version message.

  Note that these changes lead to slightly more code in some functional tests that override the `on_version` method, as the version reply has to be sent explicitly now, but I think is less confusing and reflects better what is actually happening.

ACKs for top commit:
  epiccurious:
    utACK c340503b67
  stratospher:
    tested ACK c340503b67. very useful to have since we'd want real node behaviour!
  mzumsande:
    ACK c340503b67
  sr-gi:
    tACK c340503b67

Tree-SHA512: 63eac287d3e1c87a01852bfd9f0530363354bbb642280298673b9c8817056356373adf348955c4e92af95c7c6efa8cc515cee2892e9f077bfbe1bce8e97ad082
2024-02-06 10:52:35 +00:00
Sebastian Falbesoner
a8c3454ba1 test: speedup bip324_cipher.py unit test
Executing the unit tests for the bip324_cipher.py module currently
takes quite long (>60 seconds on my notebook). Most time here is spent
in empty plaintext/ciphertext encryption/decryption loops:

    ....
    for _ in range(msg_idx):
        enc_aead.encrypt(b"", b"")
    ...
    for _ in range(msg_idx):
        enc_aead.decrypt(b"", bytes(16))
    ...

Their sole purpose is increasing the FSChaCha20Poly1305 packet
counters in order to trigger rekeying, i.e. the actual
encryption/decryption is not relevant, as the result is thrown away.
This commit speeds up the tests by supporting to pass "None" as
plaintext/ciphertext, indicating to the routines that no actual
encryption/decryption should be done.

master branch:

$ python3 -m unittest ./test/functional/test_framework/crypto/bip324_cipher.py
..
----------------------------------------------------------------------
Ran 2 tests in 64.658s

PR branch:

$ python3 -m unittest ./test/functional/test_framework/crypto/bip324_cipher.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.822s
2024-02-06 01:35:03 +01:00
brunoerg
b14298c5bc fuzz: remove unused args and context from FuzzedWallet 2024-02-05 17:06:10 -03:00
Sebastian Falbesoner
b58f009d95 test: check that mempool msgs lead to disconnect if uploadtarget is reached
Note that another reason for disconnect after receiving a MEMPOOL msg of a peer
is if bloom filters are disabled on the node. This case is covered in the
functional test `p2p_nobloomfilter_messages.py`.
2024-02-05 18:08:25 +01:00
Sebastian Falbesoner
dd5cf38818 test: check for specific disconnect reasons in feature_maxuploadtarget.py
This ensures that the disconnect happens for the expected reason and
also makes it easier to navigate between implementation and test code,
i.e. both the questions "do we have test coverage for this disconnect?"
(from an implementation reader's perspective) and "where is the code
handling this disconnect?" (from a test reader's perspective) can be
answered simply by grep-ping the corresponding debug message.
2024-02-05 18:08:25 +01:00
Sebastian Falbesoner
73d7372115 test: verify -maxuploadtarget limit state via getnettotals RPC result 2024-02-05 18:08:25 +01:00
MarcoFalke
fa3a4102ef
fuzz: Set -rss_limit_mb=8000 for generate as well
This is set by merge, so set it here as well, to avoid OOM.
2024-02-05 16:21:23 +01:00
MarcoFalke
fa4e396e1d
fuzz: Generate with random libFuzzer settings 2024-02-05 16:13:37 +01:00
glozow
9eeee7caa3
Merge bitcoin/bitcoin#29254: log: Don't use scientific notation in log messages
c819a83b4d Don't use scientific notation in log messages (Kristaps Kaupe)

Pull request description:

  Don't see any benefits here, only harder to read for most of the users.

  Before:
  ```
  2024-01-16T13:11:36Z Dumped mempool: 8.165e-06s to copy, 0.00224268s to dump
  ```

  After:
  ```
  2024-01-16T13:11:36Z Dumped mempool: 0.000s to copy, 0.002s to dump
  ```

ACKs for top commit:
  kristapsk:
    > > > > lgtm ACK [c819a83](c819a83b4d). can you update the PR description?
  glozow:
    lgtm ACK c819a83b4d. can you update the PR description?

Tree-SHA512: 0972e0a05934e1b014fdeca0c235065aa017ba9abf74b3018f514e4d8022ef02b7f042a07d3675144b51449492468aea6b5b0183233ad7f1bab887d18e3d06af
2024-02-05 14:21:10 +00:00
glozow
cd3683c21a
Merge bitcoin/bitcoin#29354: test: Assumeutxo with more than just coinbase transactions
fa5cd66f0a test: Assumeutxo with more than just coinbase transactions (MarcoFalke)

Pull request description:

  Currently the AU tests only check that loading a txout set with only coinbase outputs works.

  Fix that by adding other transactions.

ACKs for top commit:
  jamesob:
    ACK fa5cd66f0a
  glozow:
    concept ACK fa5cd66f0a

Tree-SHA512: e090c41f73490ad72e36c478405bfd0716d46fbf5a131415095999da6503094a86689a179a84addae3562b760df64cdb67488f81692178c8ca8bf771b1e931ff
2024-02-05 14:16:44 +00:00
TheCharlatan
5ca9b24da1
test: Add makefile target for running unit tests
make check runs a bunch of other subtree tests that exercise code that
is hardly ever changed and have a comparatively long runtime. There
seems to be no target for running just the unit tests, so add one.
2024-02-03 17:59:43 +01:00
furszy
2bb25ce502
wallet: remove unused 'accept_no_keys' arg from decryption process
The wallet decryption process (CheckDecryptionKey() and Unlock())
contains an arg 'accept_no_keys,' introduced in #13926, that has
never been used.
Additionally, this also removes the unimplemented SplitWalletPath
function.
2024-02-03 12:56:43 -03:00
Ryan Ofsky
a11585692e
Merge bitcoin/bitcoin#28868: wallet: Fix migration of wallets with txs that have both spendable and watchonly outputs
4da76ca247 test: Test migration of tx with both spendable and watchonly (Ava Chow)
c62a8d03a8 wallet: Keep txs that belong to both watchonly and migrated wallets (Ava Chow)
71cb28ea8c test: Make sure that migration test does not rescan on reloading (Ava Chow)
78ba0e6748 wallet: Reload the wallet if migration exited early (Ava Chow)
9332c7edda wallet: Write bestblock to watchonly and solvable wallets (Ava Chow)

Pull request description:

  A transaction does not necessarily have to belong to either the migrated wallet (with the private keys) and the watchonly wallet (with watchonly things), it could have multiple outputs with each isminetype. So we should be putting such transactions in one or the other wallet, but rather putting it in both.

  I've added a test for this behavior, however the test also revealed a few other issues. Notably, it revealed that `migratewallet` would have the watchonly wallet rescan from genesis when it is reloaded at the end of migration. This could be a cause for migration appearing to be very slow. This is resolved by first writing best block records to the watchonly and solvable wallets, as well as updating the test to make sure that rescans don't happen.

  The change to avoid rescans also found an issue where some of our early exits would result in unloading the wallet even though nothing happened. So there is also a commit to reload the wallet for such early exits.

ACKs for top commit:
  ryanofsky:
    Code review ACK 4da76ca247. This looks great. The code is actually cleaner than before, two bugs are fixed, and the test checking for rescanning is pretty clever and broadens test coverage.
  furszy:
    Code review ACK 4da76ca2

Tree-SHA512: 5fc210cff16ca6720d7b2d0616d7e3f295c974147854abc704cf99a3bfaad17572ada084859e7a1b1ca94da647ad130303219678f429b7995f85e040236db35c
2024-02-02 21:50:22 -05:00
Ryan Ofsky
93e10cab5d
Merge bitcoin/bitcoin#29367: wallet: Set descriptors flag after migrating blank wallets
3904123da9 tests: Test that descriptors flag is set for migrated blank wallets (Ava Chow)
072d506240 wallet: Make sure that the descriptors flag is set for blank wallets (Ava Chow)

Pull request description:

  While rebasing #28710 after #28976 was merged, I realized that although blank wallets were being moved to sqlite, `WALLET_FLAG_DESCRIPTORS` was not being set so those blank wallets would still continue to be treated as legacy wallets.

  To fix that, just set the descriptor flags for blank wallets. Also added a test to catch this.

ACKs for top commit:
  epiccurious:
    Tested ACK 3904123da9.
  delta1:
    tested ACK 3904123da9
  ryanofsky:
    Code review ACK 3904123da9
  murchandamus:
    code review ACK 3904123da9

Tree-SHA512: 9f6fe9c1899ca387ab909b1bb6956cd6bc5acbf941686ddc6c061f9b1ceec2cc9d009ff472486fc86e963f6068f0e2f1ae96282e7c630193797a9734c4f424ab
2024-02-02 14:33:53 -05:00
Martin Zumsande
cc87ee4c39 test: fix intermittent failure in rpc_setban.py --v2transport
When initiating a v2 connection and being immediately disconnected,
a node cannot know if the disconnect happens because the peer only
supports v1, or because it has banned you, so it schedules to reconnect with v1.
If the test doesn't wait for that, the reconnect can happen at a bad time,
resulting in failure in a later connect_nodes call.
Also add the test with --v2transport to the test runner.
2024-02-02 13:24:29 -05:00
Ava Chow
38941045c5
Merge bitcoin/bitcoin#29361: refactor: Fix timedata includes
fad0fafd5a refactor: Fix timedata includes (MarcoFalke)

Pull request description:

  Remove unused includes. Also, fixup comments, see https://github.com/bitcoin/bitcoin/pull/28956/files#r1464827885. Also, add missing includes to `chain.h` while touching it.

ACKs for top commit:
  achow101:
    ACK fad0fafd5a
  dergoegge:
    utACK fad0fafd5a
  stickies-v:
    ACK fad0fafd5a

Tree-SHA512: 45e86f2eb90f0e37012bd83bf30259719e0e58ede18b31f51ca8a6f6d23e6ca4d060fc0f56f821a711cbdb45792b82cf780f5ae3226680d7a966471990f352bc
2024-02-02 12:11:46 -05:00
Ava Chow
3904123da9 tests: Test that descriptors flag is set for migrated blank wallets 2024-02-01 18:13:02 -05:00
Ava Chow
072d506240 wallet: Make sure that the descriptors flag is set for blank wallets 2024-02-01 18:00:58 -05:00
Ava Chow
4da76ca247 test: Test migration of tx with both spendable and watchonly 2024-02-01 14:09:05 -05:00
Ava Chow
c62a8d03a8 wallet: Keep txs that belong to both watchonly and migrated wallets
It is possible for a transaction that has an output that belongs to the
mgirated wallet, and another output that belongs to the watchonly
wallet. Such transaction should appear in both wallets during migration.
2024-02-01 14:09:05 -05:00
Ava Chow
71cb28ea8c test: Make sure that migration test does not rescan on reloading
We want to make sure that all of the transactions are being copied to
the watchonly and solvable wallets as expected. The automatic rescanning
behavior can cause us to pass a test by finding the transaction
on loading rather than having it be copied as expected.
2024-02-01 14:09:05 -05:00
Ava Chow
78ba0e6748 wallet: Reload the wallet if migration exited early
Migration will unload loaded wallets prior to beginning. It will then
perform some checks which may exit early. Such unloaded wallets should
be reloaded prior to exiting.
2024-02-01 14:09:05 -05:00
Ava Chow
9332c7edda wallet: Write bestblock to watchonly and solvable wallets
When migrating, we should also be writing the bestblock record to the
watchonly and solvable wallets to avoid rescanning on the reload as that
can be slow.
2024-02-01 13:43:41 -05:00
fanquake
5b8c5970bd
Merge bitcoin/bitcoin#29189: RFC: Deprecate libconsensus
25dc87e6f8 libconsensus: deprecate (Cory Fields)

Pull request description:

  This library has existed for nearly 10 years with very little known uptake or impact. It has become a maintenance burden. In several cases it dictates our code/library structure (for example necessitating LIBBITCOIN_CRYPTO_BASE), as well as build-system procedures (building multiple copies of object files especially for the lib).

  Several discussions have arisen wrt migrating it to CMake and it has become difficult to justify adding more complexity for a library that is virtually unused anyway.

  See for example the discussions:
  https://github.com/hebasto/bitcoin/pull/41
  https://github.com/bitcoin/bitcoin/pull/29123

  And here: https://github.com/bitcoin/bitcoin/pull/29180
  Where it is pointed out that the libbitcoinconsensus functions are slower than those the internal bitcoind equivalents due to the missing sha2 implementations.

  Instead, we (fanquake, hebasto, TheCharlatan, and I) propose simply not migrating it to CMake and letting it end with v27. Any remaining use-cases could be handled in the future by libbitcoinkernel.

  If there are any users currently using libbitcoinconsensus, please chime in with your use-case!

  Edit: Corrected final release to be v27.

ACKs for top commit:
  TheCharlatan:
    ACK 25dc87e6f8
  fanquake:
    ACK 25dc87e6f8 - this library has very little, if any impactful real world usage. It has been entirely broken (on various platforms) for long periods of its existence, where nobody even noticed. Pruning this out to save porting, and starting anew with the kernel, is the sane thing to do.

Tree-SHA512: baff2b3c4f76f520c96021035f751fdcb51bedf00e767660249e92a7bc7c5c176786bcf2c4cfe2d2351c200f932b39eb886bcfb22fbec824a41617590d6a1638
2024-02-01 16:11:31 +00:00
fanquake
f879c1b24a
Merge bitcoin/bitcoin#29275: refactor: Fix prevector iterator concept issues
fad74bbbd0 refactor: Mark prevector iterator with std::contiguous_iterator_tag (MarcoFalke)
fab8a01048 refactor: Fix binary operator+ for prevector iterators (MarcoFalke)
fa44a60b2b refactor: Fix constness for prevector iterators (MarcoFalke)
facaa66b49 refactor: Add missing default constructor to prevector iterators (MarcoFalke)

Pull request description:

  Currently prevector iterators have many issues:

  * Forward iterators (and stronger) must be default constructible (https://eel.is/c++draft/forward.iterators#1.2). Otherwise, some functions can not be instantiated, like `std::minmax_element`.
  * Various `const` issues with random access iterators. For example, a `const iterator` is different from a `const_iterator`, because the first one holds a mutable reference and must also return it without `const`. Also, `operator+` must be callable regardless of the iterator object's `const`-ness.
  * When adding an offset to random access iterators, both `x+n` and `n+x` must be specified, see https://eel.is/c++draft/random.access.iterators#tab:randomaccessiterator

  Fix all issues.

  Also, upgrade the `std::random_access_iterator_tag` (C++17) to `std::contiguous_iterator_tag` (C++20)

ACKs for top commit:
  TheCharlatan:
    ACK fad74bbbd0
  stickies-v:
    ACK fad74bbbd0
  willcl-ark:
    ACK fad74bbbd0

Tree-SHA512: b1ca778a31602af94b323b8feaf993833ec78be09f1d438a68335485a4ba97f52125fdd977ffb9541b89f8d45be0105076aa07b5726936133519aae832556e0b
2024-02-01 15:57:52 +00:00
MarcoFalke
fad0fafd5a
refactor: Fix timedata includes 2024-02-01 13:52:05 +01:00
Sebastian Falbesoner
c340503b67 test: p2p: adhere to typical VERSION message protocol flow
The test framework's p2p implementation currently sends out it's VERSION
message immediately after an inbound connection (i.e. TestNode outbound
connection) is made. This doesn't follow the usual protocol flow where
the initiator sends a version first, and the responders processes that
and only then responds with its own version message. Change that
accordingly by only sending immediate VERSION message for outbound
connections (or after v2 handshake for v2 connections, respectively),
and sending out VERSION messages as response for incoming VERSION
messages (i.e. in the function `on_version`) for inbound connections.

Note that some of the overruled `on_version` methods in functional tests
needed to be changed to send the version explicitly.
2024-02-01 13:33:23 +01:00