Skip to content

G7 #140

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

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open

G7 #140

wants to merge 60 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.

Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

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.
This commit moves the serialisation, deserialisation and update
functions for ChannelEdgePolicy1 and ChannelEdgeInfo1 into their own
files.
In this commit, we update the `putChanEdgeInfo` function to take in the
models.ChannelEdgeInfo interface. If the passed value is the legacy
models.ChannelEdgeInfo1, then the encoding and decoding remains the same
but if it is the new models.ChannelEdgeInfo2 then:
- the encoding will be prefixed with a 0xff byte. This should not clash
  with the encoding of the legacy struct since that encoding will always
  start with a pub key (of node 1) which means it will always start with
  0x02 or 0x03.
- The 0xff is then followed by a type-byte which will be used to
  identify the encoding that follows (this is to make it future proof).
  For now, there is only one possible type-byte here.
- This is then followed by the TLV encoding of ChannelEdgeInfo2.
Similarly to the previous commit, here we add the encoding for the new
ChannelEdgePolicy2. This is done in the same was as for
ChannelEdgeInfo2:
- a 0xff prefix
- followed by a type-byte
- followed by the TLV encoding of the ChannelEdgePolicy2.
In preparation for CachedEdgePolicy being used to represent
ChannelEdgePolicy1 or ChannelEdgePolicy2, we update it to have
IsDisabled and HasMaxHTLC booleans (which can be extracted from both
messages) instead of having the MessageFlags and ChannelFlags which only
applies to ChannelEdgePolicy1.
Update the graph cache to use the new ChannelEdgePolicy and
ChannelEdgeInfo interfaces where possible.
Add a new ChannelUpdate2 message which can be returned with a Failure.
Also add a block_height member to the RoutingPolicy which will be
populated when the last_update field is not.
...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.
@coveralls
Copy link

coveralls commented Oct 10, 2024

Pull Request Test Coverage Report for Build 11273420909

Details

  • 3326 of 5082 (65.45%) changed or added relevant lines in 56 files are covered.
  • 76 unchanged lines in 16 files lost coverage.
  • Overall coverage increased (+9.7%) to 58.882%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lnwire/channel_update_2.go 17 18 94.44%
routing/router.go 6 7 85.71%
channeldb/graph_cache.go 41 43 95.35%
discovery/chan_series.go 18 20 90.0%
htlcswitch/link.go 11 13 84.62%
htlcswitch/switch.go 8 10 80.0%
lnwire/announcement_signatures_2.go 30 32 93.75%
netann/chan_status_manager.go 7 9 77.78%
peer/brontide.go 29 31 93.55%
discovery/message_store.go 9 12 75.0%
Files with Coverage Reduction New Missed Lines %
discovery/syncer.go 1 86.38%
routing/localchans/manager.go 1 59.4%
peer/ping_manager.go 1 86.36%
discovery/chan_series.go 1 80.73%
lnrpc/routerrpc/router_backend.go 2 65.87%
rpcserver.go 2 70.9%
peer/brontide.go 3 78.37%
discovery/sync_manager.go 3 91.79%
funding/manager.go 4 73.72%
chainntnfs/interface.go 4 69.54%
Totals Coverage Status
Change from base Build 11271602163: 9.7%
Covered Lines: 132771
Relevant Lines: 225485

💛 - Coveralls

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.

2 participants