Commit Graph

4 Commits

Author SHA1 Message Date
Carla Kirk-Cohen
019127c4f4
multi: add restriction on maximum feature bit in invoices
Base 32 encoded bolt 11 invoices only allow 10 bits to express the
length of the feature vector in a tagged field, so there is a much
lower limit on the values invoice custom features can hold.

Other places in the protocol are theoretically limited by the maximum
message size, but since we express a feature bit as u16 we don't need
to be concerned about this.

The decision is made to track maximum per-set in the feature manager,
which is conceptually aware of sets and then validate in lnwire/features
against some arbitrary maximum value provided to the caller to keep
the base features package unaware of sets.
2023-05-04 10:35:45 -04:00
Carla Kirk-Cohen
5a139fd297
feature: add update function for safe feature update
Disallow update of any features that are defined by LND (since
just updating the feature, but not the functionality will result in
strange behavior). All known feature bits should be toggled using
protocol config options.
2023-05-04 10:35:44 -04:00
Conner Fromknecht
bbb841bd5f
feature/set: add SetInvoiceAmp
AMP invoices need to signal:
 - AMPRequired in order to avoid being paid by older clients that don't
   support it.
 - Can't advertised MPP optional, otherwise older clients will attempt
   to pay the invoice with regular MPP payment.

Hence, the features advertised on AMP invoices are mutually exclusive
from those advertised on MPP. Create a new set to classify the two.
2021-05-10 16:55:16 -07: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