Commit Graph

17130 Commits

Author SHA1 Message Date
Oliver Gugger
54eeb0e792
Merge pull request #9045 from ziggie1984/fix-blinded-payment-tc
fix blinded path itest.
2024-08-29 04:51:20 -06:00
ziggie
64fb4cb4ac
itest: fix blinded path itest. 2024-08-29 09:50:46 +02:00
Oliver Gugger
5c3a8e949c
Merge pull request #9030 from lightningnetwork/extract-part1-from-staging-branch
[custom channels 1/5]: extract PART1 from mega staging branch
2024-08-28 07:06:53 -06:00
Oliver Gugger
9dfbde7013
lnwallet: thread thru input.AuxTapleaf to all relevant areas
In this commit, we start to thread thru the new aux tap leaf structures to all relevant areas. This includes: commitment outputs, resolution creation, breach handling, and also HTLC scripts.
2024-08-28 13:28:48 +02:00
Oliver Gugger
2ab22b0f0b
lnwallet: refactor commit keys to use lntypes.Dual 2024-08-28 13:26:18 +02:00
Oliver Gugger
b45d72fe59
multi: thread thru the AuxLeafStore everywhere 2024-08-28 13:26:14 +02:00
Olaoluwa Osuntokun
2510c19024
channeldb: add HtlcIndex to HTLCEntry
This may be useful for custom channel types that base everything off the index (a global value) rather than the output index (can change with each state).
2024-08-28 13:24:04 +02:00
Olaoluwa Osuntokun
669740c84e
channeldb: add custom blobs to RevocationLog+HTLCEntry
This'll be useful for custom channel types that want to store extra information that'll be useful to help handle channel revocation cases.
2024-08-28 13:23:30 +02:00
Olaoluwa Osuntokun
61f276856a
channeldb: convert RevocationLog to use RecordT 2024-08-28 13:22:48 +02:00
Olaoluwa Osuntokun
1b1e7a6168
channeldb: convert HTLCEntry to use tlv.RecordT 2024-08-28 13:21:46 +02:00
Olaoluwa Osuntokun
c1e641e9d9
lnwallet: add TLV blob to PaymentDescriptor + htlc add
In this commit, we add a TLV blob to the PaymentDescriptor struct. We also now thread through this value from the UpdateAddHTLC message to the PaymentDescriptor mapping, and the other way around.
2024-08-28 13:21:12 +02:00
Olaoluwa Osuntokun
d95c1f93f3
lnwallet+channeldb: add new AuxLeafStore for dynamic aux leaves
In this commit, we add a new AuxLeafStore which can be used to dynamically fetch the latest aux leaves for a given state. This is useful for custom channel types that will store some extra information in the form of a custom blob, then will use that information to derive the new leaf tapscript leaves that may be attached to reach state.
2024-08-28 13:21:08 +02:00
Olaoluwa Osuntokun
c36cd9298f
input: add some utility type definitions for aux leaves
In this commit, we add some useful type definitions for the aux leaf.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
d25f881433
lnwallet: add custom tlv blob to internal commitment struct
In this commit, we also add the custom TLV blob to the internal commitment struct that we use within the in-memory commitment linked list.

This'll be useful to ensure that we're tracking the current blob for our in memory commitment for when we need to write it to disk.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
12352d9e6e
lnwallet: export the HtlcView struct
We'll need this later on to ensure we can always interact with the new aux blobs at all stages of commitment transaction construction.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
5c4428c3cf
channeldb: new custom blob nested TLV
In this commit, for each channel, we'll now start to store an optional custom blob. This can be used to store extra information for custom channels in an opauqe manner.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
1aae47fd71
input+lnwallet: update taproot scripts to accept optional aux leaf
In this commit, we update all the taproot scripts to also accept an
optional aux leaf. This aux leaf can be used to add more redemption
paths for advanced channels, or just as an extra commitment space.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
8588c9bfd7
lnwallet: add initial unit tests for musig2+tapscript root chans 2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
82ba5bf0bf
lnwallet+peer: add tapscript root awareness to musig2 sessions
With this commit, the channel is now aware of if it's a musig2 channel, that also has a tapscript root. We'll need to always pass in the tapscript root each time we: make the funding output, sign a new state, and also verify a new state.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
c8b7987a39
lnwallet: update internal funding flow w/ tapscript root
This isn't hooked up yet to the funding manager, but with this commit, we can now start to write internal unit tests that handle musig2 channels with a tapscript root.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
142b408be7
multi: update GenTaprootFundingScript to pass tapscript root
In most cases, we won't yet be passing a root. The option usage helps us keep the control flow mostly unchanged.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
eeee2979e5
lnwallet/chanfunding: add optional tapscript root 2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
2c56b3120a
multi: add new tapscript root option to GenTaprootFundingScript
This'll allow us to create a funding output that uses musig2, but uses a tapscript tweak rather than a normal BIP 86 tweak.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
edf959d39f
channeldb: add optional TapscriptRoot field + feature bit 2024-08-28 11:52:29 +02:00
Olaoluwa Osuntokun
ecca095a9b
channeldb: consolidate root bucket TLVs into new struct
In this commit, we consolidate the root bucket TLVs into a new struct.
This makes it easier to see all the new TLV fields at a glance. We also
convert TLV usage to use the new type param based APis.
2024-08-28 11:51:54 +02:00
Olaoluwa Osuntokun
1bf7ad9b43
Merge pull request #9009 from Crypt-iQ/gossip_ban_8132024
discovery: implement banning for invalid channel anns
2024-08-27 18:50:00 -05:00
Oliver Gugger
64b8c6299a
Merge pull request #9039 from ellemouton/htlcPersistenceAcrossRestart
lnwallet: correctly set UpdateAddHTLC.BlindingPoint on reload from disk
2024-08-27 12:45:27 -06:00
Eugene Siegel
95acc78013
release-notes: update for 0.18.3 2024-08-27 14:11:07 -04:00
Eugene Siegel
013452cff0
discovery: implement ChannelAnnouncement banning
This commit hooks up the banman to the gossiper:
- peers that are banned and don't have a channel with us will get
  disconnected until they are unbanned.
- peers that are banned and have a channel with us won't get
  disconnected, but we will ignore their channel announcements until
  they are no longer banned. Note that this only disables gossip of
  announcements to us and still allows us to open channels to them.
2024-08-27 14:11:06 -04:00
Eugene Siegel
9380292a5a
graph: export NewErrf and ErrorCode for upcoming gossiper unit tests 2024-08-27 14:11:06 -04:00
Eugene Siegel
8e0d7774b2
discovery: clean up scid variable usage 2024-08-27 14:11:06 -04:00
Eugene Siegel
99b86ba462
multi: extend lnpeer.Peer interface with Disconnect function
This will be used in the gossiper to disconnect from peers if their
ban score passes the ban threshold.
2024-08-27 14:11:06 -04:00
Eugene Siegel
0173e4c44d
discovery: add banman for channel announcements
This commit introduces a ban manager that marks peers as banned if
they send too many invalid channel announcements to us. Expired
entries are purged after a certain period of time (currently 48 hours).
2024-08-27 14:11:06 -04:00
Eugene Siegel
199e83d3f2
channeldb: add PutClosedScid and IsClosedScid
This commit adds the ability to store closed channels by scid in
the database. This will allow the gossiper to ignore channel
announcements for closed channels without having to do any
expensive validation.
2024-08-27 14:11:05 -04:00
Elle Mouton
6c7be5b933
docs: update release notes 2024-08-27 19:31:51 +02:00
Elle Mouton
b0852a22fd
lnwallet+itest: fix PaymentDescriptor creation for blinded path htlc
This commit fixes the instantiation of the BlindingPoint member of
PaymentDescriptor during the conversion from persisted LogUpdates.
Previously, the blinding point was not set correctly. The test from the
previous commit is also updated to now assert that this behaviour is now
correct.
2024-08-27 18:18:15 +02:00
Elle Mouton
9ac8e673b4
itest: demonstrate UpdateAddHTLC reloading bug
This commit adds a new route blinding itest that demonstrates that the
reloading and re-forwarding of an UpdateAddHTLC message on restart
currently is done incorrectly for a blinded path payment. This is due to
the fact that the blinding point member is not currently set correctly.
This is fixed in the next commit which will also change the test to
assert that the behaviour is now correct.
2024-08-27 18:18:10 +02:00
Oliver Gugger
8939a217c3
Merge pull request #9021 from aakselrod/run-nativesql-itests
itest: ensure LND gets correct CLI options when itest are parallel
2024-08-25 01:25:03 -06:00
Alex Akselrod
302c690136
docs: update release notes 2024-08-24 13:28:16 -07:00
Alex Akselrod
8d5f8d822d
itest: ensure LND gets correct CLI options when itest are parallel 2024-08-24 13:28:14 -07:00
Oliver Gugger
dcd921ad69
Merge pull request #9029 from tlindi/admin-macaroon-recreate-sample
update macaroons/README.md
2024-08-23 06:45:07 -06:00
tlindi
b59ced60c0 update macaroons/README.md
Provide sample of command to create macaroon with similar rights as admin.macaroon to be used with 3rd party applications.

Co-Authored-By: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-08-23 15:10:04 +03:00
Oliver Gugger
306695cd78
Merge pull request #9025 from lightningnetwork/extract-from-staging-branch
[custom channels]: extract some independent commits from mega staging branch
2024-08-23 05:04:46 -06:00
Yong
278cf03078
Merge pull request #9028 from yyforyongyu/improve-ci-log
Makefile: silence testing log in `make itest-parallel`
2024-08-23 17:55:04 +08:00
Oliver Gugger
d0d397545a
Merge pull request #9026 from ziggie1984/bugfix-minHTLC-blindedpath
blindedpath: Minor bug fixes and feature addition.
2024-08-23 03:07:46 -06:00
Oliver Gugger
61edb36283
routing+lnrpc: fix log statements 2024-08-23 10:58:14 +02:00
Oliver Gugger
1167e9b6dd
server: fix logging of pubkey 2024-08-23 10:58:14 +02:00
Oliver Gugger
c5973aa136
cmd/commands: export StripPrefix 2024-08-23 10:58:13 +02:00
Oliver Gugger
efbaf90caf
lnwallet: add Tree() method, fix formatting 2024-08-23 10:58:13 +02:00
Oliver Gugger
f0648e24a5
lnwallet: export GenTaprootHtlcScript 2024-08-23 10:58:13 +02:00