Commit graph

14990 commits

Author SHA1 Message Date
@RandyMcMillan
ed94a8f3b4
docs/INSTALL.md: use /Users/<username>/..
Make MacOS user path consistent across docs
2023-07-14 16:41:52 -04:00
Oliver Gugger
e8c11b9898
Merge pull request #7783 from guggero/bump-tor-dependency-ipv6-fix
mod: bump tor submodule to v1.1.1
2023-07-13 11:05:20 +02:00
Oliver Gugger
bc58dce176
docs: update release notes 2023-07-13 10:17:17 +02:00
Oliver Gugger
cffdc9a46f
mod: bump tor submodule to v1.1.1 2023-07-13 10:17:02 +02:00
Olaoluwa Osuntokun
acecb12f54
Merge pull request #7354 from positiveblue/invoice-sql-schema
sqldb: add invoice schema and sql queries
2023-07-12 17:03:26 -07:00
Oliver Gugger
7d202e69ef
Merge pull request #7739 from sputn1ck/autocert_fix
tlsmanager: fix autocert autogeneration
2023-07-12 10:03:01 +02:00
sputn1ck
92e0b08a7a
docs: add release note for 7739 2023-07-11 21:25:19 +02:00
sputn1ck
10f9748193
tlsmanager: fix autocert autogeneration
As the getConfig() function would previously overwrite the
GetCertificateFunction of the tls config, the autocert manager would
never be used.
2023-07-11 21:24:46 +02:00
Olaoluwa Osuntokun
33b470b4a6
Merge pull request #7768 from ProofOfKeags/spurious-htlc-rejections
invoices+htlcswitch: fix spurious htlc rejections from overly strict onion packet integrity checks
2023-07-11 10:51:22 -07:00
Oliver Gugger
54acf270a2
Merge pull request #7758 from guggero/gpg-homedir
scripts: use gpg --homedir flag to fix new behavior in 2.4
2023-07-11 10:33:57 +02:00
Oliver Gugger
52115ab19b
docs: add release notes 2023-07-11 09:18:43 +02:00
Oliver Gugger
8c9f4515b6
scripts: use gpg --homedir flag to fix new behavior in 2.4
With the latest Golang Docker base image we are using the new gpg
version 2.4 is now being installed in the lnd Docker base image.

Apparently the expected value for the --keyring flag is just a file name
and not an absolute path. The path of the file is indicated either by
the $HOME environment variable or the --homedir flag. It looks like 2.4
now finally stopped supporting an absolute path in the --keyring flag
and we need to update our gpg command to make the script work again.

This should be backward compatible and still work on older versions of
gpg.
2023-07-11 09:18:22 +02:00
positiveblue
8fcb404161
docs: add release note for 7354 2023-07-10 17:57:09 -07:00
positiveblue
ff1379a633
CI: Add sqlc code generation check 2023-07-10 17:57:09 -07:00
positiveblue
730db7ee8c
sqlc: generate go code from SQL
run `make sqlc`

All the code in this commit is auto-generated.
2023-07-10 17:57:06 -07:00
positiveblue
877b711360
sqldb: add invoice event queries 2023-07-10 17:56:29 -07:00
positiveblue
fb16287b31
sqldb: add invoice events SQL schema 2023-07-10 17:56:27 -07:00
positiveblue
6deb916216
sqldb: add AMP invoice queries 2023-07-10 17:53:57 -07:00
positiveblue
eda95e6607
sqldb: add AMP invoices SQL schema
Schema for AMP invocies.

AMP invoices can be paid multiple times and each payment to an AMP invoice
is identified by a `set_id`.

The A in AMP stands for `Atomic`. All the htlcs belonging to the same
AMP payment (share the same set_id) will be resolved at the same time
with the same result: settled/canceled.

AMP invoices do not have an "invoice preimage". Instead, each htcl has
its own hash/preimage. When a new htlc is added the hash for that htlc
is attached to it. When all the htlcs of a set_id have been received we
are able to compute the preimage for each one of them.
2023-07-10 17:53:56 -07:00
positiveblue
7aa2f390fe
sqldb: add invoice queries
Set of queries to deal with invoices. A couple of things to take into
account:

    - Because the queries are not rewritten at runtime, we cannot have a
      generic `INSERT` with different tuples.
    - Because the queries are not rewritten at runtime, we cannot build
      one query with only the filters that matter for that queries. The
      two options are a combinatorial approach (a new query for every
      permutation) or a generic query using the pattern

          ```
            SELECT *
            FROM table
            WHERE (
                -- Can be read as:
                -- Match the filter 1 value if filter_1 != nil
                column_1 >= sqlc.narg('filter_1') OR
                sqlc.narg('filter_1') IS NULL
            ) AND (
                column_2 >= sqlc.narg('filter_2') OR
                sqlc.narg('filter_2') IS NULL
            ) ...
          ```
2023-07-10 17:53:29 -07:00
positiveblue
e3663b9942
sqldb: add invoices SQL schema
This is the schema for "ordinal" BOLT11 invoices.

The invoices table aims to keep an entry for each invoice, BOLT11 or not,
that will be supported.

Invoice related HTLCs will be stored in a separete table than forwarded
htlcs.

SQLite does not support `SEQUENCE`. We achieve atomic autoincrementals
using primary keys with autoincrement/serial. An invoice `AddIndex`
translates to `invoices(id)` while `SettleIndex` is `invoice_payments(id)`.
2023-07-10 17:53:26 -07:00
positiveblue
43a9e2f1ca
multi: add sqlc support
sqlc is a tool that generates fully type-safe idiomatic code from SQL.
The result is Go code can then used execute the queries in the database.

The noraml flow looks like:
- The developer write some sql that will update the schema in the
  database: new tables, indices, etc
- The developer updates the set of queries that will use the new schema.
- `sqlc` generates type-safe interfaces to those queries.
- The developer can then write application code that calls the methods
  generated by sqlc.

The tool configuration needs to live in the repo's root and its name is
`sqlc.yaml`.

LND will support out of the box sqlite and postgres. The sql code needs to
be (almost) the same for both engines, so we cannot use custom functions
like `ANY` in postgres.

The SQLC config file needs to define what is the target engine, we will
set postgres but the generated code can be executed by sqlite too.

In some specific cases, we will `match and replace` some sql lines to be
sure the table definitions are valid for the targeted engine.
2023-07-10 17:36:58 -07:00
Oliver Gugger
287b0ac219
Merge pull request #7817 from ViktorTigerstrom/2023-07-add-viktor-key
scripts: add ViktorTigerstrom PGP key
2023-07-10 14:34:08 +02:00
Oliver Gugger
0045344692
Merge pull request #7814 from harsha-s/patch-2
Fix docker compose run issue
2023-07-10 13:36:16 +02:00
Viktor Tigerström
376aeec52a
scripts: add ViktorTigerstrom PGP key [skip ci] 2023-07-10 12:55:19 +02:00
Oliver Gugger
6002982baa
Merge pull request #7806 from lightningnetwork/dependabot/go_modules/kvdb/google.golang.org/grpc-1.53.0
build(deps): bump google.golang.org/grpc from 1.41.0 to 1.53.0 in /kvdb
2023-07-10 11:14:50 +02:00
Harsha
d9f3a12f57
Fix docker compose run issue
docker-compose run -d --name alice --volume simnet_lnd_alice:/root/.lnd lnd

 => ERROR [builder 4/4] RUN git clone https://github.com/btcsuite/btcd.git .     && git checkout v0.23  6.2s
------
 > [builder 4/4] RUN git clone https://github.com/btcsuite/btcd.git .     && git checkout v0.23.5     && go install -v . ./cmd/...:
#0 0.253 Cloning into '.'...
#0 6.059 error: pathspec 'v0.23.5' did not match any file(s) known to git
------
failed to solve: executor failed running [/bin/sh -c git clone https://github.com/btcsuite/btcd.git .     && git checkout $BTCD_VERSION     && go install -v . ./cmd/...]: exit code: 1
2023-07-10 01:00:57 +01:00
Keagan McClelland
7b179a8e64 htlcswitch: optimize tests to not tear down harness 2023-07-07 13:30:25 -06:00
Keagan McClelland
f2bb4ff559 invoices+htlcswitch: fix style nits 2023-07-07 13:17:01 -06:00
Keagan McClelland
61f48ccf4e docs: update release notes 2023-07-07 10:49:05 -06:00
Keagan McClelland
36bf471a1f invoices+htlcswitch: add tests for relaxed link and invoice checks 2023-07-07 10:48:57 -06:00
dependabot[bot]
b9b34a086f
build(deps): bump google.golang.org/grpc from 1.41.0 to 1.53.0 in /kvdb
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.41.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 21:12:10 +00:00
Olaoluwa Osuntokun
86e7b4e1e0
Merge pull request #7794 from yyforyongyu/prepare-channel-ready-fix
brontide: refactor peer to prepare channel ready fix
2023-07-04 12:39:59 -07:00
Olaoluwa Osuntokun
55c991a1a7
Merge pull request #7775 from yyforyongyu/fix-logger-order
lnd: fix orders when initializing subsystem loggers
2023-07-04 12:39:39 -07:00
Olaoluwa Osuntokun
5015cd941e
Merge pull request #7797 from guggero/kvdb-1-4-2
mod: bump kvdb submodule to v1.4.2
2023-07-04 12:39:23 -07:00
Olaoluwa Osuntokun
df9b53b6af
Merge pull request #7766 from ffranr/export_unmarshall_outpoint
Export unmarshall outpoint functionality
2023-07-04 12:37:48 -07:00
Olaoluwa Osuntokun
f3437d6d2a
Merge pull request #7782 from guggero/fix-tor-dial-ipv6
tor: short circuit host lookup if connecting to IP
2023-07-04 12:37:36 -07:00
Keagan McClelland
1b1eedb434 htlcswitch: relax final onion packet check
The spec allows the final HTLC value and CLTV expiry to exceed
the value and expiry specified in the payload of the last hop
of the onion packet. We were over-restricting it to require
that it matches exactly.
2023-06-29 17:13:36 -06:00
Keagan McClelland
e0c0815c96 invoices: allow overpayment in mpps 2023-06-29 17:13:36 -06:00
Oliver Gugger
5c5ce1f707
Merge pull request #7780 from ziggie1984/max_local_csv
Change defaultMaxLocalCSVDelay to protect user from high delays
2023-06-29 20:52:26 +02:00
Oliver Gugger
2604aebdef
mod: bump kvdb submodule to v1.4.2
This is necessary after #7796 to apply the change made in the kvdb
submodule to the main module.
2023-06-29 13:37:58 -04:00
Oliver Gugger
5ea4251b3a
Merge pull request #7796 from hsjoberg/update-kvdb
kvdb: Update bbolt to 1.3.7 in order to address mmap issues
2023-06-29 19:35:26 +02:00
Hampus Sjöberg
3d69ed3d4c kvdb: Update bbolt to 1.3.7 in order to address mmap issues 2023-06-29 17:54:43 +02:00
ziggie
6cbb62a2df
docs: update release-notes 2023-06-28 07:08:32 +02:00
Olaoluwa Osuntokun
aa17c17f9a
Merge pull request #7772 from Roasbeef/release-notes-merge-queue
scripts: update release notes check for merge queue usage
2023-06-27 13:46:29 -04:00
yyforyongyu
195e951e58
peer: rename newChannels to newActiveChannel
As new pending channels will be tracked in the following commits, the
`newChannels` is now renamed to `newActiveChannel` to explicitly refer
to active, non-pending channels.
2023-06-27 20:19:37 +08:00
yyforyongyu
22d2819489
peer: add handleNewChannelMsg method to handle new channel request 2023-06-27 20:19:37 +08:00
yyforyongyu
60627f676f
peer: stop considering pending channels as active
This commit changes the method `isActiveChannel` such that the pending
channels are not consider as active.
2023-06-27 20:19:37 +08:00
yyforyongyu
ccb86a9d1d
peer: update and use SyncMap in Brontide
This commit applies methods `ForEach` and `Len` to `Brontide`.
2023-06-27 20:19:37 +08:00
yyforyongyu
a66d42c682
funding: use SyncMap to simplify map usage 2023-06-27 20:19:37 +08:00