Skip to content

Commit 42104cd

Browse files
authored
LND v0.20 (#7)
* LND 0.20rc1 * pull * bump
1 parent 453fcb1 commit 42104cd

File tree

8 files changed

+172
-53
lines changed

8 files changed

+172
-53
lines changed

Docker/lnd/Dockerfile

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,38 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.23.12-alpine as builder
3+
FROM golang:1.24.6-alpine AS builder
44

55
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
66
# queries required to connect to linked containers succeed.
7-
ENV GODEBUG netdns=cgo
7+
ENV GODEBUG=netdns=cgo
88

99
# Pass a tag, branch or a commit using build-arg. This allows a docker
1010
# image to be built from a specified Git state. The default image
1111
# will use the Git tip of master by default.
12-
ARG checkout="v0.19.3-beta"
12+
ARG checkout="v0.20.0-beta.rc1"
1313
ARG git_url="https://github.com/lightningnetwork/lnd"
1414

1515
# Install dependencies and build the binaries.
1616
RUN apk add --no-cache --update alpine-sdk \
1717
git \
1818
make \
19-
gcc \
20-
&& git clone $git_url /go/src/github.com/lightningnetwork/lnd \
19+
gcc
20+
RUN git clone $git_url /go/src/github.com/lightningnetwork/lnd \
2121
&& cd /go/src/github.com/lightningnetwork/lnd \
2222
&& git checkout $checkout \
2323
&& make release-install -j ${nprocs}
24-
#
25-
## Start a new, final image.
26-
#FROM alpine as final
27-
#
28-
## Define a root volume for data persistence.
29-
#VOLUME /root/.lnd
30-
#
31-
## Add utilities for quality of life and SSL-related reasons. We also require
32-
## curl and gpg for the signature verification script.
33-
#RUN apk --no-cache add \
34-
# bash \
35-
# jq \
36-
# ca-certificates \
37-
# gnupg \
38-
# curl
39-
40-
# Copy the binaries from the builder image.
41-
42-
4324

4425

4526
FROM debian:stable-slim
4627

47-
ARG LND_VERSION=0.19.0-beta.rc1
28+
ARG LND_VERSION=0.20.0-beta.rc1
4829
ENV PATH=/opt/lnd:$PATH
4930

5031
RUN apt-get update -y \
5132
&& apt-get install -y curl gosu wait-for-it \
5233
&& apt-get clean \
5334
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
5435

55-
#RUN SYS_ARCH="$(dpkg --print-architecture)" \
56-
# && curl -SLO https://github.com/lightningnetwork/lnd/releases/download/v${LND_VERSION}/lnd-linux-${SYS_ARCH}-v${LND_VERSION}.tar.gz \
57-
# && tar -xzf *.tar.gz \
58-
# && mkdir /opt/lnd \
59-
# && mv ./lnd-linux-${SYS_ARCH}-v${LND_VERSION}/* /opt/lnd \
60-
# && rm *.tar.gz
6136
RUN SYS_ARCH="$(dpkg --print-architecture)" \
6237
&& mkdir /opt/lnd
6338
COPY --from=builder /go/bin/lncli /opt/lnd/
@@ -67,7 +42,7 @@ COPY --from=builder /go/src/github.com/lightningnetwork/lnd/scripts/keys/* /keys
6742

6843

6944
RUN curl -SLO https://raw.githubusercontent.com/lightningnetwork/lnd/master/contrib/lncli.bash-completion \
70-
&& mkdir /etc/bash_completion.d \
45+
&& mkdir -p /etc/bash_completion.d \
7146
&& mv lncli.bash-completion /etc/bash_completion.d/ \
7247
&& curl -SLO https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion \
7348
&& mv bash_completion /usr/share/bash-completion/

LNUnit.LND/Grpc/lightning.proto

Lines changed: 137 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,13 @@ service Lightning {
341341
*/
342342
rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice);
343343

344+
/* lncli: `deletecanceledinvoice`
345+
DeleteCanceledInvoice removes a canceled invoice from the database. If the
346+
invoice is not in the canceled state, an error will be returned.
347+
*/
348+
rpc DeleteCanceledInvoice (DelCanceledInvoiceReq)
349+
returns (DelCanceledInvoiceResp);
350+
344351
/* lncli: `decodepayreq`
345352
DecodePayReq takes an encoded payment request string and attempts to decode
346353
it, returning a full description of the conditions encoded within the
@@ -548,9 +555,10 @@ service Lightning {
548555
returns (ListPermissionsResponse);
549556

550557
/*
551-
CheckMacaroonPermissions checks whether a request follows the constraints
552-
imposed on the macaroon and that the macaroon is authorized to follow the
553-
provided permissions.
558+
CheckMacaroonPermissions checks whether the provided macaroon contains all
559+
the provided permissions. If the macaroon is valid (e.g. all caveats are
560+
satisfied), and all permissions provided in the request are met, then
561+
this RPC returns true.
554562
*/
555563
rpc CheckMacaroonPermissions (CheckMacPermRequest)
556564
returns (CheckMacPermResponse);
@@ -1911,6 +1919,7 @@ message Peer {
19111919
repeated TimestampedError errors = 12;
19121920

19131921
/*
1922+
This field is populated when the peer has at least one channel with us.
19141923
The number of times we have recorded this peer going offline or coming
19151924
online, recorded across restarts. Note that this value is decreased over
19161925
time if the peer has not recently flapped, so that we can forgive peers
@@ -1919,6 +1928,7 @@ message Peer {
19191928
int32 flap_count = 13;
19201929

19211930
/*
1931+
This field is populated when the peer has at least one channel with us.
19221932
The timestamp of the last flap we observed for this peer. If this value is
19231933
zero, we have not observed any flaps for this peer.
19241934
*/
@@ -2074,13 +2084,6 @@ message Chain {
20742084
string network = 2;
20752085
}
20762086

2077-
message ConfirmationUpdate {
2078-
bytes block_sha = 1;
2079-
int32 block_height = 2;
2080-
2081-
uint32 num_confs_left = 3;
2082-
}
2083-
20842087
message ChannelOpenUpdate {
20852088
ChannelPoint channel_point = 1;
20862089
}
@@ -2847,6 +2850,25 @@ message PendingChannelsResponse {
28472850
// very likely canceled the funding and the channel will never become
28482851
// fully operational.
28492852
int32 funding_expiry_blocks = 3;
2853+
2854+
// The number of blocks remaining until the channel status changes from
2855+
// pending to active. A value of 0 indicates that the channel is now
2856+
// active.
2857+
//
2858+
// "Active" here means both channel peers have the channel marked OPEN
2859+
// and can immediately start using it. For public channels, this does
2860+
// not imply a channel_announcement has been gossiped. It only becomes
2861+
// public on the network after 6 on‐chain confirmations.
2862+
// See BOLT07 "Routing Gossip":
2863+
// https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
2864+
//
2865+
// ZeroConf channels bypass the pending state entirely: they are marked
2866+
// active immediately upon creation, so they never show up as "pending".
2867+
uint32 confirmations_until_active = 7;
2868+
2869+
// The confirmation height records the block height at which the funding
2870+
// transaction was first confirmed.
2871+
uint32 confirmation_height = 8;
28502872
}
28512873

28522874
message WaitingCloseChannel {
@@ -3165,10 +3187,10 @@ message QueryRoutesRequest {
31653187
map<uint64, bytes> dest_custom_records = 13;
31663188

31673189
/*
3168-
The channel id of the channel that must be taken to the first hop. If zero,
3169-
any channel may be used.
3190+
Deprecated, use outgoing_chan_ids. The channel id of the channel that must
3191+
be taken to the first hop. If zero, any channel may be used.
31703192
*/
3171-
uint64 outgoing_chan_id = 14 [jstype = JS_STRING];
3193+
uint64 outgoing_chan_id = 14 [jstype = JS_STRING, deprecated = true];
31723194

31733195
/*
31743196
The pubkey of the last hop of the route. If empty, any hop may be used.
@@ -3203,6 +3225,12 @@ message QueryRoutesRequest {
32033225
only, to 1 to optimize for reliability only or a value inbetween for a mix.
32043226
*/
32053227
double time_pref = 18;
3228+
3229+
/*
3230+
The channel ids of the channels allowed for the first hop. If empty, any
3231+
channel may be used.
3232+
*/
3233+
repeated uint64 outgoing_chan_ids = 20;
32063234
}
32073235

32083236
message NodePair {
@@ -3423,6 +3451,10 @@ message NodeInfoRequest {
34233451

34243452
// If true, will include all known channels associated with the node.
34253453
bool include_channels = 2;
3454+
3455+
// If true, will include announcements' signatures into ChannelEdge.
3456+
// Depends on include_channels.
3457+
bool include_auth_proof = 3;
34263458
}
34273459

34283460
message NodeInfo {
@@ -3476,13 +3508,39 @@ message RoutingPolicy {
34763508
uint64 max_htlc_msat = 6;
34773509
uint32 last_update = 7;
34783510

3479-
// Custom channel update tlv records.
3511+
// Custom channel update tlv records. These are customized fields that are
3512+
// not defined by LND and cannot be extracted.
34803513
map<uint64, bytes> custom_records = 8;
34813514

34823515
int32 inbound_fee_base_msat = 9;
34833516
int32 inbound_fee_rate_milli_msat = 10;
34843517
}
34853518

3519+
/*
3520+
ChannelAuthProof is the authentication proof (the signature portion) for a
3521+
channel. Using the four signatures contained in the struct, and some
3522+
auxiliary knowledge (the funding script, node identities, and outpoint) nodes
3523+
on the network are able to validate the authenticity and existence of a
3524+
channel.
3525+
*/
3526+
message ChannelAuthProof {
3527+
// node_sig1 are the raw bytes of the first node signature encoded
3528+
// in DER format.
3529+
bytes node_sig1 = 1;
3530+
3531+
// bitcoin_sig1 are the raw bytes of the first bitcoin signature of the
3532+
// MultiSigKey key of the channel encoded in DER format.
3533+
bytes bitcoin_sig1 = 2;
3534+
3535+
// node_sig2 are the raw bytes of the second node signature encoded
3536+
// in DER format.
3537+
bytes node_sig2 = 3;
3538+
3539+
// bitcoin_sig2 are the raw bytes of the second bitcoin signature of the
3540+
// MultiSigKey key of the channel encoded in DER format.
3541+
bytes bitcoin_sig2 = 4;
3542+
}
3543+
34863544
/*
34873545
A fully authenticated channel along with all its unique attributes.
34883546
Once an authenticated channel announcement has been processed on the network,
@@ -3511,6 +3569,13 @@ message ChannelEdge {
35113569

35123570
// Custom channel announcement tlv records.
35133571
map<uint64, bytes> custom_records = 9;
3572+
3573+
// Authentication proof for this channel. This proof contains a set of
3574+
// signatures binding four identities, which attests to the legitimacy of
3575+
// the advertised channel. This only is available for advertised channels.
3576+
// This field is not filled by default. Pass include_auth_proof flag to
3577+
// DescribeGraph, GetNodeInfo or GetChanInfo to get this data.
3578+
ChannelAuthProof auth_proof = 10;
35143579
}
35153580

35163581
message ChannelGraphRequest {
@@ -3520,6 +3585,9 @@ message ChannelGraphRequest {
35203585
channels, and public channels that are not yet announced to the network.
35213586
*/
35223587
bool include_unannounced = 1;
3588+
3589+
// If true, will include announcements' signatures into ChannelEdge.
3590+
bool include_auth_proof = 2;
35233591
}
35243592

35253593
// Returns a new instance of the directed channel graph.
@@ -3571,6 +3639,9 @@ message ChanInfoRequest {
35713639
// The channel point of the channel in format funding_txid:output_index. If
35723640
// chan_id is specified, this field is ignored.
35733641
string chan_point = 2;
3642+
3643+
// If true, will include announcements' signatures into ChannelEdge.
3644+
bool include_auth_proof = 3;
35743645
}
35753646

35763647
message NetworkInfoRequest {
@@ -4004,6 +4075,12 @@ message BlindedPathConfig {
40044075
blinded paths.
40054076
*/
40064077
repeated bytes node_omission_list = 4;
4078+
4079+
/*
4080+
The chained channels list specified via channel id (separated by commas),
4081+
starting from a channel owned by the receiver node.
4082+
*/
4083+
repeated uint64 incoming_channel_list = 5;
40074084
}
40084085

40094086
enum InvoiceHTLCState {
@@ -4185,6 +4262,16 @@ message InvoiceSubscription {
41854262
uint64 settle_index = 2;
41864263
}
41874264

4265+
message DelCanceledInvoiceReq {
4266+
// Invoice payment hash to delete.
4267+
string invoice_hash = 1;
4268+
}
4269+
4270+
message DelCanceledInvoiceResp {
4271+
// The status of the delete operation.
4272+
string status = 1;
4273+
}
4274+
41884275
enum PaymentFailureReason {
41894276
/*
41904277
Payment isn't failed (yet).
@@ -4667,6 +4754,14 @@ message ForwardingHistoryRequest {
46674754
// Informs the server if the peer alias should be looked up for each
46684755
// forwarding event.
46694756
bool peer_alias_lookup = 5;
4757+
4758+
// List of incoming channel ids to filter htlcs received from a
4759+
// particular channel
4760+
repeated uint64 incoming_chan_ids = 6;
4761+
4762+
// List of outgoing channel ids to filter htlcs being forwarded to a
4763+
// particular channel
4764+
repeated uint64 outgoing_chan_ids = 7;
46704765
}
46714766
message ForwardingEvent {
46724767
// Timestamp is the time (unix epoch offset) that this circuit was
@@ -5051,9 +5146,37 @@ message Op {
50515146
}
50525147

50535148
message CheckMacPermRequest {
5149+
// The macaroon to check permissions for, serialized in binary format. For
5150+
// a macaroon to be valid, it must have been issued by lnd, must succeed all
5151+
// caveat conditions, and must contain all of the permissions specified in
5152+
// the permissions field.
50545153
bytes macaroon = 1;
5154+
5155+
// The list of permissions the macaroon should be checked against. Only if
5156+
// the macaroon contains all of these permissions, it is considered valid.
5157+
// If the list of permissions given is empty, then the macaroon is
5158+
// considered valid only based on issuance authority and caveat validity.
5159+
// An empty list of permissions is therefore equivalent to saying "skip
5160+
// checking permissions" (unless check_default_perms_from_full_method is
5161+
// specified).
50555162
repeated MacaroonPermission permissions = 2;
5163+
5164+
// The RPC method to check the macaroon against. This is only used if there
5165+
// are custom `uri:<rpcpackage>.<ServiceName>/<MethodName>` permissions in
5166+
// the permission list above. To check a macaroon against the list of
5167+
// permissions of a certain RPC method, query the `ListPermissions` RPC
5168+
// first, extract the permissions for the method, and then pass them in the
5169+
// `permissions` field above.
50565170
string fullMethod = 3;
5171+
5172+
// If this field is set to true, then the permissions list above MUST be
5173+
// empty. The default permissions for the provided fullMethod will be used
5174+
// to check the macaroon. This is equivalent to looking up the permissions
5175+
// for a method in the `ListPermissions` RPC and then calling this RPC with
5176+
// the permission list returned from that call. Without this flag, the list
5177+
// of permissions must be non-empty for the check to actually perform a
5178+
// permission check.
5179+
bool check_default_perms_from_full_method = 4;
50575180
}
50585181

50595182
message CheckMacPermResponse {

LNUnit.LND/Grpc/routerrpc/router.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ service Router {
195195
*/
196196
rpc XDeleteLocalChanAliases (DeleteAliasesRequest)
197197
returns (DeleteAliasesResponse);
198+
199+
/*
200+
XFindBaseLocalChanAlias is an experimental API that looks up the base scid
201+
for a local chan alias that was registered during the current runtime.
202+
*/
203+
rpc XFindBaseLocalChanAlias (FindBaseAliasRequest)
204+
returns (FindBaseAliasResponse);
198205
}
199206

200207
message SendPaymentRequest {
@@ -1116,4 +1123,14 @@ message DeleteAliasesRequest {
11161123

11171124
message DeleteAliasesResponse {
11181125
repeated lnrpc.AliasMap alias_maps = 1;
1126+
}
1127+
1128+
message FindBaseAliasRequest {
1129+
// The alias we want to look up the base scid for.
1130+
uint64 alias = 1;
1131+
}
1132+
1133+
message FindBaseAliasResponse {
1134+
// The base scid that resulted from the base scid look up.
1135+
uint64 base = 1;
11191136
}

LNUnit.LND/LNUnit.LND.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Nullable>enable</Nullable>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<PackageId>LNUnit.LND</PackageId>
8-
<Version>2.0.0</Version>
8+
<Version>2.0.1</Version>
99
<PackageDescription>LNUnit LND Typed Clients</PackageDescription>
1010
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
1111
<LangVersion>13.0</LangVersion>

0 commit comments

Comments
 (0)