Commit Graph

12266 Commits

Author SHA1 Message Date
Oliver Gugger
140d5a8086 chainreg+lnd: split chain control initialization
As a preparation for extracting the wallet related initialization code,
we first need to separate the purely configuration related chain control
initialization from the wallet related code. We do that by splitting the
chain control into a partial and full struct that is initialized in two
parts. This also allows us to create the wallet configuration itself
outside of the chain control package and we need to thread through fewer
parameters through the chain control config.
2021-10-08 12:06:54 +02:00
Oliver Gugger
47f1b81a51 walletunlocker+lnd: move WalletUnlockParams
As a preparation for adding the wallet unlock params to the chain
control, we first need to move them out of the main package.
2021-10-08 12:06:54 +02:00
Oliver Gugger
862f712394 lnd+pilot: use minHTLCIn instead of whole config
To remove one more direct dependency to a variable in our main function,
we pass in the required parameter to the autopilot only instead of the
whole chain configuration.
2021-10-08 12:06:54 +02:00
Oliver Gugger
cab800e1e7 chainreg: add chain source and channel constraints
As a preparation for separating the pure config related chain control
setup from the wallet related chain control, we store more information
in the chain control instance that is required for the wallet
initialization.
2021-10-08 12:06:53 +02:00
Oliver Gugger
b22f51098a rpcperms+lnd: use macaroon service from interceptor chain
We'll refactor the wallet creation and unlock process in a following
commit and want to make it possible to not need a direct reference to
the macaroon service in our main function. Since we store it in the
interceptor chain anyway (if we're using macaroons in the first place),
we might as well use the instance there directly.
2021-10-08 12:06:53 +02:00
Oliver Gugger
d12154154a chainreg+lnd: add block cache to chainreg config
The block cache size in the chainreg.Config previously wasn't used but
instead the block cache was passed in as a separate parameter. We
replace the cache size with the actual cache in the config to streamline
things somewhat.
2021-10-08 12:06:53 +02:00
Oliver Gugger
e79d59dd4c multi: use key locator for lnwallet.MessageSigner
To simplify the message signing API even further, we refactor the
lnwallet.MessageSigner interface to use a key locator instead of the
public key to identify which key should be signed with.
2021-10-08 12:06:52 +02:00
Oliver Gugger
afa03f22cc multi: use key locator only for signing messages
To simplify the API surface of a remote signer even more, we refactor
the SignMessage and SignMessageCompact calls to only accept a key
locator as we always know what key we're using for signing anyway.
2021-10-08 12:06:52 +02:00
Oliver Gugger
8b7c88537c multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
lnrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:52 +02:00
Oliver Gugger
02757f6735 multi: refactor SignDigest into SignMessage
To make it possible to use a remote signrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
signrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:51 +02:00
Oliver Gugger
dd3719d5de Merge pull request #5832 from guggero/node-feature-log
channeldb: fix graph cache feature handling
2021-10-08 10:02:44 +02:00
Oliver Gugger
77bf6cfed3 channeldb: fix graph cache feature handling [skip ci]
Fixes #5830.
When a channel for a node is announced before the node itself is
announced on the network, it's possible that we have channels for a node
but no features defined yet. This was previously logged as a warning
which spammed the log unnecessarily.
2021-10-08 10:02:11 +02:00
Oliver Gugger
c30152c1c0 Merge pull request #5842 from hsjoberg/gomobile-ios-xcframework
build: make gomobile iOS build to .xcframework folder
2021-10-08 09:58:03 +02:00
Olaoluwa Osuntokun
d630b95c8b Merge pull request #5777 from orbitalturtle/buf-pass-macaroon
Lnd: Listen for RPC calls on a bufconn
2021-10-07 18:50:58 -07:00
Hampus Sjöberg
082aeab24a build: make gomobile iOS build to .xcframework folder
Recent gomobile versions are now building for the `xcframework`
packaging format instead of `framework`. This commit addresses
this by outputting to a `.xcframework` folder.
2021-10-08 00:21:53 +02:00
Olaoluwa Osuntokun
935fd267a0 Merge pull request #5834 from torkelrogstad/2021-10-06-getchaininfo
lncli: take chan_id as uint64 in getchaninfo
2021-10-07 12:49:44 -07:00
Olaoluwa Osuntokun
3efe94b4b1 Merge pull request #5833 from guggero/itest-github-fixes
itest: fix log file upload and flakes
2021-10-07 12:47:32 -07:00
Olaoluwa Osuntokun
ca4b8180a0 Merge pull request #5826 from guggero/release-fixes
GitHub: download key from git repo, update Roasbeef's key
2021-10-07 12:32:17 -07:00
Olaoluwa Osuntokun
f290746095 Merge pull request #5838 from ellemouton/printPubKeyInHex
server: print pubkey in hex in log [skip ci]
2021-10-07 12:28:48 -07:00
Torkel Rogstad
4d96f31f59 lncli: take chan_id as uint64 in getchaninfo
When taking in chan_id as a int64, there are some channels that cannot
be givn to lncli because they are out of range for an int64.
2021-10-07 14:57:32 +02:00
Oliver Gugger
0d2ea30ada docs: add release notes 2021-10-07 14:26:00 +02:00
Elle Mouton
e68b1daf00 server: print pubkey in hex in log [skip ci]
Fix log statement that prints out peer pubkey.
2021-10-07 13:02:10 +02:00
Oliver Gugger
0fac6c400e itest: wait for node to fully start up 2021-10-06 16:29:49 +02:00
Oliver Gugger
e9c9ec2e84 itest: exit goroutines on error 2021-10-06 16:29:44 +02:00
Oliver Gugger
b925ebb92c GitHub: only upload logs on failure 2021-10-06 16:29:44 +02:00
Olaoluwa Osuntokun
ccc03931ad Merge pull request #5483 from ellemouton/respectMinFeeRate
multi: respect and update min relay fee
2021-10-05 16:24:57 -07:00
Olaoluwa Osuntokun
5cc10ef18b Merge pull request #5811 from guggero/itest-flake-fix
CI: fix more flakes, move itests to GitHub (except ARM itest)
2021-10-05 16:21:09 -07:00
Oliver Gugger
134be244b4 GitHub+Travis: move itests to GitHub Actions 2021-10-05 20:48:48 +02:00
Oliver Gugger
c89637a4e2 itest: fix close of closed channel panic 2021-10-05 20:48:48 +02:00
Oliver Gugger
1774934666 multi: fix Postgres on Travis
Fixes the docker build that was caused by
https://github.com/docker-library/postgres/issues/884.
Using the alpine and version 13 image avoids the problem introduced
with postgres 14 and debian bullseye.
2021-10-05 20:48:48 +02:00
Oliver Gugger
6bc0862fdf itest: fix commitment_deadline context expired flake 2021-10-05 20:48:48 +02:00
Oliver Gugger
bedba02a2d itest: enable slow mining by default
We now redirect the mineBlocks function to the mineBlocksSlow function
which waits after each mined block. To reduce the overall time impact of
using that function everywhere, we only wait 20 milliseconds instead of 50ms
after each mined block to give all nodes
some time to process the block. This will still slow down everything by a bit
but reduce flakes that are caused by different sub systems not being
up-to-date.
2021-10-05 20:48:47 +02:00
Oliver Gugger
98061dfd58 mod+lntest: disable stall handler in btcd mining node
The latest version of btcd allows its stall handler to be disabled. We
use that new config option to make sure the mining btcd node and the lnd
chain backend btcd node aren't disconnected if some test takes too long
and no new p2p messages are exchanged.
2021-10-05 20:48:47 +02:00
Elle Mouton
f782df6768 docs: update 0.14 release notes 2021-10-05 18:30:42 +02:00
Elle Mouton
ad2859c863 chainfee: fetch fresh relay fee for btcd
This commit adds a function to the BtcdEstimator that fetches the
current min relay fee from the btcd node.
2021-10-05 18:30:41 +02:00
Elle Mouton
55077d9404 chainfee: fetch new relay fee from bitcoind
This commit adds a fetchMinMempoolFee function to the BitcoindEstimator
that fetches the current min mempool fee from the bitcoind backend. The
commit then also updates the BitcoindEstimator to use a minFeeManager
for it's minFeeManager member and uses the fetchMinMempoolFee function
to initialise this.
2021-10-05 18:30:41 +02:00
Elle Mouton
c01699853d chainfee: add minFeeManager
This commit adds a minFeeManager which holds a copy of minFeePerKW
and updates this fee every few calls.
2021-10-05 18:30:41 +02:00
Elle Mouton
f667683e6c htlcswitch: respect minimum relay fee
When channels fee rates are being considered for an update, the minimum
relay fee should also be considered.
2021-10-05 18:30:41 +02:00
Oliver Gugger
d688a2a7f5 GitHub: download key from git repo, update Roasbeef's key
With this commit we update the release template to download Roasbeef's
key from the git repository via GitHub.
We also update the key mentioned in the template to the new signing key.
[skip ci]
2021-10-05 10:06:40 +02:00
Elle Mouton
6712595618 lnwallet: fix validateFeeRate
The validateFeeRate function uses the availableBalance function to get
the current spendable balance of a channel, adds the old fee and then
ensures that the new fee is not larger than the amount we have available
to spend. This commit also removes the local reserve check in the
validateFeeRate function since the balance returned from
availableBalance already takes the local reserve into acccount.
2021-10-05 09:00:02 +02:00
Elle Mouton
2b8a4d296e lnwallet: use availableBalance in max fee calc
In this commit we ensure that the max fee calculated in the MaxFeeRate
function takes the local reserve amount into account along with any
pending HTLCs. This is done by calling the avaialbeBalance function.
2021-10-05 08:24:10 +02:00
Olaoluwa Osuntokun
af9b620854 Merge pull request #5538 from ellemouton/refreshPeerIP
multi: refresh peer IP during reconnect
2021-10-04 15:26:47 -07:00
Elle Mouton
317acf7c7c docs/release-notes: add new entry for 5538 2021-10-04 14:57:50 +02:00
Elle Mouton
da64a24ad8 server: update persistent peer addrs from announcements
In this commit, a subscription is made to topology updates. For any
NodeAnnouncements received for our peristent peers, we store their newly
advertised addresses. If at the time of receiving these new addresses
there are any existing connection requests, these are updated to reflect
the newly advertised addresses.
2021-10-04 14:57:50 +02:00
Elle Mouton
6b5b53d517 lntest: show reconnection bug
In this commit we demonstrate a bug to show that if an inbound peer
changes their listening address to one not advertised in their original
NodeAnnouncement then we will not be able to reconnect to them. This bug
will be fixed in a follow-up commit.
2021-10-04 14:57:50 +02:00
Elle Mouton
d639a4d73f server+lntest: use all addrs during reconnect
In this commit, all advertised addresses of a peer are used during
reconnection. This fixes a bug previously demonstrated in an itest.
2021-10-04 14:57:50 +02:00
Elle Mouton
169316eba2 server: fetch addr from db if outbound too
This commit just ensures that we fetch the lastest advertised addresses
for a peer from the db for both inbound and outbound peers. The reason
for seperating this into its own commit is to make future commits in
this PR easier to review.
2021-10-04 14:57:49 +02:00
Elle Mouton
004ce640d0 server: exit early if not persistent peer
The point of this commit is to make future commits in the same PR easier
to review. All that this commit does is exit early if the peer we are
considering is not persistent instead of having a bunch of logic
indented in an if-clause.
2021-10-04 14:57:49 +02:00
Elle Mouton
18909e1a8e lntest: show that multi addresses are not used
This commit adds an itest to demonstrate that if a peer advertises
multiplie external IP addresses, then they will not all be used to
reconnect to the peer during reconnection. This will be fixed in a
follow-up commit.
2021-10-04 14:57:49 +02:00
Elle Mouton
5177ec2f84 lntest: create persistent connection
This commit adds a ConnectNodesPerm function to the itest NetworkHarness
so that persistent connections between nodes can be mocked.
2021-10-04 14:57:49 +02:00