[1/7] lnwire: add new Gossip 1.75 messages#8044
Conversation
610fad0 to
20970c8
Compare
20970c8 to
9c03cfa
Compare
9c03cfa to
0491785
Compare
f06fad6 to
ba60010
Compare
3647e34 to
4074a8c
Compare
4074a8c to
0695472
Compare
b0d6a0e to
7d3db71
Compare
7d3db71 to
6ee21d7
Compare
Crypt-iQ
left a comment
There was a problem hiding this comment.
looks good, just a few questions
Roasbeef
left a comment
There was a problem hiding this comment.
Nice work! Need to cross ref with the spec, but the main comment is using tlv.RecordT in place of some of the new structs and helper functions.
6ee21d7 to
53084cb
Compare
Roasbeef
left a comment
There was a problem hiding this comment.
LGTM 🌊
Should be g2g after a linter fix:
Error: lnwire/interfaces.go:58:1: directive `//nolint:interfacebloat` is unused for linter "interfacebloat" (nolintlint)
yyforyongyu
left a comment
There was a problem hiding this comment.
Thanks for the effort in writing all those tests🙏 I think it's good to go, just a few nits. Will refresh the specs and post questions in the following PRs, if any.
| } | ||
|
|
||
| keys = append(keys, bitcoinKey1, bitcoinKey2) | ||
| } else { |
There was a problem hiding this comment.
Q: what if only one of the keys is set, like bitcoinKey1 is set but not bitcoinKey2?
There was a problem hiding this comment.
it will then fall to the else branch below which will fetch the on-chain script.
ie, we dont explicitly need to not allow that case I dont think. It could maybe be a valid future message potentially.
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 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 its 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.
So that it can be re-used elsewhere.
This commit makes an lnwallet.BlockChainIO available to the gossiper and uses it to construct a helper that can be used to fetch the pk script for a given SCID. This will be used for channel announcement verification in an upcoming commit.
from the graph package.
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.
And ensure that it implements the AnnounceSignatures interface.
And ensure that it implements the ChannelAnnouncement interface.
This commit adds the MsgHash helper function which can be used to calculate the digest of a message to be signed using schnorr signatures.
Add the new ChannelUpdate2 message and ensure that it implements the ChannelUpdate interface.
a826e6e to
077273e
Compare
|
Thanks for the review @Roasbeef & @yyforyongyu 🔈 |
This is the first step towards the Gossip 1.75 epic
In this PR, the definitions for the new gossip messages defined in the
taproot-gossip proposal are implemented. This includes:
announcement_signatures_2channel_announcement_2channel_update_2Various updates are also made to some existing messages such as
channel_readyandgossip_timestamp_rangeI expect there to still be a few updates to these messages as the proposal progresses