Commit Graph

61 Commits

Author SHA1 Message Date
eugene
dcdf36f410 lnd+funding: move Manager to funding, change references 2020-12-17 10:45:05 -05:00
eugene
936227798a lnd: remove openChanReq, call InitFundingWorkflow with InitFundingMsg 2020-12-17 09:50:48 -05:00
Eugene
4d238cfa2f lnd: export ChainControl, ChainRegistry 2020-10-29 15:20:00 -04:00
Eugene
f4fe76aaf1 chainreg: add Config, move chainparams.go
Creates a Config that initializes the chainregistry struct in the
lnd package. Also moves all of chainparams.go to the chainreg
package.
2020-10-29 15:19:58 -04:00
Johan T. Halseth
dbeafe8832
autopilot: rename to Capacity to Balance, define ChannelInfo()
We rename the field Capacity on local channels to Balance, define a new
method ChannelInfo on the manager config that let us query the database
for our latest channels state. Using this we will use the current local
balance instead of the channel capacity when doing allocation
calculations.
2020-10-05 12:24:07 +02:00
Johan T. Halseth
d40cf6b592
autopilot: split channel definition into LocalChannel/ChannelEdge
Since non-local channels won't have a balance field, we split the
definitions in anticipation of adding one.
2020-10-05 12:24:07 +02:00
Johan T. Halseth
3e1755ee99
autopilot: remove unimpleneted SpliceIn/Out methods 2020-10-05 12:16:50 +02:00
yyforyongyu
ef38b12fda
multi: use timeout field in dialer 2020-09-16 11:50:04 +08:00
nsa
3791c9efcb lnd: removing activeNetParams global, passed around instead via configs
This commit removes the activeNetParams global in chainparams.go. This
is necessary to isolate code from the lnd package so we can import it
for use in tests, other projects, etc.
2020-08-11 11:41:24 -04:00
Olaoluwa Osuntokun
f58b00ef55
multi: split database storage into remote and local instances
In this commit, we split the database storage into two classes: remote
and local data. If etcd isn't active, then everything is actually just
local though we use two pointers everywhere. If etcd is active, then
everything but the graph goes into the remote database.
2020-08-07 18:44:02 -07:00
yyforyongyu
b01947b7dc lnd: fix go fmt 2020-07-08 16:46:51 +08:00
vctt94
474ce4ae25 server: Add max value in flight to server 2020-07-02 15:49:19 -03:00
Oliver Gugger
7f1b865b53
multi: rename server's identityPriv to identityECDH 2020-05-20 09:05:14 +02:00
Oliver Gugger
9ed1cd623f
config+lncfg: move config structs to lncfg, drop suffix 2020-05-14 14:37:48 +02:00
Andras Banki-Horvath
556e3525ea misc: fix error formatting in multiple files 2020-04-24 19:15:08 +02:00
Johan T. Halseth
c9c667bbf2
pilot: log whether autopilot is active at startup 2020-03-11 12:56:16 +01:00
Joost Jager
61e114f201
autopilot: take channel min htlc from config 2019-12-11 00:17:10 +01:00
Joost Jager
ddb98fcc41
multi: distinguish between htlc in and out constraints 2019-12-11 00:16:57 +01:00
Johan T. Halseth
7524265ab1
autopilot: trigger agent channel open on new scores
This commit adds a new signal to the autopilot agent, meant to signal
when any of the available heuristics has gotten an update.

We currently use this to trigger a new channel opening after the
external scores have been updated.
2019-10-31 10:17:31 +01:00
chokoboko
c38f241b51 pilot: fix log message in initAutoPilot 2019-09-06 17:04:47 +03:00
Conner Fromknecht
e2a53f71d0
pilot+discovery: remove info spews 2019-08-20 14:13:05 -07:00
Johan T. Halseth
bf7f392c11
autopilot: use subtractFees when funding channel
To make the autopilot able to account for fees, we let it use the
subtractFees option when opening channels.

This makes sure that each channel we attempt to open will eat at most
Amt out of our budget. Previously fees would eat into our funds in
addition, causing us to deplete our funds more than expected on each
channel opening.
2019-07-18 00:58:12 +02:00
Johan T. Halseth
187c8bc0b5
config+autopilot: make conftarget configurable 2019-06-08 17:29:33 +02:00
Johan T. Halseth
9a7f24d2d3
autopilot: extract default fee estimate target conf into constant 2019-06-08 17:22:34 +02:00
Johan T. Halseth
b53899c43c
lnd: rename package main->lnd 2019-04-23 20:57:33 +02:00
Johan T. Halseth
8ab718368d
lnd+pilot+autopilot: use config to set active autopilot heuristics 2019-01-23 09:05:42 +01:00
Johan T. Halseth
36e7694e8e
config+pilot: define autopilot.heuristic
And validate the config set by the user.
2019-01-23 09:05:42 +01:00
Johan T. Halseth
f48c8f91c4
lnd+pilot: use WeightedCombAttachment
We make the default autopilot agent use the WeightedCombAttachment.
Currently it uses only one sub-heuristic, prefAttachment.
2019-01-21 09:44:38 +01:00
Johan T. Halseth
3739c19ef8
autopilot/pref_attachment: rename ConstrainedPrefAttachment->PrefAttachment
Since the ConstrainedPrefAttachment no longers require the heuristic to
be aware of the autopilot constraints, we rename it PrefAttachment.
2019-01-08 10:10:59 +01:00
Johan T. Halseth
1d82e12fcf
autopilot: define AgentConstraints
To decouple the autopilot heuristic from the constraints, we start by
abstracting them behind an interface to make them easier to mock. We
also rename them HeuristicConstraints->AgentConstraints to make it clear
that they are now constraints the agent must adhere to.
2019-01-08 10:10:58 +01:00
Johan T. Halseth
cff42e06c8
pilot+lnd: let autopilot.Manager manage pilot-agent
This commit moves the responsibility of managing the life cycle of the
autopilot from main to the autopilot Manager. It utilizes the recently
introduced autopilot Manager, and just sets up the necessary interfaces
for the Manager to properly set up the required subscriptions when
starting the agent.
2018-12-13 12:26:29 +01:00
Johan T. Halseth
35f4ec84d1
autopilot/prefattach: use HeuristicConstraints
This commit makes the pref attach heuristic and the agent use the
HeuristicConstraints internally.
2018-12-06 11:25:30 +01:00
Wilmer Paulino
0a2986355e
pilot: improve error when unable to reach any of a peer's addresses 2018-08-29 02:06:03 -07:00
Wilmer Paulino
e1a4657427
pilot: remove disconnection logic from chanController
In this commit, we remove the disconnection logic within the
chanController when failing to open a channel with a peer. We do this as
it's already done within the autopilot agent, where it should be, and
because it's possible that we were already connected to this node and we
happened to disconnect them anyway.
2018-08-29 02:06:02 -07:00
Wilmer Paulino
e1a376d9f8
autopilot: use updateBalance rather than tracking balance explicitly
In this commit, we modify the balanceUpdate autopilot signal to update
the balance according to what's returned to the WalletBalance callback
rather than explicitly tracking the balance. This gives the agent a
better sense of what the wallet's balance actually is.
2018-08-29 02:06:02 -07:00
Conner Fromknecht
93f1994dc5
pilot: signal OnNodeUpdates to autopilot 2018-08-23 18:58:12 -07:00
Olaoluwa Osuntokun
4c51f9b5ae
Merge pull request #1693 from wpaulino/autopilot-zero-conf-inputs
multi: allow use of unconfirmed outputs for funding transactions
2018-08-17 17:06:09 -07:00
Johan T. Halseth
2a3b52535e
autopilot: check if already connected before returning error
This commit fixes a small bug that could cause us to disconnect an
already connected peer if no addresses where provided to the ConnectPeer
method. Now we instead first check if we are already connected, and
return early.
2018-08-17 09:26:54 +02:00
Wilmer Paulino
7724d86801
config+pilot: add flag to specify min confs for autopilot agent 2018-08-16 20:19:31 -07:00
Wilmer Paulino
5c414bb1d0
multi: make OpenChannel take in openChanReq 2018-08-16 20:19:26 -07:00
Wilmer Paulino
454b549c7e
autopilot+pilot: refactor connection logic out of OpenChannel
In this commit, we refactor the existing connection logic outside of the
ChanController's OpenChannel method. We do this as previously it was
possible for peers to stall us while attempting to connect to them. In
order to remedy this, we now attempt to connect the peer before tracking
them in our set of pending opens.
2018-08-16 20:17:03 -07:00
Wilmer Paulino
89325a13b7
autopilot+config: support opening private channels with autopilot agent 2018-08-10 20:45:59 -07:00
Wilmer Paulino
9d2eeb6304
multi: update to latest fee estimation interface 2018-08-09 17:29:52 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
Wilmer Paulino
2e0484be19
multi: ensure addresses are no longer assumed to be TCP addresses only
In this commit, we go through the codebase looking for TCP address
assumptions and modifying them to include the recently introduced onion
addresses. This enables us to fully support onion addresses within the
daemon.
2018-06-04 20:41:49 -07:00
Conner Fromknecht
f963f91a3c
multi: use mutex-guarded ShortChanID() on OpenChannel 2018-05-09 16:06:49 -07:00
Dimitris Tsapakidis
4009f7f874 multi: fix typos in comments 2018-04-17 19:03:27 -07:00
Johan T. Halseth
208d1199ef
pilot: set remoteCsvDelay=0 (default) for OpenChannel 2018-03-22 14:54:00 +01:00
Olaoluwa Osuntokun
76f7a66259
config+pilot: add new config params to specify min+max autopilot chan size
In this commit, we add two new configuration parameters to allow users
to specify the min and max size that the autopilot agent will create.
This is useful as now users can set the values to more or less the same
size, which will allow them to control the size of each created
channel.

Before this commit, if this wasn’t set, then the agent would try to
shove as much money into a channel up until the max chan size. This was
nice on testnet, but on main net, users will likely not want all their
funds to be in a single channel, and instead be distributed across many
channels. With things like AMP, have more channels becomes more
desirable.
2018-03-18 17:10:28 -07:00
Olaoluwa Osuntokun
602048ae5c
pilot: if unable to establish channel, disconnect peer
In this commit, we fix a quick in the main autopilot handling. If we’re
unable to establish a channel to a peer for w/e reason, then we’ll
disconnect the peer. With this tactic, we avoid unnecessarily building
up tens of peers for no reason at all.
2018-03-10 16:53:03 -08:00