Commit Graph

8165 Commits

Author SHA1 Message Date
Johan T. Halseth
12a1d05127
fundingmanager: make SendToPeer sync
Since the funding flow requires messages to go through, make use of
sync version of SendToPeer. Using the async version we would risk that
the message was dropped and the process would stall (it would properly
continue after a restart though).
2019-10-24 13:08:08 +02:00
Johan T. Halseth
018737a80a
Merge pull request #3627 from guggero/witness-timelock-type
input+sweep: log input witness types instead of CSV/CLTV count
2019-10-24 11:08:33 +02:00
Oliver Gugger
05096b0c2d
input+sweep: log input witness types instead of CSV/CLTV count 2019-10-23 17:09:31 +02:00
Johan T. Halseth
fd906475dd
Merge pull request #3569 from guggero/chainntfs-addr-reuse
chainntnfs: fix nil pointer on address reuse
2019-10-23 12:45:57 +02:00
Joost Jager
3cfd1ebb03
Merge pull request #3547 from joostjager/non-strict-error
htlcswitch: fix non-strict forwarding failures
2019-10-23 11:42:41 +02:00
Oliver Gugger
fa948c23fe
chainntnfs: add test that validates fixed nil pointer dereference 2019-10-23 11:25:30 +02:00
Oliver Gugger
51c066e7ed
chainntnfs: don't register notifications twice if details exist 2019-10-23 11:19:25 +02:00
Joost Jager
200be87212
htlcswitch: fix returned failure for insufficient balance
In the scenario where the requested channel does not have enough balance
and another channel towards the same node generates a different failure,
we erroneously returned UnknownNextPeer instead of the expected
TemporaryChannelFailure.

This commit rewrites the non-strict forwarding logic in the switch to
return the proper failure message. Part of this is moving the link
balance check inside the link.
2019-10-23 09:57:34 +02:00
Joost Jager
e1b7cfe2e5
htlcswitch/test: test additional forwarding scenarios 2019-10-23 09:57:32 +02:00
Joost Jager
4ea8927845
htlcswitch/test: add forward mock result 2019-10-23 09:57:30 +02:00
Joost Jager
cb85095ab0
htlcswitch/test: assert on replied failure message 2019-10-23 09:57:28 +02:00
Joost Jager
dcf7a8b871
htlcswitch/test: create genID function 2019-10-23 09:57:26 +02:00
Joost Jager
cf98e99001
htlcswitch: remove source hop check
This is already checked in EligibleToForward()
2019-10-23 09:57:24 +02:00
Joost Jager
5404348f51
htlcswitch: rename policy check functions 2019-10-23 09:57:22 +02:00
Joost Jager
566680defb
htlcswitch: extract failure message creation 2019-10-23 09:57:20 +02:00
Joost Jager
aa359160de
htlcswitch: return consistent failure message for internal error 2019-10-23 09:57:18 +02:00
Olaoluwa Osuntokun
8ed7583448
Merge pull request #3462 from joostjager/mc-extrapolate
routing+routerrpc: improve prob. estimation for untried connections
2019-10-22 17:30:00 -07:00
Wilmer Paulino
254de64d4c
Merge pull request #3533 from alrs/macaroons-test-fixes
macaroons: Test Improvements
2019-10-22 17:22:42 +02:00
Wilmer Paulino
239abded15
Merge pull request #3615 from Meshugah/patch-1
Fix Formatting of *Wrong*
2019-10-22 17:17:58 +02:00
Wilmer Paulino
0b2ef8bb4e
Merge pull request #2813 from wereHamster/tor-target-ip-address
Tor option to override target IP address
2019-10-22 17:15:54 +02:00
Joost Jager
1fac41deed
routing+routerrpc: improve prob. estimation for untried connections
This commit changes mission control to partially base the estimated
probability for untried connections on historical results obtained in
previous payment attempts. This incentivizes routing nodes to keep all
of their channels in good shape.
2019-10-22 15:52:38 +02:00
Joost Jager
fab13900e2
routing+routerrpc: remove probability estimates from mc state snapshot
Probability estimates are amount dependent. Previously we assumed an
amount, but that starts to make less sense when we make probability more
dependent on amounts in the future.
2019-10-22 15:52:36 +02:00
Joost Jager
559d3c0910
routing: also fail pairs for node-level failures
This commit modifies the interpretation of node-level failures.
Previously only the failing node was marked. With this commit, also the
incoming and outgoing connections involved in the route are marked as
failed.

The change prepares for the removal of node-level failures in mission
control probability estimation.
2019-10-22 15:52:34 +02:00
Joost Jager
843c87a203
routing: create mc getWeight method 2019-10-22 15:52:32 +02:00
Joost Jager
a3f7dbc633
routing: change representation of pair results in mc
This commit changes the in-memory structure of the mission control
state. It prepares for calculation of a node probability. For this we
need to be able to efficiently look up the last results for all channels
of a node.
2019-10-22 15:52:30 +02:00
Joost Jager
aefbee78d6
routing: use pairResult constructors
To make it explicit whether a failure or a success result is
instantiated.
2019-10-22 15:52:28 +02:00
Joost Jager
37ef46bc48
routing/test: extract mission control test parameters 2019-10-22 15:52:26 +02:00
Vignesh Karthikeyan
2520d0a996
Fix Formatting of *Wrong*
There is a spacing issues, and thus a formatting 
issue, in the file, code_contribution_guidelines.md
2019-10-19 16:48:32 +05:30
Conner Fromknecht
21a40daf58
Merge pull request #3609 from bitromortac/fwdinghistory-msat-amounts
lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory
2019-10-18 09:16:44 +02:00
bitromortac
3af91fc9b9 lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory 2019-10-16 19:50:58 +02:00
Conner Fromknecht
93247d0304
Merge pull request #3557 from guggero/loop-sweeper-integration
input+sweep: rework witness type into interface to be used externally
2019-10-16 13:09:03 +02:00
Conner Fromknecht
7408fe51ee
Merge pull request #2352 from sangaman/jstype-string
lnrpc: set JS_STRING option for chan_id
2019-10-16 13:02:08 +02:00
Conner Fromknecht
dbc0e88584
Merge pull request #3564 from joostjager/htlcswitch-logging
build+htlcswitch+lnwallet: add prefix logger
2019-10-16 13:00:36 +02:00
Conner Fromknecht
c10eacaa24
Merge pull request #3532 from guggero/refactor-log-writer
build+lnd: refactor reusable log file rotator code into build package
2019-10-16 12:59:39 +02:00
Wilmer Paulino
73ceb9a06e
Merge pull request #3603 from cryptagoras/patch-2
discovery/gossiper: fix minor typo
2019-10-15 14:21:21 +02:00
cryptagoras
0ad6c4748f
discovery/gossiper: fix minor typo
It was missing a space
"addingto waiting batch" -> "adding to waiting batch"
2019-10-15 14:16:03 +03:00
Olaoluwa Osuntokun
a623f9d3e8
Merge pull request #3593 from halseth/neutrino-cfilter-return-error
[neutrino] Handle GetCFilter fetch errors
2019-10-15 12:30:29 +02:00
Johan T. Halseth
753f30a6ff
chainntnfs/neutrino: don't ignore failed filter fetches
Earlier GetCFilter could return a nil-error along with a nil-filter in
cases where we failed to fetch the filter. We would just ignore the
block causing us to miss potential crucial information.

Now that GetCFilter will return an error in cases where the fetch
failed, the filter will never be nil (even for blocks with only coinbase
transactions), and we'll instead return an error.

We also increase the number of retries for the filter from the default 2
to 5.
2019-10-15 11:25:31 +02:00
Johan T. Halseth
610a93e2ff
routing/chainview: check GetCFilter error
Since the filter will never be nil in non-error cases now, remove the
nil-check.
2019-10-15 10:31:25 +02:00
Johan T. Halseth
5cbef663e4
go mod: update btcd+neutrino+btcwallet 2019-10-15 10:31:23 +02:00
Daniel McNally
f437b35fc6
lnrpc: set JS_STRING option for chan_id
This sets the `jstype` option to `JS_STRING` for all `chan_id` fields
in the proto rpc definition. `chan_id` is a 64 bit integer, which is
not natively supported by javascript's floating-point `number` with
only 52 bit precision. Nevertheless, by default protobuf will use the
`number` type for 64 bit integer fields in javascript, which can cause
loss of precision problems with `chan_id`. Explicitly setting the type
for javascript as a string will prevent these issues, and should not
interfere with its use as an identifier.
2019-10-14 14:53:54 -04:00
Olaoluwa Osuntokun
faacd8d5c4
Merge pull request #3595 from wpaulino/max-cltv-expiry-pathfinding
routing+routerrpc: take max cltv limit into account within path finding
2019-10-14 17:29:45 +02:00
Olaoluwa Osuntokun
f5113bc85f
Merge pull request #3597 from Roasbeef/revert-migrations
channeldb: revert to prior migration policy
2019-10-14 16:44:50 +02:00
Oliver Gugger
fb0051a318
input+sweep: rework witness type into an interface 2019-10-14 15:32:54 +02:00
Oliver Gugger
8e4a897a60
sweep: use chain notifier instead of chain IO for best block
Because the BestBlock method of ChainIO is not exposed through any
RPC we want to get rid of it so we can use the sweeper outside of
lnd too. Since the chain notifier now also delivers the current best
block we don't need the BestBlock method any more.
2019-10-14 15:32:54 +02:00
Oliver Gugger
b6dda143d0
sweep: use bbolt DB directly instead of channeldb 2019-10-14 15:32:53 +02:00
Oliver Gugger
4190146066
sweep: add test to make sure fee estimation is correct 2019-10-14 15:32:53 +02:00
Oliver Gugger
3ca2c363fe
lnd+rpcserver: initialize new log writer correctly 2019-10-14 14:56:32 +02:00
Oliver Gugger
94f49192cf
lnd: refactor sub logger setup to use new rotating log writer 2019-10-14 14:56:31 +02:00
Oliver Gugger
d3995a73ae
build: move log rotator code 2019-10-14 14:56:31 +02:00