Commit Graph

17502 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
d52d30d46e
server+sweep: convert GenSweepScript to use new addr type
We convert it to use lnwallet.AddrWithKey, as in the future, knowing the
internal key for an address will be useful.
2024-10-02 18:09:56 -07:00
Olaoluwa Osuntokun
88ae4cbb21
contractcourt: set resolution blob in commitSweepResolver 2024-10-02 18:09:55 -07:00
Olaoluwa Osuntokun
bf3cf9ef3c
input: add ResolutionBlob method to inputKit
We also update breachedOutput w/ the new API.
2024-10-02 18:09:54 -07:00
Olaoluwa Osuntokun
3f50339898
input: refactor all inputs to use MakeBaseInput, add opts
In this commit, we refactor all the other constructors for the input to
use MakeBaseInput. We also add a new set of functional options as well.
This'll be useful later on to ensure that new options are properly
applied to all the input types.
2024-10-02 18:09:53 -07:00
Olaoluwa Osuntokun
e0ced8e629
lnwallet+peer: move internalKeyForAddr to lnwallet package
This way we can re-use it. We also make it slightly more generalized.
2024-10-02 18:09:52 -07:00
Olaoluwa Osuntokun
f74d1ce53b
contractcourt: add CommitBlob to taprootBriefcase
This'll be used to store the extra resolution information for the
commitment outputs.
2024-10-02 18:09:51 -07:00
Olaoluwa Osuntokun
4619cefc8f
lnwallet: add new aux resolver interface
This will be used by external callers to modify the way we resolve
contracts on chain. For a given contract, we'll store an extra "blob",
that will later be presented during the sweeping phase.
2024-10-02 18:09:50 -07:00
Olaoluwa Osuntokun
0f2c16de99
contractcourt: convert taprootBriefcase to use new tlv record type
This commit doesn't yet go all the way to modify all the other records
quite yet.
2024-10-02 18:09:49 -07:00
Olaoluwa Osuntokun
bf0bd64023
lnwire: modify TestLightningWireProtocol to use sub-tests
This way, it's possible to run induvidual tests to target failures.
2024-10-02 18:09:48 -07:00
George Tsagkarelis
d1a2dd6bd0
routing: add htlcAmt to PaymentBandwidth method of TlvTrafficShaper
This commit was added to the 0-19-staging branch recently and therefore
didn't make it into a previous part yet. So it's unrelated to the
changes in this part but is required for the whole custom channel saga.
2024-10-02 18:09:46 -07:00
András Bánki-Horváth
9eb405e9c6
fn: add goroutine manager
The package provides type GoroutineManager which is used to launch goroutines
until context expires or the manager is stopped. Stop method blocks until all
started goroutines stop.

Original code by Andras https://go.dev/play/p/HhRpE-K2lA0

Adjustments and tests by Boris.
2024-10-02 20:29:59 -03:00
ziggie
2915936a39
docs: add release-notes. 2024-10-03 00:38:50 +02:00
ziggie
6387c0ab50
walletrpc: error out for non-anchor chans.
Return an error if a non-anchor channel is tried to be fee-bumped.
2024-10-03 00:37:49 +02:00
Leonhard Weese
2a15f932ac Update link in musig2.md
This document contained a link to a MuSig2 draft BIP, which is no longer available. I have updated the link with the link to BIP327 in the bitcoin/bips repository.

Update musig2.md

i've removed the extra spaces and standardized the formatting for this section
2024-10-02 10:17:16 -07:00
ziggie
7ea2080abe
lnd: add logger for rpcclient 2024-10-02 11:51:24 +02:00
Elle Mouton
4d44d11ece
rpcserver: use SetBit helper for setting Bolt11 blinded bit
This commit uses the new SetBit helper for setting the Bolt11 route
blinding required bit in a generated invoice. This helper will take care
of setting the dependent bits of the feature bit (namely the route
blinding and TLV feature bits and will use the required variant of
both).
2024-10-02 10:52:59 +02:00
Elle Mouton
49a87469db
feature: add SetBit helper to set dependent bits
This commit adds a new SetBit helper function in the features package
along with a test for it.  SetBit sets the given feature bit on the
given feature bit vector along with any of its dependencies. If the bit
is required, then all the dependencies are also set to required,
otherwise, the optional dependency bits are set. Existing bits are only
upgraded from optional to required but never downgraded from required to
optional.
2024-10-02 10:52:59 +02:00
Olaoluwa Osuntokun
9f0cc159ea
Merge pull request #8644 from Roasbeef/remove-sql-mutex-part-deux
kvdb/postgres: remove global application level lock
2024-10-01 18:06:45 -07:00
Elle
f1207ef740
Merge pull request #9001 from ellemouton/namespacedMC
routing: Namespaced Mission Control
2024-10-01 20:21:53 +02:00
Elle Mouton
83c1d731e7
docs: add release note entry 2024-10-01 18:02:26 +02:00
Elle Mouton
8126930d6c
routing: support multiple namespaced MissionControls 2024-10-01 14:11:05 +02:00
Elle Mouton
5eff056933
routing: prefix MC logs with namespace 2024-10-01 14:06:54 +02:00
Elle Mouton
f0f4f2df21
routing: separate MissionControl from MissionControlManager
This commit renames the previous MissionControl to MissionController and
the previous MissionController interface to MissionControlQuerier. This
is done because soon the (new) MissionController will back multiple
namespaced MissionControl instances.  For now, it just houses a single
MissionControl in the default namespace.

This commit also replaces the MissionControl's `now` function with a
`clock.Clock`.
2024-10-01 14:06:50 +02:00
Elle Mouton
28a828a11e
routing: unexport MissionControl mutex
Only the MissionControl instance should use this variable and it should
not be accessible to users of MissionControl.
2024-10-01 13:50:50 +02:00
Elle Mouton
6b449a6633
routing: start writing and reading from namespaced MC
and invoke the associated mission control migration.
2024-10-01 13:50:50 +02:00
Elle Mouton
bfe4a08341
channeldb/migration33: migrate MC store pairs to default namespace
In this commit, the mission control store is migrated such that all
existing pairs which are currently stored directly in the top level
results bucket are now instead moved to a "default" namespace bucket.

Note that this migration is not yet invoked in this commit. The
migration will be invoked in the same commit that starts writing and
reading the new format.
2024-10-01 13:50:50 +02:00
Elle Mouton
2dd9046622
routing: introduce missionControlDB abstraction
So that `missionControlStore` can be unaware of the backing DB structure
it is writing to. In an upcoming commit when we change mission control
to write to namespaced buckets instead, we then only need to update the
`namespacedDB` implementation.
2024-10-01 13:50:50 +02:00
Elle
75eaaf7c5c
Merge pull request #8911 from ellemouton/reduceMCRouteEncoding
routing+channeldb: use a more minimal encoding for MC routes
2024-10-01 13:49:11 +02:00
Viktor Tigerström
52b3a06733
lnd: allow shutdown signal during IsSynced check
Prior to this commit, lnd could become unresponsive to shutdown signals
during the `IsSynced` check. Since the `IsSynced` check can occasionally
take a long time to complete, this could result in lnd failing to shut
down promptly.
2024-10-01 11:42:47 +02:00
Elle Mouton
34303e77a1
docs: add release notes entry 2024-10-01 10:53:48 +02:00
Olaoluwa Osuntokun
43a1ca4f3d
kvdb/postgres: remove global application level lock
In this commit, we remove the global application level lock from the
postgres backend. This lock prevents multiple write transactions from
happening at the same time, and will also block a writer if a read is on
going. Since this lock was added, we know always open DB connections
with the strongest level of concurrency control available:
`LevelSerializable`. In concert with the new auto retry logic, we ensure
that if db transactions conflict (writing the same key/row in this
case), then the tx is retried automatically.

Removing this lock should increase perf for the postgres backend, as now
concurrent write transactions can proceed, being serialized as needed.
Rather then trying to handle concurrency at the application level, we'll
set postgres do its job, with the application only needing to retry as
necessary.
2024-09-30 16:58:46 -07:00
Elle Mouton
383a6d274f
routing+channeldb: migrate MC store to use minimal Route encoding
Add a new mcRoute type that houses the data about a route that MC
actually uses. Then add a migration (channeldb/migration32) that
migrates the existing store from its current serialisation to the new,
more minimal serialisation.
2024-09-30 11:40:25 +02:00
Elle Mouton
96445f99b4
channeldb: boiler plate code for migration32
In preparation for the commit which will add the main logic for
migration 32 (which will migrate the MC store to use a more minimal
encoding), this commit just adds some of the code that the migration
will need to the package.
2024-09-30 11:40:25 +02:00
Elle Mouton
82ae0220c8
lnwire21: add custom records parsing
We add the new custom records encoding/decoding logic to the "frozen"
lnwire21 package. We can do this because nothing uses this logic yet. If
the custom records logic changes, the changes should _not_ be added to
the lnwire21 version.
2024-09-30 08:59:02 +02:00
Elle Mouton
33ab4b9db9
lnwire21: add CodeInvalidBlinding
To prevent the need to copy the entire onion_error.go file for a new
Mission Control migration, this commit just updates the existing
lnwire21/onion_error.go file with the new CodeInvalidBlinding code. The
lnwire21 should not really ever be updated but adding a new code should
be fine as it does not affect old migrations since this is a new code.
2024-09-30 08:58:15 +02:00
Olaoluwa Osuntokun
1acc8393bc
Merge pull request #9087 from ProofOfKeags/fn/list-filter
fn: add Filter to List
2024-09-28 12:47:04 +09:00
Keagan McClelland
f7264e6a5b
fn: add Filter to List
This commit adds an immutable Filter method to the linked List API.
This is useful because there are several instances wherein we iterate
through the linked List and only process a subset of it in some way
or another.
2024-09-26 14:24:36 -06:00
Olaoluwa Osuntokun
6485a816d1
Merge pull request #9134 from ellemouton/checkPayAddrBeforeDeref
routerrpc: check payaddr before using for probing
2024-09-26 14:50:29 +09:00
Elle Mouton
8663950c68
feature: remove b11 feature bit from default invoice set 2024-09-25 14:32:52 +09:00
Elle Mouton
f1015cd58d
server: stop interceptable switch in Stop 2024-09-25 14:32:52 +09:00
Elle Mouton
0bd76ffe32
invoices: init quit channel of modifier
Also add atomic start and stop vars to prevent close of a closed
channel.
2024-09-25 14:32:29 +09:00
Elle Mouton
7dc86acb8c
multi: update PaymentAddr to use fn.Option
Since it is allowed to not be set and so can lead to nil deref panics if
it is a pointer.
2024-09-25 11:14:35 +09:00
Oliver Gugger
84c91f701c
Merge pull request #9062 from Roasbeef/htlc-resolution-sweeper
contractcourt: use the sweeper for HTLC offered remote timeout resolu…
2024-09-19 09:43:16 -06:00
Oliver Gugger
611852fd34
Merge pull request #9123 from guggero/bump-18-99
build: bump master to version v0.18.99-beta
2024-09-19 03:57:11 -06:00
Oliver Gugger
4ff7d77a79
Merge pull request #9095 from lightningnetwork/extract-part4-from-staging-branch
[custom channels 4/5]: Extract PART4 from mega staging branch
2024-09-19 03:45:01 -06:00
Oliver Gugger
e0b4601fb9
multi: add co-op close custom data to close update
With this commit we populate additional information about the close
outputs (including potential custom channel data) in the close update
RPC message.
This will allow custom channels to find out how the additional close
outputs look like on chain and what data they might commit to.

We also hook up the aux custom data formatter, so it can format the
custom channel data to JSON.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
8dee76a1b8
peer: decorate delivery addr w/ internal key
In this commit, we move to add the internal key to the delivery addr. This way, we give the aux chan closer the extra information it may need to properly augment the normal co-op close process.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
44ab7e6b10
server+peer: init peer struct w/ AuxChanCloser if present 2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
625d426a56
lnwallet: modify CoopCloseBalance to not depend on chan commit 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
8d651b9370
lnwallet/chancloser: add aux chan closer, use in coop flow 2024-09-19 10:18:40 +02:00