-
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
neutrinokitserver: Added unban peer feature #7606
base: master
Are you sure you want to change the base?
Conversation
98ad4fb
to
5c88b17
Compare
Hi @Chinwendu20 - thanks for the PR One thing that stands out from the commits is that you are making use off the new RPC endpoints before actually adding the proto definitions. This means that each commit individually will not compile - even though the end product might compile. Please also take a closer look at our contribution guidelines for commit titles and messages. |
Thank you so much for the review, I would reset the commits and apply them again. I need clarity on the below
Thank you. |
yes the proto changes should be committed first because otherwise your first commit (the lncli one) does not compile right? see the detail here. package first, short description for the title (ideally under 50 chars) and then you can add as much detail as you like in the commit body. |
e8fe58a
to
8bfca7e
Compare
Hello @ellemouton I believe I have worked on review now. |
I can see there are some merge commits as I was trying to update my branch. Would that be a problem? I am trying to figure out how to update my branch without creating merge commits. |
Hi @Chinwendu20 - yes the merge commits need to please be removed. Perhaps take sometime looking into git |
What you are trying to do is called "rebasing". You want to rebase your local branch onto the latest version of |
So helpful, thanks a lot @guggero |
Is there a command to update the neutrino.yaml? Or I would have to do that manually |
That file needs to be edited manually. It will then be used to generate some more code when running My suggestion for the new RPC would be:
This requires you to change |
Closing due to inactivity |
9 similar comments
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
!lightninglabs-deploy mute |
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
318b7fd
to
37bd866
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.
Nice and clean! Almost there 👍
cmd/lncli/neutrino_active.go
Outdated
@@ -225,6 +225,51 @@ func getCFilter(ctx *cli.Context) error { | |||
return nil | |||
} | |||
|
|||
var unbanPeerCommand = cli.Command{ | |||
Name: "unbanPeer", |
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.
s/unbanPeer/unbanpeer
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.
Thanks just that unban and peer are two separate words so I was following the convention
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.
yeah but see how the other commands are done, for example addpeer
lnrpc/neutrinorpc/neutrino.proto
Outdated
|
||
// Indicates if the peer to be unbanned should be connected as a | ||
// permanent peer. | ||
bool permanent = 2; |
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.
can we make the name more descriptive? maybe something like perm_connect
? just a suggestion.
cmd/lncli/neutrino_active.go
Outdated
Action: actionDecorator(unbanPeer), | ||
Flags: []cli.Flag{ | ||
cli.BoolFlag{ | ||
Name: "permanent", |
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.
maybe permconnect
or something to make it more clear this has to do with how we connect to the peer?
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.
I will change to permconnect
, thanks.
// Display the command's help message if we do not have the expected | ||
// number of arguments/flags. | ||
if ctx.NArg() != 1 || ctx.NumFlags() > 1 { | ||
return cli.ShowCommandHelp(ctx, "unbanpeer") |
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 doesnt work cause it doesnt match the command name. Suggest changing the command name to this though
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.
Nice catch, thanks!
cmd/lncli/neutrino_active.go
Outdated
}, | ||
} | ||
|
||
func unbanPeer(ctx *cli.Context) 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.
suggest: unbanNeutrinoPeer
cmd/lncli/neutrino_active.go
Outdated
Name: "permanent", | ||
Usage: "indicates if the peer to be unbanned should " + | ||
"be connected as a permanent peer. If set, " + | ||
"it connects as a permanent peer", |
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.
nit: the second sentence isnt needed imo. It just repeats the first sentence
* [Added unbanPeer command](https://github.com/lightningnetwork/lnd/pull/7606/). | ||
This would enable unbanning and connecting to a previously banned peer using | ||
the lncli command. | ||
|
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.
can move these to 0.18.1 now :)
go.mod
Outdated
@@ -208,3 +208,5 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d | |||
go 1.21.4 | |||
|
|||
retract v0.0.2 | |||
|
|||
replace github.com/lightninglabs/neutrino => github.com/Chinwendu20/neutrino v0.0.0-20240514174050-3275e33e5504 |
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.
can point to the merge commit instead now so that the ci can run against latest version 👍
lnrpc/neutrinorpc/neutrino.proto
Outdated
message UnbanPeerResponse { | ||
} |
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.
i think the general pattern we are aiming towards with responses is to include a string status
so that the user sees some sort of success message instead of just an empty JSON struct.
See message BumpFeeResponse {
for an example of this
Hello @ellemouton thanks a lot for the review, dropped a comment here: lightninglabs/neutrino#253 (comment) |
9b88479
to
b4437e8
Compare
Signed-off-by: Ononiwu Maureen <[email protected]>
Signed-off-by: Ononiwu Maureen <[email protected]>
Signed-off-by: Ononiwu Maureen <[email protected]>
Example usage: lncli neutrino unBanPeer <peer node address> Signed-off-by: Ononiwu Maureen <[email protected]>
Signed-off-by: Ononiwu Maureen <[email protected]>
Change Description
Fixes issue lightninglabs/neutrino#253
Steps to Test
If your full node does not serve compact filter you should see this output:
In the output you should not see "COMPACT_FILTERS" in the "localservicesnames" key
You should see the full Bitcoin node gets banned in lnd logs:
Then
If your full node serves compact filters you should see this output:
There should be "COMPACT_FILTERS" in the "localservicesnames" key.
Example of bitcoin address could be 127.0.0.1:8766. Where 127.0.0.1 is the host IP address of your Bitcoin node and 8766 is the port not rpc port (It confused me at first, lol) of your bitcoin node. It is optional and if not specified the default port would be used. If you did not specify a port in your configuration file that is not the default port that should not be a problem.
Expected output:
To test the
unbanPeer
command. Run this command:You should see the full Bitcoin node gets unbanned in lnd logs:
Expected output:
The peer has been unbanned and we do not have to wait for the ban duration period.
Associated PR in neutrino: lightninglabs/neutrino#270
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.