Commit Graph

18093 Commits

Author SHA1 Message Date
Oliver Gugger
48fba10562
Merge pull request #9257 from starius/estimatefeerate-regtest2
chainreg: use feerate estimator in regtest and simnet
2024-12-03 18:56:50 +01:00
Gijs van Dam
42a1d5e22b
docs: clarify skipping the CI checks
[skip ci]
2024-12-03 18:16:13 +01:00
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
Oliver Gugger
f4d5d4ed8a
Merge pull request #9305 from ProofOfKeags/update/tlv-fn2
tlv: update to fn v2
2024-12-03 09:12:14 +01:00
Oliver Gugger
0c9b65578f
Merge pull request #9328 from guggero/golang-min-version
docker+docs: update documentation around Golang minimum version
2024-12-02 11:22:57 +01:00
Oliver Gugger
0474b4ff20
Merge pull request #9314 from ellemouton/slog1
build+lnd+docs: start using slog and add commit_hash to log lines
2024-12-02 09:53:31 +01:00
Oliver Gugger
2fdfa26268
docs: update Golang minimum version in docs/INSTALL.md 2024-12-02 09:49:25 +01:00
Oliver Gugger
7692ced5f5
multi: update comment on changing Go version
Since we now have a scripted check that makes sure the Golang version is
synced throughout all files, it is important that the main version in
the Makefile is changed, then all other versions can be detected by that
script.
2024-12-02 09:48:26 +01:00
Elle Mouton
afbb9aa41c
docs: add release note entry 2024-12-02 09:23:07 +02:00
Elle Mouton
8862ce99d5
lnd: use errors.Is for error comparison 2024-12-02 09:23:07 +02:00
Elle Mouton
ed4279b6f3
lnd: update Main logs to use structured logging 2024-12-02 09:23:07 +02:00
Elle Mouton
32fbea2f85
lnd: use structured logs in mkErr helper 2024-12-02 09:23:06 +02:00
Elle Mouton
755ad49440
build: Append commit hash to the main LND context
It can be disabled via the new `logging.no-commit-hash` config option.
2024-12-02 09:23:06 +02:00
Elle Mouton
efe08b836e
docs: add structured logging docs in code formatting rules doc 2024-12-02 09:23:06 +02:00
Elle Mouton
a04f8dfd4f
lnd: pass ctx to rest proxy 2024-12-02 09:23:06 +02:00
Elle Mouton
c5d849e044
.golangci: Replace lll with custom ll 2024-12-02 09:23:06 +02:00
Elle Mouton
ab7aae0708
multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
2024-12-02 09:14:21 +02:00
Elle Mouton
88f5369066
tools+.: add custom linter configuration file
Add this file both to the main LND directory so that devs can use it for
local linter runs and also add it to the `tools` directory so that the
docker environment used to run the linter in CI has access to it. A
custom linter binary can be built via `golangci-lint custom`. This will
pull in and register all the plugins listed in the new config file when
building the new binary. The new binary can then be run using
`custom-gcl run`.
2024-12-02 09:14:21 +02:00
Elle Mouton
bd55b2795b
tools/linters: ignore log lines
This commit adds a feature to our custom lll linter which will ignore
log lines (both single and multi-lined log lines) for the lll linter.
2024-12-02 09:14:21 +02:00
Oliver Gugger
f6aff58a6d
Merge pull request #9322 from hieblmi/fix-estimate-route-fee
cmd: fix default timeout for estimateroutefee
2024-11-29 11:21:25 +01:00
Slyghtning
440cdb3172
docs: update release notes 2024-11-29 10:23:10 +01:00
Slyghtning
85d89a5b41
cmd: fix default timeout for estimateroutefee 2024-11-29 10:20:03 +01:00
Elle Mouton
9637a8132e
tools/linters: convert to LinterPlugin implementation
This commit introduces the `LLPlugin` type and converts the existing lll
code such that the LLPlugin implements the register.LinterPlugin
interface. This will allow us to plug it into golangci-linter as a
plugin.
2024-11-29 11:03:27 +02:00
Elle Mouton
acbcb771af
tools/linters: Add copied golangci-lint lll linter code
In this commit, we copy the implementation of the golangci-lint lll
linter which we currently use in our CI flow during the `make lint`
check. This commit copies the code mostly as is (the only exception
being the line which trims white space before checking if a line starts
with "import"), and formats it to fit our codebase guidelines. A test is
also added so that we can be sure that the following commits which
adjust the implementation have the intended results.

The custom linter is put into its own module as this is requied by the
`golangci-lint custom` when building the custom linter binary which
includes the plugin.
2024-11-29 10:44:22 +02:00
Oliver Gugger
f2d9868906
Merge pull request #9287 from Abhinav-Bansal751/master
Update docs/grpc/python.md and ruby.md
2024-11-29 09:30:07 +01:00
Oliver Gugger
506586a37e
Merge pull request #9236 from ellemouton/moveGraphDBCode
[1/3] Graph RIP: refactor+graph: move all graph related DB code to the graph package
2024-11-28 13:47:16 +01:00
Elle Mouton
54dbaa60c9
docs: add release notes entry for 9236 2024-11-28 13:51:15 +02:00
Elle Mouton
439a6c7d6c
multi: rename chan DB Open method to OpenForTesting 2024-11-28 13:51:15 +02:00
Elle Mouton
4089fbcb44
multi: fix linter errors 2024-11-28 13:51:15 +02:00
Elle Mouton
fd2ea411be
itest: assert no failed updates in test
So that this fails earlier on if the actual call to UpdateChannelPolicy
fails.
2024-11-28 13:51:14 +02:00
Elle Mouton
adcaa8802f
multi: remove kvdb.Tx from ChannelGraphSource.ForAllOutgoingChannels
and the same for ChannelStateDB.FetchChannel. Most of the calls to these
methods provide a `nil` Tx anyways. The only place that currently
provides a non-nil tx is in the `localchans.Manager`. It takes the
transaction provided to the `ForAllOutgoingChannels` callback and passes
it to it's `updateEdge` method. Note, however, that the
`ForAllOutgoingChannels` call is a call to the graph db and the call to
`updateEdge` is a call to the `ChannelStateDB`. There is no reason that
these two calls need to happen under the same transaction as they are
reading from two completely disjoint databases. And so in the effort to
completely split untangle the relationship between the two databases, we
now dont use the same transaction for these two calls.
2024-11-28 13:49:41 +02:00
Elle Mouton
6e13898981
multi: move LightningNode struct to models package 2024-11-28 13:36:32 +02:00
Elle Mouton
ccb8f0eeb8
refactor: move graphsession pkg to graph package 2024-11-28 13:36:15 +02:00
Elle Mouton
b86980ec40
channeldb: remove graph db from channeldb
Now that the channel.DB no longer uses the ChannelGraph pointer, we can
completely remove it as a member of channeldb.DB.
2024-11-28 13:36:15 +02:00
Elle Mouton
2c083bc017
multi: let chan and graph db implement AddrSource
Then use both to construct a multiAddrSource AddrSource and use that
around the code-base.
2024-11-28 13:36:15 +02:00
Elle Mouton
51c2f709e1
channeldb: let AddrsForNode indicate if the node was found or not
Before this commit, the `(channeldb.DB).AddrsForNode` method treats the
results from the channel db and the graph db slightly differently. It
errors out if the channel db is unaware of the node in question but does
not error out if the graph is unaware of the node. So this commit
changes the logic slightly so that a "node-unknown" error from either
backing source is not seen as an error.
2024-11-28 13:36:15 +02:00
Elle Mouton
9537026df9
channeldb: implement a multi-source AddrSource
In this commit, we implement a version of the AddrSource interface which
merges the results of a set of AddrSource implementations. This will
later be used to merge the results of the channel db and graph db.
2024-11-28 13:36:15 +02:00
Elle Mouton
083d3c9d7c
channeldb: define a single AddrSource interface
Our aim is to completely remove the `channeldb.DB`'s direct dependence
on the `graphdb.ChannelGraph` pointer. The only place where it still
depends on this pointer is in the `(DB).AddrsForNode(..)` method where
it queries both the channel DB and the graph db for the known addresses
for the node in question and then combines the results. So, to separate
these out, we will define an AddrsForNodes interface in this commit
which we will later let both the ChannelGraph and channeldb.DB both
implement and we will merge these results outside of the channeldb
package.

All this commit does is to unify the `AddrSource` interface since this
has been defined separately in a couple of places.
2024-11-28 13:36:15 +02:00
Elle Mouton
1859993734
channeldb+graphdb: init graph DB outside of channel db
We also now use the graph DB's own optional functions. An instance of
the graph is currently still passed to the channeldb's
`CreateWithBackend` function. This will be removed in a later commit
once the two have been completely disjoint.
2024-11-28 13:36:15 +02:00
Elle Mouton
74a4b1922b
refactor: move graph related DB code to graph/db from channeldb
This is a pure refactor commit. It moves over all the graph related CRUD
code from `channeldb` to `graph/db`.
2024-11-28 13:36:13 +02:00
Elle Mouton
9f54ec90aa
multi+refactor: move models package to graph/db
All the structs defined in the `channeldb/models` package are graph
related. So once we move all the graph CRUD code to the graph package,
it makes sense to have the schema structs there too. So this just moves
the `models` package over to `graph/db/models`.
2024-11-28 13:34:33 +02:00
Elle Mouton
b707fd55b2
contractcourt: use graphdb outpoint helpers
Start using the single set of exported write/read functions for
wire.Outpoint.
2024-11-28 13:34:08 +02:00
Elle Mouton
382539a6eb
channeldb/graphdb: move outpoint ser/deser funcs to graphdb
We have the same helpers for writing and reading a wire.Outpoint type
defined separately in a couple places. We will want to use these from
the graph db package soon though so instead of defining them again
there, this commit unifies things and creates a single exported set of
helpers. The next commit will make use of these.
2024-11-28 13:34:08 +02:00
Elle Mouton
3365461500
channeldb+graph/db: move net.Addr encode/decode to graph db package
In preparation for moving the graph related schema structs to the graph
package in an upcoming commit, we move these methods to the graph
package. The structs we will move make use of these methods but we still
import them from channeldb so as to keep the ReadElement and
WriteElement helpers working as they do today.
2024-11-28 13:34:08 +02:00
Elle Mouton
1e81d83f78
channeldb: export net.Addr encode/decode methods
We'll move these to the new graphdb package later and import them from
there.
2024-11-28 13:34:08 +02:00
Oliver Gugger
4681b52c5a
make: remove exotic build targets from release list
With this commit we remove build targets from our list of release build
OS/architecture pairs to reduce the overhead of building for them with
every pull request and every release.

According to https://tooomm.github.io/github-release-stats/?username=lightningnetwork&repository=lnd
those targets are rarely used, compared to the most popular ones:

| Release File                          | Absolute DL | Relative DL |
|---------------------------------------|-------------|-------------|
| lnd-darwin-amd64-v0.18.3-beta.tar.gz  | 1,930       | 72          |
| lnd-darwin-arm64-v0.18.3-beta.tar.gz  | 2,020       | 162         |
| lnd-freebsd-386-v0.18.3-beta.tar.gz   | 1,864       | 6           |
| lnd-freebsd-amd64-v0.18.3-beta.tar.gz | 1,874       | 16          |
| lnd-freebsd-arm-v0.18.3-beta.tar.gz   | 1,865       | 7           |
| lnd-linux-386-v0.18.3-beta.tar.gz     | 1,873       | 15          |
| lnd-linux-amd64-v0.18.3-beta.tar.gz   | 3,355       | 1,497       |
| lnd-linux-arm64-v0.18.3-beta.tar.gz   | 3,053       | 1,195       |
| lnd-linux-armv6-v0.18.3-beta.tar.gz   | 1,868       | 10          |
| lnd-linux-armv7-v0.18.3-beta.tar.gz   | 1,893       | 35          |
| lnd-linux-mips-v0.18.3-beta.tar.gz    | 1,859       | 1           |
| lnd-linux-mips64-v0.18.3-beta.tar.gz  | 1,860       | 2           |
| lnd-linux-mipsle-v0.18.3-beta.tar.gz  | 1,859       | 1           |
| lnd-linux-ppc64-v0.18.3-beta.tar.gz   | 1,858       | 0           |
| lnd-linux-ppc64le-v0.18.3-beta.tar.gz | 1,859       | 1           |
| lnd-linux-s390x-v0.18.3-beta.tar.gz   | 1,859       | 1           |
| lnd-netbsd-amd64-v0.18.3-beta.tar.gz  | 1,859       | 1           |
| lnd-openbsd-amd64-v0.18.3-beta.tar.gz | 1,861       | 3           |
| lnd-source-v0.18.3-beta.tar.gz        | 1,863       | 5           |
| lnd-windows-386-v0.18.3-beta.zip      | 1,895       | 37          |
| lnd-windows-amd64-v0.18.3-beta.zip    | 1,997       | 139         |
| lnd-windows-arm-v0.18.3-beta.zip      | 1,868       | 10          |
2024-11-28 09:42:05 +01:00
Oliver Gugger
1ebdefb943
Merge pull request #9311 from Roasbeef/protofsm-race-fix
protofsm: fix race in state machine executor tests
2024-11-28 09:28:04 +01:00
Boris Nagaev
23b025cff6
docs: add release notes (feerate estimator) 2024-11-27 10:30:52 -03:00
Boris Nagaev
b89387a6da
chainreg: use feerate estimator in regtest, simnet
If feeurl is not provided and LND is running in bitcoind or btcd mode, use
fee estimator provided by bitcoind or btcd instead of using static fee estimator
(which always returns 50 sats/vbyte).

This enables simulating high feerate environment in regtest and simnet not only
via feeurl, but also by filling mempool with high feerate transactions, which is
closer to what happens in mainnet.

Also skip creating bitcoind or btcd fee estimator, if feeurl is provided. Before
LND logged both "Initializing bitcoind backed fee estimator" and "Using external
fee estimator" if running in bitcoind mode with feeurl provided, but actually
feeurl was used, so this is not a change of behavior.
2024-11-27 10:24:26 -03:00
Oliver Gugger
ae32c29deb
Merge pull request #9295 from ellemouton/logPerformanceFix
go.mod: bump btclog dep
2024-11-27 11:43:43 +01:00