Commit Graph
8447 Commits
Author SHA1 Message Date
Joost Jager 5d4ceca038 tlv: remove unused error return value
This commit also modifies a previous migration. Because the change is so
limited, we don't consider this a significant risk.
2019-12-04 13:27:29 +01:00
Joost Jager 883f9e5f9a Merge pull request #3749 from joostjager/extended-routing-failures
routing: local balance check before path finding
2019-12-04 12:17:17 +01:00
Johan T. Halseth e28c5a1e89 Merge pull request #3762 from halseth/mobile-subserver-goimports
mobile: run goimports on generated files
2019-12-04 11:28:07 +01:00
Joost Jager 9ae014edf6 routing: use self instead of source node for creating unified policy
A unified policy differs between local channels and other channels on
the network. There is more information available for local channels and
this is used in the unified policy.

Previously we used the pathfinding source pubkey to determine whether to
apply the local channel logic or not. If queryroutes is executed with a
source node that isn't the self node, this wouldn't work.
2019-12-04 09:45:09 +01:00
Joost Jager 97344af8f3 routing: local balance check 2019-12-04 09:45:07 +01:00
Johan T. Halseth a6ef03c777 Merge pull request #3743 from cfromknecht/in-order-sids
lnwire: assert sorted short channel ids
2019-12-04 08:56:02 +01:00
Johan T. Halseth 4d2813900e Merge pull request #3776 from matheusdtech/random-ports
lntest: Use TCP ports not based in nodeID
2019-12-04 08:46:37 +01:00
Conner Fromknecht 884c5f0125 Merge pull request #3584 from bjarnemagnussen/ltcd-docker
docker: fix ltcd ports
2019-12-03 13:07:34 -08:00
Matheus Degiovani e98a92233f lntest: Use TCP ports not based in nodeID
This changes TCP port selection in integration tests from being
sequential, based on the node ID to being sequential but tested before
assigment.

This should reduce the number of flaky tests that fail due to the port
already being used by another process in the CI server.
2019-12-03 16:12:14 -03:00
Joost Jager db21c394b2 Merge pull request #3782 from joostjager/zero-attempt-cost-prob
routing: improve equal cost route comparison
2019-12-03 08:28:51 +01:00
Olaoluwa Osuntokun f2f79d3990 Merge pull request #3659 from Roasbeef/external-funding-chanfunding
chanfunding: create new package to abstract over funding workflows
2019-12-02 18:13:38 -06:00
Olaoluwa Osuntokun b1940d6779 lnwallet: fix bug in verifyFundingInputs skip dual funder tests for neutrino
In this commit, we fix a long standing bug within the newly created
`verifyFundingInputs` method. Before this commit, the method would
attempt to derive the pkScript by looking at the last items on the
witness stack, and making a p2wsh output script from that. This is
incorrect as typically non of these scripts will actually be p2wsh, and
instead will be p2wkh. We fix this by using the newly available
`txscript.ComputePkScript` method to derive the proper pkScript.

This resolves an issue w.r.t passing incorrect arguments for all
backends, but an issue still stands for the neutrino backend. As is, we
pass a height hint of zero into the `GetUtxo` method call. With the way
the current utxo scanner is set up for neutrino, this'll cause it to
never find the UTXO, as it takes the height hint as a UTXO birth height,
rather than a lower bound of the birth of the UTXO.
2019-12-02 17:12:05 -06:00
Olaoluwa Osuntokun 6b729ec9f5 lnwallet: break early in TestLightningWallet when a sub-test fails 2019-12-02 17:11:58 -06:00
Olaoluwa Osuntokun c3a7da5ce7 lnwallet: add new test to exercise external channel funding 2019-12-02 17:11:54 -06:00
Olaoluwa Osuntokun 9926259da0 lnwallet: add new RegisterFundingIntent method
In this commit, we add a new method `RegisterFundingIntent` that allows
a caller to "inject" a pre-populated chanfunding.Intent into a funding
workflow. As an example, if we've already agreed upon the "shape" of the
funding output _outside_ the protocol, then we can use this to pass down
the details of the output, then leverage the normal wire protocol to
carry out the remainder of the funding flow.
2019-12-02 17:11:51 -06:00
Olaoluwa Osuntokun 6e9cbc19f9 lnwallet+funding: pass the pending channel ID into the reservation context
In this commit, we start to thread the pending channel ID from wire
protocol all the way down into the reservation context. This change will
allow negotiation to take place _outside_ the protocol that may result
in a particular chanfunding.Assembler being dispatched.
2019-12-02 17:11:46 -06:00
Olaoluwa Osuntokun c3157ae2c4 lnwallet: add awareness of chanfunding.ShimIntents
In this commit, we make the wallet aware of the second type of funding
intent: the ShimIntent. If we have one of these, then we don't need to
construct the funding transaction, and can instead just obtain the
outpoint directly from it.
2019-12-02 17:11:41 -06:00
Olaoluwa Osuntokun 7a64a7d3a4 lnwallet: delegate all channel funding logic to the new chanfunding package
In this commit, we begin to integrate the new channel funding package
into the existing codebase. With this set of changes, we'll no longer
construct and sign the funding transaction within this package, instead
delegating it to the new chanfunding package. We use the new
chanfunding.WalletAssembler to carry out all channel funding, providing
it with an implementation of all its interfaces backed by the wallet.
2019-12-02 17:11:36 -06:00
Olaoluwa Osuntokun d422ebbc66 lnwallet/chanfunding: introduce new channel funding abstractions
In this commit, we introduce a series of new abstractions for channel
funding. The end goal is to enable uses cases that construct the funding
transaction externally, eventually handing the funding outpoint to lnd.
An example of such a use case includes channel factories and external
channel funding using a hardware wallet.

We also add a new chanfunding.Assembler meant to allow external channel
funding in contexts similar to how channel factories
can be constructed. With this channel funder, we'll only obtain the
channel point and funding output from it, as this alone is enough to
carry out a funding flow as normal.
2019-12-02 17:11:32 -06:00
Olaoluwa Osuntokun 4e955dfac6 lnwallet: remove unused openChanDetails struct
We also remove some related and also unused attributes as well along the
way.
2019-12-02 17:11:29 -06:00
Olaoluwa Osuntokun 9eefdef262 chanfunding+lnwallet: move coin selection code into new chanfunding package
In this commit, we make an incremental change to move the existing coin
selection code into a new chanfunding package. In later commits, this
package will grow to serve all the lower level channel funding needs in
the daemon.
2019-12-02 17:11:25 -06:00
Olaoluwa Osuntokun f9d22cd900 funding: only broadcast the funding transaction if we actually have it 2019-12-02 17:11:21 -06:00
Olaoluwa Osuntokun 6753a02439 channeldb: add new NoFundingTxBit modifier to ChannelType
In this commit, we add a new bit to the existing ChannelType bitfield.
If this bit is set, then it signals that we have the funding transaction
stored on disk. A future change will enable lnd to have the funding
transaction be constructed externally, allowing for things like funding
from a hardware wallet, or a channel created as a sub-branch within an
existing channel factory.
2019-12-02 17:11:16 -06:00
Joost Jager 3aaf32dc2e routing: improve equal cost route comparison
When the (virtual) payment attempt cost is set to zero, probabilities
are no longer a factor in determining the best route. In case of routes
with equal costs, we'd just go with the first one found. This commit
refines this behavior by picking the route with the highest probability.
So even though probability doesn't affect the route cost, it is still
used as a tie breaker.
2019-12-02 14:23:57 +01:00
Olaoluwa Osuntokun d59aba35a0 Merge branch 'refresh-chan-id' 2019-11-27 15:21:42 -06:00
Olaoluwa Osuntokun 5bdb0d3d66 channeldb+lntest: code style fixes 2019-11-27 15:21:28 -06:00
Roei Erez 8b3dd9415e channeldb: refresh channel state within RefreshShortChanID
Refresh channel memory state whenever the short channel id is refreshed.
This is to make the in-memory channel consistent with the disk data.

Fixes #3765.
2019-11-27 15:10:00 -06:00
Joost Jager c15b0316a2 routing: use FailureReasonError for internal path finding errors 2019-11-27 15:21:12 +01:00
Joost Jager b5f1bde604 routing: add error var for pre-built route tried 2019-11-27 15:21:10 +01:00
Joost Jager ac2df9bbf4 routing: use simple errors for path finding 2019-11-27 15:21:08 +01:00
Joost Jager 6774b5a007 routing: remove unused error codes 2019-11-27 15:21:06 +01:00
Joost Jager 7e4f9dd70a routing/test: simplify context instantiation 2019-11-26 21:40:30 +01:00
Joost Jager 949a5c5a04 Merge pull request #3736 from joostjager/route-to-self
routing: allow route to self
2019-11-26 21:37:31 +01:00
Johan T. Halseth e8e5fd7abc mobile: run goimports on generated files
Subservers might depend on each other (notably walletrpc depends on
signrpc) so running goimports ensures they properly import each other.
2019-11-26 14:57:17 +01:00
Joost Jager 2d19201ede lnrpc+routerrpc+lncli: add allow_self_payments safety flag 2019-11-26 10:15:46 +01:00
Joost Jager f8e9efbf99 routing: allow route to self 2019-11-26 10:15:44 +01:00
Joost Jager 81b7798c03 routing: pop heap at the end of the loop
This prepares for routing to self.
2019-11-26 10:15:42 +01:00
Joost Jager 683282fa24 routing: check loop conditions at end
This prepares for routing to self. When checking the condition at the
start, the loop would terminate immediately because the source is equal
to the target.
2019-11-26 10:15:40 +01:00
Joost Jager 2b332893b7 routing/test: add test focusing on not having a cycle 2019-11-26 10:15:38 +01:00
Olaoluwa Osuntokun cb2b8b4513 Merge pull request #3693 from cfromknecht/tlv-invoice
migrate to tlv for invoice body
2019-11-25 18:00:52 -06:00
Olaoluwa Osuntokun ff268ac39d Merge pull request #3748 from halseth/falafel-updates
[mobile] Update readme and comments
2019-11-25 17:27:00 -06:00
Olaoluwa Osuntokun be4a1a2704 Merge pull request #3759 from wpaulino/travis-bitcoind-0.19.1
build: bump travis bitcoind version to 0.19.0.1
2019-11-25 17:25:18 -06:00
Wilmer Paulino 75dbfba4ec lntest: lower cpfp fee due to new bitcoind max fee restriction 2019-11-25 12:40:01 -08:00
Wilmer Paulino 44fa28b27b build: bump travis bitcoind version to 0.19.0.1 2019-11-25 10:59:00 -08:00
Conner Fromknecht 59c4db7f33 Merge pull request #3756 from cfromknecht/non-verbose-unit-tests
Makefile: non-verbose unit tests
2019-11-24 06:39:31 -08:00
Conner Fromknecht a83958408d Merge pull request #3648 from cfromknecht/safe-disconnect
config+itest: allow unsafe disconnect by default
2019-11-22 21:07:17 -08:00
Olaoluwa Osuntokun 74849e7325 Merge pull request #3737 from guggero/resume-scb
chanbackup: continue recovery if channel already exists
2019-11-22 19:40:47 -08:00
Olaoluwa Osuntokun 6356316a4c Merge pull request #3757 from cfromknecht/fix-nanonsecond-typo
lnrpc: fix nanonsecond typo
2019-11-22 16:24:41 -08:00
Conner Fromknecht 4c5b251748 Merge pull request #3750 from halseth/itest-flake-replacement-forceclose
lnd_test: fix race condition on simultanous force closes
2019-11-22 13:59:31 -08:00
Conner Fromknecht b07fb37c34 Merge pull request #3751 from halseth/itest-numactivenodes-mtx
lntest/node: add numActiveNodesMtx
2019-11-22 13:56:45 -08:00