Skip to content
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

Gossip #95

Closed
wants to merge 20 commits into from
Closed

Gossip #95

wants to merge 20 commits into from

Conversation

ellemouton
Copy link
Owner

Change Description

Description of change / link to associated issue.

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

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.
Copy link

github-actions bot commented Nov 9, 2023

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@ellemouton ellemouton closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant