MarcoFalke
commented at 12:08 pm on November 26, 2021:
member
rpcwallet is the file that takes longest to compile, especially with sanitizers enabled it can take several 10s of seconds.
Allow faster incremental and parallel builds by starting to split it up. First, split off signmessage, which is unrelated to other stuff such as wallet file handling, wallet encryption, tx creation, or wallet status/info.
MarcoFalke added the label
RPC/REST/ZMQ
on Nov 26, 2021
MarcoFalke added the label
Wallet
on Nov 26, 2021
MarcoFalke added the label
Refactoring
on Nov 26, 2021
MarcoFalke force-pushed
on Nov 26, 2021
wallet: Split signmessage from rpcwallet
Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
fae239208d
MarcoFalke force-pushed
on Nov 26, 2021
laanwj
commented at 3:14 pm on November 26, 2021:
member
First, split off signmessage, which is unrelated to other stuff such as wallet file handling, wallet encryption, tx creation, or wallet status/info.
It seems that way! I don’t understand how it can be unrelated to wallet encryption. It uses a private key to sign, right?
MarcoFalke
commented at 3:27 pm on November 26, 2021:
member
It seems that way! I don’t understand how it can be unrelated to wallet encryption. It uses a private key to sign, right?
I’d say encryption related are only the (two?) passphrase related calls. Otherwise all send* RPCs are also encryption related, no? Though, I am happy to put all HELP_REQUIRING_PASSPHRASE RPCs into one file, as long as the file is split up in some way.
laanwj
commented at 3:30 pm on November 26, 2021:
member
No, I’m fine with this (though I’m not sure it goes far enough, if you want to split up rpcwallet.cpp it might make sense to make a bigger plan), it was just a surprise, I see the EnsureWalletIsUnlocked(*pwallet); now.
Wazirabad2 approved
MarcoFalke
commented at 4:31 pm on November 26, 2021:
member
make a bigger plan
Sure, made another commit. Happy to add as many as reviewers would like me to add.
MarcoFalke renamed this:
wallet: Split signmessage from rpcwallet
wallet: Split stuff from rpcwallet
on Nov 26, 2021
DrahtBot
commented at 5:28 am on November 27, 2021:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
No conflicts as of last run.
laanwj
commented at 3:22 pm on November 28, 2021:
member
Concept ACK
meshcollider
commented at 0:58 am on November 29, 2021:
contributor
Concept ACK, but I too think we could definitely go even further than this. Things like
move wallet/rpcdump.cpp => wallet/rpc/backup.cpp and combine with backupwallet and restorewallet RPCs.
introduce wallet/rpc/util.cpp and move the helper functions there, like GetWalletForJSONRPCRequest and EnsureWalletIsUnlocked, etc.
introduce wallet/rpc/addresses.cpp and move getnewaddress, getrawchangeaddress, setlabel, listaddressgroupings, addmultisigaddress, keypoolrefill, newkeypool, getaddressinfo, getaddressesbylabel, listlabels, and walletdisplayaddress there.
introduce wallet/rpc/transactions.cpp and move listreceivedbyaddress, listreceivedbylabel, listtransactions, listsinceblock, gettransaction, abandontransaction, and rescanblockchain there.
introduce wallet/rpc/utxos.cpp and move getreceivedbyaddress, getreceivedbylabel, getbalance, getunconfirmedbalance, lockunspent, listlockunspent, getbalances, and listunspent there.
Move the walletpassphrase, walletpassphrasechange, walletlock, and encryptwallet RPCs to wallet/rpc/encrypt.cpp.
This would leave rpcwallet.cpp with only the getwalletinfo, listwalletdir, listwallets, loadwallet, setwalletflag, createwallet, unloadwallet, sethdseed , and upgradewallet RPCs, which are the “core” wallet management RPCs, so it makes sense. It could be moved to the wallet/rpc/ directory though under a different name.
Obviously this would be a lot of movement, so it would be worth getting more comments on beforehand. I am happy to open an RFC issue and make these changes over a number of PRs to break it up if needed. Let me know your thoughts.
DrahtBot added the label
Needs rebase
on Nov 29, 2021
MarcoFalke force-pushed
on Nov 29, 2021
MarcoFalke
commented at 4:46 pm on November 29, 2021:
member
I’ve removed fa24419d22 again to avoid the conflicts. This can be done as a second step later. I think it is pretty clear that this will be done in smaller steps according to the plan above by @meshcollider
DrahtBot removed the label
Needs rebase
on Nov 29, 2021
ryanofsky approved
ryanofsky
commented at 6:46 pm on November 29, 2021:
member
Code review ACKfae239208d3676452a755f736ee5aaa17adeb493. Confirmed move only
meshcollider
commented at 1:30 am on November 30, 2021:
contributor
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: 2024-11-17 15:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me