diff --git a/Cargo.lock b/Cargo.lock index f21f233..f093b5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,49 +394,16 @@ dependencies = [ [[package]] name = "async-graphql" -version = "6.0.11" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298a5d587d6e6fdb271bf56af2dc325a80eb291fd0fc979146584b9a05494a8c" +checksum = "261fa27d5bff5afdf7beff291b3bc73f99d1529804c70e51b0fbc51e70b1c6a9" dependencies = [ - "async-graphql-derive 6.0.11", - "async-graphql-parser 6.0.11", - "async-graphql-value 6.0.11", + "async-graphql-derive", + "async-graphql-parser", + "async-graphql-value", "async-stream", "async-trait", - "base64 0.13.1", - "bytes", - "fast_chemail", - "fnv", - "futures-util", - "handlebars", - "http 0.2.11", - "indexmap 2.2.2", - "mime", - "multer 2.1.0", - "num-traits", - "once_cell", - "pin-project-lite", - "regex", - "serde", - "serde_json", - "serde_urlencoded", - "static_assertions", - "tempfile", - "thiserror", -] - -[[package]] -name = "async-graphql" -version = "7.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16926f97f683ff3b47b035cc79622f3d6a374730b07a5d9051e81e88b5f1904" -dependencies = [ - "async-graphql-derive 7.0.1", - "async-graphql-parser 7.0.1", - "async-graphql-value 7.0.1", - "async-stream", - "async-trait", - "base64 0.13.1", + "base64 0.21.7", "bytes", "fast_chemail", "fnv", @@ -445,7 +412,7 @@ dependencies = [ "http 1.0.0", "indexmap 2.2.2", "mime", - "multer 3.0.0", + "multer", "num-traits", "once_cell", "pin-project-lite", @@ -460,13 +427,13 @@ dependencies = [ [[package]] name = "async-graphql-axum" -version = "6.0.11" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a1c20a2059bffbc95130715b23435a05168c518fba9709c81fa2a38eed990c" +checksum = "93605d26b9da33b4cf6541906a9eb9e74396f1accbbc0f066e06f3b0869b84fc" dependencies = [ - "async-graphql 6.0.11", + "async-graphql", "async-trait", - "axum", + "axum 0.7.5", "bytes", "futures-util", "serde_json", @@ -478,57 +445,28 @@ dependencies = [ [[package]] name = "async-graphql-derive" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f329c7eb9b646a72f70c9c4b516c70867d356ec46cb00dcac8ad343fd006b0" -dependencies = [ - "Inflector", - "async-graphql-parser 6.0.11", - "darling", - "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", - "strum 0.25.0", - "syn 2.0.48", - "thiserror", -] - -[[package]] -name = "async-graphql-derive" -version = "7.0.1" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a7349168b79030e3172a620f4f0e0062268a954604e41475eff082380fe505" +checksum = "3188809947798ea6db736715a60cf645ba3b87ea031c710130e1476b48e45967" dependencies = [ "Inflector", - "async-graphql-parser 7.0.1", + "async-graphql-parser", "darling", "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "strum 0.25.0", + "strum 0.26.2", "syn 2.0.48", "thiserror", ] [[package]] name = "async-graphql-parser" -version = "6.0.11" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6139181845757fd6a73fbb8839f3d036d7150b798db0e9bb3c6e83cdd65bd53b" +checksum = "d4e65a0b83027f35b2a5d9728a098bc66ac394caa8191d2c65ed9eb2985cf3d8" dependencies = [ - "async-graphql-value 6.0.11", - "pest", - "serde", - "serde_json", -] - -[[package]] -name = "async-graphql-parser" -version = "7.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdc0adf9f53c2b65bb0ff5170cba1912299f248d0e48266f444b6f005deb1d" -dependencies = [ - "async-graphql-value 7.0.1", + "async-graphql-value", "pest", "serde", "serde_json", @@ -536,21 +474,9 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "6.0.11" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323a5143f5bdd2030f45e3f2e0c821c9b1d36e79cf382129c64299c50a7f3750" -dependencies = [ - "bytes", - "indexmap 2.2.2", - "serde", - "serde_json", -] - -[[package]] -name = "async-graphql-value" -version = "7.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cf4d4e86208f4f9b81a503943c07e6e7f29ad3505e6c9ce6431fe64dc241681" +checksum = "68e40849c29a39012d38bff87bfed431f1ed6c53fbec493294c1045d61a7ae75" dependencies = [ "bytes", "indexmap 2.2.2", @@ -658,25 +584,25 @@ dependencies = [ "metrics-exporter-prometheus 0.11.0", "once_cell", "opentelemetry-prometheus 0.11.0", - "opentelemetry_api 0.18.0", + "opentelemetry_api", "opentelemetry_sdk 0.18.0", "prometheus", ] [[package]] name = "autometrics" -version = "0.6.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cef5eb1e18adfb843202bf71587174e480ed67c0ca3e976bf40e82d9adce86" +checksum = "10eaae539e7319a3813dc8cd53776a7128bdd6d82067275c12586f5a0fce9137" dependencies = [ - "autometrics-macros 0.6.0", + "autometrics-macros 1.0.1", "cfg_aliases", - "http 0.2.11", + "http 1.0.0", "linkme", "metrics-exporter-prometheus 0.12.2", "once_cell", - "opentelemetry-prometheus 0.13.0", - "opentelemetry_sdk 0.20.0", + "opentelemetry-prometheus 0.14.1", + "opentelemetry_sdk 0.21.2", "prometheus", "prometheus-client", "spez", @@ -697,14 +623,15 @@ dependencies = [ [[package]] name = "autometrics-macros" -version = "0.6.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "543250f01aa62c3b2666e327b335be532845a35e440eb984f5e6bad69106833d" +checksum = "fdf7c9ebfee6425011c65788c746adf80fac99ba38957ba1cdb824b593cfc993" dependencies = [ "percent-encoding", "proc-macro2", "quote", - "syn 1.0.109", + "regex", + "syn 2.0.48", ] [[package]] @@ -714,12 +641,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", - "base64 0.21.7", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", - "headers", "http 0.2.11", "http-body 0.4.6", "hyper 0.14.28", @@ -731,16 +656,47 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", + "sync_wrapper 0.1.2", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core 0.4.3", + "base64 0.21.7", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", "serde_json", "serde_path_to_error", "serde_urlencoded", "sha1", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.21.0", "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -760,6 +716,50 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-extra" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" +dependencies = [ + "axum 0.7.5", + "axum-core 0.4.3", + "bytes", + "futures-util", + "headers", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "serde", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "axum-macros" version = "0.4.1" @@ -811,6 +811,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -2151,7 +2157,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.24", "serde", "serde_json", "syn 2.0.48", @@ -2213,7 +2219,7 @@ checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" dependencies = [ "chrono", "ethers-core", - "reqwest", + "reqwest 0.11.24", "semver 1.0.21", "serde", "serde_json", @@ -2238,7 +2244,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.24", "serde", "serde_json", "thiserror", @@ -2270,12 +2276,12 @@ dependencies = [ "jsonwebtoken", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.24", "serde", "serde_json", "thiserror", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tracing", "tracing-futures", "url", @@ -2430,7 +2436,7 @@ dependencies = [ "alloy-primitives", "alloy-sol-types", "anyhow", - "async-graphql 7.0.1", + "async-graphql", "base64 0.21.7", "bs58", "build-info", @@ -2458,7 +2464,7 @@ dependencies = [ "merkle-cbt", "object_store", "rand 0.8.5", - "reqwest", + "reqwest 0.11.24", "rustls 0.22.2", "rustls-pemfile 2.0.0", "secp256k1 0.28.2", @@ -2466,7 +2472,7 @@ dependencies = [ "serde_json", "serde_yaml", "sha2", - "tap_core 0.7.0 (git+https://github.com/semiotic-ai/timeline-aggregation-protocol)", + "tap_core 0.7.0", "tempfile", "thegraph", "tokio", @@ -2482,10 +2488,11 @@ name = "file-service" version = "0.0.1" dependencies = [ "anyhow", - "async-graphql 6.0.11", + "async-graphql", "async-graphql-axum", "autometrics 0.3.3", - "axum", + "axum 0.7.5", + "axum-extra", "axum-macros", "base64 0.21.7", "build-info", @@ -2515,7 +2522,7 @@ dependencies = [ "once_cell", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.11.24", "rustls 0.21.10", "rustls-pemfile 1.0.4", "secp256k1 0.28.2", @@ -2882,7 +2889,7 @@ source = "git+https://github.com/edgeandnode/toolshed?tag=graphql-http-v0.2.1#b2 dependencies = [ "anyhow", "async-trait", - "reqwest", + "reqwest 0.11.24", "serde", "serde_json", "thiserror", @@ -2918,6 +2925,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.0.0", + "indexmap 2.2.2", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.3.1" @@ -3016,14 +3042,14 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 0.2.11", + "http 1.0.0", "httpdate", "mime", "sha1", @@ -3031,22 +3057,11 @@ dependencies = [ [[package]] name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http 0.2.11", -] - -[[package]] -name = "headers-derive" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33cf300c485e3cbcba0235013fcc768723451c9b84d1b31aa7fec0491ac9a11" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "http 1.0.0", ] [[package]] @@ -3149,6 +3164,19 @@ dependencies = [ "http 1.0.0", ] +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.0.0", + "http-body 1.0.0", + "pin-project-lite", +] + [[package]] name = "http-types" version = "2.12.0" @@ -3198,7 +3226,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.24", "http 0.2.11", "http-body 0.4.6", "httparse", @@ -3219,11 +3247,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" dependencies = [ "bytes", + "futures-channel", + "futures-util", + "h2 0.4.4", "http 1.0.0", "http-body 1.0.0", + "httparse", "httpdate", + "itoa", "pin-project-lite", "tokio", + "want", ] [[package]] @@ -3278,6 +3312,42 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "hyper 1.1.0", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "iana-time-zone" version = "0.1.59" @@ -3364,40 +3434,40 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexer-common" version = "0.1.0" -source = "git+https://github.com/graphprotocol/indexer-rs?rev=8c97d04#8c97d0460d61d81fe8c73b10e0759c4c33cf69f6" +source = "git+https://github.com/graphprotocol/indexer-rs?rev=1966049#1966049e5552eab5aca84f6e49879d3fe1a8db98" dependencies = [ "alloy-primitives", "alloy-sol-types", "anyhow", "arc-swap", "async-trait", - "autometrics 0.6.0", - "axum", + "autometrics 1.0.1", + "axum 0.7.5", + "axum-extra", "bigdecimal 0.4.2", "build-info", "ethers", "ethers-core", "eventuals", - "graphql-http", - "headers", - "headers-derive", "keccak-hash", "lazy_static", "lru", "once_cell", "prometheus", "regex", - "reqwest", + "reqwest 0.12.4", "secp256k1 0.28.2", "serde", "serde_json", "sqlx", - "tap_core 0.7.0 (git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=790e31f)", + "tap_core 0.8.0", "thegraph", + "thegraph-graphql-http", "thiserror", "tokio", "tokio-util", "tower", + "tower-http", "tower_governor", "tracing", ] @@ -3972,24 +4042,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "multer" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 0.2.11", - "httparse", - "log", - "memchr", - "mime", - "spin 0.9.8", - "version_check", -] - [[package]] name = "multer" version = "3.0.0" @@ -4277,7 +4329,7 @@ dependencies = [ "percent-encoding", "quick-xml", "rand 0.8.5", - "reqwest", + "reqwest 0.11.24", "ring 0.17.7", "rustls-pemfile 2.0.0", "serde", @@ -4376,30 +4428,46 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e" dependencies = [ - "opentelemetry_api 0.18.0", + "opentelemetry_api", "opentelemetry_sdk 0.18.0", ] +[[package]] +name = "opentelemetry" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" +dependencies = [ + "futures-core", + "futures-sink", + "indexmap 2.2.2", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", +] + [[package]] name = "opentelemetry-prometheus" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06c3d833835a53cf91331d2cfb27e9121f5a95261f31f08a1f79ab31688b8da8" dependencies = [ - "opentelemetry", + "opentelemetry 0.18.0", "prometheus", "protobuf", ] [[package]] name = "opentelemetry-prometheus" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d81bc254e2d572120363a2b16cdb0d715d301b5789be0cfc26ad87e4e10e53" +checksum = "6f8f082da115b0dcb250829e3ed0b8792b8f963a1ad42466e48422fbe6a079bd" dependencies = [ "once_cell", - "opentelemetry_api 0.20.0", - "opentelemetry_sdk 0.20.0", + "opentelemetry 0.21.0", + "opentelemetry_sdk 0.21.2", "prometheus", "protobuf", ] @@ -4420,22 +4488,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "opentelemetry_api" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] - [[package]] name = "opentelemetry_sdk" version = "0.18.0" @@ -4450,7 +4502,7 @@ dependencies = [ "futures-executor", "futures-util", "once_cell", - "opentelemetry_api 0.18.0", + "opentelemetry_api", "percent-encoding", "rand 0.8.5", "thiserror", @@ -4458,18 +4510,18 @@ dependencies = [ [[package]] name = "opentelemetry_sdk" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +checksum = "2f16aec8a98a457a52664d69e0091bac3a0abd18ead9b641cb00202ba4e0efe4" dependencies = [ "async-trait", "futures-channel", "futures-executor", "futures-util", + "glob", "once_cell", - "opentelemetry_api 0.20.0", + "opentelemetry 0.21.0", "ordered-float", - "regex", "thiserror", ] @@ -4481,9 +4533,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "3.9.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" dependencies = [ "num-traits", ] @@ -5002,9 +5054,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ "dtoa", "itoa", @@ -5363,12 +5415,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.24", "http 0.2.11", "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -5384,7 +5436,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -5397,7 +5449,49 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.4.4", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.0.0", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.52.0", ] [[package]] @@ -6533,6 +6627,15 @@ dependencies = [ "strum_macros 0.25.3", ] +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros 0.26.2", +] + [[package]] name = "strum_macros" version = "0.24.3" @@ -6559,6 +6662,19 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.48", +] + [[package]] name = "subtle" version = "2.5.0" @@ -6575,7 +6691,7 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", + "reqwest 0.11.24", "semver 1.0.21", "serde", "serde_json", @@ -6637,6 +6753,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -6679,8 +6801,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tap_core" version = "0.7.0" -source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=790e31f#790e31fa3d2c1844c332e5a7ff8bb012c9c5a187" +source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol#2f7c2680974d88a1de80123745c5df4862e08a27" dependencies = [ + "alloy-primitives", "alloy-sol-types", "anyhow", "async-trait", @@ -6695,15 +6818,15 @@ dependencies = [ "serde", "strum 0.24.1", "strum_macros 0.24.3", - "thegraph", "thiserror", "tokio", ] [[package]] name = "tap_core" -version = "0.7.0" -source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol#2f7c2680974d88a1de80123745c5df4862e08a27" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad526409d342a57c965a18f6a9138f999b12ca5d0529c198f8ae4a2395b0561" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -6765,7 +6888,7 @@ source = "git+https://github.com/edgeandnode/toolshed?tag=thegraph-v0.5.0#7ab59b dependencies = [ "alloy-primitives", "alloy-sol-types", - "async-graphql 7.0.1", + "async-graphql", "bs58", "ethers-core", "lazy_static", @@ -6775,6 +6898,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "thegraph-graphql-http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b7231f969a5168347a7efac9f92cc83a4ada280238139ade4d82d45360b99c" +dependencies = [ + "async-trait", + "reqwest 0.12.4", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "thiserror" version = "1.0.56" @@ -6964,10 +7100,22 @@ dependencies = [ "rustls 0.21.10", "tokio", "tokio-rustls", - "tungstenite", + "tungstenite 0.20.1", "webpki-roots", ] +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.21.0", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -7070,10 +7218,10 @@ checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.21.7", "bytes", - "h2", + "h2 0.3.24", "http 0.2.11", "http-body 0.4.6", "hyper 0.14.28", @@ -7109,6 +7257,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.4.2", + "bytes", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.2" @@ -7123,21 +7288,17 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tower_governor" -version = "0.1.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db81d9313372d714152194f3f2b66badda23a783fb6a97462e35f632814f4cff" +checksum = "3790eac6ad3fb8d9d96c2b040ae06e2517aa24b067545d1078b96ae72f7bb9a7" dependencies = [ - "axum", + "axum 0.7.5", "forwarded-header-value", - "futures 0.3.30", - "futures-core", "governor", - "http 0.2.11", + "http 1.0.0", "pin-project", "thiserror", - "tokio", "tower", - "tower-layer", "tracing", ] @@ -7252,6 +7413,25 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.0.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typenum" version = "1.17.0" @@ -7777,6 +7957,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wiremock" version = "0.5.22" diff --git a/file-service/Cargo.toml b/file-service/Cargo.toml index cfc0e97..ac215cf 100644 --- a/file-service/Cargo.toml +++ b/file-service/Cargo.toml @@ -14,18 +14,14 @@ path = "src/main.rs" [dependencies] file-exchange = { path = "../file-exchange" } -# indexer-common = { package = "indexer-common", git = "https://github.com/graphprotocol/indexer-rs", rev = "3069008" } -indexer-common = { package = "indexer-common", git = "https://github.com/graphprotocol/indexer-rs", rev = "8c97d04" } +indexer-common = { package = "indexer-common", git = "https://github.com/graphprotocol/indexer-rs", rev = "1966049" } thegraph = { git = "https://github.com/edgeandnode/toolshed", tag = "thegraph-v0.5.0" } anyhow = "1.0" -# async-graphql = "6.0.11" async-graphql = "7.0.3" async-graphql-axum = "7.0.3" -# async-graphql-axum = "6.0.11" autometrics = { version = "0.3.3", features = ["prometheus-exporter"] } axum = { version = "0.7.5", default_features = true } axum-extra = { version = "0.9.3", features = ["typed-header"] } -#axum = "0.6.20" sha3 = "0.10.6" base64 = "0.21" build-info = "0.0.34" diff --git a/file-service/src/admin.rs b/file-service/src/admin.rs index c70e74b..c7ec3c6 100644 --- a/file-service/src/admin.rs +++ b/file-service/src/admin.rs @@ -2,14 +2,13 @@ use std::collections::HashMap; use std::sync::Arc; use async_graphql::{Context, EmptySubscription, MergedObject, Object, Schema}; -use async_graphql_axum::{GraphQLRequest, GraphQLResponse, GraphQL}; -use axum::{extract::State, routing::get, Router, serve}; +use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; +use axum::{extract::State, http::header::HeaderMap, routing::get, serve, Router}; +use core::net::SocketAddr; use file_exchange::{ config::{BundleArgs, PublisherArgs}, publisher::ManifestPublisher, }; -use core::net::SocketAddr; -use http::HeaderMap; use tokio::net::TcpListener; use tokio::sync::Mutex; @@ -84,9 +83,8 @@ async fn graphql_handler( context.state.admin_schema.execute(req).await.into() } -pub fn serve_admin(context: ServerContext) { +pub fn serve_admin(context: ServerContext) { tokio::spawn(async move { - let admin_schema= build_schema().await; let admin_context = AdminContext::new( AdminState { client: context.state.client.clone(), @@ -94,7 +92,7 @@ pub fn serve_admin(context: ServerContext) { files: context.state.files.clone(), prices: context.state.prices.clone(), admin_auth_token: context.state.admin_auth_token.clone(), - admin_schema: admin_schema.clone(), + admin_schema: build_schema().await, store: context.state.store.clone(), } .into(), @@ -104,7 +102,7 @@ pub fn serve_admin(context: ServerContext) { , "Serve admin metrics"); let router = Router::new() - .route("/admin", get(graphql_playground).post_service(GraphQL::new(admin_schema))) + .route("/admin", get(graphql_playground).post(graphql_handler)) .with_state(admin_context); let listener = TcpListener::bind(&addr) @@ -114,11 +112,8 @@ pub fn serve_admin(context: ServerContext) { listener, router.into_make_service_with_connect_info::(), ) - .await.expect("Failed to initialize admin server"); - // Server::bind(&addr) - // .serve(router.into_make_service()) - // .await - // .expect("Failed to initialize admin server") + .await + .expect("Failed to initialize admin server"); }); } diff --git a/file-service/src/file_server/mod.rs b/file-service/src/file_server/mod.rs index ac86b09..706781c 100644 --- a/file-service/src/file_server/mod.rs +++ b/file-service/src/file_server/mod.rs @@ -1,6 +1,7 @@ // #![cfg(feature = "acceptor")] use axum::{ async_trait, + http::StatusCode, response::{IntoResponse, Response}, }; @@ -25,7 +26,6 @@ use file_exchange::util::public_key; use file_exchange::{errors::Error, manifest::store::Store}; // #![cfg(feature = "acceptor")] // use hyper_rustls::TlsAcceptor; -use hyper::StatusCode; pub mod cost; pub mod range; @@ -201,11 +201,11 @@ impl IntoResponse for FileServiceError { // #[derive(Debug)] pub struct FileServiceResponse { - inner: hyper::Response, + inner: axum::response::Response, } impl IndexerServiceResponse for FileServiceResponse { - type Data = hyper::Response; + type Data = axum::response::Response; type Error = FileServiceError; // not used fn is_attestable(&self) -> bool { diff --git a/file-service/src/file_server/range.rs b/file-service/src/file_server/range.rs index 997659c..2452bda 100644 --- a/file-service/src/file_server/range.rs +++ b/file-service/src/file_server/range.rs @@ -1,6 +1,10 @@ // #![cfg(feature = "acceptor")] -use hyper::header::{CONTENT_LENGTH, CONTENT_RANGE}; -use hyper::{Body, Response, StatusCode}; +use crate::file_server::StatusCode; +use axum::{ + body::Body, + http::header::{CONTENT_LENGTH, CONTENT_RANGE}, + response::Response, +}; use object_store::path::Path; use std::io::Read; diff --git a/file-service/src/file_server/service.rs b/file-service/src/file_server/service.rs index 7664f7c..b180606 100644 --- a/file-service/src/file_server/service.rs +++ b/file-service/src/file_server/service.rs @@ -5,7 +5,8 @@ use indexer_common::indexer_service::http::IndexerServiceImpl; use thegraph::types::DeploymentId; // #![cfg(feature = "acceptor")] // use hyper_rustls::TlsAcceptor; -use hyper::{Body, Response, StatusCode}; +use crate::file_server::StatusCode; +use axum::{body::Body, response::Response}; use super::{ bundle_containing_file, diff --git a/file-service/src/metrics.rs b/file-service/src/metrics.rs index f09cef0..48bc89e 100644 --- a/file-service/src/metrics.rs +++ b/file-service/src/metrics.rs @@ -1,14 +1,10 @@ use autometrics::encode_global_metrics; -use axum::http::StatusCode; -use axum::routing::get; -// use axum::{Router, Server}; -use axum::Router; -use axum::serve; -use tokio::net::TcpListener; +use axum::{http::StatusCode, routing::get, serve, Router}; use core::net::SocketAddr; use once_cell::sync::Lazy; use prometheus::{core::Collector, Registry}; use prometheus::{HistogramOpts, HistogramVec, IntGaugeVec, Opts}; +use tokio::net::TcpListener; use crate::config::ServerArgs; @@ -86,12 +82,6 @@ pub fn serve_metrics(config: &ServerArgs) { let app = Router::new().route("/metrics", get(get_metrics)); let metrics_addr = config.metrics_host_and_port.unwrap(); tokio::spawn(async move { - // Server::bind(&metrics_addr) - // .serve(app.into_make_service()) - // .await - // .expect("Failed to initialize metrics server") - - let listener = TcpListener::bind(&metrics_addr) .await .expect("Failed to bind to file-service metrics");