Appears to have been broken by #10849
RPC: Restore backward compatibility, in multiwallet mode #10989
pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:multiwallet_rpccompat changing 2 files +5 −5-
luke-jr commented at 6:54 PM on August 4, 2017: member
-
RPC: Restore backward compatibility, in multiwallet mode dde71965a8
-
ryanofsky commented at 7:11 PM on August 4, 2017: member
The check was written this way so explicitly specifying a wallet is required if more than one is loaded. So if, for example, you are writing a script that runs a series of RPCs, and you accidentally forget the wallet option in one of the calls, you get an error message instead of performing an operation or getting data returned from the wrong wallet.
If only one wallet is loaded, providing a wallet parameter should not be necessary, so there should be 100% backwards compatibility with previous releases the way this is written now.
-
jonasschnelli commented at 7:12 PM on August 4, 2017: contributor
Didn't we agree that when running Core with multiple wallets one needs to specify the wallet (instead of default using the first one)? IMO we did agree on that.
PR seems NACKish.
- jonasschnelli added the label Wallet on Aug 4, 2017
-
sipa commented at 7:14 PM on August 4, 2017: member
Yes, this is intentional and changing it looks like a footgun. NACK
-
luke-jr commented at 8:00 PM on August 4, 2017: member
@jonasschnelli No, I don't recall agreeing to that. It breaks compatibility with existing software (and also means there is literally no future-supported method to access your wallet when multiple wallets are loaded).
The primary target with multiwallet in this release is to support having other wallets loaded in the background, so they're kept up to date with a pruning node. That is broken by this behaviour... @ryanofsky I can rebase #10615 on top of this, but AFAIK it's too late for 0.15 since it adds new features. This focuses only on the existing bug.
-
jonasschnelli commented at 8:08 PM on August 4, 2017: contributor
@jonasschnelli No, I don't recall agreeing to that. It breaks compatibility with existing software (and also means there is literally no future-supported method to access your wallet when multiple wallets are loaded).
Why? 0.15 is the first release of Core with multiwallet. No versions before could run multiple wallets.
The primary target with multiwallet in this release is to support having other wallets loaded in the background, so they're kept up to date with a pruning node. That is broken by this behaviour...
This seems very dangerous. One quickly messes up the argument order making another wallet the "default" wallet which can result in lost funds.
-
ryanofsky commented at 8:57 PM on August 4, 2017: member
Right now, if you are using bitcoin-cli you can specify
rpcwallet=wallet.datin your config file, and you won't have to specify any wallet on the command line. If you are using another RPC client you can send requests to/wallet/wallet.datinstead of/, which might require some work if you have preexisting code, but at least you shouldn't have to change the content of the requests.For the future, I suggested in #10868 (comment) that we could add a server-side
-defaultwalletoption, which would let you explicitly specify a default wallet for the server, instead of having it implicitly chose one based on the order options were parsed (and no way to prevent it if you don't want a default wallet). Rebasing #10615 and adding per-user default or restricted wallets could be another option. -
promag commented at 9:39 PM on August 4, 2017: member
Unless a new option is added to allow backward compatibility? For instance,
-defaultwallet=...?Edit: ops @ryanofsky, you said the same above :)
-
jnewbery commented at 9:59 PM on August 4, 2017: member
NACK for the reasons other people have already mentioned:
- multiwallet is a new feature so backwards-compatibility is not an issue
- having an implicit default wallet in multiwallet is a footgun. Perhaps a future change could add an explicit default wallet as @ryanofsky suggests.
-
luke-jr commented at 10:12 PM on August 4, 2017: member
That multiwallet is a new feature doesn't make backward compatibility a non-issue. Just because someone enables new feature XYZ doesn't mean existing features should suddenly break completely.
-
sipa commented at 10:18 PM on August 4, 2017: member
No existing functionality is broken. As long as you only have a single wallet, everything keeps working as it was. Once you use multiple wallets - something that didn't exist before - some things stop working because of safety reasons.
Please stop arguing that this is about backward compatibility, it isn't. There are several ideas about how to accomplish your goal (having wallets loaded in the background with a primary one that RPC operates on). Focus on enabling those features that don't risk people shooting themselves in the foot.
-
jonasschnelli commented at 7:27 PM on August 15, 2017: contributor
Closing due to the NACK & comments above.
- jonasschnelli closed this on Aug 15, 2017
- DrahtBot locked this on Sep 8, 2021