-
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
Refactor gossip msg code #9384
base: master
Are you sure you want to change the base?
Refactor gossip msg code #9384
Conversation
This will make it simple in the next commits to test soley single messages rather than always the combination of announcement and channel update msg.
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
When the option SCID is used we need to make sure we update the channel data in an atomic way so that we don't miss any updates by our peer and remove all edge info which still uses the alias as the channel id (e.g. ChannelUpdate msgs). Moreover add unit test for the new ReAddEdge method.
In case we assume valid channels or have alias channels we make sure we also add the channel point to the block filter so that we are notified if the channel point is spent in a block.
We almost never need to create all messages at the same time (ChanUpdate,ChanAnnouncement,Proof) so we split it up into own functions.
7b4e121
to
681ab29
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 for commit "funding: refactor gossip msg code" 🏆
One proposal to increase test coverage.
chanID lnwire.ChannelID, fwdMinHTLC, fwdMaxHTLC lnwire.MilliSatoshi, | ||
ourPolicy *models.ChannelEdgePolicy, | ||
chanType channeldb.ChannelType) (*chanAnnouncement, error) { | ||
chanType channeldb.ChannelType) (*lnwire.ChannelAnnouncement1, 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.
This method uses f *Manager
only to get GenesisHash
.
Can it be turned into a pure function, accepting chainparams
as an argument? Then it can be covered by unit tests.
@yyforyongyu: review reminder |
depends on #8777
Splitted the Refactor code which was previously in 8777 into this PR.