Commit graph

40480 commits

Author SHA1 Message Date
glozow
ddf1d72cc2
Merge bitcoin/bitcoin#29452: doc: document that BIP324 on by default for v27.0
0d3e18bcd6 doc: document that BIP324 on by default for v27.0 (fanquake)

Pull request description:

  Addresses: https://github.com/bitcoin/bitcoin/pull/29347#issuecomment-1952335331.

ACKs for top commit:
  maflcko:
    lgtm ACK 0d3e18bcd6
  sipa:
    ACK 0d3e18bcd6
  theStack:
    ACK 0d3e18bcd6

Tree-SHA512: a2af6dbba2740e5cf9c51660059d39577f3744e2adf554222bbc2eac454a161c2e68111797a7cbe34943fe2a424f5fadbeeffcd6f7ae42e3333878875ac43424
2024-02-19 16:08:56 +00:00
fanquake
0d3e18bcd6
doc: document that BIP324 on by default for v27.0 2024-02-19 15:37:59 +00:00
Hennadii Stepanov
4c9db9b587
qt, test: Recognize dialog object by name 2024-02-19 13:53:47 +00:00
Sebastian Falbesoner
0fbf051fec depends: fix BDB compilation on OpenBSD
Compiling C++ code with `-D_XOPEN_SOURCE=600` causes problems on
OpenBSD. If that define is set, the C++ standard header detection
routine in BDB's configure script fails. This results in
`HAVE_CXX_STDHEADERS` not being defined, which then it turn leads to
the inclusion of `<iostream.h>` (rather than `<iostream>`), which
doesn't exist.

According to a mailing list post discussing a similar problem [1],
"OpenBSD provides the POSIX APIs by default", so we don't need this
define anyway and can remove it. This fixes the BDB build problem as
described in issue #28963.

Tested on OpenBSD 7.4 with clang 13.0.0.

[1] https://www.mail-archive.com/tech@openbsd.org/msg63386.html
2024-02-18 01:57:16 +01:00
Ava Chow
e041ed9b75 wallet: Retrieve ID from loaded DescSPKM directly
Instead of iterating m_spk_managers a DescriptorSPKM has been loaded in
order to get it's ID to compare, have LoadDescriptorSPKM return a
reference to the loaded DescriptorSPKM so it can be queried directly.
2024-02-16 14:36:10 -05:00
Ava Chow
39640dd34e wallet: Use scriptPubKeyCache in GetSolvingProvider 2024-02-16 14:36:10 -05:00
Ava Chow
b410f68791 wallet: Use scriptPubKey cache in GetScriptPubKeyMans 2024-02-16 14:36:10 -05:00
Ava Chow
edf4e73a16 wallet: Use scriptPubKey cache in IsMine 2024-02-16 14:36:10 -05:00
Ava Chow
37232332bd wallet: Cache scriptPubKeys for all DescriptorSPKMs
Have CWallet maintain a cache of all known scriptPubKeys for its
DescriptorSPKMs in order to improve performance of the functions that
require searching for scriptPubKeys.
2024-02-16 14:36:09 -05:00
Ava Chow
99a0cddbc0 wallet: Introduce a callback called after TopUp completes
After TopUp completes, the wallet containing each SPKM will want to know
what new scriptPubKeys were generated. In order for all TopUp calls
(including ones internal the the SPKM), we use a callback function in
the WalletStorage interface.
2024-02-16 14:35:39 -05:00
Ava Chow
b276825932 bench: Add a benchmark for ismine 2024-02-16 14:35:33 -05:00
TheCharlatan
d5228efb53
kernel: Remove dependency on CScheduler
By defining a virtual interface class for the scheduler client, users of
the kernel can now define their own event consuming infrastructure,
without having to spawn threads or rely on the scheduler design.

Removing CScheduler also allows removing the thread and
exception modules from the kernel library.
2024-02-16 17:12:52 +01:00
MarcoFalke
fa91bf2559
ci: Skip git install if it is already installed
This also avoids the sudo requirement for self-hosted CI runners.
2024-02-16 16:06:45 +01:00
fanquake
3cbc8cbc71
Merge bitcoin/bitcoin#28037: rpc: Drop migratewallet experimental warning
f1684bb88a rpc: mention that migratewallet can take a while (Andrew Chow)
9ecff997e1 rpc: Drop migratewallet experimental warning (Andrew Chow)

Pull request description:

  The migration process itself hasn't fundamentally changed since it was added, so I think it's reasonable to say that it is no longer experimental.

ACKs for top commit:
  maflcko:
    lgtm ACK f1684bb88a
  josibake:
    ACK f1684bb88a
  furszy:
    ACK f1684bb88a
  ryanofsky:
    Code review ACK f1684bb88a
  willcl-ark:
    ACK f1684bb88a

Tree-SHA512: 99b176cddbf3878c76bd4c80c030106200bf03139785e26dbae3341e1a675b623a13cd6dc7a0bb78344335bf859ae7548d97b2b58eb650c6e7b305d7cdc86e40
2024-02-16 12:28:05 +00:00
fanquake
dfff8ee02e
Merge bitcoin/bitcoin#29414: doc: Update translation process guide
3b0ec06d62 doc: Update translation_process.md (pablomartin4btc)

Pull request description:

  Updating Transifex broken link and setup Transifex config file with a token.

ACKs for top commit:
  hebasto:
    ACK 3b0ec06d62.
  hernanmarino:
    ACK 3b0ec06d62

Tree-SHA512: fc8e537a7d244e2e5983763ff7bd017a796359b2baf2119809c2fa051f43ba8a7bcbf5aef0687bc86c8badf5abc4b67cf2e0252f9e2ee14cafb50612dd51f3f7
2024-02-16 12:24:59 +00:00
MarcoFalke
dddd7be9bf
doc: Clarify maxfeerate help 2024-02-15 19:46:45 +01:00
TheCharlatan
06069b3913
scripted-diff: Rename MainSignals to ValidationSignals
-BEGIN VERIFY SCRIPT-
s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; }

s 'CMainSignals'    'ValidationSignals'
s 'MainSignalsImpl' 'ValidationSignalsImpl'
-END VERIFY SCRIPT-
2024-02-15 14:45:51 +01:00
TheCharlatan
0d6d2b650d
scripted-diff: Rename SingleThreadedSchedulerClient to SerialTaskRunner
-BEGIN VERIFY SCRIPT-
s() { git grep -l "$1" src | (grep -v "$3" || cat;) | xargs sed -i "s/$1/$2/g"; }

s 'SingleThreadedSchedulerClient'   'SerialTaskRunner'  ''
s 'SinglethreadedSchedulerClient'   'SerialTaskRunner'  ''
s 'm_schedulerClient'               'm_task_runner'     ''
s 'AddToProcessQueue'               'insert'            ''
s 'EmptyQueue'                      'flush'             ''
s 'CallbacksPending'                'size'              'validation'
sed -i '109s/CallbacksPending/size/' src/validationinterface.cpp
-END VERIFY SCRIPT-

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2024-02-15 14:43:14 +01:00
TheCharlatan
4abde2c4e3
[refactor] Make MainSignals RAII styled 2024-02-15 14:43:12 +01:00
TheCharlatan
84f5c135b8
refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
TheCharlatan
473dd4b97a
[refactor] Prepare for g_signals de-globalization
To this end move some functions into the CMainSignals class.
2024-02-15 13:29:13 +01:00
TheCharlatan
3fba3d5dee
[refactor] Make signals optional in mempool and chainman
This is done in preparation for the next two commits, where the
CMainSignals are de-globalized.

This avoids adding new constructor arguments to the ChainstateManager
and CTxMemPool classes over the next two commits.

This could also allow future tests that are only interested in the
internal behaviour of the classes to forgo instantiating the signals.
2024-02-15 13:28:45 +01:00
MarcoFalke
fa2a4fdef7
rpc: Fixed signed integer overflow for large feerates 2024-02-15 10:56:01 +01:00
MarcoFalke
fade94d11a
rpc: Add ParseFeeRate helper 2024-02-15 10:55:47 +01:00
pablomartin4btc
3b0ec06d62 doc: Update translation_process.md
Updating Transifex broken link and remove Transifex config file
section as it has been outdated.
2024-02-14 21:39:39 -03:00
MarcoFalke
fa0ff66109
rpc: Implement RPCHelpMan::ArgValue<> for UniValue 2024-02-14 17:17:25 +01:00
Hennadii Stepanov
baed5edeb6
Merge bitcoin-core/gui#793: Update translation source file for v27.0 string freeze
3d1bb1a122 qt: Update translation source file for v27.0 string freeze (Hennadii Stepanov)

Pull request description:

  This PR updates the `src/qt/locale/bitcoin_en.xlf` translation source file according to the [Release schedule for 27.0](https://github.com/bitcoin/bitcoin/issues/29028).

  Note for reviewers: it is expected to get a zero diff after running `make -C src translate` locally.

ACKs for top commit:
  jarolrod:
    ACK 3d1bb1a122

Tree-SHA512: 9b6e5aa3aaabb918d0a6418559bc3eb14297abc48b99e8c6e6de770aa1478b8b28881f8965fd15fe23cf4aa377b88ba903e978c8b75681c4f11e428ca1588b96
2024-02-13 20:18:52 +00:00
TheCharlatan
9d1dbbd4ce scripted-diff: Fix bitcoin_config_h includes
-BEGIN VERIFY SCRIPT-

regex_string='^(?!//).*(AC_APPLE_UNIVERSAL_BUILD|BOOST_PROCESS_USE_STD_FS|CHAR_EQUALS_INT8|CLIENT_VERSION_BUILD|CLIENT_VERSION_IS_RELEASE|CLIENT_VERSION_MAJOR|CLIENT_VERSION_MINOR|COPYRIGHT_HOLDERS|COPYRIGHT_HOLDERS_FINAL|COPYRIGHT_HOLDERS_SUBSTITUTION|COPYRIGHT_YEAR|ENABLE_ARM_SHANI|ENABLE_AVX2|ENABLE_EXTERNAL_SIGNER|ENABLE_SSE41|ENABLE_TRACING|ENABLE_WALLET|ENABLE_X86_SHANI|ENABLE_ZMQ|HAVE_BOOST|HAVE_BUILTIN_CLZL|HAVE_BUILTIN_CLZLL|HAVE_BYTESWAP_H|HAVE_CLMUL|HAVE_CONSENSUS_LIB|HAVE_CXX20|HAVE_DECL_BE16TOH|HAVE_DECL_BE32TOH|HAVE_DECL_BE64TOH|HAVE_DECL_BSWAP_16|HAVE_DECL_BSWAP_32|HAVE_DECL_BSWAP_64|HAVE_DECL_FORK|HAVE_DECL_FREEIFADDRS|HAVE_DECL_GETIFADDRS|HAVE_DECL_HTOBE16|HAVE_DECL_HTOBE32|HAVE_DECL_HTOBE64|HAVE_DECL_HTOLE16|HAVE_DECL_HTOLE32|HAVE_DECL_HTOLE64|HAVE_DECL_LE16TOH|HAVE_DECL_LE32TOH|HAVE_DECL_LE64TOH|HAVE_DECL_PIPE2|HAVE_DECL_SETSID|HAVE_DECL_STRERROR_R|HAVE_DEFAULT_VISIBILITY_ATTRIBUTE|HAVE_DLFCN_H|HAVE_DLLEXPORT_ATTRIBUTE|HAVE_ENDIAN_H|HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR|HAVE_FDATASYNC|HAVE_GETENTROPY_RAND|HAVE_GETRANDOM|HAVE_GMTIME_R|HAVE_INTTYPES_H|HAVE_LIBADVAPI32|HAVE_LIBCOMCTL32|HAVE_LIBCOMDLG32|HAVE_LIBGDI32|HAVE_LIBIPHLPAPI|HAVE_LIBKERNEL32|HAVE_LIBOLE32|HAVE_LIBOLEAUT32|HAVE_LIBSHELL32|HAVE_LIBSHLWAPI|HAVE_LIBUSER32|HAVE_LIBUUID|HAVE_LIBWINMM|HAVE_LIBWS2_32|HAVE_MALLOC_INFO|HAVE_MALLOPT_ARENA_MAX|HAVE_MINIUPNPC_MINIUPNPC_H|HAVE_MINIUPNPC_UPNPCOMMANDS_H|HAVE_MINIUPNPC_UPNPERRORS_H|HAVE_NATPMP_H|HAVE_O_CLOEXEC|HAVE_POSIX_FALLOCATE|HAVE_PTHREAD|HAVE_PTHREAD_PRIO_INHERIT|HAVE_STDINT_H|HAVE_STDIO_H|HAVE_STDLIB_H|HAVE_STRERROR_R|HAVE_STRINGS_H|HAVE_STRING_H|HAVE_STRONG_GETAUXVAL|HAVE_SYSCTL|HAVE_SYSCTL_ARND|HAVE_SYSTEM|HAVE_SYS_ENDIAN_H|HAVE_SYS_PRCTL_H|HAVE_SYS_RESOURCES_H|HAVE_SYS_SELECT_H|HAVE_SYS_STAT_H|HAVE_SYS_SYSCTL_H|HAVE_SYS_TYPES_H|HAVE_SYS_VMMETER_H|HAVE_THREAD_LOCAL|HAVE_TIMINGSAFE_BCMP|HAVE_UNISTD_H|HAVE_VM_VM_PARAM_H|LT_OBJDIR|PACKAGE_BUGREPORT|PACKAGE_NAME|PACKAGE_STRING|PACKAGE_TARNAME|PACKAGE_URL|PACKAGE_VERSION|PTHREAD_CREATE_JOINABLE|QT_QPA_PLATFORM_ANDROID|QT_QPA_PLATFORM_COCOA|QT_QPA_PLATFORM_MINIMAL|QT_QPA_PLATFORM_WINDOWS|QT_QPA_PLATFORM_XCB|QT_STATICPLUGIN|STDC_HEADERS|STRERROR_R_CHAR_P|USE_ASM|USE_BDB|USE_DBUS|USE_NATPMP|USE_QRCODE|USE_SQLITE|USE_UPNP|_FILE_OFFSET_BITS|_LARGE_FILES)'

exclusion_files=":(exclude)src/minisketch :(exclude)src/crc32c :(exclude)src/secp256k1 :(exclude)src/crypto/sha256_arm_shani.cpp :(exclude)src/crypto/sha256_avx2.cpp :(exclude)src/crypto/sha256_sse41.cpp :(exclude)src/crypto/sha256_x86_shani.cpp"

git grep --perl-regexp --files-with-matches "$regex_string" -- '*.cpp' $exclusion_files | xargs git grep -L "bitcoin-config.h" | while read -r file; do line_number=$(awk -v my_file="$file" '/\/\/ file COPYING or https?:\/\/www.opensource.org\/licenses\/mit-license.php\./ {line = NR} /^\/\// && NR == line + 1 {while(getline && /^\/\//) line = NR} END {print line+1}' "$file"); sed -i "${line_number}i\\\\n\#if defined(HAVE_CONFIG_H)\\n#include <config/bitcoin-config.h>\\n\#endif" "$file"; done;

git grep --perl-regexp --files-with-matches "$regex_string" -- '*.h' $exclusion_files | xargs git grep -L "bitcoin-config.h" | while read -r file; do sed -i "/#define.*_H/a \\\\n\#if defined(HAVE_CONFIG_H)\\n#include <config/bitcoin-config.h>\\n\#endif" "$file"; done;

for file in $(git grep --files-with-matches 'bitcoin-config.h' -- '*.cpp' '*.h' $exclusion_files); do if ! grep -q --perl-regexp "$regex_string" $file; then sed -i '/HAVE_CONFIG_H/{N;N;N;d;}' $file; fi; done;

-END VERIFY SCRIPT-

The first command creates a regular expression for matching all bitcoin-config.h symbols in the following form: ^(?!//).*(AC_APPLE_UNIVERSAL_BUILD|BOOST_PROCESS_USE_STD_FS|...|_LARGE_FILES). It was generated with:
./autogen.sh && printf '^(?!//).*(%s)' $(awk '/^#undef/ {print $2}' src/config/bitcoin-config.h.in | paste -sd "|" -)

The second command holds a list of files and directories that should not be processed. These include subtree directories as well as some crypto files that already get their symbols through the makefile.

The third command checks for missing bitcoin-config headers in .cpp files and adds the header if it is missing.

The fourth command checks for missing bitcoin-config headers in .h files and adds the header if it is missing.

The fifth command checks for unneeded bitcoin-config headers in sources files and removes the header if it is unneeded.
2024-02-13 20:10:44 +00:00
Ava Chow
128b4a8038
Merge bitcoin/bitcoin#29403: wallet: batch erase procedures and improve 'EraseRecords' performance
77331aa2a1 wallet: simplify EraseRecords by using 'ErasePrefix' (furszy)
33757814ce wallet: bdb batch 'ErasePrefix', do not create txn internally (furszy)
cf4d72a75e wallet: db, introduce 'RunWithinTxn()' helper function (furszy)

Pull request description:

  Seeks to optimize and simplify `WalletBatch::EraseRecords`. Currently, this process opens a cursor to iterate over the entire database, searching for records that match the type prefixes, to then call the `WalletBatch::Erase` function for each of the matching records.
  This PR rewrites this 40-line manual process into a single line; instead of performing all of those actions manually, we can simply utilize the `ErasePrefix()` functionality. The result is 06216b344dea6ad6c385fda0b37808ff9ae5273b.

  Moreover, it expands the test coverage for the `ErasePrefix` functionality and documents the db txn requirement for `BerkeleyBatch::ErasePrefix` .

ACKs for top commit:
  achow101:
    reACK 77331aa2a1
  josibake:
    code review ACK 77331aa2a1

Tree-SHA512: 9f78dda658677ff19b5979ba0efd11cf9fabf3d315feb79ed1160526f010fe843c41903fc18c0b092f78aa88bc874cf24edad8fc1ea6e96aabdc4fd1daf21ca5
2024-02-13 13:08:30 -05:00
fanquake
d7dabdbfcd
Merge bitcoin/bitcoin#29413: fuzz: increase length of string used for NetWhitelist{bind}Permissions::TryParse
864e2e9097 fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (brunoerg)

Pull request description:

  The string `s` represents the value from `-whitelist`/`-whitebind` (e.g. "bloom,forcerelay,noban@1.2.3.4:32") and it is used in `NetWhitelistPermissions::TryParse` and `NetWhitebindPermissions::TryParse`. However, a max length of 32 is not enough to cover a lot of cases. Even disconsidering the permissions, 32 would not be enough to cover a lot of addresses. This PR fixes it.

ACKs for top commit:
  maflcko:
    lgtm ACK 864e2e9097
  epiccurious:
    utACK 864e2e9097.
  vasild:
    ACK 864e2e9097

Tree-SHA512: 2b89031b9f2ea92d636f05fd167b1e5ac726742a7e7c1af8ddaeaf90236e659731aaa6b7c23f65ec16ce52ac1b9e68e7b16e23c59e355312d057e001976d172a
2024-02-13 11:47:10 -03:00
fanquake
f83565db45
Merge bitcoin/bitcoin#29394: test, assumeutxo: Add test to ensure failure when mempool not empty
8d20602e55 test, assumeutxo: Add test to ensure failure when mempool not empty (Hernan Marino)

Pull request description:

  Add a test to ensure that loadtxoutset fails when the node's mempool is not empty, as suggested by maflcko  here: https://github.com/bitcoin/bitcoin/pull/27596#discussion_r1344713537

ACKs for top commit:
  maflcko:
    re-ACK 8d20602e55
  BrandonOdiwuor:
    ACK 8d20602e55

Tree-SHA512: 97c9668c0f38897934bf0d326515d898d4e682ff219deba9d751b35125b5cf33d51c9df116a74117ecf0394f28995a3d0cae1266b1e5acb4365ff4f309ce3f6c
2024-02-13 10:04:24 -03:00
fanquake
37fdf5a492
Merge bitcoin/bitcoin#29424: v3 followups
6b161cb82a [test] second child of a v3 tx can be replaced individually (glozow)
5c998a696c [refactor] use MAX_PUBKEYS_PER_MULTISIG instead of magic numbers in test (glozow)
a9346421db [test] PackageV3Checks with inheritance violation in mempool ancestor (glozow)
63b62e123e [doc] fix docs and comments from v3 (glozow)

Pull request description:

  Addresses final comments from #28948:
  - thread at https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1483245289, using 87fc7f0a8d with some modifications
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1483769698
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1483776227
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484427635
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484467280
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484531064
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484992098
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484992336
  - https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1484994642

ACKs for top commit:
  instagibbs:
    ACK 6b161cb82a
  sdaftuar:
    utACK 6b161cb82a

Tree-SHA512: 584fce7810f4d704ee6ab51fdc7d42bab342140cae3d076f89b5e1966dd1dd8293cb25b3121e41a4dcd65f9d4a735102b9ab2e90f98aa770b84e21f4d35d63d3
2024-02-13 09:54:22 -03:00
fanquake
3054416f62
Merge bitcoin/bitcoin#29425: test: fix intermittent failure in wallet_reorgrestore.py
44d11532f8 test: fix intermittent failure in wallet_reorgrestore.py (Martin Zumsande)

Pull request description:

  By adding a missing `sync_blocks` call.
  There was a race at `node2` between connecting the block produced by `node0`, and using `-generate` to create new blocks itself. In the failed run, block generation started before connecting the block, resulting in a final block height that was smaller by 1 than expected.
  See https://github.com/bitcoin/bitcoin/issues/29392#issuecomment-1939541603 for a more detailed analysis of the failed run.

  Can be reproduced by adding a sleep to [this spot](6ff0aa089c/src/validation.cpp (L4217))  in `ChainstateManager::ProcessNewBlock()`:
  ```
  if (util::ThreadGetInternalName() == "msghand") {
      std::this_thread::sleep_for(0.2s);
  }
  ```
  which fails for me on master and succeeds with the fix.

  Fixes #29392

ACKs for top commit:
  maflcko:
    lgtm ACK 44d11532f8

Tree-SHA512: c08699e5ae348d4c0626022b519449d052f511d3f44601bcd8dac836a130a3f67fca149532e1e3690367ebfdcbcdd32e527170d039209c1f599ce861136ae29f
2024-02-13 09:43:08 -03:00
Hennadii Stepanov
3d1bb1a122
qt: Update translation source file for v27.0 string freeze
The diff is produced by running `make -C src translate`.
2024-02-13 11:11:52 +00:00
Martin Zumsande
44d11532f8 test: fix intermittent failure in wallet_reorgrestore.py
...by adding a missing sync_blocks call.
There was a race at node2 between connecting the block
produced by node 0, and using -generate to create new blocks
itself. In the failed run, the latter happened first,
resulting in a final block height that was smaller by 1 than
expected.
2024-02-12 15:27:18 -05:00
furszy
77331aa2a1
wallet: simplify EraseRecords by using 'ErasePrefix' 2024-02-12 16:06:13 -03:00
furszy
33757814ce
wallet: bdb batch 'ErasePrefix', do not create txn internally
Transactions are intended to be started on upper layers rather than
internally by the bdb batch object. This enables us to consolidate
different write operations within a procedure in the same db txn,
improving consistency due to the atomic property of the transaction,
as well as its performance due to the reduction of disk write
operations.

Important Note:
This approach also ensures that the BerkeleyBatch::ErasePrefix
function behaves exactly as the SQLiteBatch::ErasePrefix function,
which does not create a db txn internally.

Furthermore, since the `BerkeleyBatch::ErasePrefix' implementation
erases records one by one (by traversing the db), this change
ensures that the function is always called within an active txn
context. Without this measure, there's a potential risk to consistency;
certain records may be removed while others could persist due to an
internal failure during the procedure.
2024-02-12 16:05:15 -03:00
furszy
cf4d72a75e
wallet: db, introduce 'RunWithinTxn()' helper function
'RunWithinTxn()' provides a way to execute db operations within a
transactional context. It avoids writing repetitive boilerplate code for
starting and committing the database transaction.
2024-02-12 16:05:14 -03:00
Ava Chow
6ff0aa089c
Merge bitcoin/bitcoin#28987: wallet: simplify and batch zap wallet txes process
9a3c5c8697 scripted-diff: rename ZapSelectTx to RemoveTxs (furszy)
83b762845f wallet: batch and simplify ZapSelectTx process (furszy)
595d50a103 wallet: migration, remove extra NotifyTransactionChanged call (furszy)
a2b071f992 wallet: ZapSelectTx, remove db rewrite code (furszy)

Pull request description:

  Work decoupled from #28574. Brother of #28894.

  Includes two different, yet interconnected, performance and code improvements to the zap wallet transactions process.

  1) As the goal of the `ZapSelectTx` function is to erase tx records that match any of the inputted hashes. There is no need to traverse the whole database record by record. We could just check if the tx exist, and remove it directly by calling `EraseTx()`.

  2) Instead of performing single write operations per removed tx record, this PR batches them all within a single atomic db txn.

  Moreover, these changes will enable us to consolidate all individual write operations that take place during the wallet migration process into a single db txn in the future.

ACKs for top commit:
  achow101:
    ACK 9a3c5c8697
  josibake:
    ACK 9a3c5c8697

Tree-SHA512: fb2ecc48224c400ab3b1fbb32e174b5b13bf03794717727f80f01f55fb183883b067a68c0a127b2de8885564da15425d021a96541953bf38a72becc2e9929ccf
2024-02-12 13:41:47 -05:00
Hennadii Stepanov
c6398c609b
Merge bitcoin-core/gui#773: Check for private keys disabled before attempting unlock
517c7f9cba gui: Check for private keys disabled before attempting unlock (Andrew Chow)

Pull request description:

  Before trying to unlock a wallet, first check if it has private keys disabled. If so, there is no need to unlock.

  Note that such wallets are not expected to occur in typical usage. However bugs in previous versions allowed such wallets to be created, and so we need to handle them.

  Fixes #772

  For some additional context, see #631

ACKs for top commit:
  hebasto:
    ACK 517c7f9cba, I have reviewed the code and it looks OK.
  BrandonOdiwuor:
    ACK 517c7f9cba

Tree-SHA512: c92aa34344d04667b70b059d2aa0a1da999cb7239cd1413f3009781aa82379f309ff9808d7dc91d385e2c8afe2abda3564568e2091ef833b1536ebfcf80f7c3c
2024-02-12 18:18:21 +00:00
Martin Zumsande
bf5662c678 test: enable v2 for python p2p depending on global --v2transport flag
This changes the default behavior, individual tests can overwrite this option.
As a result, it is possible to run the entire test suite with
--v2transport, and all connections to the python p2p will then use it.

Also adjust several tests that are already running with --v2transport in the
test runner (although they actually made v1 connection before this change).
This is done in the same commit so that there isn't an
intermediate commit in which the CI fails.
2024-02-12 10:46:42 -05:00
glozow
6b161cb82a [test] second child of a v3 tx can be replaced individually
Co-authored-by: ismaelsadeeq <ask4ismailsadiq@gmail.com>
2024-02-12 14:57:19 +00:00
glozow
5c998a696c [refactor] use MAX_PUBKEYS_PER_MULTISIG instead of magic numbers in test 2024-02-12 14:47:12 +00:00
glozow
a9346421db [test] PackageV3Checks with inheritance violation in mempool ancestor 2024-02-12 14:47:12 +00:00
glozow
63b62e123e [doc] fix docs and comments from v3 2024-02-12 14:27:25 +00:00
Hennadii Stepanov
e3c17112dd
Merge bitcoin-core/gui#758: Update Node window title with the chain type
9d37886a3b gui: Update Node window title with chain type (pablomartin4btc)

Pull request description:

  It fixes #544.

  Enhance the Node window title by appending the chain type to it, except for the `mainnet`, mirroring the behavior in the main window.

  ![image](https://github.com/bitcoin-core/gui/assets/110166421/6b81675c-6e53-411f-9ea7-921e74cd2359)

  There was also some [interest](https://github.com/bitcoin-core/gui/issues/78#issuecomment-695755972) on this while discussing network switching.

ACKs for top commit:
  MarnixCroes:
    tACK 9d37886a3b
  hernanmarino:
    tACK 9d37886a3b
  BrandonOdiwuor:
    tested ACK 9d37886a3b
  alfonsoromanz:
    Tested ACK 9d37886a3b
  kristapsk:
    ACK 9d37886a3b
  hebasto:
    ACK 9d37886a3b, tested on Ubuntu 23.10.

Tree-SHA512: 8c34c4586bd59b1c522662e8aa0726dccc8f12e020f7a6a1af5200a29e5817e1c51e0f467c7923041fc41535ea093c3e0dd787befbbcc84d6b9f7ff0d969db04
2024-02-12 13:08:28 +00:00
Hennadii Stepanov
2afbacc4b1
Merge bitcoin-core/gui#658: Intro: Never change the prune checkbox after the user has touched it
bee0ffbecf GUI/Intro: Never change the prune checkbox after the user has touched it (Luke Dashjr)
420a983e25 Bugfix: GUI/Intro: Disable GUI prune option if -prune is set, regardless of set value (Luke Dashjr)

Pull request description:

  Re-PR from https://github.com/bitcoin/bitcoin/pull/18729

  Now includes a bugfix too (`-prune=2+` disabled the checkbox, but `-prune=0/1` did not; this behaviour is necessary since `-prune` overrides GUI settings)

ACKs for top commit:
  hebasto:
    ACK bee0ffbecf, both commits are improvements of the current behaviour. Tested on Ubuntu 23.10.

Tree-SHA512: 8eb7d90af37deb30fe226179db3bc9df8ab59e4f3218c8e447ed31fc9ddc81ac1a1629da63347518587a56a4c8558b05cf7ec474024c5f5dfc6d49d6ff0eb0cc
2024-02-12 12:08:46 +00:00
fanquake
7d837b569d
Merge bitcoin/bitcoin#29399: test: Fix utxo set hash serialisation signedness
fa0ceae970 test: Fix utxo set hash serialisation signedness (MarcoFalke)

Pull request description:

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

  5b8990a1f3/src/kernel/coinstats.cpp (L54)

  Large positive values for the block height are too difficult to hit in tests, but it still seems fine to fix this.

  The bug was introduced when the code was written in 6ccc8fc067.

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

ACKs for top commit:
  epiccurious:
    Tested ACK fa0ceae970.
  fjahr:
    utACK fa0ceae970

Tree-SHA512: ab4405c74fb191fff8520b456d3a800cd084d616bb9ddca27d56b8e5c8969bd537490f6e204c1870dbb09a3e130b03b22a27b6644252a024059c200bbd9004e7
2024-02-12 09:02:21 -03:00
Hennadii Stepanov
6868474555
Merge bitcoin-core/gui#780: Fix: Ensure 'Transaction View' remains disabled if no wallet is selected
b2e531e70a qt: update widgets availability on wallet selection (pablomartin4btc)

Pull request description:

  This PR addresses an issue where, with no wallet selected, ticking on "Settings -> Mask values" checkbox twice enables the transaction tab when the checkbox is unticked.

  <details>
  <summary>Current behavior display on master</summary>

  ![Peek 2023-12-06 19-18](https://github.com/bitcoin-core/gui/assets/110166421/6ca4eab6-5ef0-44c1-971c-89b8bc7f0283)

  </details>

  <details>
  <summary>Correction display from this branch</summary>

  ![Peek 2023-12-07 13-07](https://github.com/bitcoin-core/gui/assets/110166421/1c78f2aa-1cf7-4d63-b4ce-c034877b4832)

  </details>

  Note for maintaners: this PR should be backported to both 25.x and 26.x.

  ---

  Originally this PR was disabling the "Mask Values" checkbox when no wallet was selected but since a reviewer pointed out that a user might want to open a wallet already on "privacy mode" I rolled that change out.

  <details>
  <summary>Original correction  display disabling "Mask Values" </summary>

  ![Peek 2023-12-06 19-11](https://github.com/bitcoin-core/gui/assets/110166421/66fdf023-998a-434d-a5bd-1a3d848fb751)

  </details>

ACKs for top commit:
  alfonsoromanz:
    Tested ACK b2e531e70a
  hebasto:
    ACK b2e531e70a, tested on Ubuntu 22.04.

Tree-SHA512: 6be77ab4d5ec86267a9b0a289a4d8600bb67d279f7e0be65e47b608ec392fe705cf026e32f3c082d2f27449b697d1d9e6a1d110035900d7a804ba823c9f5dfd4
2024-02-11 22:47:46 +00:00
Hennadii Stepanov
9e68a8208f
Merge bitcoin-core/gui#752: Modify command line help to show support for BIP21 URIs
ede5014c44 Modify command line help to show support for BIP21 URIs (Hernan Marino)

Pull request description:

  While reviewing a different PR (see https://github.com/bitcoin-core/gui/pull/742 ) **hebasto** suggested that the help for bitcoin-qt should be updated to reflect the fact that bitcoin-qt supports an optional BIP21 URI parameter.

  Since this reflects actual behaviour of bitcoin-qt and is independent of whether or not the other PR gets merged, I created this simple PR to fix the help message.

ACKs for top commit:
  kristapsk:
    utACK ede5014c44
  pablomartin4btc:
    lgtm, re ACK ede5014c44
  hebasto:
    ACK ede5014c44.

Tree-SHA512: c456297c486bc5cc65e0e092e7ba9d51b0bd7a584d4fabca7f7ca1f8e58cbcc66e96226539c689ed0f5e7f40da220bbc4ea30b90e31e1aeeb8867a385a90209c
2024-02-11 22:35:08 +00:00