Commit Graph

367 Commits

Author SHA1 Message Date
Johan T. Halseth
f6f3ab5b0b
Merge pull request #4829 from yyforyongyu/typo-fix
multi: Typo fix
2020-12-10 13:55:35 +01:00
yyforyongyu
be626df689
peer: use MaxMessagePayload instead of hard coding 2020-12-04 23:08:49 +08:00
yyforyongyu
550341c036
lnwire: fix typo 2020-12-04 23:07:53 +08:00
Olaoluwa Osuntokun
cefbf5f637
Merge pull request #4786 from wpaulino/rate-limit-channel-updates
discovery: rate limit incoming channel updates
2020-11-25 17:07:21 -08:00
Olaoluwa Osuntokun
baeceb2a0b
lnwire: add new RequiresFeature method
In this commit, we add a new RequiresFeature method to the feature
vector struct. This method allows us to check if the set of features
we're examining *require* that the even portion of a bit pair be set.
This can be used to check if new behavior should be allowed (after we
flip new bits to be required) for existing contexts.
2020-11-25 16:31:56 -08:00
Wilmer Paulino
791ba3eb50
discovery: rate limit incoming channel updates
This change was largely motivated by an increase in high disk usage as a
result of channel update spam. With an in memory graph, this would've
gone mostly undetected except for the increased bandwidth usage, which
this doesn't aim to solve yet. To minimize the effects to disks, we
begin to rate limit channel updates in two ways. Keep alive updates,
those which only increase their timestamps to signal liveliness, are now
limited to one per lnd's rebroadcast interval (current default of 24H).
Non keep alive updates are now limited to one per block per direction.
2020-11-25 15:38:08 -08:00
Johan T. Halseth
724f439b0b
lnwire: update anchor bit to spec 2020-09-11 11:10:58 +02:00
Bjarne Magnussen
954e292895
lnwire: fix minor typos in wumbo features 2020-07-20 08:36:39 +02:00
Olaoluwa Osuntokun
1b8fd008c4
lnwire: define feature bits for wumbo channels 2020-07-10 16:27:10 -07:00
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
Matheus Degiovani
44555a70ed lnwire: fix decoding for initial zero sid
This fixes a decoding error when the list of short channel ids within a
QueryShortChanIDs message started with a zero sid.

BOLT-0007 specifies that lists of short channel ids should be sorted in
ascending order. Previously, this was checked within lnwire by comparing
two consecutive sids in the list, starting at the empty (zero) sid.

This meant that a list that started with a zero sid couldn't be decoded
since the first element would _not_ be greater than the last one
(namely: also zero).

Given that one can only check for ordering starting at the second
element, we add a check to ensure the proper behavior.

A unit test is also added to ensure no future regressions on this
behavior.
2020-06-18 14:04:39 -03:00
Andras Banki-Horvath
556e3525ea misc: fix error formatting in multiple files 2020-04-24 19:15:08 +02:00
Conner Fromknecht
0f94b8dc62
multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
Conner Fromknecht
f6c194c3cd
netann/node_announcement: consolidate signing logic 2020-03-17 16:25:02 -07:00
Olaoluwa Osuntokun
3dda93e30d
Merge pull request #3821 from halseth/pluggable-anchors-lnwallet
[anchor] pluggable anchor commitments
2020-03-09 19:49:05 -07:00
Johan T. Halseth
21126ab0f3
multi: optionally enable and signal anchor support
Defaults to disabled.
2020-03-09 12:59:34 +01:00
nsa
5a03fe572f
lnwire: move zero-length queryBody check to zlib case 2020-03-03 13:58:25 -05:00
Bastien Teinturier
17200afc57
lnwire: explicitly handle empty list when encoding short chan IDs
Before this commit, both writing and reading an encoded empty set of
short channel IDs from the wire would fail. Prior to this commit, we
treated decoding an empty set as a caller error, and failed to write out
the zlib encoding of an empty set in a way that us and the other
implementations were able to read.

To fix this, rather than giving zlib an empty buffer to write out (which
results in an encoding with the zlib header data and the rest), we just
write a blank slice. When decoding, if we have an empty query body, then
we'll return a `nil` slice.

With the above changes, we'll now always write out an empty short
channel ID set as:
```
0001 (1 byte follows) || <encoding_type>
```

A new test has also been added to exercise this case for both known
encoding types.
2020-01-13 20:26:55 -08:00
Wilmer Paulino
c4723ce3db
lnwire: add LastBlockHeight method to QueryChannelRange 2020-01-06 14:00:16 -08:00
carla
1d3bb5aed6
lnwire: add FailMPPTimeout message 2019-12-20 13:01:41 +02:00
Conner Fromknecht
1dbeb34a66
feature/default_sets: expose optional mpp and pay_addr features IN9 2019-12-18 23:58:11 -08:00
Conner Fromknecht
9025a30f5d
lnwire/features: add EmptyFeatureVector constructor 2019-12-18 23:52:44 -08:00
Conner Fromknecht
24e663519a
lnwire/features: add payment-addr and mpp feature bits 2019-12-16 13:06:15 -08:00
Conner Fromknecht
a168f37b9c
lnwire+rpcserver: populate feature bits on decodepayreq 2019-12-10 13:09:36 -08:00
Conner Fromknecht
f34239889b
lnwire/feature: remove feature bit number from name
The number and the name will be separate on the rpc level, so we remove
the feature bit from the string. Currently this method is unused apart
from maybe in some rare logging instances.
2019-12-10 13:08:59 -08:00
Andras Banki-Horvath
b77bb73d4c lnwire: fixing buffer size and cleaning up uint16/32 conversion
This commit removes an unnecessarely large 32 byte buffer in favor of
a small 2 byte buffer and cleans up type conversion between uint16
and uint32 values.
2019-12-05 16:28:25 +01:00
Olaoluwa Osuntokun
183797f102
Merge pull request #3655 from carlaKC/fundingmgr-optionupfrontshutdown
Add Option Upfront Shutdown
2019-12-04 21:05:24 -08: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
Steven Roose
2fb7172725
lnwire: Add upfront shutdown messages and feature bit
This commit adds the feature bit and additional fields
required in `open_channel` and `accept_channel` wire
messages for `option_upfront_shutdown_script`.
2019-12-03 11:38:21 +02:00
Conner Fromknecht
4c872c438b
channeldb: complete migration 12 for TLV invoices 2019-11-22 02:24:28 -08:00
Conner Fromknecht
c6a01f02cd
lnwire/features: add Encode256 and Decode256
These will allow us to serialize invoice features bits without double
encoding the length.
2019-11-22 02:23:35 -08:00
Conner Fromknecht
2a6e41236c
lnwire/reply_channel_range: assert sorted encodings 2019-11-20 01:57:59 -08:00
Conner Fromknecht
3cc235a349
lnwire/query_short_chan_ids: assert sorted for plain encoding 2019-11-20 01:57:36 -08:00
Conner Fromknecht
5e27b5022c
multi: remove LocalFeatures and GlobalFeatures 2019-11-08 05:32:00 -08:00
Conner Fromknecht
16318c5a41
multi: merge local+global features from remote peer 2019-11-08 05:31:47 -08:00
Conner Fromknecht
fe566e1755
feature: add new feature pkg to manage feature sets
This commit introduces a feature.Manager, which derives feature vectors
for various contexts within the daemon. The sets can be described via a
staticly compiled format, which makes any runtime adjustments to the
feature sets when the manager is initialized.
2019-11-08 05:29:16 -08:00
Conner Fromknecht
90e36ca04b
lnwire/features: add unified Features namespace 2019-11-08 05:28:47 -08:00
Conner Fromknecht
0fc506e044
lnwire/onion_error: add InvalidOnionPayload failure 2019-10-30 21:19:36 -07:00
Joost Jager
a347237e7a
routing: use unified policy for path finding
In this commit we change path finding to no longer consider all channels
between a pair of nodes individually. We assume that nodes forward
non-strict and when we attempt a connection between two nodes, we don't
want to try multiple channels because their policies may not be identical.
Having distinct policies for channel to the same peer is against the
recommendation in the spec, but it happens in the wild. Especially since
we recently changed the default cltv delta value.

What this commit introduces is a unified policy. This can be looked upon
as the greatest common denominator of all policies and should maximize
the probability of getting the payment forwarded.
2019-10-25 11:22:28 +02:00
Wilmer Paulino
5ed1084130
Merge pull request #3572 from joostjager/canceled-spelling
multi: fix canceled spelling
2019-10-03 16:50:06 -04:00
Joost Jager
b58dbb2d70
multi: fix canceled spelling 2019-10-03 17:27:36 +02: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
Olaoluwa Osuntokun
a9541b8f6a
lnwire: define new feature bits for commitment's with tweakless remote outputs 2019-09-25 18:25:32 -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
Johan T. Halseth
e4301d3a8f
lnwire: rename ErrorCode -> FundingError
To make it clear that these errors are not part of the spec, rename them
to FundingError.
2019-09-20 10:55:21 +02:00
Johan T. Halseth
33fe09482b
lnwire+multi: define Error() for lnwire.Error
To make lnwire.Error actually satisfy the error interface, define the
Error method directly.
2019-09-20 10:55:21 +02:00
Johan T. Halseth
949f6c6cec
lnwire: remove ErrorCode encoding/decoding
Never sent on the wire.
2019-09-20 10:55:20 +02:00
Joost Jager
f60e4b1e14
lnwire+htlcswitch: report height for invalid payment details failure
Extends the invalid payment details failure with the new accept height
field. This allows sender to distinguish between a genuine invalid
details situation and a delay caused by intermediate nodes.
2019-09-16 10:10:20 +02:00
Joost Jager
1de08c4780
lnwire/test: fix TestFailIncorrectDetailsOptionalAmount
This test relied on specific internals of the failure encode function.
Changes to failure message pointer receiver everywhere subtly broke this
test.
2019-09-16 10:10:18 +02:00
Joost Jager
3d7de2ad39
multi: remove dead code 2019-09-10 17:21:59 +02:00