Commit Graph

52 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
5f9c1b902f
lnwire+feature: add awareness of option_shutdown_anysegwit
In this commit, we add awareness of the option_shutdown_anysegwit that
permits both sides to send newer segwit based addresses. This'll
eventually enable us to send taproot addresses for co-op close.
2022-08-10 18:44:26 -07:00
eugene
a6c62eb71e
lnwire+feature: new zero-conf, scid-alias feature bit + chantypes
This defines the zero-conf feature bit, the scid-alias feature bit,
the zero-conf channel type, and the scid-alias channel type. It also
defines the dependency "tree" that exists for the feature bits.

The scid-alias feature bit signals that the node requires an alias
short channel id to be sent in funding_locked. The scid-alias channel
type requires that the channel is private, in addition to some other
forwarding-related privacy measures.
2022-07-07 17:10:24 -04:00
Elle Mouton
c54cc6e841
multi: announce Keysend feature bit
In this commit, we add the keysend feature bit to our NodeAnnouncement
if the accept-keysend option is set.
2022-04-14 14:01:19 +02:00
Joost Jager
9195f29e61
routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
Olaoluwa Osuntokun
60a1f2d8d9
Merge pull request #5874 from Roasbeef/chan-type-feature-bit-fix
lnwire: switch chan_type feature to bits 44/45
2021-10-25 14:19:29 -07:00
Wilmer Paulino
6052a446dc
lnwire+feature: add feature bit for script enforced lease support 2021-10-19 18:30:14 -07:00
Olaoluwa Osuntokun
028fc86e5c
lnwire: switch chan_type feature to bits 44/45
We were using an older feature bit that was just "selected". This commit
has us use the feature bit officially included in the spec.

See https://github.com/lightningnetwork/lightning-rfc/pull/906
2021-10-19 17:40:33 -07:00
Wilmer Paulino
031d7b1d55
lnwire: extend RawFeatureVector with helper methods 2021-08-30 19:17:31 -07:00
Olaoluwa Osuntokun
d0779e2ec2
lnwire: add new feature bits for explicit channel type negotiation
If these bits are present, then both sides can examine the new
CommitmentType TLV field that's present and use this in place of the
existing implicit commiment type negotiation. With this change, it's now
possible to actually deprecate old unsupported commitment types
properly.
2021-08-30 19:17:24 -07:00
yyforyongyu
e381b33b21
lnwire: fix typo in docs 2021-08-10 05:36:08 +08:00
Conner Fromknecht
438b03afa4
features: define temporary AMP feature bits 30/31 2021-04-07 12:08:34 -07:00
Johan T. Halseth
abefa93065
lnwire+feature: define AnchorsZeroFeeHtlcTx feature 2020-12-15 10:13:04 +01:00
yyforyongyu
550341c036
lnwire: fix typo 2020-12-04 23:07:53 +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
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
Johan T. Halseth
21126ab0f3
multi: optionally enable and signal anchor support
Defaults to disabled.
2020-03-09 12:59:34 +01: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
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
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
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
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
Olaoluwa Osuntokun
9145c0fd38
lnwire: add new TLV onion feature bits 2019-08-22 18:53:06 -07:00
nsa
7a65be7f14 lnwire: features "maxAllowedSize" fix 2019-02-06 07:02:10 -05:00
Olaoluwa Osuntokun
5c434b17ff
lnwire: ensure even/odd features have the same base name
In this commit, we fix a bug in the way we defined our even/odd features
for a particular feature. The check for if a feature bit is part of a
pair assumes that the pair bit has the exact same name as the bit being
queried. The way we defined our feature map didn't take note of this
assumption, as a result, any attempts to require a new bit moving from
optional to required would fail since the bit would be found, but the
names differed.
2019-01-31 20:58:10 -08:00
Conner Fromknecht
055dc233a1 lnwire/features: add required gq to local features
This commit adds the required feature name to our
set of local known features. This will allow other
peers connecting to us to set the required gossip
queries feature bit. This is required for the
subsequent commits, which instruct the server to
set the bit depending on user configured preferences.
2018-09-05 18:51:04 -07:00
Olaoluwa Osuntokun
fa6a0a7ce9
lnwire: recognize required query sync feature bit 2018-08-23 19:36:17 -07:00
Olaoluwa Osuntokun
c5065fcdba
lnwire: add new gossip query required+optional feature bits 2018-05-31 16:30:49 -07:00
Olaoluwa Osuntokun
0fcd9ce7c8
lnwire: add recognition of the data loss proected feature bit
In this commit, we add recognition of the data loss protected feature
bit. We already implement the full feature set, but then never added the
bit to our set of known features.
2018-05-31 16:30:44 -07:00
Olaoluwa Osuntokun
53f1743be0
lnwire: fix serialization order of global+local features in Init msg
Fixes #428.
2017-11-17 13:27:23 -08:00
Jim Posen
9fd77a6e40 multi: Update lnd to use new feature vector API. 2017-10-17 22:47:20 -07:00
Jim Posen
1633ab180f lnwire: New API for feature vectors.
This is a rewrite of feature vectors in lnwire. This has a few
benefits:

1) a simpler interface
2) separate structs for a plain set of feature bits and a feature
vector with associated feature names
their respective feature sets
3) loosened requirements that bits MUST be assigned in pairs
4) fix endianness of encoding/decoding
2017-10-17 22:47:20 -07:00
nsa
d65f17f1b1 fuzzing: fixed calculation of serializedSize() in features.go
This commit fixes an incorrectly calculated size of a
*FeatureVector in the serializedSize() function. go-fuzz
found that when calling NewFeatureVectorFromReader, if
a flag is invalid, it is not added to f.flags. However,
it will skip the index that wasn't included. This
becomes a problem when serializedSize() calculates the
length of f.flags via len() which can lead to an index
out of range since certain flags may be missing.
2017-09-19 16:21:31 -07:00
Olaoluwa Osuntokun
587300aa80
lnwire: use ReadFull instead of Read when parsing feature vectors
This commit fixes a bug lingering in the decoding of the feature
vectors which was masked by the prior method of reading the _entire_
message from the stream before parsing it. The issue was that
performing a zero-byte Read on an io.Reader that’s purely streaming
will result in an indefinite block. We fix this bug by properly using
io.ReadFull in this context.
2017-04-19 16:07:17 -07:00
Olaoluwa Osuntokun
0db384fd6b
lnwire: properly fold at 80-columns within features.go 2017-03-16 12:12:00 -07:00
Andrey Samokhvalov
fd97a4bd19 lnd: partially fix golint warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
8fb54782e2 lnd: fix gosimple warnings 2017-03-13 16:30:23 -07:00
Olaoluwa Osuntokun
f9b44567ed
lnwire: remove String() method from FeatureVector
This commit removes the String() method from the FeatureVector as it
can produce confusing output when revving a feature vector and not
knowing the strip mapping ahead of time.
2017-02-22 15:53:47 -08:00