Commit Graph
100 Commits
Author SHA1 Message Date
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
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
Conner Fromknecht 122b43b447 build/release: add new release targets
Notably, solaris/amd64 and illumos/amd64 were added in go1.13. The
others were have been supported previously but were not build targets.

After go1.13, nacl/* will no longer be supported and plan9/* is still
considered experiemental. As a result they are omitted.
2019-10-04 14:50:26 -07:00
Conner Fromknecht 6e9560e818 build/release: format+sort build existing targets 2019-10-03 17:31:13 -07:00
Conner Fromknecht acc5104f53 lnrpc+routerrpc: disable custom tlv records via rpc
In order to prevent future unforeseen issues, we are temporarily
disabling the ability to send custom tlv records to the receiver of a
payment. Currently the receiver does not process or expose these
additional fields via rpc or internally, so they are being disabled
until the end-to-end flow is finished and fully validated.
2019-10-03 15:55:45 -07:00
Conner Fromknecht 65a991999d lnwire/features: static_remote_key bits, 10/11 -> 12/13
Final version of spec allocated 12/13 to option_static_remote_key.
2019-10-02 03:33:22 -07:00
Conner Fromknecht 9710134f70 Merge pull request #3566 from wpaulino/wait-until-peer-active
peer+server: wait until peer is active to begin channel opening process
2019-10-01 17:36:32 -07:00
Conner Fromknecht 45114cb819 build: bump to bitcoind 0.18.1 for itests 2019-10-01 16:29:55 -07:00
Conner Fromknecht 1b79414175 server: don't prune manual perm connections 2019-10-01 16:13:35 -07:00
Conner Fromknecht 10d53e61aa Merge pull request #3551 from joostjager/safe-invoice-migration
channeldb: safe invoice migration
2019-09-30 15:48:19 -07:00
Conner Fromknecht a280a4987c peer: resend channel reestablishes without starting chan streams
This prevents the DLP protocol from breaking as a result of the
refactor, since the closing or closed channels won't be included in the
peer's active map.
2019-09-25 12:18:21 -07:00
Conner Fromknecht ced113452d peer: only mark active channels as failed
Also adds similar sanity check for LinkUpdater msgs, so that we don't
process messages for inactive channels.
2019-09-25 12:01:23 -07:00
Conner Fromknecht f33a1a61e6 peer: extract error handling logic 2019-09-25 12:01:11 -07:00
Conner Fromknecht 2df5a36048 peer+lnwire: add LinkUpdater iface and impl on relevant msgs
Removes longstanding TODO to simplify parsing of target chanid.
2019-09-25 12:00:59 -07:00
Conner Fromknecht da1b599d88 Makefile+release: only use -trimpath on release script
Allows lnd to still be compiled with go1.12.x, tho users with go1.13 can
still verify release binaries.
2019-09-19 14:34:38 -07:00
Conner Fromknecht 934b11fdac Merge pull request #3509 from alrs/fix-lnwallet-test-goroutine
lnwallet: fix goroutines in tests
2019-09-19 14:01:45 -07:00
Conner Fromknecht 6585a56581 Merge pull request #3504 from alrs/fix-brontide-test-goroutine
brontide: fix test goroutine
2019-09-19 12:51:33 -07:00
Conner Fromknecht 3276bf2960 htlcswitch/link: remove channel reestablish deadline
Now that the link will remain ineligible until it receives
channel_reestablish from the remote peer, we can remove the channel
reestablish timeout entirely.
2019-09-19 12:47:08 -07:00
Conner Fromknecht 9d6ee2ebd9 htlcswitch/link: restrict EligibleToForward to wait for reestablish
This commit modifies the link's EligibleToForward() method only return
true once the peers have successfully exchanged channel reestablish
messages. This is a preliminary step to increasing the reestablish
timeout, ensuring the switch won't try to forward over links while
we're waiting for the remote peer to resume the connection.
2019-09-19 12:46:56 -07:00
Conner Fromknecht 6dca07577d multi: move active/inactive ntfns from switch to link
Since we will now wait to deliver the event after channel reestablish,
notifying when the link is added to the switch will no longer be
sufficient. Later, we will add receiving reestablish as an additional
requirement for EligibleToForward returning true.

The inactive ntfn is also moved, to ensure that we don't fire inactive
notifications if no corresponding active notification was sent.
2019-09-19 12:46:44 -07:00
Conner Fromknecht 1d41d4d666 multi: move WaitPredicate, WaitNoError, WaitInvariant to lntest/wait 2019-09-19 12:46:29 -07:00
Conner Fromknecht 003441d7e9 build: adding missing unit test dep to go.sum 2019-09-19 12:46:17 -07:00
Conner Fromknecht 7252e175dc lncli+wtclientrpc: remove wtclientrpc build tag, compile by default 2019-09-18 17:26:15 -07:00
Conner Fromknecht cd7610ff41 Makefile: remove linter version from pkg definition 2019-09-18 14:18:14 -07:00
Conner Fromknecht 4e5c4df098 Makefile: remove side-effects to go.mod when installing all deps
This commit applies the same cd /tmp prefix to installations for all
dependencies. It also corrects the previous behavior, which requires the
cd /tmp to be in the same command, and not separate statements.
2019-09-18 14:03:18 -07:00
Conner Fromknecht ed8913f08a Makefile: add verbose output to go get for linter 2019-09-18 14:01:49 -07:00
Conner Fromknecht 697974c9cf Makefile: remove extraneous go install calls for module deps 2019-09-18 14:01:12 -07:00
Conner Fromknecht a8130f0c40 Makefile: remove -u when installing go-acc 2019-09-18 13:43:35 -07:00
Conner Fromknecht 551693e1b8 Merge pull request #3496 from joostjager/fix-incoming-dust
cnct: do not create an action for incoming dust htlcs
2019-09-16 12:31:37 -07:00
Conner Fromknecht 46586e2a4c Merge pull request #3495 from halseth/router-not-starte-deadlock
chainntnfs: start concurrent queues prior to connection
2019-09-16 12:19:54 -07:00
Conner Fromknecht 35d4652d23 Merge pull request #3503 from joostjager/remove-whitespace-linter
build: pin golangci-lint version
2019-09-13 11:25:54 -07:00
Conner Fromknecht 72c5d11a1c Merge pull request #3502 from joostjager/err-returns
multi: fix dropped errors
2019-09-13 11:24:04 -07:00
Conner Fromknecht 2c3ce2a183 Merge pull request #3484 from joostjager/fix-hop-log
htlcswitch/hop: fix logging
2019-09-11 13:37:43 -07:00
Conner Fromknecht 6015567927 htlcswitch/iterator: validate presence/omission of payload types
From BOLT 04:

The writer:
 - MUST include amt_to_forward and outgoing_cltv_value for every node.
 - MUST include short_channel_id for every non-final node.
 - MUST NOT include short_channel_id for the final node.
2019-09-05 09:32:03 -07:00
Conner Fromknecht aefec9b10f tlv: return parsed types from DecodeWithParsedTypes
This commit adds an additional return value to
Stream.DecodeWithParsedTypes, which returns the set of types that were
encountered during decoding. The set will contain all known types that
were decoded, as well as unknown odd types that were ignored.

The rationale for the return value (rather than an internal member) is
so that the stream remains stateless.

This return value can be used by callers during decoding to make
assertions as to whether specific types were included in the stream.
This is need, for example, when parsing onion payloads where certain
fields must be included/omitted depending on the hop type.

The original Decode method would incur the additional performance hit of
needing to track the parsed types, so we can selectively enable this
functionality when a decoder requires it by using a helper which
conditionally tracks the parsed types.
2019-09-05 09:30:37 -07:00
Conner Fromknecht 138b0798f5 htlcswitch/iterator: use hop.Payload constructors 2019-09-05 01:35:24 -07:00
Conner Fromknecht 378e0558c5 htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00
Conner Fromknecht fc0e4be4d8 htlcswitch+hop: move ForwardingInfo to hop.ForwaringInfo 2019-09-05 01:35:23 -07:00
Conner Fromknecht 83d2112e8b htlcswitch/hop: move NetworkHop to hop.Network 2019-09-05 01:35:20 -07:00
Conner Fromknecht 947cc50c13 routing/route/route: prevent modification of hop.TLVRecords
Currently the underlying array backing the hop's TLVRecords is modified
when combining custom records with the primitive forwarding info. This
commit uses a fresh slice to prevent modifications from mutating the
hop itself.
2019-09-04 14:14:34 -07:00
Conner Fromknecht 278e10a2fd routing/route/route: omit next_hop_id for final hop
BOLT04 says to omit this field for final hops, but must be present on
all other hops.
2019-09-04 12:05:10 -07:00
Conner Fromknecht 1b2c9a02b5 record+tlv/onion_types: move type constants to route/hop 2019-09-04 12:05:10 -07:00
Conner Fromknecht dc0f429271 htlcswitch+routing: use TLV hop constructors 2019-09-04 12:05:09 -07:00
Conner Fromknecht 495f80e0bc record/hop: add primitive hop TLV record constructors 2019-09-04 12:05:09 -07:00
Conner Fromknecht d08721b32d rpcserver: correctly compute edge-level lastUpdate 2019-08-28 13:31:12 -07:00
Conner Fromknecht 2ebd76bbbb rpcserver: marshal db edges by increasing pubkey 2019-08-28 13:30:06 -07:00
Conner Fromknecht 1311baf51f zpay32: add BOLT 11 feature bits and test vectors 2019-08-27 15:51:24 -07:00
Conner Fromknecht 8c2176fbf8 lnwire/features: add EncodeBase32 and DecodeBase32 w/ generic helpers 2019-08-27 15:51:24 -07:00
Conner Fromknecht 2953f3532a lnwire/features: add SerializeSize32 for base32 encodings 2019-08-27 15:51:24 -07:00
Conner Fromknecht 1cc48ceaf5 tlv/stream: create MaxRecordSize, remove lnwire import, add test 2019-08-21 18:12:57 -07:00
Conner Fromknecht c9a6d5bad5 utxonursery: demote building nursery report log to debug
Log can be pretty spammy when using the pendingchannels rpc, which
creates a log for each closing channel. Should help clear up logs for
more pertinent information.
2019-08-20 14:13:05 -07:00
Conner Fromknecht e2a53f71d0 pilot+discovery: remove info spews 2019-08-20 14:13:05 -07:00
Conner Fromknecht 9a5ac78912 Merge pull request #3391 from joostjager/always-return-invalid-details
htlcswitch+invoices: always return incorrect_or_unknown_payment_details
2019-08-12 20:14:49 -07:00
Conner Fromknecht da7cb2d42a tlv/primitive: use constructor for encoding/decoding type err 2019-08-08 15:57:48 -07:00
Conner Fromknecht 474ddc98ed tlv/primitive_test: add basic encode/decode tests for primitives 2019-08-08 15:57:48 -07:00
Conner Fromknecht 4dbe9379a9 Makefile: ensure submodules are linted, covered, and tested 2019-08-08 14:39:18 -07:00
Conner Fromknecht e6fdfbb1cb tlv/truncated: fix decoding bug in DTUint16 and DTUint32
This commit fixes a bug in DTUint16 and DTUint32, which would cause them
to read too many bytes from the reader. This is due to the fact that
ReadFull was being called on a slice that could be greater than the
underlying type. This is not an issue for DTUint64, since the 8-byte
buffer corresponds to the maximum possible size of a uint64. The
solution is to clamp the buffer to 2 and 4 bytes respectively.

A series of tests are also added to exercise these cases.
2019-08-07 19:42:15 -07:00
Conner Fromknecht 32bb9917f9 tlv/truncated_test: add tests for SizeTuintXX methods 2019-08-07 19:38:57 -07:00
Conner Fromknecht 3690999511 tlv/tlv_test: add BOLT1 test vectors 2019-08-07 15:04:45 -07:00
Conner Fromknecht 7c94bbb4a2 tlv/truncated: add truncated integer encodings
This commit adds the truncated integer encodings used in the
variable-size onion payloads. The amount and cltv delta both use the
truncated encoding to shave bytes in the overall size, and will likely
be used in the future for additional extensions where size is a
constraint.
2019-08-07 15:04:33 -07:00
Conner Fromknecht abdcd47dcc tlv/bench_test: add basic benchmark 2019-08-07 15:04:20 -07:00
Conner Fromknecht a0ebaeaa6c tlv: zero alloc encoding for extended types
This commit adds concrete encoding methods for primitive integral types.
When external libs need to create custom encoders, this allows them to
do so without incurring an extra allocation on the heap. Previously, the
need to pass a pointer to the integer using an interface{} would cause
the argument to escape, which we avoid by having them copied directly.
2019-08-07 15:04:08 -07:00
Conner Fromknecht bc1f23d98a tlv/stream: adds tlv stream encoding/decoding 2019-08-07 15:03:56 -07:00
Conner Fromknecht 96e0bb1411 tlv/record: adds various tlv record constructors 2019-08-07 15:03:43 -07:00
Conner Fromknecht 6773d4770a tlv/primitive: add primitive encodings 2019-08-07 15:03:30 -07:00
Conner Fromknecht 75fcf1cee1 tlv/varint_test: add tests vectors for custom Read/WriteVarInt 2019-08-07 15:03:18 -07:00
Conner Fromknecht 3afcb1f224 tlv/varint: add modified bitcoin varint
This varint has the same serialization as the varint in btcd and
bitcoind, but has different behavior wrt returned errors. In order to
ensure the inner loop properly detects cleanly written records,
ReadVarInt will not only return EOF if it can't read the first byte, as
that means the reader has zero bytes left.

It also modifies the API to allow the caller to provided a static byte
array, which can be reused across all encoding and decoding and
increases performance.
2019-08-07 15:03:05 -07:00
Conner Fromknecht 4f730076c9 Merge pull request #3380 from Roasbeef/rpc-error-interceptors
rpc: add unary+streaming interceptors to log all errors
2019-08-07 12:16:46 -07:00
Conner Fromknecht c3aa46e08b Merge pull request #3374 from halseth/ntfr-logger
[trivial] log: correct NTFR -> ntfrLog mapping
2019-08-05 12:41:24 -07:00
Conner Fromknecht 994719026f config+server: add ignore-historical-filters CLI option
This commit adds the ignore-historical-filters CLI option, initially
defaulting to false. Users may use this option to prevent lnd from doing
historical gossip dumps to peers that set their `gossip_timestamp_range`
in the past. Enabling this option will result in lower bandwidth and
memory consumption. Down the road the plan is to make this default to
true.
2019-07-30 17:26:03 -07:00
Conner Fromknecht 8cebddfe50 discovery/gossiper: thread IgnoreHistoricalFilters to sync manager 2019-07-30 17:25:47 -07:00
Conner Fromknecht a3e690e253 discovery/sync_manager: init all syncers with IgnoreHistoricalFilters 2019-07-30 17:25:31 -07:00
Conner Fromknecht 35a2de23a3 discovery/syncer: add flag to prevent historical gossip filter dump 2019-07-30 17:25:15 -07:00
Conner Fromknecht 4cb30001ac Merge pull request #3356 from openoms/documentation
lnrpc: remove lncli subscribechannelevents
2019-07-30 16:57:44 -07:00
Conner Fromknecht 4722a67ebb Merge pull request #3347 from guggero/ticker-tidy
ticker+queue: run go mod tidy
2019-07-30 14:52:25 -07:00
Conner Fromknecht b60825fa5a Merge pull request #3303 from carlaKC/ckc-I1507-lnclipasswordretry
cmd: Add passphrase confirmation when creating wallet from existing seed
2019-07-22 16:03:02 -07:00
Conner Fromknecht 2d5b91e986 Merge pull request #3330 from halseth/tls-test-fixups
[trivial] lnd: remove global var access from genCertPair
2019-07-22 15:53:17 -07:00
Conner Fromknecht 807012f960 Merge pull request #3143 from Crypt-iQ/pipelining_settle_0525
htlcswitch: pipeline settles to switch
2019-07-19 18:12:59 -07:00
Conner Fromknecht 377b7bf3ce Merge pull request #3316 from cfromknecht/num-zombies-rpc
rpcserver+channeldb: return num zombies in NetworkInfo response
2019-07-17 16:27:48 -07:00
Conner Fromknecht 97d8be7f6a rpcserver: query and set num_zombie_chans in NetworkInfo resp 2019-07-16 16:32:27 -07:00
Conner Fromknecht 0223039fb4 channeldb/graph: add NumZombies method and tests 2019-07-16 16:32:27 -07:00
Conner Fromknecht 4b70d6b987 lnrpc: add num_zombie_chans to NetworkInfo response 2019-07-16 16:32:27 -07:00
Conner Fromknecht a4097c113a discovery/gossiper: remove unused SynchronizeNode method 2019-07-15 14:11:18 -07:00
Conner Fromknecht 9eda94a40e peer: don't reply if peer's request initial_graph_sync
We stopped requesting this from other nodes as it is very expensive as
the graph continues to grow. In this commit we will also stop
responding, as nodes are recommended to begin using the `gossip_queries`
and upcoming `extended_gossip_queries` to reconcile missing graph data.
2019-07-15 14:09:42 -07:00
Conner Fromknecht 0c8ff3021c Merge pull request #2682 from valentinewallace/fix-subscribe-chans-flake
lnd_test: fix channel event subscription test flake.
2019-07-12 16:08:18 -07:00
Conner Fromknecht 0193034f4f Merge pull request #2957 from halseth/taketa-goroutine-snapshot
[lnd test] write goroutine snapshot on integration test failure
2019-07-11 16:11:51 -07:00
Conner Fromknecht a4f4ff0f83 Merge pull request #3188 from joostjager/error-source-idx
htlcswitch+routing+routerrpc: error source as index and expose decrypt failure
2019-07-11 13:27:14 -07:00
Conner Fromknecht 2e0af923f3 Merge pull request #2366 from ccdle12/routing-policy-timestamps
lnrpc+rpcserver: Adding timestamps to RoutingPolicy
2019-07-11 12:10:03 -07:00
Conner Fromknecht 1b16f84964 CODEOWNERS: fix aezeed typo 2019-07-09 18:16:23 -07:00
Conner Fromknecht 933e723ec7 Merge pull request #3178 from federicobond/once-refactor
multi: replace manual CAS with sync.Once in several more modules
2019-07-08 20:33:44 -07:00
Conner Fromknecht a6e77811b1 Merge pull request #3251 from Crypt-iQ/sync_with_chain_fix_0627
routing: move call to PruneGraph outside of the collating loop
2019-07-02 20:00:55 -07:00
Conner Fromknecht 5f4922cd57 Merge pull request #3262 from cfromknecht/watchtowerrpc-crash-fix
lnrpc/watchtowerrpc: prevent watchtowerrpc panic when tower not active
2019-07-02 18:07:53 -07:00
Conner Fromknecht 0451baecf5 cmd/lncli/commands: fix updatechanpolicy lowest possible fee msg 2019-07-02 16:20:53 -07:00
Conner Fromknecht 2440e9c2e5 docs/watchtower.md: add watchtower guide 2019-07-01 15:57:21 -07:00
Conner Fromknecht a38d44e3da sample-lnd.conf: add watchtower and wtclient sample confs 2019-07-01 15:56:10 -07:00
Conner Fromknecht 4b549cb43c watchtower/wtpolicy/policy: bump default fee rate to 10 sat/byte 2019-07-01 15:56:03 -07:00
Conner Fromknecht 05107ce969 watchtower/wtdb: fix double hex encoding of chanid 2019-07-01 13:11:58 -07:00