Commit Graph

5988 Commits

Author SHA1 Message Date
yancy ribbens
a75914fbe1 enable btct and btcctl mainnet to be invoked from docker 2019-01-12 13:03:23 -06:00
Wilmer Paulino
55b580f2b8
Merge pull request #2462 from Roasbeef/fix-length-update
lnwire: ensure we precisely encode the length for onion errors w/ cha…
2019-01-11 16:12:04 -08:00
Olaoluwa Osuntokun
2d717fdc44
Merge pull request #2446 from cfromknecht/lncfg-lnaddress-parsing
lncfg: NetAddress parsing
2019-01-11 15:42:48 -08:00
Olaoluwa Osuntokun
400a1d3282
Merge pull request #2431 from cfromknecht/keyring-remote-delay-retribution
lnwallet: Add keyring and remote CSV delay to BreachRetribution
2019-01-11 15:33:16 -08:00
Olaoluwa Osuntokun
5fde362420
Merge pull request #2452 from cfromknecht/stricter-has-active-link
htlcswitch: stricter HasActiveLink
2019-01-11 15:28:21 -08:00
Olaoluwa Osuntokun
f83fde8483
lnwire: ensure we precisely encode the length for onion errors w/ chan updates
In this commit we fix a compatibility issue with other implementations.
Before this commit, when writing out an onion error that includes a
`ChannelUpdate` we would use the `MaxPayloadLength` to get the length to
encode. However, a recent update has modified that to be the max
`brontide` payload length as it's possible to pad out the message with
optional fields we're unaware of. As a result, we would always write out
a length of 65KB or so. This didn't effect our parser as we ignore the
length and decode the channel update directly as we don't need the
length to do that. However, other implementations depended on the length
rather than just reading the channel update, meaning that they weren't
able to decode our onion errors that had channel updates.

In this commit we fix that by introducing a new
`writeOnionErrorChanUpdate` which will write out the precise length
instead of using the max payload size.

Fixes #2450.
2019-01-11 14:21:48 -08:00
Conner Fromknecht
043631e59f
Merge pull request #2430 from cfromknecht/remove-breach-txn-from-retribution
lnwallet: Remove breach txn from NewBreachRetribution
2019-01-11 13:47:30 -08:00
Johan T. Halseth
a324691013
Merge pull request #2289 from ccdle12/unsettled-balance
rpcserver+lnd_test: fixing unassigned UnsettledBalance field
2019-01-11 10:50:56 +01:00
Johan T. Halseth
3c2b46eb8c
Merge pull request #2445 from cfromknecht/netann-logging
netann: Add NANN subsystem logger
2019-01-11 10:45:29 +01:00
Johan T. Halseth
058b0e5767
Merge pull request #2454 from cfromknecht/handle-write-errors
peer: handle message encoding errors on write
2019-01-11 09:36:21 +01:00
Conner Fromknecht
2cf220a137
peer: handle message encoding errors on write
In this commit, we modify the peer's writeMessage
method to properly handle errors returned from
encoding an lnwire message and from setting the
write deadline on the connection. Since an error
would likely result in an empty byte slice, the
worse case seems to be that we may have tried to
send an empty message on the wire.

Lastly, we correct the way we compute bytes sent
on the wire to properly count the number of bytes
*written*, and not just the length of the encoded
message.
2019-01-10 19:49:44 -08:00
ccdle12
264293ff89 rpcserver+lnd_test: adding PendingHtlcs to UnsetteldBalance
rpcserver: summing PendingHtlcs and assigning to UnsettledBalance

lnd_test: adding tests for UnsettledBalance
2019-01-10 22:11:38 -05:00
Olaoluwa Osuntokun
cd15de4144
Merge pull request #2259 from yancyribbens/update-dockerfile-image
update lnd dockerfile image
2019-01-10 17:40:52 -08:00
Conner Fromknecht
6ae77bc3cb
htlcswitch/switch_test: adds HasActiveLink unit test 2019-01-10 16:34:03 -08:00
Conner Fromknecht
164250d1cd
htlcswitch/switch: check EligibleToForward in HasActiveLink
This commit modifies the behavior of the
HasActiveLink method within the switch to
only return true if the link is in the
link index and is eligible to forward
HTLCs.

The prior version returns true whenever
the link is found in the link index,
which may return true for pending
channels that are not actually active.
2019-01-10 16:34:02 -08:00
Yancy Ribbens
8fef5608b5 update lnd dockerfile image to golang:1.11-alpine for lnd 2019-01-10 18:21:12 -06:00
Conner Fromknecht
eb1167cc52
Merge pull request #2418 from cfromknecht/connectpeer-logging
rpcserver: add connectpeer log, fix existing formatting
2019-01-10 13:51:48 -08:00
Conner Fromknecht
eb2f5cecf6
multi: remove breach tx arg from NewBreachRetribution args
This commit removes the breach transaction from the
arguments passed to NewBreachRetribution. We already
keep all prior remote commitments on disk in the
commitment log, and load that transaction from disk
inside the method. In practice, the one loaded from
disk will be the same one that is passed in by the
caller, so there should be no change in behavior
as we've already derived the appropriate state number.

This changes makes integration with the watchtower
client simpler, since we no longer need to acquire
the breaching commitment transaction to be able to
construct the BreachRetribution. This simplifies
not only the logic surrounding transient backsups,
but also on startup (and later, retroactively
backing up historic updates).
2019-01-10 13:13:38 -08:00
Olaoluwa Osuntokun
9f7d2f6cbc
Merge pull request #2449 from cfromknecht/router-avoid-naked-spew
routing/router: avoid naked spew of channel policies
2019-01-10 12:44:38 -08:00
Conner Fromknecht
a5b22788bf
routing/router: avoid naked spew of channel policies 2019-01-09 23:54:41 -08:00
Conner Fromknecht
a8b2c093aa
Merge pull request #2416 from cfromknecht/netann-node-signer
netann: move NodeSigner out of main package
2019-01-09 17:01:00 -08:00
Conner Fromknecht
381b5275c4
lncfg/address_test: test LNAddress parsing, refactor addr tests 2019-01-09 16:37:56 -08:00
Conner Fromknecht
198f9323cc
lncfg/address: add LN address parsing 2019-01-09 16:37:48 -08:00
Olaoluwa Osuntokun
b6fe6059a1
Merge pull request #2433 from cfromknecht/lookout-txid-logging
watchtower/lookout: correct txid + session id logging
2019-01-09 15:53:49 -08:00
Conner Fromknecht
97f4f10355
log: initialize NANN logger for netann pkg 2019-01-09 13:31:39 -08:00
Conner Fromknecht
4c8b64d2a6
netann/log: add NANN logger 2019-01-09 13:29:46 -08:00
Olaoluwa Osuntokun
a0c0e8edc9
Merge pull request #2341 from halseth/autopilot-weighted-heuristics
[autopilot] Decouple agent constraints from heuristics
2019-01-08 20:15:57 -08:00
Conner Fromknecht
7987a41c0d
nodesigner: remove file, now in netann pkg 2019-01-08 16:18:55 -08:00
Conner Fromknecht
32041e703b
server: replace nodeSigner in main with netann.NodeSigner 2019-01-08 16:18:39 -08:00
Conner Fromknecht
30441871d3
netann/node_signer: copy and export NodeSigner from main 2019-01-08 16:18:06 -08:00
Johan T. Halseth
3ab01898fb
Merge pull request #2417 from cfromknecht/min-backoff
server: configurable min backoff
2019-01-08 15:07:50 +01:00
Johan T. Halseth
5c41243f35
Merge pull request #2118 from halseth/make-fmt-2
make: ensure make fmt is run with -s flag
2019-01-08 10:32:34 +01:00
Johan T. Halseth
5b1e72a019
autopilot/interface+agent: return NodeScore from NodeScores
Since NodeScores no longer returns fully populated AttachmentDirectives,
we make this explicit by defining a new type NodeScore that includes a
subset of what the AttachmentDirective does.
2019-01-08 10:23:50 +01:00
Johan T. Halseth
25de66d27b
autopilot/interface+choice: add NodeScore type
We create a new type NodeScore which is a tuple (NodeID, score). The
weightedChoice and chooseN algorithms are altered to expect this type.

This is done in order to simplify the types we are using, since we were
only using a subset of the fields in AttachmentDirective.
2019-01-08 10:23:48 +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
ccf4b7feab
autopilot: move address lookup from heuristic to agent
To avoid having the heuristics deal with (possibly conflicting) address
lookups, we let the agent handle them.
2019-01-08 10:10:59 +01:00
Johan T. Halseth
cfd237bf1f
autopilot: move determining chanSize from heuristic to agent
Since we want to combine scores from multiple heuristics, things get
complicated if the heuristics report their own individual channel sizes.
Therefore we change the NodeScores interface slightly, letting the agent
specify the wanted channel size, and let the heuristic score the nodes
accordingly.
2019-01-08 10:10:59 +01:00
Johan T. Halseth
d5f3714f86
autopilot/agent: return early if no funds available
If there are less funds available than the minumum channel size, there's
no reason to score candidates, so we continue early.
2019-01-08 10:10:59 +01:00
Johan T. Halseth
d0c4e253c6
autopilot/interface: remove NeedMoreChans from AttachmentHeuristic
Since the agent is now querying the constraints directly, NeedMoreChans
is no longer needed on the heuristic.
2019-01-08 10:10:59 +01:00
Johan T. Halseth
fbfc9a53af
autopilot: TestConstrainedPrefAttachmentNeedMoreChan->TestConstraintsChannelBudget
Since the constraints are no longer something the heuristic needs to be
aware of, we move the test.
2019-01-08 10:10:58 +01:00
Johan T. Halseth
0e1713956b
autopilot/agent: call ChannelBudget on constrainsts
We let the agent call ChannelBudget on its constraints directly, and
not go through the heuristic. This is needed since when we want to have
multiple active heuristics concurrently, it won't make sense anymore to
ask each of the heuristics.

The mockConstraints are also updated to act as the mockHeuristic did
before, by making it possible to control the responses it gives by
sending them on the contained channels.
2019-01-08 10:10:58 +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
Olaoluwa Osuntokun
21460c9e67
Merge pull request #2293 from halseth/unit-tests-weighted-choice
[autopilot] weighted choice unit tests and optimizations
2019-01-07 19:42:29 -08:00
Olaoluwa Osuntokun
0725fecc12
Merge pull request #2412 from Roasbeef/node-alias-validation
lnwire+peer: fully validate node aliases on the wire, don't d/c due to invalid aliases
2019-01-07 19:35:39 -08:00
Conner Fromknecht
bb8469d8ee
watchtower/lookout: correct txid + session id logging 2019-01-07 19:20:45 -08:00
Conner Fromknecht
75ec66d9b3
Merge pull request #1975 from halseth/fwdtrigger-force
[tests] Force tick on FwdEventTicker
2019-01-07 17:46:58 -08:00
Conner Fromknecht
088fb33718
contractcourt: nil keyring curves on breach info 2019-01-07 17:15:45 -08:00
Conner Fromknecht
cd54625c2d
lnwallet/channel: add keyring + remote csv to breach info 2019-01-07 17:15:33 -08:00
Olaoluwa Osuntokun
154a8a95d8
Merge pull request #2424 from alexbosworth/patch-7
lnwallet: fix trivial comment typo
2019-01-07 17:02:29 -08:00
Olaoluwa Osuntokun
4ac54dce25
Merge pull request #2355 from joostjager/move-invoices
invoices: create package
2019-01-07 16:56:22 -08:00