Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun ff2a1a4bbb Merge pull request #9318 from guggero/cross-compile-fix
make: remove exotic build targets from release list
2024-12-03 04:47:03 -06:00
Olaoluwa Osuntokun 0ff0ac84f6 protofsm: fix race in state machine executor tests
In this commit, we fix an existing race in the new `protofsm` state
machine executor tests.

The race would appear as such:
```
--- FAIL: TestStateMachineMsgMapper (0.00s)
    state_machine_test.go:165:
        Error Trace:/home/runner/work/lnd/lnd/protofsm/state_machine_test.go:165
                    /home/runner/work/lnd/lnd/protofsm/state_machine_test.go:451
        Error:      Object expected to be of type *protofsm.dummyStateStart, but was *protofsm.dummyStateFin
        Test:       TestStateMachineMsgMapper
FAIL
FAILgithub.com/lightningnetwork/lnd/protofsm0.116s
FAIL
```

This race condition was triggered as before we would start the state
machine _then_ register for notifications. In `Start` we emit the
starting event, then enter the main loop. If that event gets emitted
before our subscription, then we'll miss the event, as the terminal
event will be the only one received.

We fix this by registering for the events before the daemon has started.
2024-11-26 18:58:53 -06:00
Olaoluwa Osuntokun ab3b3c848c Merge pull request #9258 from yyforyongyu/fix-notification
chainntnfs: fix missing notifications
2024-11-19 10:43:25 -08:00
Olaoluwa Osuntokun c3fac0eb92 Merge pull request #8337 from lightningnetwork/protofsm
[1/4] - protofsm: add new package for driving generic protocol FSMs
2024-11-19 10:41:49 -08:00
Olaoluwa Osuntokun 2e3c0b2a7d protofsm: use new fn.GoroutineManager to manage goroutines
This fixes an isuse that can occur when we have concurrent calls to
`Stop` while the state machine is driving forward.
2024-11-18 20:49:01 -08:00
Olaoluwa Osuntokun 6de0615cd5 protofsm: allow multiple internal events to be emitted
In this commit, we update the execution logic to allow multiple internal
events to be emitted. This is useful to handle potential out of order
state transitions, as they can be cached, then emitted once the relevant
pre-conditions have been met.
2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun 847c1a789d protofsm: add SpendMapper to craft custom spend events
In this commit, we add the SpendMapper which allows callers to create
custom spent events. Before this commit, the caller would be able to
have an event sent to them in the case a spend happens, but that event
wouldn't have any of the relevant spend details.

With this new addition, the caller can specify how to take a generic
spend event, and transform it into the state machine specific spend
event.
2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun d805c0fc3c protofsm: add CustomPollInterval for mocking purposes
Adding this makes a state machine easier to unit test, as the caller can
specify a custom polling interval.
2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun 35ea05d5dc protofsm: add ErrorReporter interface
We'll use this to be able to signal to a caller that a critical error
occurred during the state transition.
2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun 96a98bc071 protofsm: add logging 2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun 44f035330b protofsm: add a Name() method to the env
This'll be used later to uniquely identify state machines for
routing/dispatch purposes.
2024-11-18 20:49:00 -08:00
Olaoluwa Osuntokun 424ae09631 protofsm: add ability for state machine to consume wire msgs
In this commit, we add the ability for the state machine to consume wire
messages. This'll allow the creation of a new generic message router
that takes the place of the current peer `readHandler` in an upcoming
commit.
2024-11-18 20:48:59 -08:00
Olaoluwa Osuntokun bf10e31167 protofsm: convert state machine args into config 2024-11-18 20:48:59 -08:00
Olaoluwa Osuntokun d17e737558 protofsm: add optional daemon event on init
In this commit, we add an optional daemon event that can be specified to
dispatch during init. This is useful for instances where before we
start, we want to make sure we have a registered spend/conf notification
before normal operation starts.

We also add new unit tests to cover this, and the prior spend/conf event
additions.
2024-11-18 20:48:59 -08:00
Olaoluwa Osuntokun 7f69ceb2d4 protofsm: add daemon events for spend+conf registration 2024-11-18 20:48:59 -08:00
Olaoluwa Osuntokun 3bae7f32cd protofsm: add new package for driving generic protocol FSMs
In this PR, we create a new package, `protofsm` which is intended to
abstract away from something we've done dozens of time in the daemon:
create a new event-drive protocol FSM. One example of this is the co-op
close state machine, and also the channel state machine itself.

This packages picks out the common themes of:

  * clear states and transitions between them
  * calling out to special daemon adapters for I/O such as transaction
    broadcast or sending a message to a peer
  * cleaning up after state machine execution
  * notifying relevant callers of updates to the state machine

The goal of this PR, is that devs can now implement a state machine
based off of this primary interface:
```go
// State defines an abstract state along, namely its state transition function
// that takes as input an event and an environment, and returns a state
// transition (next state, and set of events to emit). As state can also either
// be terminal, or not, a terminal event causes state execution to halt.
type State[Event any, Env Environment] interface {
	// ProcessEvent takes an event and an environment, and returns a new
	// state transition. This will be iteratively called until either a
	// terminal state is reached, or no further internal events are
	// emitted.
	ProcessEvent(event Event, env Env) (*StateTransition[Event, Env], error)

	// IsTerminal returns true if this state is terminal, and false otherwise.
	IsTerminal() bool
}
```

With their focus being _only_ on each state transition, rather than all
the boiler plate involved (processing new events, advancing to
completion, doing I/O, etc, etc).

Instead, they just make their states, then create the state machine
given the starting state and env. The only other custom component needed
is something capable of mapping wire messages or other events from the
"outside world" into the domain of the state machine.

The set of types is based on a pseudo sum type system wherein you
declare an interface, make the sole method private, then create other
instances based on that interface. This restricts call sites (must pass
in that interface) type, and with some tooling, exhaustive matching can
also be enforced via a linter.

The best way to get a hang of the pattern proposed here is to check out
the tests. They make a mock state machine, and then use the new executor
to drive it to completion. You'll also get a view of how the code will
actually look, with the focus being on the: input event, current state,
and output transition (can also emit events to drive itself forward).
2024-11-18 20:48:57 -08:00
Olaoluwa Osuntokun 0e999ed9f5 Merge pull request #9275 from yyforyongyu/fix-peer-shutdown
peer+lnd: fix peer blocking on node shutdown
2024-11-18 20:15:12 -08:00
Olaoluwa Osuntokun 7ed2c10671 sweep: update storeRecord to include utxo index
In this commit, we complete a recently added feature by ensuring that
even if we go through the RBF loop to create a txn, that we still
populate the `outpointToIndex` map. Unit tests have been updated to
ensure this is always set as expected.
2024-11-18 18:12:41 -08:00
Olaoluwa Osuntokun b9105c35e5 lntest: print node PID when launching in itests
In this commit, we start to print the PID of node's we created within an
itest. This is useful when debugging itests with `dlv` by attaching to a
given node. By printing out the PID, we facilitate such debugging
attempts.
2024-11-15 17:21:43 -08:00
Olaoluwa Osuntokun 414894348a sweep: update BudgetInputSet.Budget() to factor in extra budget
In this commit, we update the `Budget()` call to factor in the
`extraBudget` value. Otherwise, when we go to intialize the fee
function, we won't factor in the extra budget, and will determine that
we can't broadcast/bump.
2024-11-14 16:09:59 -08:00
Olaoluwa Osuntokun 87b4991bb6 lnwallet: add whoseCommit to FetchLeavesFromCommit
This is useful for additional context to know which commit the
AuxLeafStore is fetching the leaves for.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun ba16a74491 sweep: expand NotifyBroadcast to include an outpoint index
In this commit, we expand the `NotifyBroadcast` to include an outpoint
index. This is useful as it indicates the index of a given required tx
out input.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun ab41f28a8f contractcourt: pass in new aux resolution blob to sweeper in resolvers
With this commit, we update all the resolvers to pass in the new htlc
resolution blobs. Along the way, we remove the old blocking guard on
this resolution logic for HTLCs with blobs.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun 7ef2683586 contractcourt: update encode/decode for taproot aux data
When we read/write the aux data, we need to make sure we always set the
new fields for aux HTLCs.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun 9b8adf5f5c contractcourt: add HtlcBlobs to taprootBriefcase
In this commit, we add the set of HtlcBlobs to the taprootBriefcase
struct. This new field will store all the resolution blobs for a given
HTLC. We also add some new property based tests along the way for
adequate test coverage.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun 1e7c5415ae input: add new Preimage method to input.Input
In this commit, we add a new method to obtain an option of a preimage to
the input.Input struct. This is useful for callers that have an Input,
and want to optionally obtain the preimage.
2024-11-14 16:09:58 -08:00
Olaoluwa Osuntokun af60fa0c3a lnwallet: populate resolution blob for incoming+outgoing HTLC resolutions
In this commit, we populate the resolution blobs for the incoming and
outgoing HTLCs. We take care to populate the AuxSigDesc with the correct
information, as we need to pass along the second-level aux signature and
also sign desc along with it.
2024-11-14 16:09:57 -08:00
Olaoluwa Osuntokun 08d0aa2368 channel: add ResolutionBlob to Incoming+Outgoing HtlcResolution
Similar to the other blobs we have for the commitment output force close
resolution, these blobs will be used to ensure that we have everything
needed to sweep aux HTLCs.
2024-11-14 16:09:57 -08:00
Olaoluwa Osuntokun 98b41c6576 channel: always specify ChanType in ResolutionReq 2024-11-14 16:09:57 -08:00
Olaoluwa Osuntokun bf350c6ede lnwallet: expand attributes in ResolutionReq
In this commit, we add some additional attributes to the ResolutionReq
struct. These will be used to make sure that we can properly handle all
the HTLC variants, on chain.

The `AuxSigDesc` will be used to communicate if an HTLC needs to go to
the second level or not. It contains the second-level sig information
needed to finalize a broadcast to the second level.
2024-11-14 16:09:57 -08:00
Olaoluwa Osuntokun faa4f24806 Merge pull request #9182 from ziggie1984/fix-feebuffer
Deprecate dust-threshold config value
2024-11-07 19:41:38 -08:00
Olaoluwa Osuntokun 3a14382720 Merge pull request #9068 from ziggie1984/cancel-back-dust-htlc
Cancel back outgoing dust htlcs before commitment is confirmed.
2024-11-07 19:40:33 -08:00
Olaoluwa Osuntokun 49275e1d46 Merge pull request #9197 from guggero/aux-signer-batching-fixes
[custom channels]: Aux signer batching fixes
2024-10-21 17:49:15 -07:00
Olaoluwa Osuntokun cb0f0dd8a4 scripts/key: add new gpg key for roasbeef
In this commit, we add a new signing for key for roasbeef. The signing
key has been attested to here by myself in several locations on the
Internet:
  * https://gist.github.com/Roasbeef/58c5eb9d5243df73ea3b081f3848b5ce
  * https://x.com/roasbeef
  * https://keybase.io/roasbeef
2024-10-21 16:42:09 -07:00
Olaoluwa Osuntokun bdc5187749 Merge pull request #9159 from ziggie1984/fn-set-addon
fn: Add Size and IsEmpty methods to Set
2024-10-07 17:30:05 +02:00
Olaoluwa Osuntokun 8e451cb8be Merge pull request #9144 from ziggie1984/add-rpcclient-logging
lnd: add logger for rpcclient
2024-10-07 11:05:00 +02:00
Olaoluwa Osuntokun e9fbbe2528 Merge pull request #9143 from ellemouton/rb-set-bit-required
feature+rpcserver: add SetBit helper to set dependent bits
2024-10-04 19:16:34 -07:00
Olaoluwa Osuntokun e2c97ede81 Merge pull request #9141 from starius/goroutines2
fn: add goroutine manager
2024-10-04 19:15:46 -07:00
Olaoluwa Osuntokun 35759dea1b Merge pull request #9117 from Liongrass/patch-6
Update link in musig2.md
2024-10-04 19:09:16 -07:00
Olaoluwa Osuntokun b8c828d730 Merge pull request #9135 from ProofOfKeags/fn/slice-uncons
[MICRO]: fn: add uncons, unsnoc and its component projections
2024-10-04 19:08:58 -07:00
Olaoluwa Osuntokun 42500b2129 Merge pull request #9154 from ziggie1984/master
multi: bump btcd version.
2024-10-03 15:41:59 -07:00
Olaoluwa Osuntokun 2d333178c3 Merge pull request #8960 from lightningnetwork/0-19-staging-rebased
[custom channels 5/5]: merge custom channel staging branch into master
2024-10-03 10:07:16 -07:00
Olaoluwa Osuntokun bdaa9f4146 sweep: ensure we factor in extra change addrs in MaxFeeRateAllowed 2024-10-02 18:10:14 -07:00
Olaoluwa Osuntokun 8494887adc lnd: signal taproot overlay chans based on config
We also add a sanity check to make sure they can't be signaled without
the aux interfaces.
2024-10-02 18:10:11 -07:00
Olaoluwa Osuntokun c6ba5d11f1 lncfg: add new config option for taproot overlay chans 2024-10-02 18:10:10 -07:00
Olaoluwa Osuntokun 2395c4d0a1 rpc+funding: add taproot overlay as RPC chan type 2024-10-02 18:10:09 -07:00
Olaoluwa Osuntokun d72de4cdbc lnrpc: add SIMPLE_TAPROOT_OVERLAY feature bit 2024-10-02 18:10:08 -07:00
Olaoluwa Osuntokun 18521dbe0c funding: add chan type awareness for new taproot chans overlay 2024-10-02 18:10:07 -07:00
Olaoluwa Osuntokun 0ee9b02094 lnwallet: add awareness of taproot overlay chan type to reservations 2024-10-02 18:10:06 -07:00
Olaoluwa Osuntokun f21c1165a0 feature: add awareness of new taproot chans overlay feature bit
This bit will be false by default in current production deployments.
2024-10-02 18:10:05 -07:00
Olaoluwa Osuntokun 7f9268c38f lnwire: add new taproot chans overlay feature bit 2024-10-02 18:10:04 -07:00
Olaoluwa Osuntokun 4920bf6e1a contractcourt: integration aux sweeper to breach arb
Similar to the sweeper, when we're about to make a new breach
transaction, we ask the sweeper for a new change address, if it has one.
Then when we go to publish, we notify broadcast.
2024-10-02 18:10:03 -07:00
Olaoluwa Osuntokun c59f11168b contractcourt: update makeBreachedOutput to accept resolution blob 2024-10-02 18:10:02 -07:00
Olaoluwa Osuntokun f81cd79bca contractcourt: update GenSweepScript to return internal key
For the upcoming aux sweeper integration, the internal key is needed for
the call backs.
2024-10-02 18:10:01 -07:00
Olaoluwa Osuntokun 9a181105e2 multi: hook up new aux interfaces 2024-10-02 18:10:00 -07:00
Olaoluwa Osuntokun 47f728e548 contractcourt: pause resolution for HTLCs w/ custom records
This is a hold over until the aux resolution is finalized for HTLC
outputs.
2024-10-02 18:09:59 -07:00
Olaoluwa Osuntokun eaea11e48f sweep: update sweeper to use AuxSweeper to add extra change addr
In this commit, we start to use the AuxSweeper (if present) to obtain a
new extra change addr we should add to the sweeping transaction. With
this, we'll take the set of inputs and our change addr, and then maybe
gain a new change addr to add to the sweep transaction.

The extra change addr will be treated as an extra required tx out,
shared across all the relevant inputs. This'll also be used in
NeedWalletInput to make sure that we add an extra input if needed to be
able to pay for the change addr.
2024-10-02 18:09:58 -07:00
Olaoluwa Osuntokun cb93f8c01a sweep: add new AuxSweeper interface
In this commit, we add a new AuxSweeper interface. This'll take a set of
inputs, and a change addr for the sweep transaction, then optionally
return a new sweep output to be added to the sweep transaction.

We also add a new NotifyBroadcast method.  This'll be used to notify
that we're _about_ to broadcast a sweeping transaction. The set of
inputs is passed in, which allows the caller to prepare for the ultimate
broadcast of the sweeping transaction.

We also add ExtraTxOut to BumpRequest pass fees to NotifyBroadcast. This
allows the callee to know the total fee of the sweeping transaction.
2024-10-02 18:09:57 -07:00
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
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
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
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
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
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
Olaoluwa Osuntokun 7ff251ca44 lnwallet/chancloser: add new AuxChanCloser interface 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun 117a144f4e lnwallet: add ability to do custom sort for coop close txn 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun 517608ca3b lnwallet: add ability to add extra co-op close outputs 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun 7b396f4969 lnwallet: add FundingBlob method to LightningChannel 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun 099f5566bc lnwire: add CustomRecords to shutdown message 2024-09-19 10:18:39 +02:00
Olaoluwa Osuntokun 13a7becb91 Merge pull request #8044 from ellemouton/g175Messages
[1/7] lnwire: add new Gossip 1.75 messages
2024-09-18 16:05:38 -07:00
Olaoluwa Osuntokun 83fdbda2fa multi: obtain+verify aux sigs for all second level HTLCs
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
2024-09-18 19:04:53 +02:00
Olaoluwa Osuntokun 1e85c5054e lnwallet: add WithAuxSigner option to channel 2024-09-18 10:25:42 +02:00
Olaoluwa Osuntokun aa0c680e18 lnwallet: add new AuxSigner interface to mirror SigPool
In this commit, we add a new aux signer interface that's meant to mirror the SigPool. If present, this'll be used to (maybe) obtain signatures for second level HTLCs for certain classes of custom channels.
2024-09-18 10:25:42 +02:00
Olaoluwa Osuntokun bcb66585d4 funding+lnwallet: finish hook up new aux funding flow
For the initiator, once we get the signal that the PSBT has been
finalized, we'll call into the aux funder to get the funding desc. For
the responder, once we receive the funding_created message, we'll do the
same.

We now also have local+remote aux leaves for the commitment transaction.

Some old TODO comments that in retrospect aren't required anymore are
removed as well.
2024-09-18 10:25:41 +02:00
Olaoluwa Osuntokun 7ec48a5054 funding+lnwallet: only blind tapscript root early in funding flow
In this commit, we modify the aux funding work flow slightly. We won't
be able to generate the full AuxFundingDesc until both sides has
sent+received funding params. So we'll now only attempt to bind the
tapscript root as soon as we send+recv the open_channel message.

We'll now also make sure that we pass the tapscript root all the way
down into the musig2 session creation.
2024-09-18 10:25:41 +02:00
Olaoluwa Osuntokun bed4562584 lnwallet: for PsbtIntent return the internal key in the POutput
We also add a new assertion to the itests to ensure the field is being properly set.
2024-09-18 10:25:41 +02:00
Olaoluwa Osuntokun 7144a1c733 lnwallet: add TaprootInternalKey method to ShimIntent
If this is a taproot channel, then we'll return the internal key which'll be useful to callers.
2024-09-18 10:25:41 +02:00
Olaoluwa Osuntokun 65f54cb075 config+serer: add AuxFundingController as top level cfg option 2024-09-18 10:25:40 +02:00
Olaoluwa Osuntokun 84cc9a1f0b funding: create new AuxFundingController interface
In this commit, we make a new `AuxFundingController` interface capable of processing messages off the wire. In addition, we can use it to abstract away details w.r.t how we obtain a `AuxFundingDesc` for a given channel.

We'll now use this whenever we get a channel funding request, to make sure we pass along the custom state that a channel may require.
2024-09-18 10:25:40 +02:00
Olaoluwa Osuntokun 72beb7955d lnwallet: use AuxFundingDesc to populate all custom chan info
With this commit, we'll now populate all the custom channel information within the OpenChannel and ChannelCommitment structs.
2024-09-18 10:25:40 +02:00
Olaoluwa Osuntokun 116a6430f0 lnwallet: add new AuxFundingDesc struct
This struct will house all the information we'll need to do a class of custom channels that relies primarily on adding additional items to the tapscript root of the HTLC/commitment/funding outputs.
2024-09-18 10:25:40 +02:00
Olaoluwa Osuntokun 903c8fc076 contractcourt: use the sweeper for HTLC offered remote timeout resolution
In this commit, we bring the timeout resolver more in line with the
success resolver by using the sweeper to handle the HTLC offered remote
timeout outputs. These are outputs that we can sweep directly from the
remote party's commitment transaction when they broadcast their version
of the commitment transaction.

With this change, we slim down the scope slightly by only doing this for
anchor channels. Non-anchor channels will continue to use the
utxonursery for this output type for now.
2024-09-12 18:13:44 -07:00
Olaoluwa Osuntokun c898b68bba contractcourt: use t.Run in TestHtlcTimeoutResolver
Along the way we refactor the test to eliminate some unnecessary line
length.
2024-09-12 18:13:42 -07:00
Olaoluwa Osuntokun 06b3588512 kvdb: update to latest walletdb version 2024-09-12 16:41:43 -07:00
Olaoluwa Osuntokun f8962af444 kvdb: update bbolt to v1.3.11 2024-09-11 10:45:12 -07:00
Olaoluwa Osuntokun f04fa54622 routing: skip amtInRange for custom HTLCs
We might be trying to send an invoice amount that's greater than the size of the channel, but once you factor in the custom channel logic, an actual HTLC can be sent over the channel to pay that larger payment.

As a result, we'll skip over this check if a have a custom HTLC.
2024-09-05 18:00:52 +02:00
Olaoluwa Osuntokun 6747fc13b4 Merge pull request #9063 from guggero/update-sqldb
mod: bump sqldb to latest version
2024-09-04 13:18:21 -07:00
Olaoluwa Osuntokun ce27e4e62c Merge pull request #9046 from Roasbeef/taproot-chan-sync-bug-fix
lnwallet: ensure we re-sign retransmitted commits for taproot channels
2024-09-03 17:25:19 -07:00
Olaoluwa Osuntokun 80b257991e docs/release-notes: add release notes entry for taproot chans bug fix 2024-09-03 17:23:53 -07:00