Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 74237f2c24 build: bump verison to v0.18.0-beta.rc3 2024-05-22 11:44:24 -07:00
Olaoluwa Osuntokun 64639fb771 Merge pull request #8762 from ProofOfKeags/bugfix/ping-stability
Adjust ping parameters to improve tor stability
2024-05-21 19:34:57 -07:00
Olaoluwa Osuntokun e1c5fe2f9e Merge pull request #8751 from yyforyongyu/fix-sweeper-18
contractcourt+sweep: fix fee function and deadline issue
2024-05-20 18:11:26 -07:00
Olaoluwa Osuntokun 130c4999c6 Merge pull request #8723 from bufo24/add-inbound-fees-to-channel-notifications
add inbound fees channel updates to notifications
2024-05-13 12:52:50 -07:00
Olaoluwa Osuntokun a585833fb5 build: update release builds and CI to Go 1.22.3 2024-05-09 15:24:19 -07:00
Olaoluwa Osuntokun 3e36df42e5 Merge pull request #8733 from lightningnetwork/0-18-branch-rc2
build: bump version to v0.18.0-beta.rc2
2024-05-07 14:20:36 -07:00
Olaoluwa Osuntokun 954ad4a329 build: bump version to v0.18.0-beta.rc2 2024-05-06 18:10:52 -07:00
Olaoluwa Osuntokun 6bcbc8dd97 Merge pull request #8719 from yyforyongyu/merge-fee-cache
Merge fee cache and fix sample conf
2024-05-06 18:09:06 -07:00
Olaoluwa Osuntokun 399ea864da Merge pull request #8703 from carlaKC/flake-blindedchainerr
itest/flake: add more comprehensive assertions before HTLC cleared check
2024-05-02 12:09:04 -05:00
Olaoluwa Osuntokun 9f4e92c518 Merge pull request #8706 from guggero/release-notes-fix
0.18: add contributors from git log, polish release notes
2024-04-29 16:09:28 -07:00
Olaoluwa Osuntokun ded995a843 Merge pull request #8701 from Roasbeef/0-18-branch
build: bump version to v0.18.0-beta.rc1
2024-04-26 19:45:41 -07:00
Olaoluwa Osuntokun 3b6103d29f build: bump version to v0.18.0-beta.rc1 2024-04-26 19:19:23 -07:00
Olaoluwa Osuntokun b92216ea13 Merge pull request #8700 from Roasbeef/kvdb-update-1-4-8
build: update to kvdb v1.4.8
2024-04-26 19:09:13 -07:00
Olaoluwa Osuntokun f536c9b608 build: update to kvdb v1.4.8 2024-04-26 16:17:19 -07:00
Olaoluwa Osuntokun 5148941ed9 Merge pull request #8699 from Roasbeef/kvdb-sqlite-update-4-26
build: update to sqldb v1.0.2
2024-04-26 16:10:49 -07:00
Olaoluwa Osuntokun e80adcde8e Merge pull request #8692 from guggero/tlv-types
tlv: add new types and functions
2024-04-26 16:10:24 -07:00
Olaoluwa Osuntokun 7302051f44 build: update to sqldb v1.0.2
In this commit, we update the project and relevant sub-modules to sqldb
v1.0.2. The next step is to tag a new version of kvdb, then update the
main module to use that.
2024-04-26 15:31:14 -07:00
Olaoluwa Osuntokun abcad6218e Merge pull request #8696 from Roasbeef/sqlite-update
sqldb+kvdb: update to sqlite v1.29.8
2024-04-26 15:25:33 -07:00
Olaoluwa Osuntokun b0463124d0 Merge pull request #8694 from Roasbeef/fix-pkg-race
channeldb: fix race in TestPackager by removing global test var
2024-04-26 15:18:00 -07:00
Olaoluwa Osuntokun 675ae6e213 Merge pull request #8693 from yyforyongyu/add-default-conf
rpc: add default conf target back
2024-04-26 12:45:06 -07:00
Olaoluwa Osuntokun add2691954 Merge pull request #8485 from carlaKC/7298-3-forwardblindedroutes
[3/3]: Blinded Route Error Handling
2024-04-26 12:39:11 -07:00
Olaoluwa Osuntokun fe8784aa0c channeldb: fix race in TestPackager by removing global test var
In this commit, we fix a race in the `TestPackager` series on channeldb.
A few tests were sharing the same global variable of the set of log
updates, which includes a pointer to an HTLC. The `ExtraData` value of
the HTLC would then be mutated once we go to encode the message on disk.

To fix this, we the global with a function that returns a new instance
of all the test data.

```
==================
WARNING: DATA RACE
Write at 0x0000021b0a48 by goroutine 2896:
  github.com/lightningnetwork/lnd/lnwire.(*ExtraOpaqueData).PackRecords()
      /home/runner/work/lnd/lnd/lnwire/extra_bytes.go:74 +0x546
  github.com/lightningnetwork/lnd/lnwire.EncodeMessageExtraData()
      /home/runner/work/lnd/lnd/lnwire/extra_bytes.go:121 +0x4d
  github.com/lightningnetwork/lnd/lnwire.(*UpdateAddHTLC).Encode()
      /home/runner/work/lnd/lnd/lnwire/update_add_htlc.go:164 +0x5af
  github.com/lightningnetwork/lnd/lnwire.WriteMessage()
      /home/runner/work/lnd/lnd/lnwire/message.go:330 +0x351
  github.com/lightningnetwork/lnd/channeldb.WriteElement()
      /home/runner/work/lnd/lnd/channeldb/codec.go:186 +0x1975
  github.com/lightningnetwork/lnd/channeldb.WriteElements()
      /home/runner/work/lnd/lnd/channeldb/codec.go:247 +0x14f
  github.com/lightningnetwork/lnd/channeldb.serializeLogUpdate()
      /home/runner/work/lnd/lnd/channeldb/channel.go:2529 +0x3c
  github.com/lightningnetwork/lnd/channeldb.putLogUpdate()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package.go:525 +0xae
  github.com/lightningnetwork/lnd/channeldb.(*ChannelPackager).AddFwdPkg()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package.go:489 +0x684
  github.com/lightningnetwork/lnd/channeldb_test.TestPackagerOnlyAdds.func1()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package_test.go:283 +0x4c
  github.com/btcsuite/btcwallet/walletdb/bdb.(*db).Update()
      /home/runner/go/pkg/mod/github.com/btcsuite/btcwallet/walletdb@v1.4.2/bdb/db.go:429 +0xe5
  github.com/lightningnetwork/lnd/kvdb.Update()
      /home/runner/go/pkg/mod/github.com/lightningnetwork/lnd/kvdb@v1.4.6/interface.go:16 +0x258
  github.com/lightningnetwork/lnd/channeldb_test.TestPackagerOnlyAdds()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package_test.go:282 +0x17b
  testing.tRunner()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1595 +0x238
  testing.(*T).Run.func1()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1648 +0x44

Previous write at 0x0000021b0a48 by goroutine 2898:
  github.com/lightningnetwork/lnd/lnwire.(*ExtraOpaqueData).PackRecords()
      /home/runner/work/lnd/lnd/lnwire/extra_bytes.go:74 +0x546
  github.com/lightningnetwork/lnd/lnwire.EncodeMessageExtraData()
      /home/runner/work/lnd/lnd/lnwire/extra_bytes.go:121 +0x4d
  github.com/lightningnetwork/lnd/lnwire.(*UpdateAddHTLC).Encode()
      /home/runner/work/lnd/lnd/lnwire/update_add_htlc.go:164 +0x5af
  github.com/lightningnetwork/lnd/lnwire.WriteMessage()
      /home/runner/work/lnd/lnd/lnwire/message.go:330 +0x351
  github.com/lightningnetwork/lnd/channeldb.WriteElement()
      /home/runner/work/lnd/lnd/channeldb/codec.go:186 +0x1975
  github.com/lightningnetwork/lnd/channeldb.WriteElements()
      /home/runner/work/lnd/lnd/channeldb/codec.go:247 +0x14f
  github.com/lightningnetwork/lnd/channeldb.serializeLogUpdate()
      /home/runner/work/lnd/lnd/channeldb/channel.go:2529 +0x3c
  github.com/lightningnetwork/lnd/channeldb.putLogUpdate()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package.go:525 +0xae
  github.com/lightningnetwork/lnd/channeldb.(*ChannelPackager).AddFwdPkg()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package.go:489 +0x684
  github.com/lightningnetwork/lnd/channeldb_test.TestPackagerAddsThenSettleFails.func1()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package_test.go:490 +0x4c
  github.com/btcsuite/btcwallet/walletdb/bdb.(*db).Update()
      /home/runner/go/pkg/mod/github.com/btcsuite/btcwallet/walletdb@v1.4.2/bdb/db.go:429 +0xe5
  github.com/lightningnetwork/lnd/kvdb.Update()
      /home/runner/go/pkg/mod/github.com/lightningnetwork/lnd/kvdb@v1.4.6/interface.go:16 +0x2cd
  github.com/lightningnetwork/lnd/channeldb_test.TestPackagerAddsThenSettleFails()
      /home/runner/work/lnd/lnd/channeldb/forwarding_package_test.go:489 +0x1e7
  testing.tRunner()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1595 +0x238
  testing.(*T).Run.func1()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1648 +0x44

Goroutine 2896 (running) created at:
  testing.(*T).Run()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1648 +0x82a
  testing.runTests.func1()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1595 +0x238
  testing.runTests()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:2052 +0x896
  testing.(*M).Run()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1925 +0xb57
  github.com/lightningnetwork/lnd/kvdb.RunTests()
      /home/runner/go/pkg/mod/github.com/lightningnetwork/lnd/kvdb@v1.4.6/test_utils.go:23 +0x26
  github.com/lightningnetwork/lnd/channeldb.TestMain()
      /home/runner/work/lnd/lnd/channeldb/setup_test.go:10 +0x308
  main.main()
      _testmain.go:321 +0x303

Goroutine 2898 (running) created at:
  testing.(*T).Run()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1648 +0x82a
  testing.runTests.func1()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1595 +0x238
  testing.runTests()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:2052 +0x896
  testing.(*M).Run()
      /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.4.linux-amd64/src/testing/testing.go:1925 +0xb57
  github.com/lightningnetwork/lnd/kvdb.RunTests()
      /home/runner/go/pkg/mod/github.com/lightningnetwork/lnd/kvdb@v1.4.6/test_utils.go:23 +0x26
  github.com/lightningnetwork/lnd/channeldb.TestMain()
      /home/runner/work/lnd/lnd/channeldb/setup_test.go:10 +0x308
  main.main()
      _testmain.go:321 +0x303
==================
```
2024-04-26 12:36:53 -07:00
Olaoluwa Osuntokun eb605a02fd sqldb+kvdb: update to sqlite v1.29.8
Updates to SQLite 3.45.3: https://www.sqlite.org/releaselog/3_45_3.html.

May also address https://github.com/lightningnetwork/lnd/issues/8666.
2024-04-26 12:26:59 -07:00
Olaoluwa Osuntokun e6d6789fd9 Merge pull request #8681 from Roasbeef/amp-flag-consistency
lnrpc: ensure parsing of the Amp flag for payments is consistent
2024-04-25 18:49:51 -07:00
Olaoluwa Osuntokun e8031fdccf lnrpc: ensure parsing of the Amp flag for payments is consistent
In this commit, we fix an inconsistent in the API related to AMP
payments. When a payment request isn't specified, we require the `--amp`
flag on the CLI to make an AMP payment. However, for payment requests,
we don't require this flag. To fix this inconsistency, we now require
the `--amp` flag to _also_ be set for payment requests.
2024-04-25 16:16:16 -07:00
Olaoluwa Osuntokun ab2f34e13b Merge pull request #8621 from ziggie1984/fix-sync-neutrino-nodes
fix sync neutrino nodes
2024-04-25 16:13:32 -07:00
Olaoluwa Osuntokun 956b00b599 tlv: add in new BigSizeT type
This type is useful when one wants to encode an integer as an underlying BigSize record. It wraps any integer, then handles the transformation into and out of the BigSize encoding on disk.
2024-04-25 16:48:29 +02:00
Olaoluwa Osuntokun 5b2869b0ec tlv: add new Blob type alias
In this commit, we add a new type alias for a blob type. This type can be used in areas where a byte slice is used to store a TLV value, which may be a fully opaque nested TLV.
2024-04-25 16:48:06 +02:00
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