-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Add "warnings", deprecate "warning" in {create,load,unload,restore}wallet #27279
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
Add "warnings", deprecate "warning" in {create,load,unload,restore}wallet #27279
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
e266277 to
6a5ceb3
Compare
vasild
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
6a5ceb3 to
748e755
Compare
cf8c237 to
452d869
Compare
f3cb41f to
eaa6785
Compare
eaa6785 to
e67da5f
Compare
pinheadmz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concept ACK
Light code review. I prefer this to #27138 it seems like the right move. Built and ran tests, played with interface, nice!
--> bccli -regtest -named createwallet wallet_name=oops2 descriptors=false passphrase=""
{
"name": "oops2",
"warnings": [
"Empty string given as passphrase, wallet will not be encrypted.",
"Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."
]
}
I did a quick search for other RPCs that string together warnings, I think getblockchaininfo still does - worth including here?
Also, the GUI: I don't think encrypting wallet with a blank passphrase is possible from the UI so I don't know if there is a way to see multiple warnings in production, or if that is already handled.
|
Thanks for testing!
Info getter RPCs
I think the GUI handles these operations at a higher (non-RPC) layer, e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code review ACK @ e67da5fedd526c38e030d6d18f3678313a683dc9
A few questions.
sedited
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK
vasild
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e67da5fedd526c38e030d6d18f3678313a683dc9
Some non-blockers below.
- clarify that there can be multiple warning messages - specify the correct wallet action - describe the use of newlines as delimiters
This new "warnings" field is a JSON array of strings intended to replace the "warning" string field in these four RPCs, to better handle returning multiple warning messages and for consistency with other wallet RPCs.
and clarify the "warning" field behavior.
This string field has been replaced in these four RPCs by a "warnings" field returning a JSON array of strings.
and add the walletutil.h include header for WALLET_FLAG_AVOID_REUSE that was already missing before this change. WALLET_FLAG_CAVEATS is only used in one RPC, so no need to encumber wallet.h and wallet.cpp with it, along with all of the files that include wallet.h during their compilation. Also apply clang-format per: git diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v
as these RPCs have a "warnings" field, not a "warning" one.
e67da5f to
7ccdd74
Compare
|
Thank you @pinheadmz, @vasild and @TheCharlatan. Repushed to address feedback, should be trivial to re-ACK.
|
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7ccdd74
vasild
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7ccdd74
pinheadmz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK 7ccdd74
confirmed trivial diff since last review, ran unit and functional tests locally, ran in regtest one more time to check UX with and without deprecated rpc flag
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK 7ccdd741fe1544c13b2a9b7baa5c5727e84d6e55
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmQ20YEACgkQ5+KYS2KJ
yTqF/Q/8DnfN9Esae47Y1bvswkY5oX93SBB59pUEOHSxfTugRWFr18xZyUZI3zHz
kK8SFsVEXfm7lWTdMiRLjDSthFcsHMnzv+JNc76qvFuOhD5TYHkX81V7fUXSiDiS
VaODlGlVS/Cw6KoOQ52WWXltJxt0bIxPZMYBrtSus7poarSuCaOsXDqCaU+Ma6SM
KglES3j1+M4f7FIPUD6QVzHbhfYddTnFuwsBAgwMBxb/c7O8JrEWwxem80vc2jH4
9erbjBhF8YotvH4ici8Xl0bO6/FmpldLz3CNRqbl7tYJOIxU+z+WsgpcI+D9C2jQ
NXOIL6bKCHom8MlOBJpTez892wRoTjV6SXNHa1TrlGuRFUVQpTb8QWMiP4RmSuFm
UcDyuwLkDOUGx09SviS2FjZA1BBogCsWiwD7ZpoBcW1sXqmFqGL9VCGrAzmuwqcd
9xDn9vbzcvSEx8JdQvDYRpjdnQ8y2yt1VsgbpABRtb8uj16GLT1WiDCMFJFGxkV+
3dSIIHe7DnNSw30v8YFoBYCbrXQBJLhNGu1AsLmlQJ3rpiULOAklRqWV4tE22cp8
BU8g9003FTC5gBTJlyXDdZTVkh82ucuTWAlpFQysHXswunmP6nmYvMDhWjSPf46d
jdhQo38SR7lZQ49cetwAOOy2G7TxOm7T0/vts2HUCp8Pyx6sjBo=
=Q/2X
-----END PGP SIGNATURE-----
pinheadmz's public key is on keybase
|
ACK 7ccdd74 |
- clarify that there can be multiple warning messages - specify the correct wallet action - describe the use of newlines as delimiters Github-Pull: bitcoin#27279 Rebased-From: f73782a
dc711fb doc: update 24.1 release notes (fanquake) fc8c1a8 doc: fix/improve warning helps in {create,load,unload,restore}wallet (Jon Atack) 3a26b19 bugfix: rest: avoid segfault for invalid URI (pablomartin4btc) c40b1da depends: fix compiling bdb with clang-16 on aarch64 (fanquake) 0bac52d Don't return OutputType::UNKNOWN in ParseOutputType (Pttn) Pull request description: Backports: * bitcoin#27279 (only f73782a) * bitcoin#27462 * bitcoin#27468 * bitcoin#27473 ACKs for top commit: stickies-v: ACK dc711fb hebasto: re-ACK dc711fb jonatack: ACK dc711fb Tree-SHA512: 72c673be82689e3c3a1c2564a1fdd6afe0b357b7aa8bec9524fe6999804fbccf310da0b074e647af14b753e5e695024e268fe4f69aa58747f541f7f429ebede6
…d,restore,unload}wallet 5524fa0 doc: add release note about removal of `deprecatedrpc=walletwarningfield` flag (Sebastian Falbesoner) 5c77db7 Restorewallet/createwallet help documentation fixups/improvements (Jon Atack) a00ae31 rpc: remove deprecated "warning" field from {create,load,restore,unload}wallet (Sebastian Falbesoner) Pull request description: The "warning" string field for wallet creating/loading RPCs (`createwallet`, `loadwallet`, `unloadwallet` and `restorewallet`) has been deprecated with the configuration option `-deprecatedrpc=walletwarningfield` in PR #27279 (released in v25.0). For the next release v26.0, the field and the configuration option can be removed. ACKs for top commit: achow101: ACK 5524fa0 jonatack: ACK 5524fa0 Tree-SHA512: 8212f72067d08095304018b8a95d2ebef630004b65123483fbbfb078cc5709c2d825bbc35b16ea5f6b28ae7377347382d7e9afaf7bdbf0575d2c229d970784de
…ate,load,restore,unload}wallet 5524fa0 doc: add release note about removal of `deprecatedrpc=walletwarningfield` flag (Sebastian Falbesoner) 5c77db7 Restorewallet/createwallet help documentation fixups/improvements (Jon Atack) a00ae31 rpc: remove deprecated "warning" field from {create,load,restore,unload}wallet (Sebastian Falbesoner) Pull request description: The "warning" string field for wallet creating/loading RPCs (`createwallet`, `loadwallet`, `unloadwallet` and `restorewallet`) has been deprecated with the configuration option `-deprecatedrpc=walletwarningfield` in PR bitcoin#27279 (released in v25.0). For the next release v26.0, the field and the configuration option can be removed. ACKs for top commit: achow101: ACK 5524fa0 jonatack: ACK 5524fa0 Tree-SHA512: 8212f72067d08095304018b8a95d2ebef630004b65123483fbbfb078cc5709c2d825bbc35b16ea5f6b28ae7377347382d7e9afaf7bdbf0575d2c229d970784de
Based on discussion and concept ACKed in #27138, add a
warningsfield to RPCs createwallet, loadwallet, unloadwallet, and restorewallet as a JSON array of strings to replace thewarningstring field in these 4 RPCs. The idea is to more gracefully handle multiple warning messages and for consistency with other wallet RPCs. Then, deprecate the latter fields, which represent all the remaining RPCwarningfields.The first commit f73782a implements #27138 (comment) as an alternative to #27138. One of those two could potentially be backported to our currently supported releases.