Add interfaces::ExternalSigner
class to let signer objects be passed between processes and let signer code run in the original process where the object was created.
This PR is part of the process separation project.
Add interfaces::ExternalSigner
class to let signer objects be passed between processes and let signer code run in the original process where the object was created.
This PR is part of the process separation project.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, 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.
enumeratesigners
RPC call works (not very useful). See rpc_signer.py
. This is consistent with RPC calls like signrawtransactionwithkey
which also don’t need a wallet. This is why I initially picked the Node interface. Not sure how much this matters, or even if anyone cares about using external signers without a (watch-only) wallet.
Add interfaces::ExternalSigner to let signer objects be passed between
processes and signer code to run in the original process, without
multiple processes linking and running signer code.
External signers can in principle be used without wallet support, though currently only the
enumeratesigners
RPC call works (not very useful). Seerpc_signer.py
. This is consistent with RPC calls likesignrawtransactionwithkey
which also don’t need a wallet. This is why I initially picked the Node interface. Not sure how much this matters, or even if anyone cares about using external signers without a (watch-only) wallet.
Fair enough. I moved the signers list method back to the Node
interface instead of adding it to the WalletClient
interface so the signer code will keep running in the node process instead of the wallet process and there’s no behavior change. This makes the PR smaller, and if there is ever any reason to switch which process signing code runs in, it can be moved later.
Now this PR only adds the interfaces::ExternalSigner
class, which is needed so there is some way of passing signers between processes.
Rebased c74e5706a46d063adbdef93b1cf2582086a78382 -> e3afe660a44aec9cc6ce6a2e04461fdf5ade2483 (pr/ipc-signer.1
-> pr/ipc-signer.2
, compare) due to conflict with #22951, and also moved list signers method back to the Node interface as sjors suggested
71+{
72+public:
73+#ifdef ENABLE_EXTERNAL_SIGNER
74+ ExternalSignerImpl(::ExternalSigner signer) : m_signer(std::move(signer)) {}
75+ std::string getName() override { return m_signer.m_name; }
76+ ::ExternalSigner m_signer;
m_signer
is not a private:
member?
re: #23004 (review)
Why
m_signer
is not aprivate:
member?
Added. No real reason but the whole class is effectively private.
configure
options: --enable-external-signer
and --disable-external-signer
.
Thanks for review!
Updated e3afe660a44aec9cc6ce6a2e04461fdf5ade2483 -> a032fa30d282fa69c304e0afd1f95f67c55d22e3 (pr/ipc-signer.2
-> pr/ipc-signer.3
, compare) with suggestion