Skip to content

Commit

Permalink
bump until lnd 0.18.4
Browse files Browse the repository at this point in the history
  • Loading branch information
niteshbalusu11 committed Dec 26, 2024
1 parent a185149 commit 07fae8e
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lnd_grpc_rust"
version = "2.8.0"
version = "2.9.0"
authors = ["Martin Habovstiak <[email protected]>", "Jonathan Zernik <[email protected]>", "Nitesh Balusu <[email protected]>"]
edition = "2018"
description = "An async library implementing LND RPC via tonic_openssl and prost"
Expand Down
2 changes: 1 addition & 1 deletion vendor/autopilotrpc/autopilot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ message SetScoresRequest {
}

message SetScoresResponse {
}
}
61 changes: 59 additions & 2 deletions vendor/invoicesrpc/invoices.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,19 @@ service Invoices {
rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp);

/*
LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
using either its payment hash, payment address, or set ID.
*/
rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice);

/*
HtlcModifier is a bidirectional streaming RPC that allows a client to
intercept and modify the HTLCs that attempt to settle the given invoice. The
server will send HTLCs of invoices to the client and the client can modify
some aspects of the HTLC in order to pass the invoice acceptance tests.
*/
rpc HtlcModifier (stream HtlcModifyResponse)
returns (stream HtlcModifyRequest);
}

message CancelInvoiceMsg {
Expand Down Expand Up @@ -191,4 +200,52 @@ message LookupInvoiceMsg {
}

LookupModifier lookup_modifier = 4;
}
}

// CircuitKey is a unique identifier for an HTLC.
message CircuitKey {
// The id of the channel that the is part of this circuit.
uint64 chan_id = 1;

// The index of the incoming htlc in the incoming channel.
uint64 htlc_id = 2;
}

message HtlcModifyRequest {
// The invoice the intercepted HTLC is attempting to settle. The HTLCs in
// the invoice are only HTLCs that have already been accepted or settled,
// not including the current intercepted HTLC.
lnrpc.Invoice invoice = 1;

// The unique identifier of the HTLC of this intercepted HTLC.
CircuitKey exit_htlc_circuit_key = 2;

// The amount in milli-satoshi that the exit HTLC is attempting to pay.
uint64 exit_htlc_amt = 3;

// The absolute expiry height of the exit HTLC.
uint32 exit_htlc_expiry = 4;

// The current block height.
uint32 current_height = 5;

// The wire message custom records of the exit HTLC.
map<uint64, bytes> exit_htlc_wire_custom_records = 6;
}

message HtlcModifyResponse {
// The circuit key of the HTLC that the client wants to modify.
CircuitKey circuit_key = 1;

// The modified amount in milli-satoshi that the exit HTLC is paying. This
// value can be different from the actual on-chain HTLC amount, in case the
// HTLC carries other valuable items, as can be the case with custom channel
// types.
optional uint64 amt_paid = 2;

// This flag indicates whether the HTLCs associated with the invoices should
// be cancelled. The interceptor client may set this field if some
// unexpected behavior is encountered. Setting this will ignore the amt_paid
// field.
bool cancel_set = 3;
}
77 changes: 76 additions & 1 deletion vendor/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1388,8 +1388,14 @@ enum CommitmentType {
A channel that uses musig2 for the funding output, and the new tapscript
features where relevant.
*/
// TODO(roasbeef): need script enforce mirror type for the above as well?
SIMPLE_TAPROOT = 5;

/*
Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
This channel type also commits to additional meta data in the tapscript
leaves for the scripts in a channel.
*/
SIMPLE_TAPROOT_OVERLAY = 6;
}

message ChannelConstraints {
Expand Down Expand Up @@ -1592,6 +1598,11 @@ message Channel {
the channel's operation.
*/
string memo = 36;

/*
Custom channel data that might be populated in custom channels.
*/
bytes custom_channel_data = 37;
}

message ListChannelsRequest {
Expand Down Expand Up @@ -2028,10 +2039,38 @@ message ChannelOpenUpdate {
ChannelPoint channel_point = 1;
}

message CloseOutput {
// The amount in satoshi of this close output. This amount is the final
// commitment balance of the channel and the actual amount paid out on chain
// might be smaller due to subtracted fees.
int64 amount_sat = 1;

// The pkScript of the close output.
bytes pk_script = 2;

// Whether this output is for the local or remote node.
bool is_local = 3;

// The TLV encoded custom channel data records for this output, which might
// be set for custom channels.
bytes custom_channel_data = 4;
}

message ChannelCloseUpdate {
bytes closing_txid = 1;

bool success = 2;

// The local channel close output. If the local channel balance was dust to
// begin with, this output will not be set.
CloseOutput local_close_output = 3;

// The remote channel close output. If the remote channel balance was dust
// to begin with, this output will not be set.
CloseOutput remote_close_output = 4;

// Any additional outputs that might be added for custom channel types.
repeated CloseOutput additional_outputs = 5;
}

message CloseChannelRequest {
Expand Down Expand Up @@ -2709,6 +2748,11 @@ message PendingChannelsResponse {
impacts the channel's operation.
*/
string memo = 13;

/*
Custom channel data that might be populated in custom channels.
*/
bytes custom_channel_data = 34;
}

message PendingOpenChannel {
Expand Down Expand Up @@ -2968,6 +3012,12 @@ message ChannelBalanceResponse {

// Sum of channels pending remote balances.
Amount pending_open_remote_balance = 8;

/*
Custom channel data that might be populated if there are custom channels
present.
*/
bytes custom_channel_data = 9;
}

message QueryRoutesRequest {
Expand Down Expand Up @@ -3293,6 +3343,20 @@ message Route {
The total amount in millisatoshis.
*/
int64 total_amt_msat = 6;

/*
The actual on-chain amount that was sent out to the first hop. This value is
only different from the total_amt_msat field if this is a custom channel
payment and the value transported in the HTLC is different from the BTC
amount in the HTLC. If this value is zero, then this is an old payment that
didn't have this value yet and can be ignored.
*/
int64 first_hop_amount_msat = 7;

/*
Custom channel data that might be populated in custom channels.
*/
bytes custom_channel_data = 8;
}

message NodeInfoRequest {
Expand Down Expand Up @@ -3922,6 +3986,11 @@ message InvoiceHTLC {

// Details relevant to AMP HTLCs, only populated if this is an AMP HTLC.
AMP amp = 11;

/*
Custom channel data that might be populated in custom channels.
*/
bytes custom_channel_data = 12;
}

// Details specific to AMP HTLCs.
Expand Down Expand Up @@ -4162,6 +4231,12 @@ message Payment {
uint64 payment_index = 15;

PaymentFailureReason failure_reason = 16;

/*
The custom TLV records that were sent to the first hop as part of the HTLC
wire message for this payment.
*/
map<uint64, bytes> first_hop_custom_records = 17;
}

message HTLCAttempt {
Expand Down
91 changes: 91 additions & 0 deletions vendor/routerrpc/router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ service Router {
*/
rpc UpdateChanStatus (UpdateChanStatusRequest)
returns (UpdateChanStatusResponse);

/*
XAddLocalChanAliases is an experimental API that creates a set of new
channel SCID alias mappings. The final total set of aliases in the manager
after the add operation is returned. This is only a locally stored alias,
and will not be communicated to the channel peer via any message. Therefore,
routing over such an alias will only work if the peer also calls this same
RPC on their end. If an alias already exists, an error is returned
*/
rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse);

/*
XDeleteLocalChanAliases is an experimental API that deletes a set of alias
mappings. The final total set of aliases in the manager after the delete
operation is returned. The deletion will not be communicated to the channel
peer via any message.
*/
rpc XDeleteLocalChanAliases (DeleteAliasesRequest)
returns (DeleteAliasesResponse);
}

message SendPaymentRequest {
Expand Down Expand Up @@ -339,6 +358,15 @@ message SendPaymentRequest {
being sent.
*/
bool cancelable = 24;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass application
specific data during the payment attempt. Record types are required to be in
the custom range >= 65536. When using REST, the values must be encoded as
base64.
*/
map<uint64, bytes> first_hop_custom_records = 25;
}

message TrackPaymentRequest {
Expand Down Expand Up @@ -432,6 +460,15 @@ message SendToRouteRequest {
routes, incorrect payment details, or insufficient funds.
*/
bool skip_temp_err = 3;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass application
specific data during the payment attempt. Record types are required to be in
the custom range >= 65536. When using REST, the values must be encoded as
base64.
*/
map<uint64, bytes> first_hop_custom_records = 4;
}

message SendToRouteResponse {
Expand Down Expand Up @@ -707,6 +744,15 @@ message BuildRouteRequest {
This is also called payment secret in specifications (e.g. BOLT 11).
*/
bytes payment_addr = 5;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass application
specific data during the payment attempt. Record types are required to be in
the custom range >= 65536. When using REST, the values must be encoded as
base64.
*/
map<uint64, bytes> first_hop_custom_records = 6;
}

message BuildRouteResponse {
Expand Down Expand Up @@ -963,12 +1009,17 @@ message ForwardHtlcInterceptRequest {
// The block height at which this htlc will be auto-failed to prevent the
// channel from force-closing.
int32 auto_fail_height = 10;

// The custom records of the peer's incoming p2p wire message.
map<uint64, bytes> in_wire_custom_records = 11;
}

/**
ForwardHtlcInterceptResponse enables the caller to resolve a previously hold
forward. The caller can choose either to:
- `Resume`: Execute the default behavior (usually forward).
- `ResumeModified`: Execute the default behavior (usually forward) with HTLC
field modifications.
- `Reject`: Fail the htlc backwards.
- `Settle`: Settle this htlc with a given preimage.
*/
Expand Down Expand Up @@ -999,12 +1050,36 @@ message ForwardHtlcInterceptResponse {
// For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the
// default value for this field.
lnrpc.Failure.FailureCode failure_code = 5;

// The amount that was set on the p2p wire message of the incoming HTLC.
// This field is ignored if the action is not RESUME_MODIFIED or the amount
// is zero.
uint64 in_amount_msat = 6;

// The amount to set on the p2p wire message of the resumed HTLC. This field
// is ignored if the action is not RESUME_MODIFIED or the amount is zero.
uint64 out_amount_msat = 7;

// Any custom records that should be set on the p2p wire message message of
// the resumed HTLC. This field is ignored if the action is not
// RESUME_MODIFIED.
map<uint64, bytes> out_wire_custom_records = 8;
}

enum ResolveHoldForwardAction {
// SETTLE is an action that is used to settle an HTLC instead of forwarding
// it.
SETTLE = 0;

// FAIL is an action that is used to fail an HTLC backwards.
FAIL = 1;

// RESUME is an action that is used to resume a forward HTLC.
RESUME = 2;

// RESUME_MODIFIED is an action that is used to resume a hold forward HTLC
// with modifications specified during interception.
RESUME_MODIFIED = 3;
}

message UpdateChanStatusRequest {
Expand All @@ -1021,3 +1096,19 @@ enum ChanStatusAction {

message UpdateChanStatusResponse {
}

message AddAliasesRequest {
repeated lnrpc.AliasMap alias_maps = 1;
}

message AddAliasesResponse {
repeated lnrpc.AliasMap alias_maps = 1;
}

message DeleteAliasesRequest {
repeated lnrpc.AliasMap alias_maps = 1;
}

message DeleteAliasesResponse {
repeated lnrpc.AliasMap alias_maps = 1;
}

0 comments on commit 07fae8e

Please sign in to comment.