Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 7af195768a Merge pull request #8667 from lightningnetwork/elle-new-sweeper
Merge new sweeper branch to master
2024-04-22 11:20:49 -07:00
Olaoluwa Osuntokun d4c1937572 Merge pull request #8573 from guggero/bitcoind-27
GitHub: use bitcoind v27.0 for CI
2024-04-18 14:36:58 -07:00
Olaoluwa Osuntokun 63ef2f8433 Merge pull request #8643 from Roasbeef/kvdb-top-level-module-bump
build: bump top level module to kvdb v1.4.6
2024-04-18 14:22:08 -07:00
Olaoluwa Osuntokun 2162c943de build: bump top level module to kvdb v1.4.6 2024-04-12 15:32:22 -07:00
Olaoluwa Osuntokun 07b6af41db Merge pull request #8642 from Roasbeef/kvdb-update
kvdb: bump to sqldb/v1.0.1
2024-04-12 15:29:28 -07:00
Olaoluwa Osuntokun 06e4ffb3f3 kvdb: bump to sqldb/v1.0.1
Post merge module clean up after
https://github.com/lightningnetwork/lnd/pull/8611.
2024-04-12 15:16:26 -07:00
Olaoluwa Osuntokun 1c229e4422 Merge pull request #8611 from bhandras/sql-tx-retry
sqldb+kvdb: unify SQL error mapping and transaction retry for between the `kvdb` and `sqldb` packages
2024-04-11 15:41:56 -07:00
Olaoluwa Osuntokun 0609431a0c channeldb: fix payment control unit tests w/ errors.Is 2024-04-11 15:04:04 +02:00
Olaoluwa Osuntokun cd0ca43a00 kvdb: don't do a critical log for db serialization errors
In this commit, we fix a bug that would cause the entire db to shutdown
if hit a panic (since db operations in the main buckets exit with a
panic) while executing a txn call back. This might be a postgres error
we need to check, so we don't want to bail out, and instead want to pass
up the error to the caller so we can retry if needed.
2024-04-11 15:04:03 +02:00
Olaoluwa Osuntokun 120d6dd297 channeldb: explicitly catch error in pruneGraphNodes
With the new postgres concurrency control, an error may come from a
bucket function that's actually a postgres error. In this case, we need
to return early so we can retry the txn. Otherwise, we'll be working
with an aborted tx, and never actually return the error so we don't auto
retry.
2024-04-11 15:04:03 +02:00
Olaoluwa Osuntokun 329fcc6498 kvdb+sqldb: update SQL error parsing to account for non wrapped errs
Some sub-systems like btcwallet will return an error from the database,
but they won't properly wrap it. As a result, we were unable to actually
catch the serialization errors in the first place. To work around this,
we'll now attempt to parse the error string directly.
2024-04-11 15:04:03 +02:00
Olaoluwa Osuntokun 9bafcb2e3e Merge pull request #8160 from carlaKC/7298-2-forwardblindedroutes
[2/3]: Support Forwarding of Blinded Payments
2024-04-03 16:48:12 -07:00
Olaoluwa Osuntokun 5599b3c9e2 Merge pull request #6934 from bottlepay/inbound-fees-send-support
routing: inbound fees send support
2024-03-31 10:54:09 -07:00
Olaoluwa Osuntokun a6d4bb5c89 Merge pull request #6703 from bottlepay/inbound-fees
htlcswitch: add inbound routing fees receive support
2024-03-31 08:43:09 -07:00
Olaoluwa Osuntokun 1d61de28c0 Merge pull request #8159 from carlaKC/7298-1-forwardblindedroutes
[1/3]: Preparatory work for Forwarding Blinded Routes
2024-03-28 15:13:05 -07:00
Olaoluwa Osuntokun 41cdb0fce5 Merge pull request #8599 from yyforyongyu/update-fn
gomod: bump `fn` version to v1.0.5
2024-03-28 14:28:21 -07:00
Olaoluwa Osuntokun 482b0ad7b4 github/CODEOWNERS: rename code owners file to soft deactivate
In this commit, rather than attempt to reduce the scope of the current
`CODEOWNERS` file, we instead rename it as a way to stop Github from
automatically assigning reviewers based on it. Instead, we put things in
a "hint" mode as a way for PR OPs to figure out who they should manually
assign PRs today.

With the CODEOWNERS file reduced to a code review assignment hint, we
aim to instead promote usage of the `@code-review` team which will use a
load balancing algorithm for automatic code review assignment.
2024-03-07 17:15:22 -08:00
Olaoluwa Osuntokun 716c6dddd8 Merge pull request #8052 from bhandras/sql-invoices
sqldb: `InvoiceDB` implementation
2024-03-06 21:15:14 -06:00
Olaoluwa Osuntokun d5138c1039 Merge pull request #8505 from yyforyongyu/version-check-testmempool
lnwallet: skip `testmempoolaccept` when the backend version is too low
2024-03-06 17:35:55 -06:00
Olaoluwa Osuntokun f61761277f Merge pull request #8513 from lightningnetwork/lnd-master-version-17-99
build: bump version to v0.17.99
2024-03-01 13:58:48 -06:00
Olaoluwa Osuntokun e623263b7f Merge pull request #8499 from Roasbeef/taproot-nonce-tlv-t
multi: upgrade new taproot TLVs to use tlv.OptionalRecordT
2024-02-29 16:00:09 -06:00
Olaoluwa Osuntokun cac779b69e funding: send warning to remote peer if chan nonce missing on reest 2024-02-29 11:32:31 -06:00
Olaoluwa Osuntokun 7feb8b21e1 multi: upgrade new taproot TLVs to use tlv.OptionalRecordT
In this commit, we update new Taproot related TLVs (nonces, partial sig,
sig with nonce, etc). Along the way we were able to get rid of some
boiler plate, but most importantly, we're able to better protect against
API misuse (using a nonce that isn't initialized, etc) with the new
options API. In some areas this introduces a bit of extra boiler plate,
and where applicable I used some new helper functions to help cut down
on the noise.

Note to reviewers: this is done as a single commit, as changing the API
breaks all callers, so if we want things to compile it needs to be in a
wumbo commit.
2024-02-29 11:32:26 -06:00
Olaoluwa Osuntokun 6bd556d38c build: bump tlv version to v1.2.3 2024-02-29 11:32:20 -06:00
Olaoluwa Osuntokun 72764b1473 Merge pull request #8100 from bhandras/updateinvoice-refactor
channeldb: refactor `UpdateInvoice` to make it simpler to create SQL specific implementation
2024-02-27 16:50:02 -08:00
Olaoluwa Osuntokun b234658945 Merge pull request #8501 from Roasbeef/tlv-fn-ergonomics
tlv: add UnwrapOrErrV+UnwrapOrFailV+Zero to OptionalRecord
2024-02-26 17:03:37 -08:00
Olaoluwa Osuntokun 3dd01cdc78 tlv: add Zero() method for OptionalRecordT
Most of the time with wire messages, we'll have the wrapped record, so
this is useful when decoding into a blank instance of the record's
value.
2024-02-26 16:12:55 -08:00
Olaoluwa Osuntokun afde7162c6 tlv: add UnwrapOrErrV and UnwrapOrFailV
These two methods mirror the recently added `fn.Option` methods but
allow us to unwrap on level deeper into the underlying value of the
Record.
2024-02-26 16:12:49 -08:00
Olaoluwa Osuntokun d69e1111ba build: update to fn/v1.0.4 2024-02-26 16:12:47 -08:00
Olaoluwa Osuntokun 6d8f40cb27 Merge pull request #8500 from Roasbeef/fn-option-ergonomics
fn: add UnwrapOrErr and UnwrapOrFail to Option
2024-02-26 16:06:17 -08:00
Olaoluwa Osuntokun 5a960269f2 Merge pull request #8378 from guggero/fundpsbt-coin-select
walletrpc: unify coin selection, allow coin selection for PSBT with pre-defined inputs
2024-02-26 16:05:07 -08:00
Olaoluwa Osuntokun 166b2fdb97 fn: add UnwrapOrErr and UnwrapOrFail to Option
In this commit, we add two new methods that simplify usage of an
handling a value wrapped in an Option. Thes methods allow a caller to
force the nil/None check up front, and either obtain the value, or fail
the current execution or test.

This should replace most usages of `UnsafeFromSome` where ever used
today.
2024-02-24 17:21:37 -08:00
Olaoluwa Osuntokun 935e550da6 Merge pull request #8463 from ProofOfKeags/refactor/chainreg/rm-channel-constraints
Remove `DefaultChannelConstraints` from PartialChainControl and lnwallet.Config
2024-02-22 14:39:35 -08:00
Olaoluwa Osuntokun 7a3101710c Merge pull request #8430 from bhandras/update-pr-stats
github: bump pull-resquest-stats to v2.11.0
2024-02-14 17:52:11 -08:00
Olaoluwa Osuntokun 771d1f0a9c Merge pull request #8338 from lightningnetwork/coop-close-v2-wire-messages
lnwire: add new closing_complete and closing_sig messages
2024-02-05 17:08:36 -08:00
Olaoluwa Osuntokun ba3c0c497a .github: codeowners additions 2024-02-05 16:30:31 -08:00
Olaoluwa Osuntokun 5953eaa9d8 lnwire: add fuzz tests for ClosingComplete+ClosingSigs 2024-02-05 16:30:26 -08:00
Olaoluwa Osuntokun 3d88017b38 lnwire: add new closing_complete and closing_sig messages
These two messages will be used to implement the new and improved co-op
closing protocol. This PR also show cases how to use the new
`tlv.OptionalRecord` type to define and handle TLV level parsing.

I think we can make one additional helper function to clean up some of
the boiler plate for the encode/decode.
2024-02-05 16:30:23 -08:00
Olaoluwa Osuntokun 34fd35bc63 lnwire: add Record() method to lnwire.Sig
We'll use this later on to re-use the normal primitive record to create
a series of new TLV types for the new co-op close protocol.
2024-02-05 16:30:16 -08:00
Olaoluwa Osuntokun 78e0e5ac5d tlv: add new Zero method on RecordT
In this commit, we add a new `Zero` method for the `RecordT` type. This
method allows a caller to create the zero record for a type without
needing to reference the actual TLV type.

With this we go from this:
```go
sig1 := tlv.ZeroRecordT[tlv.TlvType1, Sig]()
```

To this:
```
sig1 := c.CloserNoClosee.Zero()
```
2024-02-02 17:31:06 -08:00
Olaoluwa Osuntokun 47fced69da Merge pull request #8440 from saubyk/codeowners
Add CODEOWNERS file
2024-02-02 17:25:30 -08:00
Olaoluwa Osuntokun 7d74165296 Merge pull request #8442 from ProofOfKeags/bugfix/shutdown-msg
peer: fix issue where we echo remote Shutdown
2024-01-31 12:05:30 -08:00
Olaoluwa Osuntokun cf4f468ab5 Merge pull request #8437 from ellemouton/v0-17-3-tls-fix
tls_manager: let REST proxy skip tls cert verification
2024-01-30 11:22:31 -08:00
Olaoluwa Osuntokun d44c72b979 Merge pull request #8345 from yyforyongyu/use-testmempoolaccept
lnwallet: perform mempool acceptance check before publishing
2024-01-26 18:54:43 -08:00
Olaoluwa Osuntokun 0d37621bcb Merge pull request #8420 from ProofOfKeags/cleanup/contractcourt/naming
contractcourt: rename files for package consistency
2024-01-25 15:23:02 -08:00
Olaoluwa Osuntokun 11bafe84ff lnwallet/test: add new tx publish sub-test for policy weight limits 2024-01-25 08:45:22 +08:00
Olaoluwa Osuntokun a616fa3fb7 lnwallet/test: convert the tx publish tests to sub-tests 2024-01-25 08:21:11 +08:00
Olaoluwa Osuntokun 758ae6fbec Merge pull request #8336 from lightningnetwork/fn-module-goodies
fn: add some new goodies to sub-module to be used in future PRs
2024-01-23 19:18:34 -08:00
Olaoluwa Osuntokun 1d1c1382d0 fn: add utility funcs/method for option type 2024-01-23 19:09:59 -08:00
Olaoluwa Osuntokun 1fc3f14467 fn: add new generic set container 2024-01-23 19:09:53 -08:00
Olaoluwa Osuntokun eb72bb9712 fn: add SendOrQuit 2024-01-23 19:09:50 -08:00
Olaoluwa Osuntokun a2694009cd fn: add basic generic chan recv utility funcs 2024-01-23 19:09:47 -08:00
Olaoluwa Osuntokun f7e2e6ddd6 fn: add basic generic queue 2024-01-23 19:09:45 -08:00
Olaoluwa Osuntokun f166829fe4 fn: add reduce func 2024-01-23 19:09:42 -08:00
Olaoluwa Osuntokun d702158d9b fn: add new EventPublisher event pub/sub system
This builds on the concurrent queue to create a generic way to allow
goroutines to pub/sub information. An example includes being notified
each time a state machine is able to carry out a new state transition.
2024-01-23 19:09:39 -08:00
Olaoluwa Osuntokun 1cbfda525a fn: add new Either[L, R] type
This implements a union of two values. Uses the existing option under
the hood, and adds a simple helper function.
2024-01-23 19:09:36 -08:00
Olaoluwa Osuntokun 0715e84f04 fn: add new ConcurrentQueue[T] data structure
This is a version of the queue we have elsewhere, but we can get rid of
all the casting and interface usage in favor of a type param.
2024-01-23 19:09:29 -08:00
Olaoluwa Osuntokun 1caca81ba1 Merge pull request #8167 from ProofOfKeags/bugfix/htlc-flush-shutdown
Bugfix/htlc flush shutdown
2024-01-23 18:49:47 -08:00
Olaoluwa Osuntokun 185119f5c3 peer: refactor main event loop for ping handler
The error was never used as the init couldn't return an error, so we do
away with that. We also modify the main event loop dispatch to more
closely match other areas of the codebase.
2024-01-22 18:20:30 -08:00
Olaoluwa Osuntokun b5cbeb4ad7 peer: make PingManager disconnect call async
In this commit, we make all calls to disconnect after a ping/pong
violation is detected in the `PingManager` async. We do this to avoid
circular waiting that may occur if the disconnect call back ends up
waiting on the peer goroutine to be torn down. If this happens, then the
peer goroutine will be blocked on the ping manager fully tearing down,
which is blocked on the peer disconnect succeeding.

This is a similar class of issue we've delt with recently as pertains to
the peer and the server: sync all back execution must not lead to
a circular waiting loop.

Fixes #8379
2024-01-22 18:20:23 -08:00
Olaoluwa Osuntokun 41c167d37c Merge pull request #8400 from ellemouton/deadlockFix
channeldb: acquire mutexes in the same order throughout
2024-01-22 12:57:48 -08:00
Olaoluwa Osuntokun ba1725f161 Merge pull request #8376 from ProofOfKeags/feature/unsafe-from-some
fn: add UnsafeFromSome to Option API
2024-01-11 17:22:33 -08:00
Olaoluwa Osuntokun 2f04ce7c6e Merge pull request #8334 from lightningnetwork/tlv-record-enchancements
tlv: various enhancements to the new RecordT type
2024-01-05 13:57:55 -08:00
Olaoluwa Osuntokun cedbdd8999 Merge pull request #8142 from carlaKC/8137-validateblindedpayload
routing: Add Validation for Decoding Blinded Paths
2024-01-03 12:33:11 -08:00
Olaoluwa Osuntokun ffd330ac43 Merge pull request #8095 from carlaKC/7882-mcblinding
missioncontrol: add invalid onion blinding handling for blinded paths
2024-01-03 12:29:43 -08:00
Olaoluwa Osuntokun 85046997c9 tlv: add utility funcs/methods to make tlv.OptionalRecord easier to use
We add a WhenSome that'll pass in the actual underlying value, and not
just the record.

We also add `SomeRecord` to make it easier to create TLV records w/
`Some` set.
2024-01-02 18:51:41 -08:00
Olaoluwa Osuntokun aec2f9bf08 tlv: add TlvType method to RecordT
This will be useful when decoding optional TLV records, as we can use
this to look up in the `typeMap` for a given field to see if we decoded
it or not.
2024-01-02 18:51:35 -08:00
Olaoluwa Osuntokun 09afc92215 tlv: make TlvType method for TlvType interface public
With this change, callers can now examine a struct instance of the
`TlvType` instance to figure out programmatically which integer type is
maps to. This'll be useful when decoding optional TLV types into a wire
struct (knowing when to set it to Some vs None).
2024-01-02 18:51:33 -08:00
Olaoluwa Osuntokun 66cf4396a2 tlv: modify RecordT type to ensure type param takes precedence
In this commit, we modify the RecordT type to allow callers to re-use
the Record definition of a different type, but use the new type param to
override the integer type used on the wire.

This will let use do things like encode a signature using the same
RecordProducer instance, but with a diff type in another context.

The upcoming use for this is allowing our `lnwire.Sig` type to be
encoded in the same message using distinct TLV integer types (new co-op
close protocol).
2024-01-02 18:51:30 -08:00
Olaoluwa Osuntokun 7f8b185f40 Merge pull request #8307 from ziggie1984/channel-reestablishment-logging
lnwallet: fix logging.
2024-01-02 12:28:01 -08:00
Olaoluwa Osuntokun ac9ca024a4 Merge pull request #8121 from Roasbeef/tlv-record-type-param
tlv: add new RecordT[T] utility type
2023-12-12 17:47:59 -08:00
Olaoluwa Osuntokun 63e86b72c5 tlv: add new RecordT[T, V] utility type
In this commit, we add a new type, `RecordT[T, V]` to reduce some of the
common boiler plate for TLV types. This type lets you take either a
primitive type, or an existing Record, and gain common methods used to
create tlv streams.

It also serves as extra type annotation as well, since wire structs can
use this to wrap any existing type and gain the relevant record methods.

This implementation ensures that the very definition of the field also
binds the TLV type value. It does this by using the generated code to
map a struct like TlvType1 to an actually Type like Type(1).
2023-12-12 17:47:10 -08:00
Olaoluwa Osuntokun c304c2a8bb tlv: run go generate for new set of TLV types
This shouldn't need to be run again, as this implementation restricts
things to just values 0-99, due to a hard upper limit with the way Go
unions work under the hood.
2023-12-12 17:47:04 -08:00
Olaoluwa Osuntokun 78d5806555 tlv/internal: add new internal package for generating TLV type structs
In this commit, we add some new code generation to the codebase. As
we'll see in a future commit, this'll allow us to create a new Record[T,
V] type, where T is actually a concrete _struct_ that implements a
special interface that deems it as a valid TLV type.
2023-12-12 17:47:01 -08:00
Olaoluwa Osuntokun 2fee3f6efa Merge pull request #8030 from ellemouton/queryChanUpdateTimestamps
multi: query chan update timestamps
2023-12-11 11:18:08 -08:00
Olaoluwa Osuntokun c32edbd732 Merge pull request #8266 from Roasbeef/fn-v1
build: bump to fn/v1.0.0
2023-12-08 14:28:40 -08:00
Olaoluwa Osuntokun d50dd8e2d7 build: bump to fn/v1.0.0 2023-12-08 14:08:17 -08:00
Olaoluwa Osuntokun 445bd27e59 Merge pull request #8259 from Roasbeef/fn-module
fn: create new sub-module
2023-12-08 13:52:26 -08:00
Olaoluwa Osuntokun b0114efad3 fn: create new sub-module
In this commit, we make a new sub-module from the `fn` package. This
lets other projects use it w/o pulling in all of lnd, and also other
sub-packages within lnd.

We also add a temp replace directive for new module.  We'll remove this
once we tag the final version.
2023-12-06 17:00:10 -08:00
Olaoluwa Osuntokun f87e370efd Merge pull request #8232 from yyforyongyu/optimize-mempool
gomod: update `btcwallet` version
2023-11-30 14:47:14 -08:00
Olaoluwa Osuntokun d9b88fba67 Merge pull request #8198 from morehouse/brontide_startup_race_test
peer: test for startup writeHander data race
2023-11-17 16:01:16 -08:00
Olaoluwa Osuntokun 64753b01d1 Merge pull request #8186 from Crypt-iQ/issue_8184_2
peer: send reestablish, shutdown messages before starting writeHandler
2023-11-16 12:58:12 -08:00
Olaoluwa Osuntokun e02fd39ce6 Merge pull request #8170 from yyforyongyu/0-18-staging-missed
Add missing commits from `0-18-staging`
2023-11-13 10:38:23 -08:00
Olaoluwa Osuntokun 9937b1d6de Merge branch 'dyncomms' 2023-11-10 13:30:28 -08:00
Olaoluwa Osuntokun 6de3fea8e6 Merge pull request #8158 from Crypt-iQ/writeMessage_fix
peer: send messages in Start via writeMessage to bypass writeHandler
2023-11-08 14:54:54 -08:00
Olaoluwa Osuntokun dacb86fdbc Merge pull request #8106 from orbitalturtle/sign-tagged-hash-rpc
lnrpc: add tagged hash option to signer.SignMessage/VerifyMessage rpcs
2023-11-06 17:05:35 -08:00
Olaoluwa Osuntokun e6fbaafda4 Merge pull request #8139 from yyforyongyu/upgrade-bitcoind
CI: upgrade bitcoind version to 0.25
2023-11-01 11:15:12 -07:00
Olaoluwa Osuntokun eb5fc0c349 Merge pull request #7811 from yyforyongyu/fix-panix
contractcourt: stop lnd when received witness is empty
2023-10-31 15:17:30 -07:00
Olaoluwa Osuntokun b0261f7793 Merge pull request #8132 from Roasbeef/strict-macaroon-version
macaroons: reject unknown macaroon versions
2023-10-31 15:16:55 -07:00
Olaoluwa Osuntokun 9287b755d8 macaroons: reject unknown macaroon versions
We've only ever made macaroons with the v2 versions, so we should
explicitly reject those that aren't actually v2. We add a basic test
along the way, and also add a similar check for the version encoded in
the macaroon ID.
2023-10-31 13:23:50 -07:00
Olaoluwa Osuntokun c382268201 Merge pull request #8104 from Roasbeef/taproot-chans-nonce-double-init
multi: skip InitRemoteMusigNonces if we've already called it
2023-10-31 13:02:54 -07:00
Olaoluwa Osuntokun 7f652ee729 Merge pull request #8135 from yyforyongyu/fix-flakes
multi: fix test flakes in unit tests and itests
2023-10-31 12:58:25 -07:00
Olaoluwa Osuntokun 8c121ee5e0 docs/release-notes: add entry for nonce init fix 2023-10-31 10:10:49 -07:00
Olaoluwa Osuntokun 32c8b82c36 Merge pull request #7669 from morehouse/fuzz_lnwire_onion_errors
lnwire: fuzz onion failure messages
2023-10-30 12:44:55 -07:00
Olaoluwa Osuntokun 78ff68ad05 Merge pull request #8119 from lightningnetwork/udpate-docs
docs: Add requirement for bitcoind.
2023-10-30 12:34:57 -07:00
Olaoluwa Osuntokun 99617f7afe Merge pull request #8123 from R3DRUN3/master
add release build and go report status badges
2023-10-30 10:51:10 -07:00
Olaoluwa Osuntokun 19880ffe2c Merge pull request #8101 from yyforyongyu/fix-web-fee-unit-test
chainfee: Fix test flake in `TestWebAPIFeeEstimator`
2023-10-30 10:50:16 -07:00
Olaoluwa Osuntokun 99481e3e84 Merge pull request #8127 from lightningnetwork/dependabot/go_modules/github.com/docker/docker-24.0.7incompatible
build(deps): bump github.com/docker/docker from 20.10.24+incompatible to 24.0.7+incompatible
2023-10-30 10:41:27 -07:00
Olaoluwa Osuntokun a1fa195493 Merge pull request #8091 from yyforyongyu/remove-rbf-sweeper
sweep: remove possible RBF when sweeping new inputs
2023-10-25 15:14:32 -07:00
Olaoluwa Osuntokun 63a94ad987 build: build+install using GOEXPERIMENT=loopvar
We also update the release script to do the same as well.
2023-10-24 18:40:58 -07:00