Commit graph

17202 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
41bd293f33
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-10-11 14:11:56 +02:00
Olaoluwa Osuntokun
ca5dcbbf5c
lnwallet: add initial unit tests for musig2+tapscript root chans 2024-10-11 14:11:56 +02:00
Olaoluwa Osuntokun
cae4f21897
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-10-11 14:11:56 +02:00
Olaoluwa Osuntokun
62713c1270
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-10-11 14:11:56 +02:00
Olaoluwa Osuntokun
b7e153fd82
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-10-11 14:11:56 +02:00
Olaoluwa Osuntokun
9fd8287c7b
lnwallet/chanfunding: add optional tapscript root 2024-10-11 14:11:55 +02:00
Olaoluwa Osuntokun
1e71b1e544
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-10-11 14:11:55 +02:00
Olaoluwa Osuntokun
74cb1f48ad
channeldb: add optional TapscriptRoot field + feature bit 2024-10-11 14:11:55 +02:00
Olaoluwa Osuntokun
e71627f893
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-10-11 14:11:55 +02:00
Oliver Gugger
264dcd0641
Merge branch '0-18-4-branch-rc1-9025' into 0-18-4-branch-rc1 2024-10-11 14:04:01 +02:00
Oliver Gugger
830dd49fa8
routing+lnrpc: fix log statements 2024-10-11 14:04:00 +02:00
Oliver Gugger
1447493081
server: fix logging of pubkey 2024-10-11 14:04:00 +02:00
Oliver Gugger
2d6ba8c056
cmd/commands: export StripPrefix 2024-10-11 14:04:00 +02:00
Oliver Gugger
4fd1abfe52
lnwallet: add Tree() method, fix formatting 2024-10-11 14:04:00 +02:00
Oliver Gugger
89f75e7d1b
lnwallet: export GenTaprootHtlcScript 2024-10-11 14:04:00 +02:00
Oliver Gugger
29f139225b
lnwallet: export AnchorSize 2024-10-11 14:04:00 +02:00
Oliver Gugger
90470065ba
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-10-11 14:04:00 +02:00
Olaoluwa Osuntokun
41ca01a1b7
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-10-11 14:03:59 +02:00
Olaoluwa Osuntokun
cd5fa5976a
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-10-11 14:03:59 +02:00
ffranr
b59ecc9270
htlcswitch: add missing method doc 2024-10-11 14:03:59 +02:00
ffranr
cc2b7b6fda
multi: improve comment grammar 2024-10-11 14:03:59 +02:00
ffranr
58ed8e751d
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-10-11 14:03:59 +02:00
Oliver Gugger
1893104392
mod: bump tlv to v1.2.6 2024-10-11 14:03:59 +02:00
Olaoluwa Osuntokun
213618adcc
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-10-11 14:03:59 +02:00
Oliver Gugger
7e656257d1
Merge branch '0-18-4-branch-rc1-9007' into 0-18-4-branch-rc1 2024-10-11 14:02:44 +02:00
Oliver Gugger
c849f91590
.golangci: fix config, update new-from-rev 2024-10-11 14:02:31 +02:00
Oliver Gugger
03493d491b
multi: update linter, fix new issues 2024-10-11 14:02:30 +02:00
Oliver Gugger
7502bf3ad9
.golangci: remove or rename old and deprecated linters 2024-10-11 14:01:44 +02:00
Olaoluwa Osuntokun
e735f77d43
build: set min build version to Go 1.22.6
Go 1.23 was released this week, so with this PR we update the build
system to officially support the last two releases.
2024-10-11 14:01:44 +02:00
Oliver Gugger
3b5e1fa764
Merge branch '0-18-4-branch-rc1-8520' into 0-18-4-branch-rc1 2024-10-11 14:01:29 +02:00
Olaoluwa Osuntokun
8eae1eec4a
peer: don't stop global msg router
In this commit, we fix a bug that would cause a global message router to
be stopped anytime a peer disconnected. The global msg router only
allows `Start` to be called once, so afterwards, no messages would
properly be routed.
2024-10-11 14:01:29 +02:00
Olaoluwa Osuntokun
35e48838c3
multi: make MsgRouter available in the ImplementationCfg
With this commit, we allow the `MsgRouter` to be available in the
`ImplementationCfg`. With this, programs outside of lnd itself are able
to now hook into the message processing flow to direct handle custom
messages, and even normal wire messages.
2024-10-11 14:01:29 +02:00
Olaoluwa Osuntokun
e257188017
peer: update readHandler to dispatch to msgRouter if set
Over time with this, we should be able to significantly reduce the size
of the peer.Brontide struct as we only need all those deps as the peer
needs to recognize and handle each incoming wire message itself.
2024-10-11 14:01:29 +02:00
Olaoluwa Osuntokun
a888573fcc
msgmux: add new abstract message router
In this commit, we add a new abstract message router. Over time, the
goal is that this message router replaces the logic we currently have in
the readHandler (the giant switch for each message).

With this new abstraction, can reduce the responsibilities of the
readHandler to *just* reading messages off the wire and handing them off
to the msg router. The readHandler no longer needs to know *where* the
messages should go, or how they should be dispatched.

This will be used in tandem with the new `protofsm` module in an
upcoming PR implementing the new rbf-coop close.
2024-10-11 14:01:29 +02:00
Oliver Gugger
0719c808dd
Merge branch '0-18-4-branch-rc1-8996' into 0-18-4-branch-rc1 2024-10-11 11:42:24 +02:00
Keagan McClelland
8344699a0d
lntypes: Add Dual[A] primitive type
This commit introduces a new type Dual[A] to make it easier to
manage symmetric configurations or state for lightning channels.
2024-10-11 11:42:23 +02:00
Oliver Gugger
d72a3aaf26
Merge pull request #9088 from Roasbeef/0-18-3-branch
build: bump version to v0.18.3
2024-09-11 05:22:27 -06:00
Olaoluwa Osuntokun
6eea5f3b13
build: bump version to v0.18.3 2024-09-10 19:44:13 -07:00
Olaoluwa Osuntokun
4f40e43b26
Merge pull request #9061 from Roasbeef/0-18-3-branch
release: create branch for v0.18.3 rc3
2024-09-06 15:34:20 -07:00
Olaoluwa Osuntokun
d85ce8415b
build: bump version to v0.18.3 rc3 2024-09-06 12:59:37 -07:00
Olaoluwa Osuntokun
e1351eaa0a Merge branch '0-18-3-branch-9050' into 0-18-3-branch 2024-09-06 12:59:32 -07:00
Olaoluwa Osuntokun
ce442a5083 Merge branch '0-18-3-branch-9046' into 0-18-3-branch 2024-09-06 12:59:32 -07:00
Andras Banki-Horvath
d4fbc815c6 docs: update docs/release-notes/release-notes-0.18.3.md 2024-09-06 12:59:32 -07:00
Olaoluwa Osuntokun
2341019016 lnwallet: expand chan sync tests to cover taproot channels
In this commit, we expand some of the existing chan sync tests to cover
taproot channels (the others already did). Along the way, we always
assert that the `PartialSig` is populated on retransmission. In
addition, we now send the new commit sig rather than the existing
in-memory one to test the new logic that re-signs the commitment.
2024-09-06 12:59:32 -07:00
Andras Banki-Horvath
b62db3733d sqldb: fix end date filter when querying invoices
Previously, the SQL implementation of the invoice query simply
converted the start and end timestamps to time and used them
in SQL queries to check for inclusivity. However, this logic
failed when the start and end timestamps were equal.

This commit addresses and corrects this issue.
2024-09-06 12:59:32 -07:00
Andras Banki-Horvath
9298133614 sqldb+invoices: synchronize SQL invoice updater behavior with KV version
Previously SQL invoice updater ignored the set ID hint when updating an
AMP invoice resulting in update subscriptions returning all of the AMP
state as well as all AMP HTLCs. This commit synchornizes behavior with
the KV implementation such that we now only return relevant AMP state
and HTLCs when updating an AMP invoice.
2024-09-06 12:59:32 -07:00
Andras Banki-Horvath
b3dc3ed5c8 channeldb: filter AMP state to relevant set IDs
When fetching an AMP invoice we sometimes filter HTLCs to selected set
IDs, however we always kept the full AMP state which is irrelevant as it
contains state for all AMP payments. This was a side effect of
UpdateInvoice needing to serialize the whole invoice when storing after
an update but it is an unwanted "feature" as users will need to filter
to relevant set when listing an AMP payment or subsribing to an update.
2024-09-06 12:59:32 -07:00
Alex Akselrod
cadce23b47 invoices: ensure AMP subinvoices are correctly updated w/nativesql 2024-09-06 12:59:32 -07:00
Alex Akselrod
8c6e24346a itest: check that AMP subinvoices are correctly updated w/nativesql 2024-09-06 12:59:32 -07:00
Alex Akselrod
e152a52625 invoices/sqldb: query by ChanID when updating AMP invoice preimage 2024-09-06 12:59:32 -07:00