-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lnd: fix missing RPC permissions when bitcoind is pruned #563
Conversation
This also improves performance by removing the extra module evaluation.
5f6e6a6
to
83cb507
Compare
83cb507
to
67949a0
Compare
Nice, this is working for me |
Pinging @seberm, could you have a look at the commits affecting shellcheck? |
The
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lnd commit looks good to me.
(mkIf isPruned { | ||
services.bitcoind.rpc.users.lnd = { | ||
passwordHMACFromFile = true; | ||
rpcwhitelist = bitcoind.rpc.users.public.rpcwhitelist ++ [ | ||
"getpeerinfo" | ||
"getnodeaddresses" | ||
]; | ||
}; | ||
nix-bitcoin.secrets = { | ||
bitcoin-rpcpassword-lnd.user = cfg.user; | ||
bitcoin-HMAC-lnd.user = bitcoind.user; | ||
}; | ||
nix-bitcoin.generateSecretsCmds.lndBitcoinRPC = '' | ||
makeBitcoinRPCPassword lnd | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder at what point it would make sense to abstract this. "privileged", "joinmarket-ob-watcher", "btcpayserver" all set the same options modulo user and rpcwhitelist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have a branch from 2021 which implements such an abstraction (by adding options passwordFile.{user,group}
to bitcoind.rpc.users.<name>
).
I guess I deemed that its benefits didn't warrant the increase in implicitness and the extra review burden. But if you're open to it, I'll dust it off and publish it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah well if you already came to that conclusion no need to dust it off now.
Hello @jonasnick, the code seems fine to me. I also rechecked the shellcheck still works as expected (made shellcheck erros into preStart scripts of nix-bitcoin services):
As you can see, it's working fine when running:
But the test is not failing, when I add a
Is this expected behavior? Thanks. |
Yes, service shellcheck is only run for the VM test that's run as a Nix build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch includes some required commits from #559.
I've confirmed that lnd requires extra bitcoin RPC commands (via pruned_block_dispatcher.go) when bitcoind is pruned. This PR fixes the missing RPC permissions.
@ekimber, does this PR fix #562 for you?