Skip to content

Commit

Permalink
Remove provider checks at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
mangas committed Apr 19, 2024
1 parent c3d8529 commit bf5aa3c
Show file tree
Hide file tree
Showing 5 changed files with 607 additions and 17 deletions.
12 changes: 9 additions & 3 deletions chain/ethereum/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ use anyhow::{anyhow, bail};
use graph::cheap_clone::CheapClone;
use graph::endpoint::EndpointMetrics;
use graph::firehose::{AvailableCapacity, SubgraphLimit};
use graph::parking_lot::RwLock;
use graph::prelude::chrono::{DateTime, Utc};
use graph::prelude::rand::seq::IteratorRandom;
use graph::prelude::rand::{self, Rng};
use jsonrpc_core::futures_util::future::join_all;
use std::cmp::Ordering;
use std::collections::HashMap;
use std::sync::atomic::{AtomicBool, AtomicU8};
use std::sync::Arc;

pub use graph::impl_slog_value;
Expand Down Expand Up @@ -46,9 +50,10 @@ impl EthereumNetworkAdapter {
}
}

#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct EthereumNetworkAdapters {
pub adapters: Vec<EthereumNetworkAdapter>,
// provider_status: ProviderGenesisVerification,
adapters: Vec<EthereumNetworkAdapter>,
call_only_adapters: Vec<EthereumNetworkAdapter>,
// Percentage of request that should be used to retest errored adapters.
retest_percent: f64,
Expand All @@ -66,6 +71,7 @@ impl EthereumNetworkAdapters {
adapters: vec![],
call_only_adapters: vec![],
retest_percent: retest_percent.unwrap_or(DEFAULT_ADAPTER_ERROR_RETEST_PERCENT),
// provider_status: ProviderGenesisVerification::default(),
}
}

Expand All @@ -76,7 +82,7 @@ impl EthereumNetworkAdapters {
self.adapters.push(adapter);
}
}
pub fn all_cheapest_with(
fn all_cheapest_with(
&self,
required_capabilities: &NodeCapabilities,
) -> impl Iterator<Item = &EthereumNetworkAdapter> + '_ {
Expand Down
2 changes: 1 addition & 1 deletion graph/src/blockchain/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl From<BlockPtr> for BlockNumber {
}
}

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
/// A collection of attributes that (kind of) uniquely identify a blockchain.
pub struct ChainIdentifier {
pub net_version: String,
Expand Down
Loading

0 comments on commit bf5aa3c

Please sign in to comment.