-
Notifications
You must be signed in to change notification settings - Fork 682
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
TIER1 implementation #8141
TIER1 implementation #8141
Conversation
@@ -67,9 +68,23 @@ impl ValidatorConfig { | |||
|
|||
#[derive(Clone)] | |||
pub struct Tier1 { | |||
/// Interval between attempts to connect to proxies of other TIER1 nodes. |
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.
BTW - if we fail to connect to a given validator - do we keep retrying forever or do we give up?
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.
we keep retrying forever.
|
||
// Override force_encoding for outbound Tier1 connections, | ||
// since Tier1Handshake is supported only with proto encoding. | ||
let force_encoding = match &stream.type_ { |
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.
do we still use forced encoding anywhere?
(as I don't like the fact that we're overwriting it silently 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.
yes, in tests.
@@ -77,4 +179,147 @@ impl super::NetworkState { | |||
self.config.event_sink.push(Event::Tier1AdvertiseProxies(new_data.clone())); | |||
new_data | |||
} | |||
|
|||
/// Closes TIER1 connections from nodes which are not TIER1 any more. |
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.
note to self: this part is not reviewed yet.
// Direct TIER1 connections have priority. | ||
for key in &accounts_data.keys { | ||
if let Some(conn) = tier1.ready_by_account_key.get(&key) { | ||
safe.insert(key, &conn.peer_info.id); |
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.
what should happen if validator_cfg is None?
should we still add these connections to the safe set?
I see that you do multiple times 'if Some(vc) = validator_cfg -- shouldn't we do this verification at the beginning of the method (and AFAIK - if validator_cfg is None- simply close all the connections and be done?)
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.
no, TIER1 proxies are not TIER1 nodes, but they also accept TIER1 connections.
Implemented TIER1 connections:
Monitoring of the TIER1 performance will come in the next PR.