Skip to content

09+11: require transitive feature dependencies#719

Merged
cdecker merged 4 commits intolightning:masterfrom
cfromknecht:feature-deps
Jan 21, 2020
Merged

09+11: require transitive feature dependencies#719
cdecker merged 4 commits intolightning:masterfrom
cfromknecht:feature-deps

Conversation

@cfromknecht
Copy link
Collaborator

@cfromknecht cfromknecht commented Dec 16, 2019

This PR adds an additional column to our feature table in BOLT 09, enumerating any dependencies that a feature pair has. At the moment, there are 3 such pairs that have dependencies, and more will be added in the near term. The motivation is to offer a concise way to describe these relations, and also simplify how we specify behavior gated by features with dependencies.

Consider the basic_mpp feature, which (as of #712) depends on payment_secret and transitively depends on var_onion_optin. Instead of specifying (or coding) has(basic_mpp) && has(payment_secret) && has(var_onion_optin) everywhere we need to gate basic_mpp, this allows us to isolate the gate to only basic_mpp since the transitive requirements are assumed to be already validated..

An implementation of this validation can be found here: https://github.com/lightningnetwork/lnd/blob/master/feature/deps.go which we are currently using as we build out MPP to simplify our own logic.

The test vectors have also been updated to set the var_onion_optin feature when setting a payment secret, as @t-bast points out, the current ones are missing this bit to be fully aligned with the existing spec.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Meeting Discussion Raise at next meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants