Proto commits in lightningnetwork/lnd

These commits are when the Protocol Buffers files have changed: (only the last 100 relevant commits are shown)

Commit:aa466dd
Author:saubyk
Committer:ziggie

lnrpc: add partial_update to PolicyUpdateRequest PolicyUpdateRequest can't tell an unset base fee, fee rate or time lock delta from zero, so every update has to send all three. Add an opt-in partial_update message that marks which of the three fields to apply, so callers can update individual fields. Without partial_update the existing semantics are unchanged, as current clients rely on omitted (zero) values being applied. Fixes #1523.

The documentation is generated from this commit.

Commit:d15c451
Author:yyforyongyu
Committer:yyforyongyu

lnrpc: define ordinary invoice finality Add pending invoice and HTLC states for ordinary payments. Distinguish failed released HTLCs and expose the release decision without treating knowledge of the preimage as evidence that it left the node. Document complete collection and cancellation semantics so callers can separate final credit, released failures and unreleased cancellations. Keep AMP settlement outside the new finality guarantee.

Commit:06e6c72
Author:yyforyongyu
Committer:yyforyongyu

walletrpc: retire lease depth fields Remove the count-based request controls and response metadata. Reserve their protobuf numbers and names so they cannot be reused accidentally. Document the boolean lifetime and same-owner renewal acknowledgement.

Commit:1b9c6fb
Author:yyforyongyu
Committer:yyforyongyu

walletrpc: define lease expiry flags Expose the no-timeout lifetime explicitly for unused output leases. Document owner cancellation and first-confirmed-spend cleanup, and add boolean acknowledgement fields so clients can verify the selected mode.

Commit:a9d4ca3
Author:bitromortac
Committer:GitHub

Merge pull request #11374 from bitromortac/20261016-c7e5-dispatch bolt12handler+devrpc: dispatch invoice requests and add CreateOffer

Commit:11f79be
Author:Olaoluwa Osuntokun
Committer:GitHub

Merge pull request #11282 from lightningnetwork/elle-base-branch-payment-service multi: add switchrpc external HTLC dispatch subsystem

Commit:4ae29e8
Author:bitromortac
Committer:bitromortac

devrpc: add the CreateOffer proto Add the CreateOffer method and its messages to the Dev service, with the POST /v2/dev/createoffer REST route. The Dev service exists only in a dev build, so a release build has no BOLT 12 API while the feature is experimental. The server does not implement the method yet.

Commit:78ea7cc
Author:Calvin Zachman
Committer:Calvin Zachman

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:d45592b
Author:Calvin Zachman
Committer:Calvin Zachman

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:7b629fe
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DisableRemoteRouter rpc In this commit, we add a DisableRemoteRouter RPC to the switchrpc sub-server that allows an operator to transition from external (switchrpc) back to local payment lifecycle management. The handler delegates to the Switch's DisableRemoteRouter method and distinguishes between precondition failures (attempt entries still exist) and internal errors, returning codes.FailedPrecondition or codes.Internal respectively. This gives callers a clear signal to drain pending attempts before retrying.

Commit:ae5e26c
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DeleteAttempts RPC Expose the store-layer DeleteAttempts as a gRPC endpoint on the Switch sub-server, allowing remote callers to garbage-collect terminal attempt records by explicitly naming the finished IDs. A unit test with a stateful mock demonstrates that hard delete removes the idempotency protection, allowing re-dispatch with the same ID.

Commit:fbe0492
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update SendOnion error handling Update both proto and handler to communicate error information via gRPC status details.

Commit:8ffc8e9
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update TrackOnion rpc error handling The new structure uses a top-level `oneof` to provide a compile-time distinction between a successful payment (preimage) and a failed one. Additional information on a failed attempt can be found in FailureDetails. We now also use a structured ForwardingFailure type for communicating the failure index and wire message from failures which occur during htlc forwarding downstream in the route.

Commit:20c18ec
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update sendonion rpc docs Clarify useage of API for rpc clients.

Commit:1dcb706
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: proto message updates Update the Switch RPC protos to make use of the 'optional' directive. Though this may not impact the generated types or how the user interacts with these types, it may serve to document the fact that they are optional a bit better.

Commit:fe09173
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new BuildOnion rpc proto

Commit:11d6835
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new TrackOnion rpc proto

Commit:cfcc9d0
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new SendOnion rpc proto Support all fields from UpdateAddHtlc. This allows users of the SendOnion RPC to include all fields that we support using with the UpdateAddHtlc type.

Commit:f9dcb6f
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new grpc subserver The SwitchRPC server will be hidden behind a non default build tag.

Commit:f3c85a4
Author:Calvin Zachman
Committer:Calvin Zachman

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:f658649
Author:Calvin Zachman
Committer:Calvin Zachman

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:b259b31
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DisableRemoteRouter rpc In this commit, we add a DisableRemoteRouter RPC to the switchrpc sub-server that allows an operator to transition from external (switchrpc) back to local payment lifecycle management. The handler delegates to the Switch's DisableRemoteRouter method and distinguishes between precondition failures (attempt entries still exist) and internal errors, returning codes.FailedPrecondition or codes.Internal respectively. This gives callers a clear signal to drain pending attempts before retrying.

Commit:a1a43ff
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DeleteAttempts RPC Expose the store-layer DeleteAttempts as a gRPC endpoint on the Switch sub-server, allowing remote callers to garbage-collect terminal attempt records by explicitly naming the finished IDs. A unit test with a stateful mock demonstrates that hard delete removes the idempotency protection, allowing re-dispatch with the same ID.

Commit:5b61a39
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update SendOnion error handling Update both proto and handler to communicate error information via gRPC status details.

Commit:b019b27
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update TrackOnion rpc error handling The new structure uses a top-level `oneof` to provide a compile-time distinction between a successful payment (preimage) and a failed one. Additional information on a failed attempt can be found in FailureDetails. We now also use a structured ForwardingFailure type for communicating the failure index and wire message from failures which occur during htlc forwarding downstream in the route.

Commit:0783822
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update sendonion rpc docs Clarify useage of API for rpc clients.

Commit:1abaa15
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: proto message updates Update the Switch RPC protos to make use of the 'optional' directive. Though this may not impact the generated types or how the user interacts with these types, it may serve to document the fact that they are optional a bit better.

Commit:acbe9b5
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new BuildOnion rpc proto

Commit:a85095e
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new TrackOnion rpc proto

Commit:917b6c7
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new SendOnion rpc proto Support all fields from UpdateAddHtlc. This allows users of the SendOnion RPC to include all fields that we support using with the UpdateAddHtlc type.

Commit:5699acc
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new grpc subserver The SwitchRPC server will be hidden behind a non default build tag.

Commit:7e15100
Author:saubyk
Committer:saubyk

lnrpc: add reverse field to GetTransactionsRequest Add an explicit reverse flag to GetTransactionsRequest so callers can request wallet transactions oldest-first, with unconfirmed transactions last. The flag only changes the order of the transactions within the response; pagination (index_offset/max_transactions) selects the same page either way. Ties on the number of confirmations keep the order produced by the wallet in both modes, which the field comment states explicitly. SubscribeTransactions shares this request message but does not honour the flag, which the field comment also states. Also correct the start_height docs: a start_height greater than end_height makes the wallet read blocks in reverse, which changes the page that pagination selects, but the response ordering has always been governed by the RPC layer and is now governed by the reverse flag. An end_height of -1 (the default) counts as the chain tip for that comparison, so start_height=0 with end_height=-1 is a regular oldest-first range, which both height comments now state.

Commit:06eb72c
Author:Olaoluwa Osuntokun
Committer:Olaoluwa Osuntokun

lnrpc: define trampoline payment fields In this commit, we extend the public payment schema with explicit trampoline onions, relay paths, padding controls, BOLT 12 invoice bytes, and the local error-path material needed for restart-safe nested failure decryption. The route, feature, and failure messages also expose the protocol values required to inspect trampoline attempts and retry quotes.

Commit:041929c
Author:ziggie
Committer:ziggie

lnrpc: document that the legacy commitment type is rejected on input In this commit, we document the restriction on the API itself, so callers can discover it without reading the release notes. The LEGACY enum value notes that it is only ever reported for channels that already exist, and the commitment_type fields of OpenChannelRequest and BatchOpenChannel note that it is turned down as an input. Worth spelling out on those fields that an empty channel type on the wire asks for the legacy type as well, so there is no way to request it at all. The generated code carries no change beyond the comments. (cherry picked from commit 9b634bfd0929ecc0f0e0ddc0b6aa85a5234a06b6)

Commit:c96fcdb
Author:Nishant Bansal
Committer:ziggie

multi: require explicit channel type in all negotiations Move from optional implicit negotiation to mandatory explicit channel type in OpenChannel and AcceptChannel. The returned ChannelType is now always non-nil. Channel type is required in all negotiations now. We only fallback to a default channel type when the RPC caller does not explicitly specify one. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com> (cherry picked from commit 53da78ad68a5182240c10d5de369cc54fb802cef)

Commit:be5e44e
Author:Nishant Bansal
Committer:ziggie

multi: require explicit channel type in all negotiations Move from optional implicit negotiation to mandatory explicit channel type in OpenChannel and AcceptChannel. The returned ChannelType is now always non-nil. Channel type is required in all negotiations now. We only fallback to a default channel type when the RPC caller does not explicitly specify one. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com> (cherry picked from commit 53da78ad68a5182240c10d5de369cc54fb802cef)

Commit:b737198
Author:ziggie
Committer:ziggie

lnrpc: document that the legacy commitment type is rejected on input In this commit, we document the restriction on the API itself, so callers can discover it without reading the release notes. The LEGACY enum value notes that it is only ever reported for channels that already exist, and the commitment_type fields of OpenChannelRequest and BatchOpenChannel note that it is turned down as an input. Worth spelling out on those fields that an empty channel type on the wire asks for the legacy type as well, so there is no way to request it at all. The generated code carries no change beyond the comments. (cherry picked from commit 9b634bfd0929ecc0f0e0ddc0b6aa85a5234a06b6)

Commit:112cb5f
Author:ziggieXXX
Committer:GitHub

Merge pull request #11212 from ziggie1984/disable-legacy-channels multi: stop opening legacy channels

Commit:9b634bf
Author:ziggie
Committer:ziggie

lnrpc: document that the legacy commitment type is rejected on input In this commit, we document the restriction on the API itself, so callers can discover it without reading the release notes. The LEGACY enum value notes that it is only ever reported for channels that already exist, and the commitment_type fields of OpenChannelRequest and BatchOpenChannel note that it is turned down as an input. Worth spelling out on those fields that an empty channel type on the wire asks for the legacy type as well, so there is no way to request it at all. The generated code carries no change beyond the comments.

Commit:9484c48
Author:Calvin Zachman
Committer:Calvin Zachman

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:3bf65c5
Author:Calvin Zachman
Committer:Calvin Zachman

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:b321509
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DisableRemoteRouter rpc In this commit, we add a DisableRemoteRouter RPC to the switchrpc sub-server that allows an operator to transition from external (switchrpc) back to local payment lifecycle management. The handler delegates to the Switch's DisableRemoteRouter method and distinguishes between precondition failures (attempt entries still exist) and internal errors, returning codes.FailedPrecondition or codes.Internal respectively. This gives callers a clear signal to drain pending attempts before retrying.

Commit:190d6d7
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DeleteAttempts RPC Expose the store-layer DeleteAttempts as a gRPC endpoint on the Switch sub-server, allowing remote callers to garbage-collect terminal attempt records by explicitly naming the finished IDs. A unit test with a stateful mock demonstrates that hard delete removes the idempotency protection, allowing re-dispatch with the same ID.

Commit:e73b0c0
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update SendOnion error handling Update both proto and handler to communicate error information via gRPC status details.

Commit:64db9e2
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update TrackOnion rpc error handling The new structure uses a top-level `oneof` to provide a compile-time distinction between a successful payment (preimage) and a failed one. Additional information on a failed attempt can be found in FailureDetails. We now also use a structured ForwardingFailure type for communicating the failure index and wire message from failures which occur during htlc forwarding downstream in the route.

Commit:7c7701b
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update sendonion rpc docs Clarify useage of API for rpc clients.

Commit:16a7860
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: proto message updates Update the Switch RPC protos to make use of the 'optional' directive. Though this may not impact the generated types or how the user interacts with these types, it may serve to document the fact that they are optional a bit better.

Commit:407b3f6
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new BuildOnion rpc proto

Commit:97d802e
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new TrackOnion rpc proto

Commit:999b04b
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new SendOnion rpc proto Support all fields from UpdateAddHtlc. This allows users of the SendOnion RPC to include all fields that we support using with the UpdateAddHtlc type.

Commit:8fdc72c
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new grpc subserver The SwitchRPC server will be hidden behind a non default build tag.

Commit:30a09ce
Author:ziggie
Committer:ziggie

multi: preserve invoice HTLC replay outcomes Keep unexpected invoice lookup errors retryable instead of turning them into terminal HTLC failures. Resolve recorded HTLCs before invoking the interceptor, while retaining the atomic replay check during the invoice update. Only turn interceptor errors for confirmed-new HTLCs into individual failures. Update failure reporting and multi-backend regression tests to cover the final behavior. (cherry picked from commit 044d260bb6b4fb93d52b966376b0a7e0645dac6b)

Commit:74690de
Author:ziggie
Committer:ziggie

multi: preserve invoice HTLC replay outcomes Keep unexpected invoice lookup errors retryable instead of turning them into terminal HTLC failures. Resolve recorded HTLCs before invoking the interceptor, while retaining the atomic replay check during the invoice update. Only turn interceptor errors for confirmed-new HTLCs into individual failures. Update failure reporting and multi-backend regression tests to cover the final behavior. (cherry picked from commit 044d260bb6b4fb93d52b966376b0a7e0645dac6b)

Commit:e5046bd
Author:Dario Anongba Varela
Committer:ziggie

routerrpc: FailureDetail enums for invoice/AMP validation failures (cherry picked from commit 05eed5cdb40bd38f1b2f078dfad043d39ad91ce6)

Commit:0449629
Author:ziggie
Committer:ziggie

multi: preserve invoice HTLC replay outcomes Keep unexpected invoice lookup errors retryable instead of turning them into terminal HTLC failures. Resolve recorded HTLCs before invoking the interceptor, while retaining the atomic replay check during the invoice update. Only turn interceptor errors for confirmed-new HTLCs into individual failures. Update failure reporting and multi-backend regression tests to cover the final behavior. (cherry picked from commit 044d260bb6b4fb93d52b966376b0a7e0645dac6b)

Commit:9f7b695
Author:Dario Anongba Varela
Committer:ziggie

routerrpc: FailureDetail enums for invoice/AMP validation failures (cherry picked from commit 05eed5cdb40bd38f1b2f078dfad043d39ad91ce6)

Commit:044d260
Author:ziggie
Committer:ziggie

multi: preserve invoice HTLC replay outcomes Keep unexpected invoice lookup errors retryable instead of turning them into terminal HTLC failures. Resolve recorded HTLCs before invoking the interceptor, while retaining the atomic replay check during the invoice update. Only turn interceptor errors for confirmed-new HTLCs into individual failures. Update failure reporting and multi-backend regression tests to cover the final behavior.

Commit:c74272b
Author:elsiribot
Committer:ziggie

docs+routerrpc: document that interceptor outgoing amount is untrusted The `outgoing_amount_msat` field of `ForwardHtlcInterceptRequest` is the sender's `amt_to_forward` value copied straight out of the onion payload. The incoming link does not validate it, and the switch only compares it against the real incoming amount and the outgoing forwarding policy in `CheckHtlcForward` when the HTLC is resumed. When the interceptor answers with SETTLE that check never runs, so an interceptor that credits the outgoing amount can be made to release a preimage for far more than the incoming HTLC is actually worth. The field comments did not say any of this, and the naming makes the outgoing amount look like "the" amount. Spell out that only `incoming_amount_msat` reflects what the peer committed to, and that the `in_amount_msat` override on RESUME_MODIFIED replaces the value used by the policy check without changing what is actually received. Generated files are updated by hand to match the proto comments since only comments changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit cee8ed624e17a91dc4c46ccf0cff0d8dab26056d)

Commit:20efc10
Author:elsiribot
Committer:ziggie

docs+routerrpc: document that interceptor outgoing amount is untrusted The `outgoing_amount_msat` field of `ForwardHtlcInterceptRequest` is the sender's `amt_to_forward` value copied straight out of the onion payload. The incoming link does not validate it, and the switch only compares it against the real incoming amount and the outgoing forwarding policy in `CheckHtlcForward` when the HTLC is resumed. When the interceptor answers with SETTLE that check never runs, so an interceptor that credits the outgoing amount can be made to release a preimage for far more than the incoming HTLC is actually worth. The field comments did not say any of this, and the naming makes the outgoing amount look like "the" amount. Spell out that only `incoming_amount_msat` reflects what the peer committed to, and that the `in_amount_msat` override on RESUME_MODIFIED replaces the value used by the policy check without changing what is actually received. Generated files are updated by hand to match the proto comments since only comments changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit cee8ed624e17a91dc4c46ccf0cff0d8dab26056d)

Commit:cee8ed6
Author:elsiribot
Committer:elsiribot

docs+routerrpc: document that interceptor outgoing amount is untrusted The `outgoing_amount_msat` field of `ForwardHtlcInterceptRequest` is the sender's `amt_to_forward` value copied straight out of the onion payload. The incoming link does not validate it, and the switch only compares it against the real incoming amount and the outgoing forwarding policy in `CheckHtlcForward` when the HTLC is resumed. When the interceptor answers with SETTLE that check never runs, so an interceptor that credits the outgoing amount can be made to release a preimage for far more than the incoming HTLC is actually worth. The field comments did not say any of this, and the naming makes the outgoing amount look like "the" amount. Spell out that only `incoming_amount_msat` reflects what the peer committed to, and that the `in_amount_msat` override on RESUME_MODIFIED replaces the value used by the policy check without changing what is actually received. Generated files are updated by hand to match the proto comments since only comments changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Commit:7d504f9
Author:Andras Banki-Horvath
Committer:ziggie

walletrpc: expose configurable output leases Add optional confirmation-depth fields to LeaseOutput and FundPsbt. A non-zero value selects a lease that ignores wall-clock expiry and releases at the requested spend depth or by explicit owner release. Zero preserves time-controlled leases. Resolve wallet capability before acquiring inputs so unsupported backends fail closed even when FundPsbt selects no new input. Echo the accepted depth after installation, and expose persisted spend height through ListLeases so clients can observe confirmation and reorg progress. Cover option forwarding, zero-depth compatibility, unsupported wallets, partial acquisition rollback, and response marshalling.

Commit:d07d9c3
Author:Olaoluwa Osuntokun
Committer:Olaoluwa Osuntokun

walletrpc: return the master key birthday from ListAccounts In this commit, we add a master_key_birthday_timestamp field to ListAccountsResponse and populate it from the wallet. The accounts in that response are extended public keys, and an xpub says nothing about when it was created. That's a problem for the one thing the response exists for: exporting a signer's accounts so a watch-only wallet can import them. The importing side has no birthday to work with, so lnd substitutes the aezeed "Bitcoin Days Genesis" epoch of 2017-08-24 and rescans from there. On mainnet that's hundreds of thousands of blocks and several hours, even for a node with no history whatsoever. See lightninglabs/lndinit#97 for what that looks like in practice. The field is named to match WatchOnly.master_key_birthday_timestamp on the InitWallet request, which is where the value ends up, and it round-trips through the accounts JSON file that lncli's createwatchonly and lndinit both read. A wallet that somehow has no birthday at all reports zero rather than the nonsense a uint64 cast of a pre-epoch time would produce, since zero is already what InitWallet reads as "unknown".

Commit:515ceaa
Author:Andras Banki-Horvath
Committer:Andras Banki-Horvath

walletrpc: expose configurable output leases Add optional confirmation-depth fields to LeaseOutput and FundPsbt. A non-zero value selects a lease that ignores wall-clock expiry and releases at the requested spend depth or by explicit owner release. Zero preserves time-controlled leases. Resolve wallet capability before acquiring inputs so unsupported backends fail closed even when FundPsbt selects no new input. Echo the accepted depth after installation, and expose persisted spend height through ListLeases so clients can observe confirmation and reorg progress. Cover option forwarding, zero-depth compatibility, unsupported wallets, partial acquisition rollback, and response marshalling.

Commit:1f324eb
Author:Yong
Committer:GitHub

Merge pull request #11064 from NishantBansal2003/explicit-chan-type funding: require explicit channel type in all negotiations

Commit:53da78a
Author:Nishant Bansal
Committer:Nishant Bansal

multi: require explicit channel type in all negotiations Move from optional implicit negotiation to mandatory explicit channel type in OpenChannel and AcceptChannel. The returned ChannelType is now always non-nil. Channel type is required in all negotiations now. We only fallback to a default channel type when the RPC caller does not explicitly specify one. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>

Commit:10dfc9e
Author:Boris Nagaev
Committer:Boris Nagaev

lnrpc: document payment request fields Document the encoding, units, defaults, and absent-value behavior of every field returned by DecodePayReq. Clarify in particular that expiry is a relative duration from the invoice timestamp and defaults to 3600 seconds when the BOLT-11 expiry field is omitted. This is a documentation-only change and does not alter RPC behavior.

Commit:61b2b86
Author:Elle Mouton
Committer:github-actions[bot]

walletrpc: define the XCreateAccount RPC Declares the RPC and its messages, and regenerates the stubs. The implementation follows in the next commits. The account's address type selects the BIP-0043 key scope it is created under, which is permanent and also fixes the address type of its change outputs, so the proto spells out both that pairing and the fact that a seed-only recovery does not rediscover funds held in such an account. The X prefix follows XImportMissionControl and the XAddLocalChanAliases family: it marks the API as experimental, so it may change or be removed without the usual deprecation period. It comes off once a seed-only recovery can find these accounts. (cherry picked from commit 9a6a3a701365130cf5249b2f66b18cad96dcea38)

Commit:b309be5
Author:Yong
Committer:GitHub

Merge pull request #11065 from ellemouton/agent/walletrpc-create-account walletrpc: add XCreateAccount for wallet-derived accounts

Commit:9a6a3a7
Author:Elle Mouton
Committer:Elle Mouton

walletrpc: define the XCreateAccount RPC Declares the RPC and its messages, and regenerates the stubs. The implementation follows in the next commits. The account's address type selects the BIP-0043 key scope it is created under, which is permanent and also fixes the address type of its change outputs, so the proto spells out both that pairing and the fact that a seed-only recovery does not rediscover funds held in such an account. The X prefix follows XImportMissionControl and the XAddLocalChanAliases family: it marks the API as experimental, so it may change or be removed without the usual deprecation period. It comes off once a seed-only recovery can find these accounts.

Commit:5ecef3d
Author:Viktor Torstensson
Committer:Viktor Torstensson

watchonlyrpc: add `SignCoordinatorStreams` RPC To enable an outbound remote signer to connect to the watch-only lnd node, we add a SignCoordinatorStreams bi-directional streaming RPC endpoint. The stream created when the remote signer connects to this endpoint can be used to pass any requests to the remote signer and to receive the corresponding responses. The RPC endpoint is added to the new `watchonlyrpc` package, which will have a dedicated RPC server that specifically accepts incoming requests from the remote signer. We clearly define the types of requests and responses that can be sent over the stream, including all the requests that can be sent to the remote signer with the previous implementation. Those are the ones sent to the `signrpc.SignerClient` and `walletrpc.WalletKitClient` in the `lnwallet/rpcwallet.go` file. We also include messages for the required handshake between the remote signer and the watch-only node, and a message that the remote signer can send if it encounters an error while processing a request.

Commit:ce10411
Author:Elle Mouton
Committer:Olaoluwa Osuntokun

lnwallet+walletrpc: add SubmitPackage for v3 CPFP package relay Add SubmitPackage to the lnwallet.WalletController interface and a new WalletKit.SubmitPackage RPC, so a client of lnd can relay a package of related transactions (parents first, child last) through lnd's own chain connection. This lets a zero-fee v3/TRUC parent be accepted via its fee-paying CPFP child without the caller needing a separate connection to the chain backend. BtcWallet.SubmitPackage forwards to the chain backend's submitpackage for bitcoind/btcd, and broadcasts each transaction individually for neutrino (no mempool; relies on the peer's 1p1c package relay). The WalletKit handler maps the proto request/response to the btcjson result and is gated by the onchain:write macaroon permission. Mock controllers and the no-chain backend gain trivial implementations. (cherry picked from commit f55c0565d02cff63760b055970d36eca82e2beb1) Backport note: the original bumps btcwallet to v0.18.0, which sits on top of the btcd v2 module migration. This branch tracks the pre-v2 btcd layout, so it pins btcwallet v0.16.19 instead: the same chain.Interface SubmitPackage backported onto the v0.16 line. The lnd-side change is otherwise unmodified.

Commit:b034ef6
Author:Elle Mouton
Committer:Andras Banki-Horvath

lnwallet+walletrpc: add SubmitPackage for v3 CPFP package relay Add SubmitPackage to the lnwallet.WalletController interface and a new WalletKit.SubmitPackage RPC, so a client of lnd can relay a package of related transactions (parents first, child last) through lnd's own chain connection. This lets a zero-fee v3/TRUC parent be accepted via its fee-paying CPFP child without the caller needing a separate connection to the chain backend. BtcWallet.SubmitPackage forwards to the chain backend's submitpackage for bitcoind/btcd, and broadcasts each transaction individually for neutrino (no mempool; relies on the peer's 1p1c package relay). The WalletKit handler maps the proto request/response to the btcjson result and is gated by the onchain:write macaroon permission. Mock controllers and the no-chain backend gain trivial implementations. (cherry picked from commit f55c0565d02cff63760b055970d36eca82e2beb1)

Commit:a5fa81f
Author:Calvin Zachman
Committer:Calvin Zachman

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:0ba6974
Author:Calvin Zachman
Committer:Calvin Zachman

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:9e1f98e
Author:bitromortac
Committer:ziggie

lnrpc/routerrpc: add outgoing_node_id to HTLC intercept request A blinded route may identify the next hop by node ID (next_node_id) rather than by channel, in which case there is no sender-specified outgoing channel to report to an HTLC interceptor. Add an outgoing_node_id field to ForwardHtlcInterceptRequest to carry the next hop's public key for these forwards, and document that outgoing_requested_chan_id then holds a reserved sentinel value so that clients switching on a zero channel ID to detect the exit hop do not misclassify the forward as a final receive. This commit only adds the schema and regenerated stubs; the fields are populated by later commits. (cherry picked from commit 14640a501658cd18853b14a2f2d2ff86b56dfbf8)

Commit:17a3fe4
Author:bitromortac
Committer:github-actions[bot]

lnrpc/routerrpc: add outgoing_node_id to HTLC intercept request A blinded route may identify the next hop by node ID (next_node_id) rather than by channel, in which case there is no sender-specified outgoing channel to report to an HTLC interceptor. Add an outgoing_node_id field to ForwardHtlcInterceptRequest to carry the next hop's public key for these forwards, and document that outgoing_requested_chan_id then holds a reserved sentinel value so that clients switching on a zero channel ID to detect the exit hop do not misclassify the forward as a final receive. This commit only adds the schema and regenerated stubs; the fields are populated by later commits. (cherry picked from commit 14640a501658cd18853b14a2f2d2ff86b56dfbf8)

Commit:14640a5
Author:bitromortac
Committer:bitromortac

lnrpc/routerrpc: add outgoing_node_id to HTLC intercept request A blinded route may identify the next hop by node ID (next_node_id) rather than by channel, in which case there is no sender-specified outgoing channel to report to an HTLC interceptor. Add an outgoing_node_id field to ForwardHtlcInterceptRequest to carry the next hop's public key for these forwards, and document that outgoing_requested_chan_id then holds a reserved sentinel value so that clients switching on a zero channel ID to detect the exit hop do not misclassify the forward as a final receive. This commit only adds the schema and regenerated stubs; the fields are populated by later commits.

Commit:aaf9ec1
Author:Calvin Zachman
Committer:Calvin Zachman

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:6e2e2e8
Author:Calvin Zachman
Committer:Calvin Zachman

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:71007cb
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DisableRemoteRouter rpc In this commit, we add a DisableRemoteRouter RPC to the switchrpc sub-server that allows an operator to transition from external (switchrpc) back to local payment lifecycle management. The handler delegates to the Switch's DisableRemoteRouter method and distinguishes between precondition failures (attempt entries still exist) and internal errors, returning codes.FailedPrecondition or codes.Internal respectively. This gives callers a clear signal to drain pending attempts before retrying.

Commit:dc4dacb
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add DeleteAttempts RPC Expose the store-layer DeleteAttempts as a gRPC endpoint on the Switch sub-server, allowing remote callers to garbage-collect terminal attempt records by explicitly naming the finished IDs. A unit test with a stateful mock demonstrates that hard delete removes the idempotency protection, allowing re-dispatch with the same ID.

Commit:76b66cf
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update SendOnion error handling Update both proto and handler to communicate error information via gRPC status details.

Commit:f924be9
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update TrackOnion rpc error handling The new structure uses a top-level `oneof` to provide a compile-time distinction between a successful payment (preimage) and a failed one. Additional information on a failed attempt can be found in FailureDetails. We now also use a structured ForwardingFailure type for communicating the failure index and wire message from failures which occur during htlc forwarding downstream in the route.

Commit:f6a2754
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: update sendonion rpc docs Clarify useage of API for rpc clients.

Commit:cd9de27
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: proto message updates Update the Switch RPC protos to make use of the 'optional' directive. Though this may not impact the generated types or how the user interacts with these types, it may serve to document the fact that they are optional a bit better.

Commit:c59510c
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new BuildOnion rpc proto

Commit:ff2c545
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new TrackOnion rpc proto

Commit:951a578
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new SendOnion rpc proto Support all fields from UpdateAddHtlc. This allows users of the SendOnion RPC to include all fields that we support using with the UpdateAddHtlc type.

Commit:4aeea44
Author:Calvin Zachman
Committer:Calvin Zachman

switchrpc: add new grpc subserver The SwitchRPC server will be hidden behind a non default build tag.

Commit:3d3648b
Author:Olaoluwa Osuntokun
Committer:Olaoluwa Osuntokun

walletrpc: return the master key birthday from ListAccounts In this commit, we add a master_key_birthday_timestamp field to ListAccountsResponse and populate it from the wallet. The accounts in that response are extended public keys, and an xpub says nothing about when it was created. That's a problem for the one thing the response exists for: exporting a signer's accounts so a watch-only wallet can import them. The importing side has no birthday to work with, so lnd substitutes the aezeed "Bitcoin Days Genesis" epoch of 2017-08-24 and rescans from there. On mainnet that's hundreds of thousands of blocks and several hours, even for a node with no history whatsoever. See lightninglabs/lndinit#97 for what that looks like in practice. The field is named to match WatchOnly.master_key_birthday_timestamp on the InitWallet request, which is where the value ends up, and it round-trips through the accounts JSON file that lncli's createwatchonly and lndinit both read. A wallet that somehow has no birthday at all reports zero rather than the nonsense a uint64 cast of a pre-epoch time would produce, since zero is already what InitWallet reads as "unknown".

Commit:40c64f9
Author:Yong
Committer:GitHub

Merge pull request #10900 from ellemouton/walletkit-submitpackage lnwallet+walletrpc: add WalletKit.SubmitPackage for v3 CPFP package relay

Commit:f55c056
Author:Elle Mouton
Committer:Elle Mouton

lnwallet+walletrpc: add SubmitPackage for v3 CPFP package relay Add SubmitPackage to the lnwallet.WalletController interface and a new WalletKit.SubmitPackage RPC, so a client of lnd can relay a package of related transactions (parents first, child last) through lnd's own chain connection. This lets a zero-fee v3/TRUC parent be accepted via its fee-paying CPFP child without the caller needing a separate connection to the chain backend. BtcWallet.SubmitPackage forwards to the chain backend's submitpackage for bitcoind/btcd, and broadcasts each transaction individually for neutrino (no mempool; relies on the peer's 1p1c package relay). The WalletKit handler maps the proto request/response to the btcjson result and is gated by the onchain:write macaroon permission. Mock controllers and the no-chain backend gain trivial implementations.

Commit:c4a67b6
Author:ziggieXXX
Committer:GitHub

Merge pull request #10832 from bitromortac/2604-bolt12-1b bolt12: add `InvoiceRequest` codec and structural validators

Commit:bc8463a
Author:ziggie
Committer:ziggie

routerrpc: add clarifying docs for the intercepted forward routerrpc: document on-chain interceptor responses (cherry picked from commit 8909c2fbf5535b81ee18c4f4e7fe0160ca43e725)

Commit:be2d915
Author:ziggie
Committer:github-actions[bot]

routerrpc: add clarifying docs for the intercepted forward routerrpc: document on-chain interceptor responses (cherry picked from commit 8909c2fbf5535b81ee18c4f4e7fe0160ca43e725)

Commit:8909c2f
Author:ziggie
Committer:ziggie

routerrpc: add clarifying docs for the intercepted forward routerrpc: document on-chain interceptor responses

Commit:c5733c4
Author:bitromortac
Committer:bitromortac

lnrpc: document reply_path verbatim passthrough on OnionMessageUpdate Document that the introduction_node field in an OnionMessageUpdate's reply_path is passed through verbatim from the wire, potentially carrying either a 33-byte pubkey or a 9-byte sciddir form. Subscribers wishing to reply must resolve sciddir forms against their local channel graph. The SubscribeOnionMessages bridge is refactored to use a new marshallBlindedPath helper, ensuring a nil reply path remains nil in the RPC response rather than being emitted as an empty struct.

Commit:748a65e
Author:Calvin Zachman
Committer:ziggie

routerrpc: allow BuildRoute RPC to use arbitrary source The routerrpc.Server and ChannelRouter assume that the source public key for a route is always the node’s public key when calling BuildRoute. We update to allow overriding of this field to any arbitrary public key. The list of hop public keys must be connected to the source via channels in our graph view.

Commit:db12dbc
Author:Calvin Zachman
Committer:ziggie

lnrpc: allow arbitrary route source The RouterBackend assumes that the source public key for a route is always the node’s public key when calling UnmarshallRoute. Here we update to allow overriding of this field to any arbitrary public key.

Commit:f18a786
Author:Calvin Zachman
Committer:ziggie

switchrpc: add DisableRemoteRouter rpc In this commit, we add a DisableRemoteRouter RPC to the switchrpc sub-server that allows an operator to transition from external (switchrpc) back to local payment lifecycle management. The handler delegates to the Switch's DisableRemoteRouter method and distinguishes between precondition failures (attempt entries still exist) and internal errors, returning codes.FailedPrecondition or codes.Internal respectively. This gives callers a clear signal to drain pending attempts before retrying.