rpc, wallet: Expose database format in getwalletinfo#20125
rpc, wallet: Expose database format in getwalletinfo#20125meshcollider merged 2 commits intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
|
Concept ACK |
hebasto
left a comment
There was a problem hiding this comment.
Approach ACK 56e1b81ef8efdcfe26b6fe22fea5354952afcead
Mind making the new Format member function const?
@ryanofsky fine by you? |
56e1b81 to
5e737a0
Compare
|
Concept/Approach ACK, this was the first thing I wanted to see when testing #19077. Looks like it's only missing tests. Maybe also add it to |
jonatack
left a comment
There was a problem hiding this comment.
Tested ACK modulo test coverage
RPC results
$ ./src/bitcoin-cli -rpcwallet= getwalletinfo
{
"walletname": "",
"walletversion": 169900,
"format": "bdb",
...
$ ./src/bitcoin-cli -rpcwallet=sqlite getwalletinfo
{
"walletname": "sqlite",
"walletversion": 169900,
"format": "sqlite",
...
help
Result:
{ (json object)
"walletname" : "str", (string) the wallet name
"walletversion" : n, (numeric) the wallet version
"format" : "str", (string) the database format (bdb or sqlite)
...
|
@jonatack thanks for testing, will pick this after base is merged. |
5e737a0 to
f33d6e1
Compare
|
Rebased. |
|
Test coverage commit at https://github.com/jonatack/bitcoin/commits/test-getwalletinfo-format-field, feel free to pull in or use. |
1083e8c to
624bab0
Compare
|
Thanks @jonatack, included as is. |
|
Will need a release note here or added manually in https://github.com/bitcoin-core/bitcoin-devwiki/wiki. |
hebasto
left a comment
There was a problem hiding this comment.
ACK 624bab0, tested on Linux Mint 20 (x86_64).
Tested in the GUI console :)
Mind making the new
Formatmember functionconst?@ryanofsky fine by you?
Didn't get what are concerns. 😃
|
He previously said that he dislikes interfaces that enforce const. Probably not relevant in this case. |
| int64_t kp_oldest = pwallet->GetOldestKeyPoolTime(); | ||
| obj.pushKV("walletname", pwallet->GetName()); | ||
| obj.pushKV("walletversion", pwallet->GetVersion()); | ||
| obj.pushKV("format", pwallet->GetDatabase().Format()); |
There was a problem hiding this comment.
Not sure, since it is related to the "descriptors" bool field, maybe place "format" at the end right after "descriptors". IDK.
There was a problem hiding this comment.
For now it's related. But note that you can have descriptor wallets in bdb format.
Actually you can have a bdb descriptors wallet if you use a build before #19077.
|
I think this information is mildly useful for troubleshooting user issues, and for testing. |
|
How would it be possible to have a legacy-sqlite wallet or a descriptor-bdb wallet? This should only be useful for developers that ran master? |
|
No objection obviously. doesn't hurt ACK 624bab0 |
…info 624bab0 test: add coverage for getwalletinfo format field (Jon Atack) 5e737a0 rpc, wallet: Expose database format in getwalletinfo (João Barbosa) Pull request description: Support for sqlite based wallets was added in bitcoin#19077. This PR adds the `format` key in `getwalletinfo` response, that can be `bdb` or `sqlite`. ACKs for top commit: jonatack: Tested ACK 624bab0 laanwj: Code review ACK 624bab0. MarcoFalke: doesn't hurt ACK 624bab0 hebasto: ACK 624bab0, tested on Linux Mint 20 (x86_64). meshcollider: utACK 624bab0 Tree-SHA512: a81f8530f040f6381d33e073a65f281993eccfa717424ab6e651c1203cbaf27794dcb7175570459e7fdaa211565bc060d0a3ecbe70d2b6f9c49b8d5071e4441c
Support for sqlite based wallets was added in #19077. This PR adds the
formatkey ingetwalletinforesponse, that can bebdborsqlite.