c98fc36d094a08d44f3c95431db2c5f34a96cc73 wallet: migration, consolidate external wallets db writes (furszy) 7c9076a2d2e5dd117c31ca871e81c9170aa0e371 wallet: migration, consolidate main wallet db writes (furszy) 9ef20e86d7fd5d775c463a7a752c5bba9ef1266b wallet: provide WalletBatch to 'SetupDescriptorScriptPubKeyMans' (furszy) 34bf0795fc0fe30bd04a5b3a89b779f502189262 wallet: refactor ApplyMigrationData to return util::Result<void> (furszy) aacaaaa0d3aeb576e01e2b4e6b3b094ab10f602a wallet: provide WalletBatch to 'RemoveTxs' (furszy) 57249ff669748d60895c275255dfb9bffaecbb67 wallet: introduce active db txn listeners (furszy) 91e065ec175e3d40439230d0a70b2c2c73ff024b wallet: remove post-migration signals connection (furszy) 055c0532fc8bb3135102590b46e266b68e9d9edc wallet: provide WalletBatch to 'DeleteRecords' (furszy) 122d103ca22f347eef7b323910477b72736c64b9 wallet: introduce 'SetWalletFlagWithDB' (furszy) 6052c7891dc033e30b342ae5ea1690f8e7cbeb9e wallet: decouple default descriptors creation from external signer setup (furszy) f2541d09e132ce17a5d166583be98f5cdbf06588 wallet: batch MigrateToDescriptor() db transactions (furszy) 66c9936455fc0b79629686fe6b5737a020662e5d bench: add coverage for wallet migration process (furszy) Pull request description: Last step in a chain of PRs (#26836, #28894, #28987, #29403). #### Detailed Description: The current wallet migration process performs only individual db writes. Accessing disk to delete all legacy records, clone and clean each address book entry for every created wallet, create each new descriptor (with their corresponding master key, caches and key pool), and also clone and delete each transaction that requires to be transferred to a different wallet. This work consolidates all individual disk writes into two batch operations. One for the descriptors creation from the legacy data and a second one for the execution of the migration process itself. Efficiently dumping all the information to disk at once atomically at the end of each process. This represent a speed up and also a consistency improvement. During migration, we either want to succeed or fail. No other outcomes should be accepted. We should never leave a partially migrated wallet on disk and request the user to manually restore the previous wallet from a backup (at least not if we can avoid it). Since the speedup depends on the storage device, benchmark results can vary significantly. Locally, I have seen a 15% speedup on a USB 3.2 pendrive. #### Note for Testers: The first commit introduces a benchmark for the migration process. This one can be cherry-picked on top of master to compare results pre and post changes. Please note that the benchmark setup may take some time (~70 seconds here) due to the absence of a batching mechanism for the address generation process (`GetNewDestination()` calls). ACKs for top commit: achow101: ACK c98fc36d094a08d44f3c95431db2c5f34a96cc73 theStack: re-ACK c98fc36d094a08d44f3c95431db2c5f34a96cc73 pablomartin4btc: re-ACK c98fc36d094a08d44f3c95431db2c5f34a96cc73 Tree-SHA512: a52d5f2eef27811045d613637c0a9d0b7e180256ddc1c893749d98ba2882b570c45f28cc7263cadd4710f2c10db1bea33d88051f29c6b789bc6180c85b5fd8f6
Bitcoin Core integration/staging tree
For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.
What is Bitcoin Core?
Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.
Further information about Bitcoin Core is available in the doc folder.
License
Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.
Development Process
The master
branch is regularly built (see doc/build-*.md
for instructions) and tested, but it is not guaranteed to be
completely stable. Tags are created
regularly from release branches to indicate new official, stable release versions of Bitcoin Core.
The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.
The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.
Testing
Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.
Automated Testing
Developers are strongly encouraged to write unit tests for new code, and to
submit new unit tests for old code. Unit tests can be compiled and run
(assuming they weren't disabled during the generation of the build system) with: ctest
. Further details on running
and extending unit tests can be found in /src/test/README.md.
There are also regression and integration tests, written
in Python.
These tests can be run (if the test dependencies are installed) with: build/test/functional/test_runner.py
(assuming build
is your build directory).
The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.
Manual Quality Assurance (QA) Testing
Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.
Translations
Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.
Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.
Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.