Commit Graph

5785 Commits

Author SHA1 Message Date
Johan T. Halseth
d9eef4625e
autopilot/prefattach: populate Addrs field 2018-12-10 15:00:41 +01:00
Johan T. Halseth
55ba5fe654
autopilot/graph: add addresses to memNode 2018-12-10 14:56:54 +01:00
Olaoluwa Osuntokun
4d647b6e5d
lnrpc/signrpc: add macaroon perms for ComputeInputScript 2018-12-09 15:10:35 -08:00
Olaoluwa Osuntokun
5451211d19
Merge pull request #2007 from icota/max-backoff-config
Server: make maximum backoff configurable
2018-12-06 17:18:46 -08:00
Olaoluwa Osuntokun
c071a17ac3
Merge pull request #2006 from halseth/autpilot-score-attachement
Scoring based autopilot attachment heuristic
2018-12-06 16:59:12 -08:00
Olaoluwa Osuntokun
eb16427dfc
Merge pull request #2093 from Roasbeef/walletkit-service
lnrpc: add new WalletKit sub-RPC server
2018-12-06 16:53:27 -08:00
Olaoluwa Osuntokun
363b9926b7
rpc: extend the admin macaroon with signer capabilities
In this commit, we extend the admin macaroon with signer capabilities in
order to allow it to be used with the new signer sub-server. As a
result, users will need to clear out their old macaroons in order to
have the new improved admin macaroon generated. In the future, we may
want to restructure the way the admin macaroon functions: rather than
white listing each of these entities and operations, we can instead add
a catch all capability. This capability will instead allow access to any
call, as each new call would be modified to permit this capabilities and
no others.
2018-12-06 16:25:41 -08:00
Olaoluwa Osuntokun
273dee607b
lnrpc: remove oneof from signrpc.KeyDescriptor 2018-12-06 16:25:38 -08:00
Olaoluwa Osuntokun
844698048a
log: wire up the new WalletKit logger 2018-12-06 16:25:37 -08:00
Olaoluwa Osuntokun
14ca3bb012
config: add a new entry for the WalletKit sub-RPC server to subRpcServerConfigs 2018-12-06 16:25:36 -08:00
Olaoluwa Osuntokun
b492114016
chainregistry: add the keyRing and walletController to chainControl 2018-12-06 16:25:35 -08:00
Olaoluwa Osuntokun
406fd2a37e
lnrpc/walletrpc: implement the WalletKitServer gRPC service
In this commit, we implement the newly defiend WalletKitServer gRPC
service. We use the same template w.r.t build tags as the existing
signrpc service.
2018-12-06 16:25:34 -08:00
Olaoluwa Osuntokun
097b6f7f6d lnrpc/walletrpc: add new sub-RPC server, the WalletKit
In this commit, we add a new sub-RPC server to the existing set of gRPC
servers. This new sub-RPC server is the WalletKit. It's a utility
toolkit that contains method which allow clients to perform common
interactions with a wallet such as getting a new address, or sending a
transaction. It also includes some supplementary actions such as fee
estimation.

One thing to note in the RPC file is that we _import_ the existing
signer.proto file in order to get at some existing proto definitions
which are useful in our use case.
2018-12-06 16:24:54 -08:00
Olaoluwa Osuntokun
73e1f2957c
Merge pull request #2288 from cfromknecht/wtwire-error-handling
[trivial] watchtower/wtwire/wtwire: fix missed error handling
2018-12-06 16:08:08 -08:00
Conner Fromknecht
226640aa3c
watchtower/wtwire/wtwire: fix missed error handling 2018-12-06 15:49:53 -08:00
Johan T. Halseth
6130189d95
autopilot/interface+agent: remove Select 2018-12-06 14:26:28 +01:00
Johan T. Halseth
b3d315298c
autopilot/agent: use NodeScores to select channel candidates
This commit makes the autopilot agent use the new NodeScores heuristic
API to select channel candiates, instead of the Select API. The result
will be similar, but instead of selecting a set of nodes to open
channels to, we get a score based results which can later be used
together with other heuristics to choose nodes to open channels to.

This commit also makes the existing autopilot agent tests compatible
with the new NodeScores API.
2018-12-06 14:26:26 +01:00
Johan T. Halseth
e84bd29836
autopilot/agent: add weightedChoice and chooseN algorithm
The algorithms will be used to select nodes at random from the weighted
distribution set by the node's scores given by the heuristic.
2018-12-06 14:26:05 +01:00
Johan T. Halseth
be45697c6d
autopilot/prefattach_test: use NodeScores API for prefAttach tests
This commit converts the existing unit tests of Select into tests of
NodeScores.
2018-12-06 14:26:05 +01:00
Johan T. Halseth
5e8e54083f
autopilot/prefattach+interface: add API NodeScores
This commit adds a new method NodeScores to the AttachementHeuristic
interface. Its intended use is to score a set of nodes according to
their preference as channel counterparties.

The PrefAttach heuristic gets a NodeScores method that will score the
ndoes according to their number of already existing channels, similar to
what is done already in Select.
2018-12-06 14:26:05 +01:00
Johan T. Halseth
5ecc209c41
autopilot/interface+agent: remove NodeKey from AttachmentDirective
Instead parse the pubkey bytes only when needed.
2018-12-06 14:26:05 +01:00
Johan T. Halseth
89c3c5319f
autopilot/agent: split opening logic into own method
This commit takes the logic after the autopilot agent has decided that it
needs to open more channels, and moves it into a new method openChan.
2018-12-06 14:26:03 +01:00
Johan T. Halseth
26810fe928
autopilot/agent: split attachement directive attempts into method 2018-12-06 14:25:22 +01:00
Johan T. Halseth
fb10175ea5
autopilot/agent: add maps to agent struct
This commit moves the maps used by the controller loop to the Agent
struct, in preparation for breaking it up into smaller parts.
2018-12-06 14:24:18 +01:00
Johan T. Halseth
86e6d230f2
autopilot/agent: add attachment directive goroutine to wait group 2018-12-06 14:24:15 +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
Johan T. Halseth
e98d859882
autopilot: define HeuristicConstraints
This commit defines a new struct HeuristicConstraints that will be used
to keep track of the initial constraints the autopilot agent needs to
adhere to. This is currently done in the ConstrainedPrefAttachement
heuristic itself, but this lets us share these constraints and common
method netween several heuristics.
2018-12-06 11:20:09 +01:00
Igor Cota
02442ecbae Server: make maximum backoff configurable 2018-12-06 10:57:09 +01:00
Olaoluwa Osuntokun
45f49899ae
Merge pull request #2243 from joostjager/prune-single-direction
routing: prune single direction
2018-12-05 21:22:49 -08:00
Olaoluwa Osuntokun
1d1e9f2c44
Merge pull request #2030 from halseth/authsig-len
Validate own node announcement, signature length
2018-12-05 21:08:46 -08:00
Joost Jager
3ed16837e4
routing: prune channels unidirectional
In this commit we introduce pruning of channel edges instead of channels.
Channel failures apply to a single direction and it is unnecessarily
restricting to prune both directions.
2018-12-05 14:39:23 +01:00
Joost Jager
8b8e82a171
routing: remove route hop maps
Hop maps were used in a test to verify the population of the hop map
itself and further only in a single function (getFailedChannelID).
Rewrote that function and removed the hop maps completely.
2018-12-05 14:39:23 +01:00
Johan T. Halseth
3d7bbd6d72
channeldb/graph: write max 80 sig len for nodes 2018-12-05 09:31:26 +01:00
Johan T. Halseth
5dcd2a4530
gossiper: validate our own node announement 2018-12-05 09:31:25 +01:00
Joost Jager
42debc6c12
routing: fix node ordering in test graph
There is the general assumption that channel edge policy nodes are
ordered such that the node1 pubkey is smaller than the key of node 2. In
the test graph, this assumption didn't hold. This commit fixes the test
graph and also adds a check to prevent this from happening again.
2018-12-05 09:15:27 +01:00
Johan T. Halseth
349551373d
Merge pull request #2257 from yancyribbens/apk-docker-dependencies-fix
docker: fix dockerfile dependency bug
2018-12-05 08:26:53 +01:00
Olaoluwa Osuntokun
810afa937a
Merge pull request #2115 from halseth/disable-bit-decoupling
path finding: Disable bit decoupling
2018-12-04 17:31:08 -08:00
Olaoluwa Osuntokun
b8d6ac8cb2
Merge pull request #2270 from halseth/unit-test-go-sum
[make+mod] fetch correct btcd version
2018-12-04 16:35:08 -08:00
Johan T. Halseth
0ba4fb8605
make: don't hardcode commit date
As it won't correspond to the commit hash, include the whole version
string.
2018-12-04 14:09:33 +01:00
Johan T. Halseth
bafc44c14b
make: get btcd commit hash from go.mod
Since go.sum also contains historical commits, we must fetch currenct
commit hash from go.mod.
2018-12-04 13:50:51 +01:00
Johan T. Halseth
5f8425cb03
routing/pathfind_test: check error before attempting cleanup 2018-12-04 12:20:45 +01:00
Johan T. Halseth
67b018476c
routing/pathfind test: add TestPathSourceEdgesBandwidth
This commit adds a new test that checks that the bandwidth hints are
considered correclty for local channels, and that disable flags are
ignored in this case.
2018-12-04 12:20:45 +01:00
Johan T. Halseth
0b6a19866b
routing/pathfind: pass ignore disable flags for local channels
To decouple our own path finding from the graph state, we don't consider
the disable bit when attempting to use local channels. Instead the
bandwidth hints will be zero for local inactive channels.

We alos modify the unit test to check that the disable flag is ignored
for local edges.
2018-12-04 12:20:45 +01:00
Johan T. Halseth
20b9d5d000
routing: define graphParams and restrictParams
To avoid the findPath parameter list getting out of hand, we define new
structs that wraps the mandatory and optional parameters to findPath.
2018-12-04 12:20:44 +01:00
Olaoluwa Osuntokun
640fe2558b
discovery: update TestReceiveRemoteChannelUpdateFirst due to stricter stale node checks
A recent commit modified the `IsNodeStale` method in the mocks to mirror
the actual implementation in the gossiper. As a result, we now expect
one less node announcement to be broadcast.
2018-12-03 21:04:28 -08:00
Olaoluwa Osuntokun
da973315d4
hltcswitch: use build package to detect debug build 2018-12-03 20:40:12 -08:00
Olaoluwa Osuntokun
127bc71546
Merge pull request #2148 from xsb/rest-endpoints
Add missing REST endpoints for SignMessage and VerifyMessage
2018-12-03 20:14:09 -08:00
Olaoluwa Osuntokun
b4e4f40125
Merge pull request #2128 from mrfelton/fix/queryroutes-default-num-routes
queryroutes: set queryroutes numRoutes param default to 10
2018-12-03 20:12:44 -08:00
Olaoluwa Osuntokun
5ad2592891
Merge pull request #2123 from halseth/node-announcement-no-forward
[Tests] No forwarding of stale node announcements
2018-12-03 20:11:43 -08:00
Offer Markovich
6e8dd9e00f htlcswitch: verify test are running with "debug" tag
Per team decision all tests should run with "debug" flag.
Makefile updated accordingly.

A developer may still run the test from command line by "go test ...."

The commit protects against this and issue an error if needed.
2018-12-03 19:53:36 -08:00