Commit graph

15824 commits

Author SHA1 Message Date
Manisha
034bb5b51e Wrong documentation on lncli
Signed-off-by: Manisha <manisha2133@gmail.com>
2024-01-03 21:57:25 +05:30
Oliver Gugger
82e2b4010b
Merge pull request #8320 from threewebcode/patch-2
fix: correct the typo [skip ci]
2024-01-03 14:07:41 +01:00
Thabokani
b8d2fc3816
kvdb+cmd: fix typos 2024-01-03 12:06:32 +08:00
Olaoluwa Osuntokun
85046997c9
tlv: add utility funcs/methods to make tlv.OptionalRecord easier to use
We add a WhenSome that'll pass in the actual underlying value, and not
just the record.

We also add `SomeRecord` to make it easier to create TLV records w/
`Some` set.
2024-01-02 18:51:41 -08:00
Olaoluwa Osuntokun
aec2f9bf08
tlv: add TlvType method to RecordT
This will be useful when decoding optional TLV records, as we can use
this to look up in the `typeMap` for a given field to see if we decoded
it or not.
2024-01-02 18:51:35 -08:00
Olaoluwa Osuntokun
09afc92215
tlv: make TlvType method for TlvType interface public
With this change, callers can now examine a struct instance of the
`TlvType` instance to figure out programmatically which integer type is
maps to. This'll be useful when decoding optional TLV types into a wire
struct (knowing when to set it to Some vs None).
2024-01-02 18:51:33 -08:00
Olaoluwa Osuntokun
66cf4396a2
tlv: modify RecordT type to ensure type param takes precedence
In this commit, we modify the RecordT type to allow callers to re-use
the Record definition of a different type, but use the new type param to
override the integer type used on the wire.

This will let use do things like encode a signature using the same
RecordProducer instance, but with a diff type in another context.

The upcoming use for this is allowing our `lnwire.Sig` type to be
encoded in the same message using distinct TLV integer types (new co-op
close protocol).
2024-01-02 18:51:30 -08:00
Olaoluwa Osuntokun
7f8b185f40
Merge pull request #8307 from ziggie1984/channel-reestablishment-logging
lnwallet: fix logging.
2024-01-02 12:28:01 -08:00
Thabokani
55072bfd5e
sweep+lntest: fix typos 2024-01-02 19:23:30 +08:00
Yong
ab8fb2c9c3
Merge pull request #8308 from ziggie1984/new_min_cltv_default
zpay32: Change min_final_cltv_expiry_delta.
2024-01-02 17:19:52 +08:00
ziggie
160713eade
docs: add release-notes. 2023-12-29 22:35:12 +01:00
Afanti
fff785c909
fix: correct the typo 2023-12-29 21:27:13 +08:00
ziggie
ec02ffa383
zpay32: Change min_final_cltv_expiry_delta.
We adhere to BOLT 02 and use 18 instead of 9.
2023-12-22 18:16:07 +01:00
ziggie
45a3bf333b
lnwallet: fix logging. 2023-12-22 17:36:41 +01:00
Oliver Gugger
4d8fa349ca
Merge pull request #8303 from AtomicInnovation321/master
docs: fix typos
2023-12-21 17:31:59 +01:00
bitcoin-lightning
b72fc9529e docs: fix typos 2023-12-21 15:21:35 +00:00
Oliver Gugger
30348baedc
Merge pull request #8296 from threewebcode/patch-1
fix: rectify the typos in the docs
2023-12-20 09:47:14 +01:00
Afanti
c0ef879b8c
fix: rectify the typos in the docs 2023-12-20 08:21:57 +08:00
Carla Kirk-Cohen
b31bab3529
docs: add release notes 2023-12-18 12:08:05 -05:00
Carla Kirk-Cohen
4071db77b5
routing: add handling for blinded errors from final node
We do not expect blinding errors from the final node:
1. If the introduction is the recipient, they should use regular errors.
2. Otherwise, nodes have no business sending this error when they are
   not part of a blinded route.
2023-12-18 12:07:56 -05:00
Carla Kirk-Cohen
7ce3a152a1
routing/refactor: add failNode helper to final outcome processing
Note: this refactor updates the inequality used from >= 2 to > 1 to
align with the rest of this file so that we express this concept
consistently throughout the code.
2023-12-18 12:07:47 -05:00
Carla Kirk-Cohen
b82478a7e7
routing: add result interpretation for intermediate invalid blinding
This commit adds handling for route blinding errors that are reported
by the introduction node in a multi-hop blinded route. As the
introduction node is always responsible for handling blinded errors,
it is not penalized - only the final hop is penalized to discourage the
blinded route without filling up mission control with ephemeral
results.

If this error code is reported by a node that is not an introduction
node, we penalize the node because it is returning an error code that
it should not be using.
2023-12-18 12:07:46 -05:00
Carla Kirk-Cohen
f91589bef9
routing: handle introduction node failure to convert error
This commit adds handling for errors that originate after the
introduction node when making payment to a blinded route. This
indicates that the introduction node is not obeying the spec, so
it is punished for the violation.
2023-12-18 12:07:36 -05:00
Carla Kirk-Cohen
31d4242b6d
docs: add release notes for 0.18 2023-12-18 11:27:57 -05:00
Carla Kirk-Cohen
af4fdcc1fd
htlcswitch/test: allow missing field errors in payload decode 2023-12-18 11:27:56 -05:00
Carla Kirk-Cohen
69d5496e7c
multi: update payload validation to account for blinded routes 2023-12-18 11:27:55 -05:00
Carla Kirk-Cohen
343a6ed831
hltcswitch/hop: add next hop to intermediate hop with custom records
Fix our existing test to have a valid intermediate hop that will pass
stricter validation. Previously, we did not specify a next channel for
an intermediate hop (which violates bolt4).
2023-12-18 11:27:53 -05:00
Carla Kirk-Cohen
7db072e020
routing: add additional validation to hop payload creation 2023-12-18 11:27:52 -05:00
Carla Kirk-Cohen
585f28c5f5
multi: explicitly signal final hop in pack hop payload
Previously, we'd use the value of nextChanID to infer whether a payload
was for the final hop in a route. This commit updates our packing logic
to explicitly signal to account for blinded routes, which allow zero
value nextChanID in intermediate hops. This is a preparatory commit
that allows us to more thoroughly validate payloads.
2023-12-18 11:27:52 -05:00
Carla Kirk-Cohen
b5afd905d1
htlcswitch/hop: explicitly signal final hop from sphinx packet
Previously, we were using nextChanID to determine whether a hop
payload is for the final recipient. This is no longer suitable in a
route-blinding world where intermediate hops are allowed to have zero
nextChanID TLVs (as this information is provided to forwarding nodes
in their encrypted data). This commit updates payload reading to use
the signal provided by sphinx that we are on the last packet, rather
than implying it from the contents of a hop.
2023-12-18 11:27:51 -05:00
Carla Kirk-Cohen
2f8587341a
htlcswitch/test: do not set amount and cltv for blinded test cases 2023-12-18 11:27:50 -05:00
Carla Kirk-Cohen
a75bc13230
routing/test: set outgoing timelock on non-legacy test cases
Provide valid hop payloads for tests cases that use TLV onion format.
2023-12-18 11:27:49 -05:00
Carla Kirk-Cohen
fa78d21975
htlcswitch/test: add sphinx action to decoding test
Update test to include the sphinx action to more closely represent
reality. This will be required when we add more validation to the
presence of a nextChanID field. A MoreHops action is chose because
we're testing the case with a payload that contains forwarding info.
2023-12-18 11:27:48 -05:00
Oliver Gugger
0df507eca0
Merge pull request #8261 from markettes/lncli-multiple-outgoing-channels
Enable multiple outgoing channel ids in payments
2023-12-18 11:38:46 +01:00
Marcos
ea9a780203
docs: release notes update for 0.18.0 2023-12-18 10:27:19 +01:00
Marcos
72a56f56b4
lncli: enable multiple outgoing channel ids in payments 2023-12-18 10:27:03 +01:00
Olaoluwa Osuntokun
ac9ca024a4
Merge pull request #8121 from Roasbeef/tlv-record-type-param
tlv: add new RecordT[T] utility type
2023-12-12 17:47:59 -08:00
Olaoluwa Osuntokun
63e86b72c5
tlv: add new RecordT[T, V] utility type
In this commit, we add a new type, `RecordT[T, V]` to reduce some of the
common boiler plate for TLV types. This type lets you take either a
primitive type, or an existing Record, and gain common methods used to
create tlv streams.

It also serves as extra type annotation as well, since wire structs can
use this to wrap any existing type and gain the relevant record methods.

This implementation ensures that the very definition of the field also
binds the TLV type value. It does this by using the generated code to
map a struct like TlvType1 to an actually Type like Type(1).
2023-12-12 17:47:10 -08:00
Olaoluwa Osuntokun
c304c2a8bb
tlv: run go generate for new set of TLV types
This shouldn't need to be run again, as this implementation restricts
things to just values 0-99, due to a hard upper limit with the way Go
unions work under the hood.
2023-12-12 17:47:04 -08:00
Olaoluwa Osuntokun
78d5806555
tlv/internal: add new internal package for generating TLV type structs
In this commit, we add some new code generation to the codebase. As
we'll see in a future commit, this'll allow us to create a new Record[T,
V] type, where T is actually a concrete _struct_ that implements a
special interface that deems it as a valid TLV type.
2023-12-12 17:47:01 -08:00
Oliver Gugger
f2d48c328b
Merge pull request #7800 from ziggie1984/neutrino-remove-sweeptx
neutrino remove sweeptx
2023-12-12 17:48:12 +01:00
Carla Kirk-Cohen
b0870ea2ed
htlcswitch/test: add encrypted data to blinded intermediate hop
Blinding points will always be accompanied by encrypted data, so
update the test to more accurately represent reality.
2023-12-12 10:01:26 -05:00
Carla Kirk-Cohen
1bb48178d7
routing/test: add channel id for final hop in clear route
Add the missing channel field to the final hop in our clear text
route test case. Note that this is the channel of the hop. With the
addition of stricter validation, we'll need this so that the
penultimate hop has a non-zero next channel ID.
2023-12-12 10:01:25 -05:00
Carla Kirk-Cohen
d017fe01e3
lnrpc: surface invalid onion blinding on rpc 2023-12-12 09:44:42 -05:00
Carla Kirk-Cohen
fd8381bf2a
lnwire: add invalid onion blinding error code 2023-12-12 09:44:05 -05:00
ziggie
043153fe09
docs: add release-notes 2023-12-12 14:18:17 +01:00
ziggie
58a5dcd502
docs: add formatting rule for function calls. 2023-12-12 14:18:17 +01:00
ziggie
7c09cc3326
lncli: add new removetx cmd.
This new command calls the new rpc endpoint RemoveTransaction.
2023-12-12 14:18:17 +01:00
ziggie
1ca3732f25
itest: add an itest for the removal of a tx. 2023-12-12 14:18:16 +01:00
ziggie
227ac770af
walletrpc: add new RemoveTransaction endpoint.
The RemoveTransaction endpoint removes the transaction with the
provided txid including all its descendants from the internal wallet.

We still keep watching for the address of the transation in case
the transcation is confirmed nonetheless. This command is particular
useful for neutrino backends because new bitcoind versions do not
reply with an invalid transaction error code when the tx published
fails to be included into the mempool (fullnodes do).
2023-12-12 14:18:16 +01:00