-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[n/n] Gossip 1.75 #8185
Draft
ellemouton
wants to merge
74
commits into
lightningnetwork:master
Choose a base branch
from
ellemouton:gossip175
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[n/n] Gossip 1.75 #8185
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In preparation for adding a new message, AnnounceSignatures2 along with an AnnounceSignatures interface, we rename the existing message to AnnounceSignatures1.
In preparation for adding the new ChannelAnnouncement2 message along with a ChannelAnnouncement interface, we rename the existing message to ChannelAnnouncement1.
In preparation for adding a new ChannelUpdate2 message and a ChannelUpdate interface, we rename the existing message to ChannelUpdate1.
In preparation for adding a new NodeAnnouncement2 message along with a NodeAnnouncement interface, we rename the existing message to NodeAnnouncement1.
Before this commit, any MuSig2Nonce TLV field used within a message is expected to use the same tlv type number. This is changed in this commit so that each message must specify which type number it wishes to use. This is necessary for if there is ever more than one MuSig2Nonce used within the same message or if it is ever used in a message with a conflicting type number.
This commits defines the RawFeatureVectorRecordProducer type which will allow RawFeatureVector type to be used for a TLV record.
Sometimes we have a set of records instead of a set of record producers that we would want to extract from. So this commit renames the existing `ExtractRecords` method to `ExtractRecordsFromProducers` (since extracting from producers is what it is actually doing) and then adds a new `ExtractRecords` method which extracts from records. The `ExtractRecordsFromProducers` method calls `ExtractRecords` after first converting the given `tlv.RecordProducers` into `tlv.Records`.
the `lnwire.ChannelType` type is just a `RawFeatureVector` underneath. Since we now have a more general `RawFeatureVectorRecordProducer`, we can use that for encoding the ChannelType.
The `ShortChannelID` type wont only be used for the `ChannelReady` message and so will sometimes have a type number other than 1. So in this commit, we make the type more re-usable by introducing a `ShortChannelIDRecordProducer` which wraps a `ShortChannelID` with a TLV type number.
In preparation for Gossip 1.75, we add new TLV's to the `ChannelReady` message. Namely: `AnnouncementBitcoinNonce` and `AnnouncementNodeNonce`. These will be used to exchange nones required for producing the partial signature to be send in the `AnnouncementSignatures2` message. The type numbers for these new fields are even because if they are set, then a peer is expecting it's peer to understand gossip 1.75 and the new fields.
Add new FirstBlockHeight and BlockRange TLV fields to the GossipTimestampRange message. This will be used to query for Gossip 1.75 messages which are timestamped using block height instead of Unix timestamps.
Add a AnnounceSignatures interface and ensure that AnnounceSignatures1 implements it.
Add a new ChannelAnnouncement interface and ensure that ChannelAnnouncement1 implements it.
In this commit, a new ChannelUpdate interface is added and ChannelUpdate1 is made to implement the new interface.
This commit adds the MsgHash helper funcion which can be used to calculate the digest of a message to be signed using schnorr signatures.
And ensure that it implements the AnnounceSignatures interface.
And ensure that it implements the ChannelAnnouncement interface.
Add the new ChannelUpdate2 message and ensure that it implements the ChannelUpdate interface.
To prepare for the addition of ChannelAuthProof2 along with a ChannelAuthProof interface, rename ChannelAuthProof to ChannelAuthProof1.
In preparation for the addition of ChannelEdgePolicy2 and a ChannelEdgePolicy interface, rename ChannelEdgePolicy to ChannelEdgePolicy1.
In preparaion for adding ChannelEdgeInfo2 and a ChannelEdgeInfo interface, rename ChannelEdgeInfo to ChannelEdgeInfo1.
Add new ChannelEdgeInfo and ChannelAuthProof interfaces and ensure that they are implemented by ChannelEdgeInfo1 and ChannelAuthProof respectively.
And ensure that ChannelEdgePolicy1 implements it.
And ensure that it implements the ChannelEdgeInfo interface.
And ensure that it implements the ChannelEdgePoicy interface.
With a migration to migrate existing entries in the waiting proof store to use a type byte prefix.
In this commit, we pass the MessageSignerRing around in places where Schnorr signing will be needed to sign Gossip 1.75 messages.
Update the ChannelUpdate modifiers to use the lnwire.ChannelUpdate interface instead of *lnwire.ChannelUpdate1.
...interface instead of ChannelUpdate1.
In the IsKeepAlive and IsStaleEdgePolicy functions
So that a start block and end block can also be passed in.
In preparation for the signing flow for the ChannelAnnouncement2 message, we add functionality here to store the bitcoin and node nonces sent to us by our peer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NB: This is just to give the bigger picture. I will split this PR into a string of reviewable PRs.
So this PR should always stay in draft.
In the spirit of "share early, share often".....
This mega PR is the current (total) state of the work that has been done for the
Gossip 1.75 epic.
What this covers:
With this PR, you can announce a taproot channel and learn about other taproot channels.
The itest "if tap chan -> make private chan" restrictions have been removed.
What it does not cover:
This does not cover the logic for creating and handling the new
node_announcement_2
message.That can be done in a follow up.
The flow (which will likely dictate the sub-PRs):
✅ = reviewable, 🖊️ = getting there, ✏️ = still rough
lnwire
: adding the new types and adding interfaces the v1 vs v2 types.channeldb
: adding the new types, interfaces to abstract the v1 vs v2 typeschanneldb
: nonce persistence & waiting proof store updates (+migration)lnwire
andchanneldb
interface types throughout lnd (this was done across quite a few commits to ease review)discovery
Use block heights during graph syncingfunding
channel_ready nonce exchangefunding
construct new node announcement etc