Update keypoolrefill
RPC docs to make it clear that descriptor wallets have 4 ScriptPubKeyManagers by default and each of them is updated in this command, as suggested #29924 (comment)
docs: Improve keypoolrefill
RPC docs
#32429
pull
w0xlt
wants to merge
1
commits into
bitcoin:master
from
w0xlt:keypoolrefill_docs
changing
1
files
+2 −1
-
w0xlt commented at 7:15 pm on May 6, 2025: contributor
-
DrahtBot commented at 7:15 pm on May 6, 2025: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32429.
Reviews
See 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.
-
DrahtBot added the label Docs on May 6, 2025
-
in src/wallet/rpc/addresses.cpp:340 in 9e20f6ba68 outdated
335@@ -336,7 +336,9 @@ RPCHelpMan addmultisigaddress() 336 RPCHelpMan keypoolrefill() 337 { 338 return RPCHelpMan{"keypoolrefill", 339- "\nFills the keypool."+ 340+ "\nRefills each `ScriptPubKeyManager` keypool in the wallet up to the specified number of new keys.\n" 341+ "By default, descriptor wallets have four `ScriptPubKeyManagers` (`wpkh`, `tr`, `pkh`, and `sh-wpkh`), each with 1000 entries.\n"
maflcko commented at 8:43 pm on May 6, 2025:Should probably useDEFAULT_KEYPOOL_SIZE
instead of hardcoded 1000? Same for theOUTPUT_TYPES
? Also,ScriptPubKeyManagers
was never used in user-facing docs, except for one error message. Maybe just use “active ranged descriptor” (or similar)?
w0xlt commented at 11:37 pm on May 6, 2025:Done (forDEFAULT_KEYPOOL_SIZE
andScriptPubKeyManagers
). RegardingOUTPUT_TYPES
, I think it may need to be refactored to include it in the RPC documentation due to static initialization. But for now, I leftkeypoolrefill
exactly asgetnewaddress
.
w0xlt commented at 3:17 am on May 7, 2025:OUTPUT_TYPES
handled in https://github.com/bitcoin/bitcoin/pull/32432in src/wallet/rpc/addresses.cpp:341 in 9e20f6ba68 outdated
335@@ -336,7 +336,9 @@ RPCHelpMan addmultisigaddress() 336 RPCHelpMan keypoolrefill() 337 { 338 return RPCHelpMan{"keypoolrefill", 339- "\nFills the keypool."+ 340+ "\nRefills each `ScriptPubKeyManager` keypool in the wallet up to the specified number of new keys.\n" 341+ "By default, descriptor wallets have four `ScriptPubKeyManagers` (`wpkh`, `tr`, `pkh`, and `sh-wpkh`), each with 1000 entries.\n" 342+ "Legacy wallet typically uses a single `LegacyScriptPubKeyMan` (which manages both external and internal keypools)\n"+
maflcko commented at 9:07 pm on May 6, 2025:also, now that bdb was removed, no need to add docs for it?
w0xlt commented at 11:37 pm on May 6, 2025:Done. Thanks.w0xlt force-pushed on May 6, 2025w0xlt force-pushed on May 6, 2025in src/wallet/rpc/addresses.cpp:339 in cd00fb85e9 outdated
335@@ -336,7 +336,8 @@ RPCHelpMan addmultisigaddress() 336 RPCHelpMan keypoolrefill() 337 { 338 return RPCHelpMan{"keypoolrefill", 339- "\nFills the keypool."+ 340+ "\nRefills each descriptor keypool in the wallet up to the specified number of new keys.\n"
maflcko commented at 7:46 am on May 7, 2025:0 "Refills each descriptor keypool in the wallet up to the specified number of new keys.\n"
nit: This is trimmed anyway.
w0xlt commented at 5:45 pm on May 7, 2025:in src/wallet/rpc/addresses.cpp:340 in cd00fb85e9 outdated
335@@ -336,7 +336,8 @@ RPCHelpMan addmultisigaddress() 336 RPCHelpMan keypoolrefill() 337 { 338 return RPCHelpMan{"keypoolrefill", 339- "\nFills the keypool."+ 340+ "\nRefills each descriptor keypool in the wallet up to the specified number of new keys.\n" 341+ "By default, descriptor wallets have 4 active ranged descriptors (\"legacy\", \"p2sh-segwit\", \"bech32\", and \"bech32m\"), each with " + std::to_string(DEFAULT_KEYPOOL_SIZE) + " entries.\n" +
w0xlt commented at 5:45 pm on May 7, 2025:rkrux approvedrkrux commented at 10:49 am on May 7, 2025: contributorACK cd00fb85e9e0997120715e68374462cff0dad7eb given the suggestions are addressed.
I checked that by default there are 4 scriptpubkeymans setup on the first run of the wallet inside
SetupDescriptorScriptPubKeyMans
. Also, ack because the lack of this information has caused an issue to be created.docs: Improve `keypoolrefill` RPC docs ff35a4b021w0xlt force-pushed on May 7, 2025brunoerg approvedbrunoerg commented at 5:48 pm on May 7, 2025: contributorcode review ACK ff35a4b021e12ae33e28c01ffeeb2c1916f7a487DrahtBot requested review from rkrux on May 7, 2025achow101 commented at 9:44 pm on May 7, 2025: memberACK ff35a4b021e12ae33e28c01ffeeb2c1916f7a487achow101 merged this on May 7, 2025achow101 closed this on May 7, 2025
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-05-08 12:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me