removes staked-nodes updater service excessive locks on gossip (#29936)
This commit is contained in:
parent
652955d053
commit
efb8a53b28
|
@ -128,18 +128,13 @@ impl StakedNodesUpdaterService {
|
|||
ip_to_stake_map: &mut HashMap<IpAddr, u64>,
|
||||
staked_map_overrides: &HashMap<Pubkey, u64>,
|
||||
) {
|
||||
for (id_override, stake_override) in staked_map_overrides.iter() {
|
||||
if let Some(ip_override) =
|
||||
cluster_info
|
||||
let nodes: HashMap<Pubkey, IpAddr> = cluster_info
|
||||
.all_peers()
|
||||
.into_iter()
|
||||
.find_map(|(node, _seen_time)| {
|
||||
if node.id == *id_override {
|
||||
return Some(node.tvu.ip());
|
||||
}
|
||||
None
|
||||
})
|
||||
{
|
||||
.map(|(node, _)| (node.id, node.tvu.ip()))
|
||||
.collect();
|
||||
for (id_override, stake_override) in staked_map_overrides {
|
||||
if let Some(&ip_override) = nodes.get(id_override) {
|
||||
if let Some(previous_stake) = id_to_stake_map.get(id_override) {
|
||||
*total_stake -= previous_stake;
|
||||
}
|
||||
|
@ -148,8 +143,9 @@ impl StakedNodesUpdaterService {
|
|||
ip_to_stake_map.insert(ip_override, *stake_override);
|
||||
} else {
|
||||
error!(
|
||||
"staked nodes overrides configuration for id {} with stake {} does not match existing IP. Skipping",
|
||||
id_override, stake_override
|
||||
"staked nodes overrides configuration for id \
|
||||
{id_override} with stake {stake_override} does not \
|
||||
match existing IP. Skipping",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue