-
Notifications
You must be signed in to change notification settings - Fork 22
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
Exponse block/unblock functionality in da service #1122
base: master
Are you sure you want to change the base?
Conversation
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.
@bacv is this for testing purposes? If so it should not be exposed in builds.
No, this is to block unblock unwanted peers in DA network (malicious for example). |
why http api then? 🤔 |
At the moment temporal (with cooldown) or permantent (until unblocked) blocking is performed by DA Monitor - we want user to allow to modify this behaviour manually. |
I'm not sure this should happen manually. We can add a the |
Happy to change if needed. @bacv, @danielSanchezQ If you guys like we could also discuss it and spec out what needs to be done. |
How will you remove blacklisted peers if you change your mind? |
Yes monitor behaviour is already based on the linked behaviour - it is actually a superset, because it has temporary blocking. |
Maybe I'm missing something.I thought blacklisting was done through the manager policies. If a misbehaving peer is detected maybe is blacklisted right? If it is added automatically, we should have an automated policy for removing them as well. |
Ok, so monitor behaviour does track that. I thought it was the connection manager, hence my confusion. |
Yes, the decisions are made through the Policy - based on policy:
Even if the policy would have a way to determine when the peer is considered not malicious again, I think a user should have a way to block/unblock chosen peers, lets say because some new information about bad actors behind couple of nodes was uncovered. |
The PR looks good, one command seems worth adding - a command to get the list of currently blocked peers - what do you think @danielSanchezQ @pradovic ? Could it be added here or maybe not required. |
Yep, seems good as other services may need of that. Btw, As this command are growing, better to nest them.
Names are orientative... |
@bacv, @danielSanchezQ Thanks for the input! Everything should be implemented now. I am not sure do we need a call for temporary block as well, and should temporary blocked peers be part of blacklisted call. It is similar functionality, but not quite the same, as @bacv already mentioned. |
@@ -75,6 +78,13 @@ impl SamplingEvent { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] | |||
pub enum PeerRequest { |
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.
Just idea, could this be MonitorCommand
as it goes directly to the monitor behaviour?
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.
Makes sense, fixed!
Temporal block is to disconnect from unhealty peers with a hope that after some time has passed their operation will go back to normal. The cooldown interval is set in the config, and unless it's set to minutes, not seconds, then the user shouldn't be required to unblock them. Having unhealthy peer unblocked wouldn't change the outcome - if it fails to respond to the messages or refuses the connection, I don't see the reason to keep it unblocked manually. |
1. What does this PR implement?
Exponse block/unblock functionality in da service. This is the PR that enables the follow up which is adding http block/unblock functionality.
2. Does the code have enough context to be clearly understood?
Yes.
3. Who are the specification authors and who is accountable for this PR?
@bacv, @pradovic.
4. Is the specification accurate and complete?
Yes, but still debating.
5. Does the implementation introduce changes in the specification?
No.
Checklist
Warning
Do not merge the PR if any of the following is missing: