Commit Graph

9905 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
a6ba965bc4
Merge pull request #2474 from cfromknecht/read-and-write-pools
lnpeer+brontide: reduce memory footprint using read/write pools for message encode/decode
2019-02-24 16:39:32 -03:00
Olaoluwa Osuntokun
f95a71fdc9
build: bump to psuedo version 0.5.2-99-beta 2019-02-22 15:31:07 -08:00
Johan T. Halseth
b93b4f2974
Merge pull request #2672 from Gfloresechaiz/Gfloresechaiz-patch-1
INSTALL.md : bump to go.1.11.5 on Linux
2019-02-22 12:56:27 +01:00
Conner Fromknecht
db2c104111
peer: reduce write timeout to 10s 2019-02-21 20:11:47 -08:00
Conner Fromknecht
603601a4c8
peer+server: use peer-level readPool 2019-02-21 20:11:33 -08:00
Conner Fromknecht
8ac8d95b54
brontide/conn: expose ReadNextHeader+ReadNextBody 2019-02-21 20:11:19 -08:00
Conner Fromknecht
93ce4a7575
brontide/noise: compose ReadMessage from ReadHeader+ReadBody 2019-02-21 20:11:05 -08:00
Conner Fromknecht
9a3c0b8bca
peer+server: switch to pool.Write from pool.WriteBuffer 2019-02-21 20:10:51 -08:00
Conner Fromknecht
ce1bd4be2c
pool/worker_test: add tests for concrete Worker pools 2019-02-21 20:10:40 -08:00
Conner Fromknecht
32339a92d3
pool/read: adds Read pool 2019-02-21 20:10:28 -08:00
Conner Fromknecht
d2eeee7a12
pool/write: adds Write pool 2019-02-21 20:10:17 -08:00
Conner Fromknecht
37d866328b
pool/worker: add generic Worker pool 2019-02-21 20:10:06 -08:00
Valentine Wallace
f0e668974e htlcswitch/link: verify an htlc is not too large in HtlcSatifiesPolicy
Before forwarding an HTLC, ensure that the amount to forward
including fees does not exceed the max HTLC set for the channel
link.
2019-02-21 18:45:37 -08:00
Valentine Wallace
90cbf9fe35 peer: set max htlc when loading active channels on start 2019-02-21 18:39:32 -08:00
Valentine Wallace
833c31eaca htlcswitch/link_test+test_utils: add max htlc to forwarding policies 2019-02-21 18:39:32 -08:00
Valentine Wallace
675a8b2d9e rpcserver: include max htlc in DescribeGraph response 2019-02-21 18:39:32 -08:00
Valentine Wallace
0c6c1040d8 routing/ntfns+rpcserver: include max htlc in topology notifications 2019-02-21 18:39:32 -08:00
Valentine Wallace
e62a8f3269 lnrpc: add max_htlc to RoutingPolicy 2019-02-21 18:39:32 -08:00
Valentine Wallace
20b3114100 htlcswitch+lnwallet+peer: default max htlc in fwding policy of new chans
In this commit, we set a default max HTLC in the forwarding
policies of newly open channels.

The ForwardingPolicy's MaxHTLC field (added in this commit)
will later be used to decide whether an HTLC satisfies our policy before
forwarding it.

To ensure the ForwardingPolicy's MaxHTLC default matches the max HTLC
advertised in the ChannelUpdate sent out for this channel,  we also add
a MaxPendingAmount() function to the lnwallet.Channel.
2019-02-21 18:39:32 -08:00
Olaoluwa Osuntokun
cbe0bf6a22
Merge pull request #2501 from cfromknecht/batch-preimage-writes
htlcswitch: batch preimage writes/consistency fix
2019-02-21 17:00:00 -08:00
Olaoluwa Osuntokun
f3215e0a3f
Merge pull request #2610 from halseth/trivial-itest
Small integration test fixes
2019-02-21 16:32:01 -08:00
Wilmer Paulino
188df621ad
Merge pull request #2656 from Roasbeef/neutrino-op-return-fix
build: update to latest neutrino build
2019-02-21 14:18:35 -08:00
Johan T. Halseth
f00a643ef8
Merge pull request #2634 from halseth/ottosuess-comment_typo_fix
lnrpc: fix minor comment typo
2019-02-21 16:20:33 +01:00
Joost Jager
4de9ffdf7b
Merge pull request #2679 from joostjager/itest-unkeyed
lnd_test: remove unkeyed field references
2019-02-21 14:36:32 +01:00
Joost Jager
d67b1962a8
lnd_test: remove unkeyed field references 2019-02-21 13:47:58 +01:00
Olaoluwa Osuntokun
e1382bd4fc
Merge pull request #2083 from Roasbeef/ln-router-service
rpc+lnd: add new sub RPC server, Router service
2019-02-20 16:49:39 -08:00
Gfloresechaiz
02617875c0
Update INSTALL.md 2019-02-20 19:30:23 -05:00
Olaoluwa Osuntokun
88252d759b
config: add sub-server config parsing logic for the new Router service 2019-02-20 16:10:43 -08:00
Olaoluwa Osuntokun
cfd6a0d860
lnrpc/routerrpc: add config, implement full RouterServer
In this commit, we implement the full RouterServer as specified by the
newly added sub-service as defined in router.proto. This new sub-server
has its own macaroon state (but overlapping permissions which can be
combined with the current admin.macaroon), and gives users a simplified
interface for a gRPC service that is able to simply send payment. Much
of the error reporting atm, is a place holder, and a follow up commit
will put up the infrastructure for a proper set of errors.
2019-02-20 16:10:39 -08:00
Olaoluwa Osuntokun
38769fb388 lnrpc/routerrpc: add protos for new Router sub-server 2019-02-20 16:10:24 -08:00
Olaoluwa Osuntokun
8a0d0ec98f
Merge pull request #2651 from kaplanmaxe/payinvoice-error-exit-code
lncli: returning non 0 exit code when paying invoice fails
2019-02-20 15:07:32 -08:00
Olaoluwa Osuntokun
2bf22617d4
Merge pull request #1595 from wpaulino/send-channel-update-reliably
discovery/gossiper: reliably send channel update msg to remote peer
2019-02-19 21:09:04 -08:00
Conner Fromknecht
0a3e1cfbe5
channeldb+witness_beacon: use sha256 lookup+delete witness 2019-02-19 17:06:42 -08:00
Conner Fromknecht
3428fde5ab
htlcswitch/link_test: batch preimage write test 2019-02-19 17:06:28 -08:00
Conner Fromknecht
76cecb1396
htlcswitch/link: batch write to preimage cache
This commit makes use of the batched AddWitness
method of the WitnessCache, in order to avoid
performing one write for each accepted preimage.

Additionally, this fixes an existing hole in the
consistency guarantees since the batched writes
are now guaranteed to take place before accepting
the next CommitSig. Previously, these writes were
processed in an unsynchronized go routine that
could be delayed arbitrarily long before being
executed.

With this change, the async_payments_benchmarks
actually shows a slight improvement in
performance, presumably because we no longer do
an individual write per preimage, even though
the execution is now explicitly in the critical
path. There is likely also a marginal performance
improvement from the reduction in goroutine
overhead.
2019-02-19 17:06:15 -08:00
Conner Fromknecht
29f07a58cb
cnct+lnwl+hswc: use lntypes.Preimage for witness beacon 2019-02-19 17:06:00 -08:00
Conner Fromknecht
2d8bc99d9e
lntypes/preimage: add MakePreimage initializer 2019-02-19 17:05:45 -08:00
Conner Fromknecht
e8b7f1fca3
channeldb/witness_cache: create AddSha256Witnesses helper + test 2019-02-19 17:05:30 -08:00
Conner Fromknecht
56b6becc48
channeldb/witness_cache_test: test batch preimage insertion 2019-02-19 17:05:17 -08:00
Conner Fromknecht
30f61b7630
multi: make AddPreimage variadic, optimistically compute key
In this commit, we modify the WitnessCache's
AddPreimage method to accept a variadic number
of preimages. This enables callers to batch
preimage writes in performance critical areas
of the codebase, e.g. the htlcswitch.

Additionally, we lift the computation of the
witnesses' keys outside of the db transaction.
This saves us from having to do hashing inside
and blocking other callers, and limits extraneous
blocking at the call site.
2019-02-19 17:05:04 -08:00
Olaoluwa Osuntokun
9d23d382fc
Merge pull request #2419 from cfromknecht/brontide-buffer-pool
brontide: read buffer pool
2019-02-18 17:51:17 -08:00
Olaoluwa Osuntokun
e65012a7ff
build: update to latest neutrino build
In this commit, we update lnd to build against the latest version of
neutrino. This new version fixes a bug left behind as a result of the
btcd filter bug fix. When we were comparing filters in order to ban
invalid peers, we used the old OP_RETURN filtering rather than the new
one. As a result, we might've rejected a valid filter/block as we were
applying the old (incorrect) rules.
2019-02-18 17:34:34 -08:00
Olaoluwa Osuntokun
c8b5e1f55e
Merge pull request #2411 from cfromknecht/chan-status-manager
netann: channel status manager
2019-02-18 17:16:30 -08:00
Roei Erez
6c256aea30 server: fix the algo to prefer connections when multiple exist
This commit modified the condition to whether drop an existing
connection to a peer when a new connection to this peer is
established.
The previous algorithm used public keys comparison for this decision
which determines that between every two nodes only one of them will
ever drop the connection in such cases.
The problematic case is when a node disconnects and reconnects in a
short interval which is the case of mobile devices.
In such case it takes as much as the "timeout" configured value for
the remote node to detect the "disconnection" (and try to reconnect
if this connection is persistent). In the case this node is also the
one that has the "smaller" public key the reconnect attempts of the
other node will be rejected causing it impossible to fast reconnect.

The solution is to only drop the connection if if we already have a
connected peer that is of the opposite direction from the this new
connection. By doing so the "initiator" will be enabled to replace
the connection and recconnect immediately.
2019-02-18 19:00:56 +02:00
Max Kaplan
9bfb8224cd
lncli: returning non 0 exit code when paying invoice fails 2019-02-18 10:33:03 -05:00
Olaoluwa Osuntokun
44b8cd6699
Merge pull request #2602 from lightningnetwork/ticker-queue-modules
build: add module support for ticker and queue packages
2019-02-16 14:54:53 -08:00
Conner Fromknecht
2900d8aff8
brontide/noise: take read buffers from pool, return w/ finalizer 2019-02-15 19:33:23 -08:00
Conner Fromknecht
5d9514fbe4
buffer+pool: add buffer.Read and pool.ReadBuffer 2019-02-15 19:33:08 -08:00
Conner Fromknecht
6f96d04b72
multi: add buffer.Write and pool.WriteBuffer, make GCQueue generic 2019-02-15 19:31:24 -08:00
Conner Fromknecht
ca4226d429
brontide/listener: handle SetReadDeadline errors 2019-02-15 18:14:02 -08:00