Commit Graph

17111 Commits

Author SHA1 Message Date
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
Oliver Gugger
cf2174fc2d lnwallet: export AnchorSize 2024-08-23 10:58:13 +02:00
Oliver Gugger
22a3988222 cmd/lncli: move commands and export
We want to export some of our CLI code to re-use in other projects. But
in Golang you cannot import code from a `main` package.
So we need to move the actual code into its own package and only have
the `func main()` in the `main` package.
2024-08-23 10:57:59 +02:00
yyforyongyu
35287ee899 scripts: silence test outputs 2024-08-23 15:48:09 +08:00
ziggie
816b25e2ba docs: add release-notes. 2024-08-22 19:09:43 +02:00
ziggie
25f7b1c362 blindedpath: minHTLC for blinded path change.
We will not add a buffer to the chan policy for blinded paths in case
the sender amount violates the minHTLC restriction in the first place.

Moreover we disgard a route fast if the payment amount is smaller than
the minHTLC along the route.
2024-08-22 19:09:43 +02:00
Olaoluwa Osuntokun
75477c8896 funding: use atomic.Uint64 for chanIDNonce
This lets us get rid of the mutex usage there. We also shift the algo slightly to increment by 1, then use that as the next value, which plays nicer with the atomics.
2024-08-22 18:33:24 +02:00
Olaoluwa Osuntokun
614711748c funding: add new type alias for PendingChanID = [32]byte
This'll be useful for new interface definitions that use the contents of the package.
2024-08-22 18:33:24 +02:00
ffranr
1297e8f7c7 htlcswitch: add missing method doc 2024-08-22 18:33:24 +02:00
ffranr
7df093b3b1 multi: improve comment grammar 2024-08-22 18:33:24 +02:00
ffranr
9f3593a341 lnwire: add type CustomRecords
This commit introduces the `CustomRecords` type in the `lnwire` package,
designed to hold arbitrary byte slices. Each entry in this map can
associate with TLV type values that are greater than or equal to 65536.
2024-08-22 18:33:24 +02:00
ziggie
73984964a8 blindedpath: fix log output. 2024-08-22 17:48:27 +02:00
ziggie
5d7113ac1d blindedpath: remove blockexpiry check.
Removes a check where we would NOT allow to create a blinded invoice
with an expiry (invoice expiry in seconds considered as block time)
lower than the min_final_ctlv_delta.
2024-08-22 17:45:45 +02:00
Oliver Gugger
9e926924f1 mod: bump tlv to v1.2.6 2024-08-22 12:21:52 +02:00
Olaoluwa Osuntokun
38441d24c9 lnwallet/chanfunding: rename assembler.go to interface.go
In this commit, we rename the files as assembler.go houses the primary
interfaces/abstractions of the package. In the rest of the codebase,
this file is near uniformly called interface.go, so we rename the file
to make the repo more digestible at a scan.
2024-08-22 12:21:47 +02:00
Olaoluwa Osuntokun
cc9e2b783e Merge pull request #8961 from yyforyongyu/fix-leaseoutput
Improve the performace of `LeaseOutput`
2024-08-21 16:31:26 -07:00
Oliver Gugger
a028064fa7 Merge pull request #9007 from Roasbeef/go-1-22
build: set min build version to Go 1.22.6
2024-08-20 12:27:02 -06:00
Oliver Gugger
3ae6553eef .golangci: fix config, update new-from-rev 2024-08-20 19:14:44 +02:00
Oliver Gugger
e99e6662cf multi: update linter, fix new issues 2024-08-20 19:14:44 +02:00
Oliver Gugger
9eef428e77 .golangci: remove or rename old and deprecated linters 2024-08-20 19:13:23 +02:00