-
Notifications
You must be signed in to change notification settings - Fork 138
Feature bits #1748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature bits #1748
Conversation
eb267a6
to
77f9420
Compare
Pull Request Test Coverage Report for Build 18007703532Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial questions and comments, mostly about the AuxChanNegotiator handling in the RFQ system.
77f9420
to
74d98bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made another pass, with some additional questions and suggestions. I think everything on my end should be resolved after this.
74d98bf
to
611a9fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 👍
// custom feature bits to include in the init message TLVs. The implementation | ||
// can decide which features to advertise based on the peer's identity. | ||
func (n *AuxChannelNegotiator) GetInitFeatures( | ||
_ route.Vertex) (tlv.Blob, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think w/ the latest direction, this can now just return the feature vector directly, to be merged by lnd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdym? To merge this feature vector with the one that LND uses in lnwire.Init
?
Might be a nice convenience since that message already uses a feature vec, but can't see the opportunities. We'd skip a few lines (just for lnwire.Init
) which encode/decode the aux features within ExtraData
, which is a bit more lean, but then again for the other messages we'd have to maintain the current approach as they don't have a feature-vec field.
611a9fc
to
3d4c18f
Compare
3d4c18f
to
f9e10d7
Compare
Also guarded the new hooks with the |
f9e10d7
to
cf4c996
Compare
Pushed an update that uses the new LND aux negotiator interface. |
Will have to update golang to v1.24.6, will probably create a separate PR for that and rebase |
Can be rebased now! |
|
||
srvrLog.Tracef("GetInitRecords called, peer=%s", peer) | ||
|
||
if err := s.waitForReady(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this here? IIUC GetInitRecords()
will just read some static variables.
We need to be careful here to not introduce yet another deadlock bug when lnd
is trying to start up but tapd
hasn't been fully initialized yet.
I don't think any of these need waitForReady
, as they don't interact with any outside daemon/sub-system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're always using the aux chan negotiator, which needs to be initialized by the server.
Without this we'll be racing against the server, occasionally panicking because of nil dereference.
For the init records we could actually have it be static and detached from the negotiator -- the rest of the calls I'm not so sure about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this we'll be racing against the server, occasionally panicking because of nil dereference.
Why would we panic?
I'm referring to issues like this: #1780.
Init can def be static.
Do we have a reason to include this? Given that we've seen deadlock instances when this wasn't needed?
cf4c996
to
14af993
Compare
Rebased on |
(Just noting for posterity that this will resolve #1573.) |
Thanks, added a |
@Roasbeef: review reminder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🪻
On the concerns related to servers reaching a deadlock waiting for each other to start: Currently the new aux hooks in tapd related to aux features are guarded by On the LND side the callsites for these new hooks reside within brontide and the htlcswitch links (created by brontide). Any other LND sub-server does not have its start-up affected by these new call-sites, which are also ran asynchronously in a goroutine. This PR is now ready to merge into |
Description
Adds the necessary subsystem to handle custom feature bit negotiation for tap channels. This allows us to introduce new channel features that would otherwise break backwards compatibility. We piggy-back on the existing LND messages (init & reestablish) to nest the
tlv.Blob
that encodes theCustomChannelType
(uint64) type.The set of active features over a channel is the intersection of the locally supported features and the features that the peer provided.
Currently we follow a "global" approach on the feature bits that we support. We don't make any distinctions between peers or channels. The locally supported feature bits is a static set.
We also don't allow reading/writing feature bits per channel, but per peer. For now the funding outpoint / funding blob arguments are ignored. When we establish a feature-set with a peer, that applies to all of our channels with that peer.
An older tapd node (i.e a node that does not contain the contents of this PR) will be treated as if they provided an empty feature set (
uint64
with0
's)Dependencies
LND lightningnetwork/lnd#10182
Lndclient lightninglabs/lndclient#239
LiT itest: lightninglabs/lightning-terminal#1138
Closes #1573