Skip to content
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

Update a few dependencies #5873

Merged
merged 6 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,17 @@ license = "MIT OR Apache-2.0"

[workspace.dependencies]
anyhow = "1.0"
async-graphql = { version = "7.0.15", features = ["chrono", "uuid"] }
async-graphql = { version = "7.0.15", features = ["chrono"] }
async-graphql-axum = "7.0.15"
axum = "0.8.1"
chrono = "0.4.38"
bs58 = "0.5.1"
clap = { version = "4.5.4", features = ["derive", "env"] }
derivative = "2.2.0"
diesel = { version = "2.2.4", features = [
"postgres",
"serde_json",
"numeric",
"r2d2",
"chrono",
"uuid",
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
] }
diesel = { version = "2.2.7", features = ["postgres", "serde_json", "numeric", "r2d2", "chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes"] }
diesel-derive-enum = { version = "2.1.0", features = ["postgres"] }
diesel-dynamic-schema = { version = "0.2.1", features = ["postgres"] }
diesel_derives = "2.1.4"
diesel-dynamic-schema = { version = "0.2.3", features = ["postgres"] }
diesel_derives = "2.2.3"
diesel_migrations = "2.1.0"
graph = { path = "./graph" }
graph-core = { path = "./core" }
Expand Down
1 change: 0 additions & 1 deletion chain/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ graph-runtime-derive = { path = "../../runtime/derive" }

[dev-dependencies]
base64 = "0"
uuid = { version = "1.15.1", features = ["v4"] }

[build-dependencies]
tonic-build = { workspace = true }
29 changes: 10 additions & 19 deletions chain/ethereum/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ mod tests {
url::Url,
};
use std::sync::Arc;
use uuid::Uuid;

use crate::{EthereumAdapter, EthereumAdapterTrait, ProviderEthRpcMetrics, Transport};

Expand Down Expand Up @@ -679,18 +678,14 @@ mod tests {
#[tokio::test]
async fn eth_adapter_selection_multiple_adapters() {
let logger = Logger::root(Discard, o!());
let unavailable_provider = Uuid::new_v4().to_string();
let error_provider = Uuid::new_v4().to_string();
let no_error_provider = Uuid::new_v4().to_string();
let unavailable_provider = "unavailable-provider";
let error_provider = "error-provider";
let no_error_provider = "no-error-provider";

let mock_registry = Arc::new(MetricsRegistry::mock());
let metrics = Arc::new(EndpointMetrics::new(
logger,
&[
unavailable_provider.clone(),
error_provider.clone(),
no_error_provider.clone(),
],
&[unavailable_provider, error_provider, no_error_provider],
mock_registry.clone(),
));
let logger = graph::log::logger(true);
Expand Down Expand Up @@ -718,7 +713,7 @@ mod tests {
];

// Set errors
metrics.report_for_test(&ProviderName::from(error_provider.clone()), false);
metrics.report_for_test(&ProviderName::from(error_provider), false);

let mut no_retest_adapters = vec![];
let mut always_retest_adapters = vec![];
Expand Down Expand Up @@ -796,26 +791,22 @@ mod tests {
#[tokio::test]
async fn eth_adapter_selection_single_adapter() {
let logger = Logger::root(Discard, o!());
let unavailable_provider = Uuid::new_v4().to_string();
let error_provider = Uuid::new_v4().to_string();
let no_error_provider = Uuid::new_v4().to_string();
let unavailable_provider = "unavailable-provider";
let error_provider = "error-provider";
let no_error_provider = "no-error-provider";

let mock_registry = Arc::new(MetricsRegistry::mock());
let metrics = Arc::new(EndpointMetrics::new(
logger,
&[
unavailable_provider,
error_provider.clone(),
no_error_provider.clone(),
],
&[unavailable_provider, error_provider, no_error_provider],
mock_registry.clone(),
));
let chain_id: Word = "chain_id".into();
let logger = graph::log::logger(true);
let provider_metrics = Arc::new(ProviderEthRpcMetrics::new(mock_registry.clone()));

// Set errors
metrics.report_for_test(&ProviderName::from(error_provider.clone()), false);
metrics.report_for_test(&ProviderName::from(error_provider), false);

let mut no_retest_adapters = vec![];
no_retest_adapters.push(EthereumNetworkAdapter {
Expand Down
1 change: 0 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ anyhow = "1.0"

[dev-dependencies]
tower-test = { git = "https://github.com/tower-rs/tower.git" }
uuid = { version = "1.15.1", features = ["v4"] }
wiremock = "0.6.1"
7 changes: 5 additions & 2 deletions core/src/polling_monitor/ipfs_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ mod test {
use graph::log::discard;
use graph::tokio;
use tower::ServiceExt;
use uuid::Uuid;
use wiremock::matchers as m;
use wiremock::Mock;
use wiremock::MockServer;
Expand All @@ -114,7 +113,11 @@ mod test {

#[tokio::test]
async fn cat_file_in_folder() {
let random_bytes = Uuid::new_v4().as_bytes().to_vec();
let random_bytes = "One morning, when Gregor Samsa woke \
from troubled dreams, he found himself transformed in his bed \
into a horrible vermin"
.as_bytes()
.to_vec();
let ipfs_file = ("dir/file.txt", random_bytes.clone());

let add_resp = add_files_to_local_ipfs_node_for_testing([ipfs_file])
Expand Down
1 change: 0 additions & 1 deletion runtime/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ graph = { path = "../../graph" }
bs58 = "0.4.0"
graph-runtime-derive = { path = "../derive" }
semver = "1.0.23"
uuid = { version = "1.15.1", features = ["v4"] }
anyhow = "1.0"
never = "0.1"

Expand Down
7 changes: 5 additions & 2 deletions runtime/wasm/src/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use graph::runtime::gas::Gas;
use parity_wasm::elements::ExportEntry;
use std::collections::BTreeMap;
use std::panic::AssertUnwindSafe;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::{panic, thread};

Expand All @@ -28,6 +29,8 @@ pub fn spawn_module<C: Blockchain>(
where
<C as Blockchain>::MappingTrigger: ToAscPtr,
{
static THREAD_COUNT: AtomicUsize = AtomicUsize::new(0);

let valid_module = Arc::new(ValidModule::new(&logger, raw_module, timeout)?);

// Create channel for event handling requests
Expand All @@ -39,8 +42,8 @@ where
// In case of failure, this thread may panic or simply terminate,
// dropping the `mapping_request_receiver` which ultimately causes the
// subgraph to fail the next time it tries to handle an event.
let conf =
thread::Builder::new().name(format!("mapping-{}-{}", &subgraph_id, uuid::Uuid::new_v4()));
let next_id = THREAD_COUNT.fetch_add(1, Ordering::SeqCst);
let conf = thread::Builder::new().name(format!("mapping-{}-{:0>4}", &subgraph_id, next_id));
conf.spawn(move || {
let _runtime_guard = runtime.enter();

Expand Down
1 change: 0 additions & 1 deletion store/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ postgres-openssl = "0.5.0"
rand = "0.8.4"
serde = { workspace = true }
serde_json = { workspace = true }
uuid = { version = "1.15.1", features = ["v4"] }
stable-hash_legacy = { git = "https://github.com/graphprotocol/stable-hash", branch = "old", package = "stable-hash" }
anyhow = "1.0.86"
git-testament = "0.2.5"
Expand Down
6 changes: 3 additions & 3 deletions store/postgres/src/store_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use graph::tokio_stream::wrappers::ReceiverStream;
use std::sync::{atomic::Ordering, Arc, RwLock};
use std::{collections::HashMap, sync::atomic::AtomicUsize};
use tokio::sync::mpsc::{channel, Sender};
use uuid::Uuid;

use crate::notification_listener::{NotificationListener, SafeChannelName};
use graph::components::store::SubscriptionManager as SubscriptionManagerTrait;
Expand Down Expand Up @@ -89,7 +88,7 @@ impl StoreEventListener {
/// Manage subscriptions to the `StoreEvent` stream. Keep a list of
/// currently active subscribers and forward new events to each of them
pub struct SubscriptionManager {
subscriptions: Arc<RwLock<HashMap<String, Sender<Arc<StoreEvent>>>>>,
subscriptions: Arc<RwLock<HashMap<usize, Sender<Arc<StoreEvent>>>>>,

/// Keep the notification listener alive
listener: StoreEventListener,
Expand Down Expand Up @@ -180,7 +179,8 @@ impl SubscriptionManager {

impl SubscriptionManagerTrait for SubscriptionManager {
fn subscribe(&self) -> StoreEventStreamBox {
let id = Uuid::new_v4().to_string();
static SUBSCRIPTION_COUNTER: AtomicUsize = AtomicUsize::new(0);
let id = SUBSCRIPTION_COUNTER.fetch_add(1, Ordering::SeqCst);

// Prepare the new subscription by creating a channel and a subscription object
let (sender, receiver) = channel(100);
Expand Down
Loading