diff --git a/Cargo.lock b/Cargo.lock index 22b04d4609c..f03b62d96cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,7 +538,7 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro-error", "proc-macro2", "quote", @@ -996,7 +996,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8910921b014e2af16298f006de12aa08af894b71f0f49a486ab6d74b17bbed" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 1.0.107", @@ -1632,7 +1632,7 @@ name = "graph-chain-common" version = "0.31.0" dependencies = [ "anyhow", - "heck 0.4.1", + "heck", "protobuf 3.2.0", "protobuf-parse", ] @@ -1810,7 +1810,7 @@ dependencies = [ name = "graph-runtime-derive" version = "0.31.0" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 1.0.107", @@ -2077,15 +2077,6 @@ dependencies = [ "http", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -3402,7 +3393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb5320c680de74ba083512704acb90fe00f28f79207286a848e730c45dd73ed6" dependencies = [ "bytes", - "heck 0.4.1", + "heck", "itertools 0.10.5", "lazy_static", "log", @@ -4302,14 +4293,15 @@ checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" [[package]] name = "strum_macros" -version = "0.21.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro2", "quote", - "syn 1.0.107", + "rustversion", + "syn 2.0.12", ] [[package]] @@ -5031,12 +5023,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - [[package]] name = "unicode-width" version = "0.1.8" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d92f6d17fb8..86a7d035dd0 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -34,7 +34,8 @@ services: command: [ "postgres", - "-cshared_preload_libraries=pg_stat_statements" + "-cshared_preload_libraries=pg_stat_statements", + "-cmax_connections=200" ] environment: POSTGRES_USER: graph-node diff --git a/graph/Cargo.toml b/graph/Cargo.toml index c9ed3498345..12f08b82f9d 100644 --- a/graph/Cargo.toml +++ b/graph/Cargo.toml @@ -39,7 +39,7 @@ slog = { version = "2.7.0", features = ["release_max_level_trace", "max_level_tr stable-hash_legacy = { version = "0.3.3", package = "stable-hash" } stable-hash = { version = "0.4.2" } strum = "0.21.0" -strum_macros = "0.21.1" +strum_macros = "0.25.2" slog-async = "2.5.0" slog-envlogger = "2.1.0" slog-term = "2.7.0" diff --git a/graph/src/components/store/entity_cache.rs b/graph/src/components/store/entity_cache.rs index 292ed91699d..0f8d0caed34 100644 --- a/graph/src/components/store/entity_cache.rs +++ b/graph/src/components/store/entity_cache.rs @@ -205,7 +205,7 @@ impl EntityCache { entity_field: field.name.clone().into(), value: eref.entity_id.clone(), causality_region: eref.causality_region, - id_is_bytes: id_is_bytes, + id_is_bytes, }; let mut entity_map = self.store.get_derived(&query)?; diff --git a/graph/src/components/subgraph/proof_of_indexing/event.rs b/graph/src/components/subgraph/proof_of_indexing/event.rs index f2ca94f1d60..6a7ae64a70b 100644 --- a/graph/src/components/subgraph/proof_of_indexing/event.rs +++ b/graph/src/components/subgraph/proof_of_indexing/event.rs @@ -3,10 +3,9 @@ use crate::prelude::{impl_slog_value, Value}; use stable_hash_legacy::StableHasher; use std::collections::{BTreeMap, HashMap}; use std::fmt; -use strum::AsStaticRef as _; -use strum_macros::AsStaticStr; +use strum_macros::IntoStaticStr; -#[derive(AsStaticStr)] +#[derive(IntoStaticStr)] pub enum ProofOfIndexingEvent<'a> { /// For when an entity is removed from the store. RemoveEntity { entity_type: &'a str, id: &'a str }, @@ -64,8 +63,8 @@ impl stable_hash_legacy::StableHash for ProofOfIndexingEvent<'_> { use stable_hash_legacy::prelude::*; use ProofOfIndexingEvent::*; - self.as_static() - .stable_hash(sequence_number.next_child(), state); + let str: &'static str = self.into(); + str.stable_hash(sequence_number.next_child(), state); match self { RemoveEntity { entity_type, id } => { entity_type.stable_hash(sequence_number.next_child(), state); @@ -123,7 +122,7 @@ impl stable_hash::StableHash for ProofOfIndexingEvent<'_> { /// sorted. impl fmt::Debug for ProofOfIndexingEvent<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let mut builder = f.debug_struct(self.as_static()); + let mut builder = f.debug_struct(self.into()); match self { Self::RemoveEntity { entity_type, id } => { builder.field("entity_type", entity_type); diff --git a/graph/src/data/store/mod.rs b/graph/src/data/store/mod.rs index 706331afd37..d80362dc39d 100644 --- a/graph/src/data/store/mod.rs +++ b/graph/src/data/store/mod.rs @@ -18,8 +18,7 @@ use std::convert::TryFrom; use std::fmt; use std::str::FromStr; use std::sync::Arc; -use strum::AsStaticRef as _; -use strum_macros::AsStaticStr; +use strum_macros::IntoStaticStr; use super::{ graphql::{ext::DirectiveFinder, TypeExt as _}, @@ -186,7 +185,7 @@ pub enum IdType { /// An attribute value is represented as an enum with variants for all supported value types. #[derive(Clone, Deserialize, Serialize, PartialEq, Eq)] #[serde(tag = "type", content = "data")] -#[derive(AsStaticStr)] +#[derive(IntoStaticStr)] pub enum Value { String(String), Int(i32), @@ -215,7 +214,7 @@ impl stable_hash_legacy::StableHash for Value { return; } stable_hash_legacy::StableHash::stable_hash( - &self.as_static().to_string(), + &Into::<&str>::into(self).to_string(), sequence_number.next_child(), state, ); diff --git a/runtime/wasm/Cargo.toml b/runtime/wasm/Cargo.toml index 42487e13ef6..f261c3d404a 100644 --- a/runtime/wasm/Cargo.toml +++ b/runtime/wasm/Cargo.toml @@ -16,7 +16,7 @@ semver = "1.0.18" lazy_static = "1.4" uuid = { version = "1.4.1", features = ["v4"] } strum = "0.21.0" -strum_macros = "0.21.1" +strum_macros = "0.25.2" bytes = "1.0" anyhow = "1.0" wasmtime = "0.27.0"