lnd: only init wallet with root key if supported#799
Conversation
|
Instead of replacing the entire startup probe, can we add a flag (or even better, actual version parsing like this) and just leave out the macaroon root key option? What happens if the option is still left in, does lnd 15 refuse to start? I think the macaroon root key logic is mainly for friendly experimentation, and isn't used in battle games where each node has to have security from players, so I think this is generally an ok thing to do. |
Sounds good, I'll look into this, thanks!
The LND node starts, but it will wait forever for the wallet: because startupProbe times out: because this loop runs forever: until curl --fail --insecure https://localhost:8080/v1/initwallet --data "{\"macaroon_root_key\":\"{{ .Values.macaroonRootKey }}\", \"wallet_password\":\"AAAAAAAAAAA=\", \"cipher_seed_mnemonic\": $PHRASE}"; do
sleep 5
done(At least I'm pretty sure that's what's happening. k8s doesn't seem to expose the output of startupProbe.) Edit: Could be that I misunderstood what you meant with "What happens if the option is still left in". Maybe you didn't mean what currently happens ( |
d8bf25e to
5efdcc6
Compare
5efdcc6 now does this, and it's much better!
It now doesn't matter if I have tested this like this: (The |
d76732c to
56334d2
Compare
Done in 56334d2. Included the node in During network setup, wallet addresses are fetched to fund the node. I had to read admin.macaroon from the pod to pass RPC authentication. Since reading admin.macaroon requires permission to execute code on the pod, any scenario that includes a pre-16 lnd node now needs to be run as admin, which is why I added I don't like this, but short of some hack to make pre-16 lnd support custom macaroon root keys, like writing macaroons.db with the root key material manually, or somehow wiring the return value of |
This includes a lnd v0.15.5-beta node in the existing macaroon tests. To set the correct Grpc-Metadata-macaroon RPC header, we read admin.macaroon from the pod if the version is below v0.16.0-beta. RBAC was updated for that.
56334d2 to
32db780
Compare
This makes it possible to overridestartupProbeof an LND node.This is required for bitcoin-dev-project/wrath-of-nalo#8 because lnd v0.15.5-beta does not supportmacaroon_root_keyininitwallet. (Support was added in v0.16.0, see lightningnetwork/lnd#6457.I couldn't simply use{{- toYaml .Values.startupProbe | nindent 8 }}and put the current default value into values.yaml similar tolivenessProbeetc. because{{ .Values.global.chain }}wouldn't get interpolated.This was tested by deploying the battlefield in bitcoin-dev-project/wrath-of-nalo#8 and inspecting the pod running lnd v0.15.5-beta.Instead of the above, it now parses the version, see #799 (comment).