Added option to send remote IP to peers#1326
Conversation
|
I am new to this community and using rust in general. |
TheBlueMatt
left a comment
There was a problem hiding this comment.
For adding it to the message, you'll need to edit InitMessage and add a new field, then add it to the TLV encoding in msgs.rs as defined for InitMessage.
I am not able to find where Also in |
|
Oops sorry, its |
|
I was able to find this in Do I have to add the field here or where |
|
Also is there any documentation I can refer to? I did go through the ldk website but there wasn't much info present there on init messages. |
|
You should add it as a field in the |
Thanks, I have added the net_address as a field and resolved some of the errors. Please tell me what else needs to be done. |
|
I ran the following code in Here is the assertion error How should I fix this? |
|
See the |
Codecov Report
@@ Coverage Diff @@
## main #1326 +/- ##
==========================================
+ Coverage 90.75% 90.78% +0.02%
==========================================
Files 73 73
Lines 41062 41002 -60
Branches 41062 41002 -60
==========================================
- Hits 37266 37223 -43
+ Misses 3796 3779 -17
Continue to review full report at Codecov.
|
How can I fix the |
|
You can rebase and squash intermediate commits to rewrite the history to make the code pass at each commit. |
|
Please have a look at the fuzz test as well |
|
This is the error I am getting I am not sure how to fix this. |
|
The |
|
I have fixed the warnings, is there anything else that needs to be done? |
valentinewallace
left a comment
There was a problem hiding this comment.
- should we open an issue to support this in
net-tokio? - do we care to expose our remote IP in the future, from the
Initmessages we receive?
I'm pretty fine to address all feedback in follow-up, since it's an external contributor PR and the code looks fine :)
|
Is there anything else that needs to be done here? |
|
You'll need to get your branch in order still as per: https://github.com/lightningdevkit/rust-lightning/pull/1326/files#r817983366 |
I have rebased it now. Is this alright? |
|
You should rename the commits to describe the changes that are happening in each, instead of "squashed commits". |
TheBlueMatt
left a comment
There was a problem hiding this comment.
One real comment and some style nits, thanks for sticking with it, this is looking great now!
| fn filter_addresses(ip_address: Option<NetAddress>) -> Option<NetAddress> { | ||
| match ip_address{ | ||
| // For IPv4 range 10.0.0.0 - 10.255.255.255 (10/8) | ||
| Some(NetAddress::IPv4{addr: [0xA, 0x00..=0xFF, _, _], port: _}) => None, |
There was a problem hiding this comment.
nit: this would be more readable if you replace all the 0x00..=0xff places with just _. Also, for IPv4, not using hex is more readable, since the traditional representation is decimal, my previous nit about hex was just for v6, where the traditional representation is hex.
Thank you so much! I couldn't have done this without your guidance! |
|
See #1326 (comment) please feel free to squash the last fixup commit down (I already checked with @jkczyz ). |
|
Looks like this is now randomly including one commit from upstream? |
I'm not really sure how to remove that, i used |
|
Take a look at the Bitcoin Core contributors guide, it has a section on how to do git rebases. |
|
Is there anything else that needs to be done? |
TheBlueMatt
left a comment
There was a problem hiding this comment.
Oops sorry, github didn't tag the PR as unread when you pushed...A few minor nits, needs a second review.
|
Can you squash down the two new commits into the first commit? Then LGTM. |
Sure |
valentinewallace
left a comment
There was a problem hiding this comment.
Needs rebase. Some optional nits but I'm ACK!
@TheBlueMatt do we care to expose our remote IP in the future or to use this for our node_announcements, from the Init messages we receive?
Yea, its something to consider using, totally, Its kinda nice cause we can completely automate it without our users having to care, I opened #1377 for the followup. |
|
Oops, this now needs rebase, sorry about that! |
|
Thank you so much! This was a great learning experience for me! @TheBlueMatt |
Fixes #1244