-
Notifications
You must be signed in to change notification settings - Fork 0
Merge bitcoin/bitcoin#26532: wallet: bugfix, invalid crypted key "checksum_valid" set #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: backport-0.25-batch-249
Are you sure you want to change the base?
Merge bitcoin/bitcoin#26532: wallet: bugfix, invalid crypted key "checksum_valid" set #144
Conversation
…lid" set 13d9760 test: load wallet, coverage for crypted keys (furszy) 373c996 refactor: move DuplicateMockDatabase to wallet/test/util.h (furszy) ee7a984 refactor: unify test/util/wallet.h with wallet/test/util.h (furszy) cc5a5e8 wallet: bugfix, invalid crypted key "checksum_valid" set (furszy) Pull request description: At wallet load time, the crypted key "checksum_valid" variable is always set to false. Which, on every wallet decryption call, forces the process to re-write all the ckeys to db when it's not needed. Note: The first commit fixes the issue, the two commits in the middle are cleanups so `DuplicateMockDatabase` can be used without duplicating code. And, the last one is pure test coverage for the crypted keys loading process. Includes test coverage for the following scenarios: 1) "All ckeys checksums valid" test: Loads an encrypted wallet with all the crypted keys with a valid checksum and verifies that 'CWallet::Unlock' doesn't force an entire crypted keys re-write. (we force a complete ckeys re-write if we find any missing crypted key checksum during the wallet loading process) 2) "Missing checksum in one ckey" test: Verifies that loading up a wallet with, at least one, 'ckey' with no checksum triggers a complete re-write of the crypted keys. 3) "Invalid ckey checksum error" test: Verifies that loading up a ckey with an invalid checksum stops the wallet loading process with a corruption error. 4) "Invalid ckey pubkey error" test: Verifies that loading up a ckey with an invalid pubkey stops the wallet loading process with a corruption error. ACKs for top commit: achow101: ACK 13d9760 aureleoules: ACK 13d9760 Tree-SHA512: 9ea630ee4a355282fbeee61ca04737294382577bb4b2631f50e732568fdab8f72491930807fbda58206446c4f26200cdc34d8afa14dbe1241aec713887d06a0b
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
- Update getNewDestination to use Dash's GetNewDestination signature - Add missing includes for bilingual_str and std::runtime_error - Adapt wallet test util functions for Dash API differences This fixes compilation issues with the wallet test utilities backported from Bitcoin.
|
Backports bitcoin#26532
Original commit: 5690848
This backport includes the test utility refactoring parts of the original PR. The main bugfix for the crypted key checksum validation is already present in Dash Core. The walletload_tests.cpp file was not included due to significant API differences between Bitcoin and Dash (missing UNKNOWN_DESCRIPTOR error type, different GetNewDestination signature, missing DeleteRecords and SetupGeneration methods).
Backported from Bitcoin Core v0.25