Skip to content

Commit a66d004

Browse files
committed
bump: tokio
1 parent 8c89755 commit a66d004

File tree

5 files changed

+30
-13
lines changed

5 files changed

+30
-13
lines changed

chain/ethereum/src/health.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
1+
use crate::adapter::EthereumAdapter as EthereumAdapterTrait;
2+
use crate::EthereumAdapter;
23
use std::sync::{Arc, RwLock};
34
use std::time::{Duration, Instant};
45
use tokio::time::sleep;
5-
use crate::adapter::EthereumAdapter as EthereumAdapterTrait;
6-
use crate::EthereumAdapter;
7-
86
#[derive(Debug)]
97
pub struct Health {
108
pub provider: Arc<EthereumAdapter>,

chain/ethereum/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
pub mod health;
21
mod adapter;
32
mod buffered_call_cache;
43
mod capabilities;
54
pub mod codec;
65
mod data_source;
76
mod env;
87
mod ethereum_adapter;
8+
pub mod health;
99
mod ingestor;
1010
mod polling_block_stream;
1111
pub mod runtime;

chain/ethereum/src/network.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ impl EthereumNetworkAdapters {
277277
let weights: Vec<_> = input
278278
.iter()
279279
.map(|a| {
280-
let health_checker = self.health_checkers.iter().find(|h| h.provider() == a.provider());
280+
let health_checker = self
281+
.health_checkers
282+
.iter()
283+
.find(|h| h.provider() == a.provider());
281284
let score = health_checker.map_or(1.0, |h| h.score());
282285
a.weight * score
283286
})
@@ -861,8 +864,14 @@ mod tests {
861864
vec![],
862865
);
863866

864-
let always_retest_adapters =
865-
EthereumNetworkAdapters::new(chain_id, manager.clone(), vec![], Some(1f64), false, vec![]);
867+
let always_retest_adapters = EthereumNetworkAdapters::new(
868+
chain_id,
869+
manager.clone(),
870+
vec![],
871+
Some(1f64),
872+
false,
873+
vec![],
874+
);
866875

867876
assert_eq!(
868877
no_retest_adapters
@@ -978,8 +987,14 @@ mod tests {
978987
ProviderCheckStrategy::MarkAsValid,
979988
);
980989

981-
let no_retest_adapters =
982-
EthereumNetworkAdapters::new(chain_id.clone(), manager, vec![], Some(0f64), false, vec![]);
990+
let no_retest_adapters = EthereumNetworkAdapters::new(
991+
chain_id.clone(),
992+
manager,
993+
vec![],
994+
Some(0f64),
995+
false,
996+
vec![],
997+
);
983998
assert_eq!(
984999
no_retest_adapters
9851000
.cheapest_with(&NodeCapabilities {

node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ prometheus = { version = "0.14.0", features = ["push"] }
4545
json-structural-diff = { version = "0.2", features = ["colorize"] }
4646
globset = "0.4.16"
4747
notify = "8.0.0"
48-
tokio = { version = "1", features = ["full"] }
48+
tokio = { version = "1.47.1", features = ["full"] }
4949

5050
[target.'cfg(unix)'.dependencies]
5151
pgtemp = { git = "https://github.com/graphprotocol/pgtemp", branch = "initdb-args" }

node/src/network_setup.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl AdapterConfiguration {
103103
}
104104
}
105105

106-
use graph_chain_ethereum::health::{Health, health_check_task};
106+
use graph_chain_ethereum::health::{health_check_task, Health};
107107

108108
pub struct Networks {
109109
pub adapters: Vec<AdapterConfiguration>,
@@ -297,7 +297,11 @@ impl Networks {
297297
},
298298
);
299299

300-
let health_checkers: Vec<_> = eth_adapters.clone().flat_map(|(_, adapters)| adapters).map(|adapter| Arc::new(Health::new(adapter.adapter.clone()))).collect();
300+
let health_checkers: Vec<_> = eth_adapters
301+
.clone()
302+
.flat_map(|(_, adapters)| adapters)
303+
.map(|adapter| Arc::new(Health::new(adapter.adapter.clone())))
304+
.collect();
301305
if weighted_rpc_steering {
302306
tokio::spawn(health_check_task(health_checkers.clone()));
303307
}

0 commit comments

Comments
 (0)