-
Notifications
You must be signed in to change notification settings - Fork 27
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
P2p: peer discouragement #1451
P2p: peer discouragement #1451
Conversation
PreservedInboundCountNewTransactions, PreservedInboundCountPing, | ||
}, | ||
}; | ||
|
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.
FYI: except for the TODO about naming, there is nothing new in this file, I've just moved PeerManagerConfig
to a separate file.
@@ -79,6 +82,136 @@ use crate::{ | |||
PeerManagerEvent, | |||
}; | |||
|
|||
async fn validate_invalid_connection<A, S>() |
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.
FYI: I just moved this test here from ban.rs
.await; | ||
} | ||
|
||
async fn inbound_connection_invalid_magic<A, T>() |
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.
FYI: again, this was moved from ban.rs
.
make_config_setting!(EnableFeelerConnections, bool, true); | ||
make_config_setting!(ForceDnsQueryIfNoGlobalAddressesKnown, bool, false); | ||
|
||
// TODO: this name is too generic, because not all peer manager settings are contained here. |
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.
Let's have a discussion about this at some point when you feel it's appropriate. Using words like "internal" can quickly become a mess.
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.
First round looks good. I'll review again when you're done with the details we discussed.
ecd6f1d
to
3e0f528
Compare
…ed; ban tests were rewritten; PeermanagerConfig was moved to a separate file; some cleanup
Peers are no longer automatically banned; Ban duration is now always specified explicitly by the user; Time formatting improvements; Wallet & rpc commands for printing reserved and discouraged addresses were added; Printing banned and discouraged addresses now also prints the expiration time;
3e0f528
to
a3e500d
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.
Looks good.
I just have one question. Because of the bloom filter in bitcoin you cannot retrieve all the elements. I'm not sure what is exact reason in case of discouragement but we are doing this intentionally, right?
[discussed] yes, we do this intentionally |
AnnounceAddrRequest
and are not included intoAddrListResponse
.humantime
crate, so it can be something like1y
(1 year) or3M
(3 months).Time
- instead of having a separate functionas_standard_printable_time
it now has custom implementations ofDebug
andDisplay
. The implementations delegate printing tochrono::DateTime<Utc>
, just likeas_standard_printable_time
, but also handle the case whenTime
is not representable viachrono::DateTime
.