diff --git a/Cargo.lock b/Cargo.lock index c337b9f7..22a12a09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8ebf106e84a1c37f86244df7da0c7587e697b71a0d565cce079449b85ac6f8" +checksum = "02b0561294ccedc6181e5528b850b4579e3fbde696507baa00109bfd9054c5bb" dependencies = [ "alloy-consensus", "alloy-contract", @@ -107,25 +107,41 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed961a48297c732a5d97ee321aa8bb5009ecadbcb077d8bec90cb54e651629" +checksum = "a101d4d016f47f13890a74290fdd17b05dd175191d9337bc600791fb96e4dea8" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", + "alloy-trie", "auto_impl", "c-kzg", "derive_more", + "k256", + "serde", +] + +[[package]] +name = "alloy-consensus-any" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa60357dda9a3d0f738f18844bd6d0f4a5924cc5cf00bfad2ff1369897966123" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", "serde", ] [[package]] name = "alloy-contract" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460ab80ce4bda1c80bcf96fe7460520476f2c7b734581c6567fac2708e2a60ef" +checksum = "2869e4fb31331d3b8c58c7db567d1e4e4e94ef64640beda3b6dd9b7045690941" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -139,7 +155,7 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -186,9 +202,9 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -199,9 +215,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" +checksum = "8b6755b093afef5925f25079dd5a7c8d096398b804ba60cb5275397b06b31689" dependencies = [ "alloy-eip2930", "alloy-eip7702", @@ -217,12 +233,13 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde15e14944a88bd6a57d325e9a49b75558746fe16aaccc79713ae50a6a9574c" +checksum = "aeec8e6eab6e52b7c9f918748c9b811e87dbef7312a2e3a2ca1729a92966a6af" dependencies = [ "alloy-primitives", "alloy-serde", + "alloy-trie", "serde", ] @@ -240,29 +257,31 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af5979e0d5a7bf9c7eb79749121e8256e59021af611322aee56e77e20776b4b3" +checksum = "4fa077efe0b834bcd89ff4ba547f48fb081e4fdc3673dd7da1b295a2cf2bb7b7" dependencies = [ "alloy-primitives", "alloy-sol-types", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.3", "tracing", ] [[package]] name = "alloy-network" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "204237129086ce5dc17a58025e93739b01b45313841f98fa339eb1d780511e57" +checksum = "209a1882a08e21aca4aac6e2a674dc6fcf614058ef8cb02947d63782b1899552" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", "alloy-primitives", + "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -270,14 +289,16 @@ dependencies = [ "async-trait", "auto_impl", "futures-utils-wasm", - "thiserror 1.0.69", + "serde", + "serde_json", + "thiserror 2.0.3", ] [[package]] name = "alloy-network-primitives" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514f70ee2a953db21631cd817b13a1571474ec77ddc03d47616d5e8203489fde" +checksum = "c20219d1ad261da7a6331c16367214ee7ded41d001fabbbd656fbf71898b2773" dependencies = [ "alloy-consensus", "alloy-eips", @@ -316,9 +337,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4814d141ede360bb6cd1b4b064f1aab9de391e7c4d0d4d50ac89ea4bc1e25fbd" +checksum = "9eefa6f4c798ad01f9b4202d02cea75f5ec11fa180502f4701e2b47965a8c0bb" dependencies = [ "alloy-chains", "alloy-consensus", @@ -347,7 +368,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.3", "tokio", "tracing", "url", @@ -356,9 +377,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba46eb69ddf7a9925b81f15229cb74658e6eebe5dd30a5b74e2cd040380573" +checksum = "aac9a7210e0812b1d814118f426f57eb7fc260a419224dd1c76d169879c06907" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -397,9 +418,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc2bd1e7403463a5f2c61e955bcc9d3072b63aa177442b0f9aa6a6d22a941e3" +checksum = "ed30bf1041e84cabc5900f52978ca345dd9969f2194a945e6fdec25b0620705c" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -423,9 +444,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea9bf1abdd506f985a53533f5ac01296bcd6102c5e139bbc5d40bc468d2c916" +checksum = "5ab686b0fa475d2a4f5916c5f07797734a691ec58e44f0f55d4746ea39cbcefb" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", @@ -434,11 +455,22 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-rpc-types-any" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200661999b6e235d9840be5d60a6e8ae2f0af9eb2a256dd378786744660e36ec" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", +] + [[package]] name = "alloy-rpc-types-engine" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886d22d41992287a235af2f3af4299b5ced2bcafb81eb835572ad35747476946" +checksum = "5d297268357e3eae834ddd6888b15f764cbc0f4b3be9265f5f6ec239013f3d68" dependencies = [ "alloy-consensus", "alloy-eips", @@ -452,11 +484,12 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b034779a4850b4b03f5be5ea674a1cf7d746b2da762b34d1860ab45e48ca27" +checksum = "a0600b8b5e2dc0cab12cbf91b5a885c35871789fb7b3a57b434bd4fced5b7a8b" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", "alloy-primitives", @@ -471,9 +504,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028e72eaa9703e4882344983cfe7636ce06d8cce104a78ea62fd19b46659efc4" +checksum = "9afa753a97002a33b2ccb707d9f15f31c81b8c1b786c95b73cc62bb1d1fd0c3f" dependencies = [ "alloy-primitives", "serde", @@ -482,9 +515,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592c185d7100258c041afac51877660c7bf6213447999787197db4842f0e938e" +checksum = "9b2cbff01a673936c2efd7e00d4c0e9a4dbbd6d600e2ce298078d33efbb19cd7" dependencies = [ "alloy-dyn-abi", "alloy-primitives", @@ -493,14 +526,14 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "alloy-signer-aws" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a406102908a4e51834f32c4e5c1b29aa2c407b3fd23a5cad129c28b56d85e1b8" +checksum = "71ce77227fdb9059fd7a3b38a8679c0dae95d81886ee8c13ef8ad99d74866bbd" dependencies = [ "alloy-consensus", "alloy-network", @@ -510,15 +543,15 @@ dependencies = [ "aws-sdk-kms", "k256", "spki", - "thiserror 1.0.69", + "thiserror 2.0.3", "tracing", ] [[package]] name = "alloy-signer-gcp" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d363e12280cb43747d3b62a1e6f00d595bc1a56464bb20200c6b6ca5d68185" +checksum = "7622438a51e1fa6379cad6bff52e0cde88b0d4e5e3f2f15e5feebdee527ef5f2" dependencies = [ "alloy-consensus", "alloy-network", @@ -528,15 +561,15 @@ dependencies = [ "gcloud-sdk", "k256", "spki", - "thiserror 1.0.69", + "thiserror 2.0.3", "tracing", ] [[package]] name = "alloy-signer-ledger" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a642c9f66ac73ae0d5398ce7ce3ce5bdfad5658d549abd48ea48962e585dca" +checksum = "b7b56789cbd13bace37acd7afd080aa7002ed65ab84f0220cd0c32e162b0afd6" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -548,15 +581,15 @@ dependencies = [ "coins-ledger", "futures-util", "semver 1.0.23", - "thiserror 1.0.69", + "thiserror 2.0.3", "tracing", ] [[package]] name = "alloy-signer-local" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6614f02fc1d5b079b2a4a5320018317b506fd0a6d67c1fd5542a71201724986c" +checksum = "bd6d988cb6cd7d2f428a74476515b1a6e901e08c796767f9f93311ab74005c8b" dependencies = [ "alloy-consensus", "alloy-network", @@ -567,7 +600,7 @@ dependencies = [ "coins-bip39", "k256", "rand", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -645,9 +678,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be77579633ebbc1266ae6fd7694f75c408beb1aeb6865d0b18f22893c265a061" +checksum = "d69d36982b9e46075ae6b792b0f84208c6c2c15ad49f6c500304616ef67b70e0" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -655,7 +688,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.3", "tokio", "tower 0.5.1", "tracing", @@ -665,9 +698,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fd1a5d0827939847983b46f2f79510361f901dc82f8e3c38ac7397af142c6e" +checksum = "2e02ffd5d93ffc51d72786e607c97de3b60736ca3e636ead0ec1f7dce68ea3fd" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -680,9 +713,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8073d1186bfeeb8fbdd1292b6f1a0731f3aed8e21e1463905abfae0b96a887a6" +checksum = "1b6f8b87cb84bae6d81ae6604b37741c8116f84f9784a0ecc6038c302e679d23" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -699,9 +732,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f27837bb4a1d6c83a28231c94493e814882f0e9058648a97e908a5f3fc9fcf" +checksum = "9c085c4e1e7680b723ffc558f61a22c061ed3f70eb3436f93f3936779c59cec1" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -715,6 +748,22 @@ dependencies = [ "ws_stream_wasm", ] +[[package]] +name = "alloy-trie" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5fd8fea044cc9a8c8a50bb6f28e31f0385d820f116c5b98f6f4e55d6e5590b" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec 0.7.6", + "derive_more", + "nybbles", + "serde", + "smallvec", + "tracing", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -926,6 +975,9 @@ name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +dependencies = [ + "serde", +] [[package]] name = "ascii" @@ -3538,7 +3590,6 @@ dependencies = [ name = "indexer-allocation" version = "0.1.0" dependencies = [ - "alloy", "anyhow", "indexer-query", "serde", @@ -3549,7 +3600,6 @@ dependencies = [ name = "indexer-attestation" version = "0.1.0" dependencies = [ - "alloy", "anyhow", "indexer-allocation", "test-assets", @@ -3561,7 +3611,6 @@ dependencies = [ name = "indexer-config" version = "1.2.2" dependencies = [ - "alloy", "bigdecimal", "bip39", "figment", @@ -3584,9 +3633,7 @@ dependencies = [ name = "indexer-dips" version = "0.1.0" dependencies = [ - "alloy", "alloy-rlp", - "alloy-sol-types", "anyhow", "thegraph-core", "thiserror 1.0.69", @@ -3596,7 +3643,6 @@ dependencies = [ name = "indexer-monitor" version = "0.1.0" dependencies = [ - "alloy", "anyhow", "axum", "bip39", @@ -3622,7 +3668,6 @@ dependencies = [ name = "indexer-query" version = "0.1.0" dependencies = [ - "alloy", "anyhow", "graphql_client", "serde", @@ -3633,7 +3678,6 @@ dependencies = [ name = "indexer-service-rs" version = "1.4.0" dependencies = [ - "alloy", "anyhow", "async-graphql", "async-graphql-axum", @@ -3691,7 +3735,6 @@ dependencies = [ name = "indexer-tap-agent" version = "1.7.4" dependencies = [ - "alloy", "anyhow", "async-trait", "axum", @@ -4543,6 +4586,19 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", +] + [[package]] name = "object" version = "0.36.5" @@ -6721,7 +6777,7 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tap_aggregator" version = "0.3.2" -source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=61b47b3#61b47b3b96aaa1437fc390eb581636d51134b006" +source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=1c6e29f#1c6e29f56fc1672087070c7e8e710bac0564e273" dependencies = [ "alloy", "anyhow", @@ -6745,7 +6801,7 @@ dependencies = [ [[package]] name = "tap_core" version = "2.0.0" -source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=61b47b3#61b47b3b96aaa1437fc390eb581636d51134b006" +source = "git+https://github.com/semiotic-ai/timeline-aggregation-protocol?rev=1c6e29f#1c6e29f56fc1672087070c7e8e710bac0564e273" dependencies = [ "alloy", "anyhow", @@ -6774,7 +6830,6 @@ dependencies = [ name = "test-assets" version = "0.1.0" dependencies = [ - "alloy", "bip39", "indexer-allocation", "lazy_static", @@ -6806,17 +6861,15 @@ dependencies = [ [[package]] name = "thegraph-core" -version = "0.7.0" -source = "git+https://github.com/edgeandnode/toolshed?rev=1663534fc1738e2db1b11cb54b5bb478ee970d40#1663534fc1738e2db1b11cb54b5bb478ee970d40" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e669ad507b7afcf8b2d303e98de2d8bcd7af56042a8626cd708838349cc4d928" dependencies = [ - "alloy-primitives", - "alloy-signer", - "alloy-sol-types", + "alloy", "bs58", "serde", "serde_with", "thiserror 1.0.69", - "url", ] [[package]] @@ -7691,9 +7744,9 @@ dependencies = [ [[package]] name = "wasmtimer" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", diff --git a/Cargo.toml b/Cargo.toml index 89bee41c..fd64e46c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,16 +17,6 @@ resolver = "2" opt-level = 3 [workspace.dependencies] -alloy = { version = "=0.5.4", features = [ - "kzg", - "signer-mnemonic", - "dyn-abi", - "sol-types", - "signer-local", - "eip712", - "rlp", - "signers", -], default-features = false } clap = "4.4.3" lazy_static = "1.4.0" axum = { version = "0.7.9", default-features = false, features = [ @@ -62,14 +52,23 @@ uuid = { version = "1.11.0", features = ["v7"] } tracing = { version = "0.1.40", default-features = false } bigdecimal = "0.4.3" build-info = "0.0.39" -tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "61b47b3", default-features = false } -tap_aggregator = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "61b47b3", default-features = false } +tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "1c6e29f", default-features = false } +tap_aggregator = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "1c6e29f", default-features = false } tracing-subscriber = { version = "0.3", features = [ "json", "env-filter", "ansi", ], default-features = false } -thegraph-core = { git = "https://github.com/edgeandnode/toolshed", rev = "1663534fc1738e2db1b11cb54b5bb478ee970d40" } +thegraph-core = { version = "0.9.6", features = [ + "attestation", + "alloy-eip712", + "alloy-sol-types", + "alloy-rlp", + "alloy-signers", + "alloy-signer-local", + "alloy-signer-mnemonic", + "serde" +] } thegraph-graphql-http = { version = "0.3.2", features = ["reqwest"] } graphql_client = { version = "0.14.0", features = ["reqwest-rustls"] } bip39 = "2.0.0" diff --git a/crates/allocation/Cargo.toml b/crates/allocation/Cargo.toml index 99453d25..47311d0e 100644 --- a/crates/allocation/Cargo.toml +++ b/crates/allocation/Cargo.toml @@ -6,6 +6,5 @@ edition = "2021" [dependencies] indexer-query = { path = "../query" } serde = { workspace = true, features = ["derive"] } -alloy.workspace = true thegraph-core.workspace = true anyhow.workspace = true diff --git a/crates/allocation/src/lib.rs b/crates/allocation/src/lib.rs index 9f2992f9..360ea786 100644 --- a/crates/allocation/src/lib.rs +++ b/crates/allocation/src/lib.rs @@ -3,10 +3,12 @@ use std::str::FromStr; -use alloy::primitives::{Address, U256}; use indexer_query::allocations_query; use serde::{Deserialize, Deserializer}; -use thegraph_core::DeploymentId; +use thegraph_core::{ + alloy::primitives::{Address, U256}, + DeploymentId, +}; #[derive(Clone, Debug, PartialEq, Eq)] pub struct Allocation { diff --git a/crates/attestation/Cargo.toml b/crates/attestation/Cargo.toml index 621651c5..71a4c08d 100644 --- a/crates/attestation/Cargo.toml +++ b/crates/attestation/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" [dependencies] indexer-allocation = { path = "../allocation" } -alloy.workspace = true thegraph-core.workspace = true anyhow.workspace = true diff --git a/crates/attestation/src/lib.rs b/crates/attestation/src/lib.rs index 004fdbac..26a169a4 100644 --- a/crates/attestation/src/lib.rs +++ b/crates/attestation/src/lib.rs @@ -1,16 +1,20 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{ - primitives::{Address, ChainId}, - signers::{ - k256, - local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, +use indexer_allocation::Allocation; +use thegraph_core::{ + alloy::{ + primitives::{Address, ChainId}, + signers::{ + k256, + local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, + }, + sol_types::Eip712Domain, }, - sol_types::Eip712Domain, + attestation, + attestation::Attestation, + DeploymentId, }; -use indexer_allocation::Allocation; -use thegraph_core::{attestation, Attestation, DeploymentId}; pub fn derive_key_pair( indexer_mnemonic: &str, @@ -119,10 +123,10 @@ fn wallet_for_allocation( mod tests { use std::str::FromStr; - use alloy::primitives::{address, U256}; use indexer_allocation::{Allocation, AllocationStatus, SubgraphDeployment}; use test_assets::DISPUTE_MANAGER_ADDRESS; use test_log::test; + use thegraph_core::alloy::primitives::{address, U256}; use super::*; diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index 078a6bba..9d599cb3 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -4,7 +4,6 @@ version = "1.2.2" edition = "2021" [dependencies] -alloy.workspace = true serde.workspace = true thegraph-core.workspace = true tracing.workspace = true diff --git a/crates/config/src/config.rs b/crates/config/src/config.rs index 852a1b57..9f4558c7 100644 --- a/crates/config/src/config.rs +++ b/crates/config/src/config.rs @@ -10,7 +10,6 @@ use std::{ time::Duration, }; -use alloy::primitives::Address; use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive}; use bip39::Mnemonic; use figment::{ @@ -21,7 +20,7 @@ use regex::Regex; use serde::Deserialize; use serde_repr::Deserialize_repr; use serde_with::{serde_as, DurationSecondsWithFrac}; -use thegraph_core::DeploymentId; +use thegraph_core::{alloy::primitives::Address, DeploymentId}; use url::Url; use crate::NonZeroGRT; @@ -423,9 +422,9 @@ pub struct RavRequestConfig { mod tests { use std::{env, fs, path::PathBuf, str::FromStr}; - use alloy::primitives::{Address, FixedBytes}; use figment::value::Uncased; use sealed_test::prelude::*; + use thegraph_core::alloy::primitives::{Address, FixedBytes}; use tracing_test::traced_test; use super::{DatabaseConfig, SHARED_PREFIX}; diff --git a/crates/dips/Cargo.toml b/crates/dips/Cargo.toml index cf481f7d..55dc8f9d 100644 --- a/crates/dips/Cargo.toml +++ b/crates/dips/Cargo.toml @@ -4,9 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy.workspace = true thiserror.workspace = true anyhow.workspace = true -alloy-sol-types = "=0.8.15" -alloy-rlp = "0.3.9" +alloy-rlp = "0.3.10" thegraph-core.workspace = true diff --git a/crates/dips/src/lib.rs b/crates/dips/src/lib.rs index 452dc148..1bd55f82 100644 --- a/crates/dips/src/lib.rs +++ b/crates/dips/src/lib.rs @@ -6,16 +6,14 @@ use std::{ time::{Duration, SystemTime, UNIX_EPOCH}, }; -pub use alloy; -use alloy::{ +use thegraph_core::alloy::{ core::primitives::Address, primitives::PrimitiveSignature as Signature, - rlp::{RlpDecodable, RlpEncodable}, + rlp::{Encodable, RlpDecodable, RlpEncodable}, signers::SignerSync, - sol_types::{sol, Eip712Domain, SolStruct}, + sol, + sol_types::{Eip712Domain, SolStruct}, }; -pub use alloy_rlp; -use alloy_rlp::Encodable; use thiserror::Error; sol! { @@ -216,12 +214,14 @@ impl SignedCancellationRequest { mod test { use std::time::{Duration, SystemTime, UNIX_EPOCH}; - use alloy::{ - primitives::{Address, FixedBytes, U256}, - signers::local::PrivateKeySigner, - sol_types::SolStruct, + use thegraph_core::{ + alloy::{ + primitives::{Address, FixedBytes, U256}, + signers::local::PrivateKeySigner, + sol_types::SolStruct, + }, + attestation::eip712_domain, }; - use thegraph_core::attestation::eip712_domain; use crate::{ AgreementVoucherValidationError, CancellationRequest, CancellationRequestValidationError, diff --git a/crates/monitor/Cargo.toml b/crates/monitor/Cargo.toml index f3bf6c43..15bbde36 100644 --- a/crates/monitor/Cargo.toml +++ b/crates/monitor/Cargo.toml @@ -9,7 +9,6 @@ indexer-allocation = { path = "../allocation" } indexer-attestation = { path = "../attestation" } indexer-watcher = { path = "../watcher" } thiserror.workspace = true -alloy.workspace = true anyhow.workspace = true reqwest = { workspace = true, features = ["json"] } tracing.workspace = true diff --git a/crates/monitor/src/allocations.rs b/crates/monitor/src/allocations.rs index 0c8ec2b2..b2bd3899 100644 --- a/crates/monitor/src/allocations.rs +++ b/crates/monitor/src/allocations.rs @@ -6,10 +6,10 @@ use std::{ time::{Duration, SystemTime, UNIX_EPOCH}, }; -use alloy::primitives::{Address, TxHash}; use indexer_allocation::Allocation; use indexer_query::allocations_query::{self, AllocationsQuery}; use indexer_watcher::new_watcher; +use thegraph_core::alloy::primitives::{Address, TxHash}; use tokio::sync::watch::Receiver; use crate::client::SubgraphClient; @@ -93,7 +93,7 @@ mod test { const NETWORK_SUBGRAPH_URL: &str = "https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-arbitrum"; - use alloy::primitives::address; + use thegraph_core::alloy::primitives::address; use super::*; use crate::client::{DeploymentDetails, SubgraphClient}; diff --git a/crates/monitor/src/attestation.rs b/crates/monitor/src/attestation.rs index badb7749..c518967e 100644 --- a/crates/monitor/src/attestation.rs +++ b/crates/monitor/src/attestation.rs @@ -6,11 +6,11 @@ use std::{ sync::{Arc, Mutex}, }; -use alloy::primitives::{Address, ChainId}; use bip39::Mnemonic; use indexer_allocation::Allocation; use indexer_attestation::AttestationSigner; use indexer_watcher::join_and_map_watcher; +use thegraph_core::alloy::primitives::{Address, ChainId}; use tokio::sync::watch::Receiver; use crate::{AllocationWatcher, DisputeManagerWatcher}; diff --git a/crates/monitor/src/deployment_to_allocation.rs b/crates/monitor/src/deployment_to_allocation.rs index 7c76889d..ce961148 100644 --- a/crates/monitor/src/deployment_to_allocation.rs +++ b/crates/monitor/src/deployment_to_allocation.rs @@ -3,9 +3,8 @@ use std::collections::HashMap; -use alloy::primitives::Address; use indexer_watcher::map_watcher; -use thegraph_core::DeploymentId; +use thegraph_core::{alloy::primitives::Address, DeploymentId}; use tokio::sync::watch::Receiver; use crate::AllocationWatcher; diff --git a/crates/monitor/src/dispute_manager.rs b/crates/monitor/src/dispute_manager.rs index 04935235..232d205a 100644 --- a/crates/monitor/src/dispute_manager.rs +++ b/crates/monitor/src/dispute_manager.rs @@ -3,10 +3,10 @@ use std::time::Duration; -use alloy::primitives::Address; use anyhow::Error; use indexer_query::dispute_manager::{self, DisputeManager}; use indexer_watcher::new_watcher; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch::Receiver; use crate::client::SubgraphClient; diff --git a/crates/monitor/src/escrow_accounts.rs b/crates/monitor/src/escrow_accounts.rs index 11bd0216..29c375c3 100644 --- a/crates/monitor/src/escrow_accounts.rs +++ b/crates/monitor/src/escrow_accounts.rs @@ -7,9 +7,9 @@ use std::{ time::Duration, }; -use alloy::primitives::{Address, U256}; use anyhow::anyhow; use indexer_query::escrow_account::{self, EscrowAccountQuery}; +use thegraph_core::alloy::primitives::{Address, U256}; use thiserror::Error; use tokio::sync::watch::Receiver; diff --git a/crates/query/Cargo.toml b/crates/query/Cargo.toml index a4331d2e..e8903211 100644 --- a/crates/query/Cargo.toml +++ b/crates/query/Cargo.toml @@ -7,5 +7,4 @@ edition = "2021" graphql_client.workspace = true thegraph-core.workspace = true serde.workspace = true -alloy.workspace = true anyhow.workspace = true diff --git a/crates/query/src/lib.rs b/crates/query/src/lib.rs index 7c133a6c..38c8a43e 100644 --- a/crates/query/src/lib.rs +++ b/crates/query/src/lib.rs @@ -4,8 +4,8 @@ use graphql_client::GraphQLQuery; pub mod dispute_manager { - use alloy::primitives::Address; use graphql_client::GraphQLQuery; + use thegraph_core::alloy::primitives::Address; type Bytes = Address; #[derive(GraphQLQuery)] @@ -37,8 +37,8 @@ pub mod escrow_account { } pub mod allocations_query { - use alloy::primitives::{B256, U256}; use graphql_client::GraphQLQuery; + use thegraph_core::alloy::primitives::{B256, U256}; type BigInt = U256; type Bytes = B256; diff --git a/crates/service/Cargo.toml b/crates/service/Cargo.toml index 5d4b2f72..167e19c2 100644 --- a/crates/service/Cargo.toml +++ b/crates/service/Cargo.toml @@ -38,19 +38,18 @@ base64.workspace = true graphql = { git = "https://github.com/edgeandnode/toolshed", tag = "graphql-v0.3.0" } tap_core.workspace = true uuid.workspace = true -alloy.workspace = true typed-builder.workspace = true tower_governor = { version = "0.5.0", features = ["axum"] } governor = "0.8.0" tower-http = { version = "0.6.2", features = [ - "auth", - "cors", - "normalize-path", - "trace", + "auth", + "cors", + "normalize-path", + "trace", ] } autometrics = { version = "1.0.1", features = ["prometheus-exporter"] } axum-extra = { version = "0.9.3", features = [ - "typed-header", + "typed-header", ], default-features = false } tokio-util = "0.7.10" cost-model = { git = "https://github.com/graphprotocol/agora", rev = "3ed34ca" } diff --git a/crates/service/src/database/dips.rs b/crates/service/src/database/dips.rs index 72903762..eb667764 100644 --- a/crates/service/src/database/dips.rs +++ b/crates/service/src/database/dips.rs @@ -3,12 +3,12 @@ use std::collections::HashMap; -use alloy::rlp::Decodable; use anyhow::bail; use axum::async_trait; use build_info::chrono::Utc; use indexer_dips::{SignedCancellationRequest, SignedIndexingAgreementVoucher}; use sqlx::PgPool; +use thegraph_core::alloy::rlp::Decodable; use uuid::Uuid; #[async_trait] diff --git a/crates/service/src/middleware/allocation.rs b/crates/service/src/middleware/allocation.rs index d1465a92..d5a57688 100644 --- a/crates/service/src/middleware/allocation.rs +++ b/crates/service/src/middleware/allocation.rs @@ -3,14 +3,13 @@ use std::collections::HashMap; -use alloy::primitives::Address; use axum::{ extract::{Request, State}, middleware::Next, response::Response, }; use tap_core::receipt::SignedReceipt; -use thegraph_core::DeploymentId; +use thegraph_core::{alloy::primitives::Address, DeploymentId}; use tokio::sync::watch; /// The current query Allocation Id address @@ -58,7 +57,6 @@ pub async fn allocation_middleware( #[cfg(test)] mod tests { - use alloy::primitives::Address; use axum::{ body::Body, http::{Extensions, Request}, @@ -68,6 +66,7 @@ mod tests { }; use reqwest::StatusCode; use test_assets::{create_signed_receipt, SignedReceiptRequest, ESCROW_SUBGRAPH_DEPLOYMENT}; + use thegraph_core::alloy::primitives::Address; use tokio::sync::watch; use tower::ServiceExt; diff --git a/crates/service/src/middleware/attestation.rs b/crates/service/src/middleware/attestation.rs index afdf5981..2110eb96 100644 --- a/crates/service/src/middleware/attestation.rs +++ b/crates/service/src/middleware/attestation.rs @@ -12,7 +12,7 @@ use axum::{ use indexer_attestation::AttestationSigner; use reqwest::StatusCode; use serde::Serialize; -use thegraph_core::Attestation; +use thegraph_core::attestation::Attestation; use crate::error::StatusCodeExt; @@ -103,7 +103,6 @@ impl IntoResponse for AttestationError { #[cfg(test)] mod tests { - use alloy::primitives::Address; use axum::{ body::{to_bytes, Body}, http::{Request, Response}, @@ -115,6 +114,7 @@ mod tests { use indexer_attestation::AttestationSigner; use reqwest::StatusCode; use test_assets::{INDEXER_ALLOCATIONS, INDEXER_MNEMONIC}; + use thegraph_core::alloy::primitives::Address; use tower::ServiceExt; use crate::middleware::{ diff --git a/crates/service/src/middleware/attestation_signer.rs b/crates/service/src/middleware/attestation_signer.rs index 71847281..4860a72b 100644 --- a/crates/service/src/middleware/attestation_signer.rs +++ b/crates/service/src/middleware/attestation_signer.rs @@ -3,13 +3,13 @@ use std::collections::HashMap; -use alloy::primitives::Address; use axum::{ extract::{Request, State}, middleware::Next, response::Response, }; use indexer_attestation::AttestationSigner; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch; use super::Allocation; diff --git a/crates/service/src/middleware/labels.rs b/crates/service/src/middleware/labels.rs index f51d7818..f9a77b72 100644 --- a/crates/service/src/middleware/labels.rs +++ b/crates/service/src/middleware/labels.rs @@ -81,7 +81,6 @@ pub async fn labels_middleware(mut request: Request, next: Next) -> Response { #[cfg(test)] mod tests { - use alloy::primitives::Address; use axum::{ body::Body, http::{Extensions, Request}, @@ -91,6 +90,7 @@ mod tests { }; use reqwest::StatusCode; use test_assets::ESCROW_SUBGRAPH_DEPLOYMENT; + use thegraph_core::alloy::primitives::Address; use tower::ServiceExt; use super::labels_middleware; diff --git a/crates/service/src/middleware/sender.rs b/crates/service/src/middleware/sender.rs index 2b603efa..ecfb48d0 100644 --- a/crates/service/src/middleware/sender.rs +++ b/crates/service/src/middleware/sender.rs @@ -1,7 +1,6 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{primitives::Address, sol_types::Eip712Domain}; use axum::{ extract::{Request, State}, middleware::Next, @@ -9,6 +8,7 @@ use axum::{ }; use indexer_monitor::EscrowAccounts; use tap_core::receipt::SignedReceipt; +use thegraph_core::alloy::{primitives::Address, sol_types::Eip712Domain}; use tokio::sync::watch; use crate::error::IndexerServiceError; diff --git a/crates/service/src/routes/dips.rs b/crates/service/src/routes/dips.rs index 3a142622..e1338201 100644 --- a/crates/service/src/routes/dips.rs +++ b/crates/service/src/routes/dips.rs @@ -8,11 +8,12 @@ use async_graphql::{Context, EmptySubscription, FieldResult, Object, Schema, Sim use base64::{engine::general_purpose::STANDARD, Engine}; use indexer_config::{BlockchainConfig, DipsConfig}; use indexer_dips::{ - alloy::{core::primitives::Address, sol_types::Eip712Domain}, - alloy_rlp::Decodable, SignedCancellationRequest, SignedIndexingAgreementVoucher, SubgraphIndexingVoucherMetadata, }; -use thegraph_core::attestation::eip712_domain; +use thegraph_core::{ + alloy::{core::primitives::Address, rlp::Decodable, sol_types::Eip712Domain}, + attestation::eip712_domain, +}; use uuid::Uuid; use crate::database::dips::AgreementStore; @@ -264,14 +265,16 @@ async fn validate_and_cancel_agreement( mod test { use std::sync::Arc; - use alloy::signers::local::PrivateKeySigner; use base64::{engine::general_purpose::STANDARD, Engine}; - use indexer_dips::{ - alloy::core::primitives::{Address, FixedBytes, U256}, - alloy_rlp::{self}, - IndexingAgreementVoucher, SubgraphIndexingVoucherMetadata, + use indexer_dips::{IndexingAgreementVoucher, SubgraphIndexingVoucherMetadata}; + use thegraph_core::{ + alloy::{ + core::primitives::{Address, FixedBytes, U256}, + rlp, + signers::local::PrivateKeySigner, + }, + attestation::eip712_domain, }; - use thegraph_core::attestation::eip712_domain; use uuid::Uuid; use crate::database::dips::{AgreementStore, InMemoryAgreementStore}; @@ -301,12 +304,12 @@ mod test { maxEpochsPerCollection: 1000, minEpochsPerCollection: 1000, durationEpochs: 1000, - metadata: alloy_rlp::encode(metadata).into(), + metadata: rlp::encode(metadata).into(), }; let domain = eip712_domain(0, Address::ZERO); let voucher = voucher.sign(&domain, payer)?; - let rlp_voucher = alloy_rlp::encode(voucher.clone()); + let rlp_voucher = rlp::encode(voucher.clone()); let b64 = STANDARD.encode(rlp_voucher); let id = Uuid::now_v7(); diff --git a/crates/service/src/service/router.rs b/crates/service/src/service/router.rs index 9d14db2e..3cff6e03 100644 --- a/crates/service/src/service/router.rs +++ b/crates/service/src/service/router.rs @@ -3,7 +3,6 @@ use std::{sync::Arc, time::Duration}; -use alloy::sol_types::Eip712Domain; use async_graphql_axum::GraphQL; use axum::{ extract::MatchedPath, @@ -24,6 +23,7 @@ use indexer_monitor::{ }; use reqwest::Method; use tap_core::{manager::Manager, receipt::checks::CheckList}; +use thegraph_core::alloy::sol_types::Eip712Domain; use tower::ServiceBuilder; use tower_governor::{ governor::GovernorConfigBuilder, key_extractor::SmartIpKeyExtractor, GovernorLayer, diff --git a/crates/service/src/tap.rs b/crates/service/src/tap.rs index 74d3738c..e6ca2b48 100644 --- a/crates/service/src/tap.rs +++ b/crates/service/src/tap.rs @@ -3,12 +3,12 @@ use std::{collections::HashMap, fmt::Debug, sync::Arc, time::Duration}; -use alloy::{primitives::Address, sol_types::Eip712Domain}; use indexer_allocation::Allocation; use indexer_monitor::EscrowAccounts; use receipt_store::{DatabaseReceipt, InnerContext}; use sqlx::PgPool; use tap_core::receipt::checks::ReceiptCheck; +use thegraph_core::alloy::{primitives::Address, sol_types::Eip712Domain}; use tokio::sync::{ mpsc::{self, Sender}, watch::Receiver, diff --git a/crates/service/src/tap/checks/allocation_eligible.rs b/crates/service/src/tap/checks/allocation_eligible.rs index c16d2c50..94d8505a 100644 --- a/crates/service/src/tap/checks/allocation_eligible.rs +++ b/crates/service/src/tap/checks/allocation_eligible.rs @@ -3,7 +3,6 @@ use std::collections::HashMap; -use alloy::primitives::Address; use anyhow::anyhow; use indexer_allocation::Allocation; use tap_core::receipt::{ @@ -11,6 +10,7 @@ use tap_core::receipt::{ state::Checking, ReceiptWithState, }; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch::Receiver; pub struct AllocationEligible { diff --git a/crates/service/src/tap/checks/deny_list_check.rs b/crates/service/src/tap/checks/deny_list_check.rs index 171c4111..df703ab7 100644 --- a/crates/service/src/tap/checks/deny_list_check.rs +++ b/crates/service/src/tap/checks/deny_list_check.rs @@ -7,13 +7,13 @@ use std::{ sync::{Arc, RwLock}, }; -use alloy::primitives::Address; use sqlx::{postgres::PgListener, PgPool}; use tap_core::receipt::{ checks::{Check, CheckError, CheckResult}, state::Checking, ReceiptWithState, }; +use thegraph_core::alloy::primitives::Address; use crate::middleware::Sender; @@ -190,9 +190,9 @@ impl Drop for DenyListCheck { #[cfg(test)] mod tests { - use alloy::hex::ToHexExt; use tap_core::receipt::{Context, ReceiptWithState}; use test_assets::{self, create_signed_receipt, SignedReceiptRequest, TAP_SENDER}; + use thegraph_core::alloy::hex::ToHexExt; use super::*; diff --git a/crates/service/src/tap/checks/receipt_max_val_check.rs b/crates/service/src/tap/checks/receipt_max_val_check.rs index 2723dba7..c138266f 100644 --- a/crates/service/src/tap/checks/receipt_max_val_check.rs +++ b/crates/service/src/tap/checks/receipt_max_val_check.rs @@ -44,15 +44,15 @@ mod tests { time::{Duration, SystemTime}, }; - use alloy::{ - primitives::Address, - signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, - }; use tap_core::{ receipt::{checks::Check, state::Checking, Context, Receipt, ReceiptWithState}, signed_message::EIP712SignedMessage, tap_eip712_domain, }; + use thegraph_core::alloy::{ + primitives::Address, + signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, + }; use super::*; use crate::tap::Eip712Domain; diff --git a/crates/service/src/tap/checks/sender_balance_check.rs b/crates/service/src/tap/checks/sender_balance_check.rs index 25f37508..c9704dcc 100644 --- a/crates/service/src/tap/checks/sender_balance_check.rs +++ b/crates/service/src/tap/checks/sender_balance_check.rs @@ -1,7 +1,6 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::primitives::U256; use anyhow::anyhow; use indexer_monitor::EscrowAccounts; use tap_core::receipt::{ @@ -9,6 +8,7 @@ use tap_core::receipt::{ state::Checking, ReceiptWithState, }; +use thegraph_core::alloy::primitives::U256; use tokio::sync::watch::Receiver; use crate::middleware::Sender; diff --git a/crates/service/src/tap/checks/timestamp_check.rs b/crates/service/src/tap/checks/timestamp_check.rs index c6c6684d..12615e8c 100644 --- a/crates/service/src/tap/checks/timestamp_check.rs +++ b/crates/service/src/tap/checks/timestamp_check.rs @@ -51,15 +51,15 @@ impl Check for TimestampCheck { mod tests { use std::str::FromStr; - use alloy::{ - primitives::Address, - signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, - }; use tap_core::{ receipt::{checks::Check, state::Checking, Context, Receipt, ReceiptWithState}, signed_message::EIP712SignedMessage, tap_eip712_domain, }; + use thegraph_core::alloy::{ + primitives::Address, + signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, + }; use super::*; use crate::tap::Eip712Domain; diff --git a/crates/service/src/tap/receipt_store.rs b/crates/service/src/tap/receipt_store.rs index 3646347c..82c7a499 100644 --- a/crates/service/src/tap/receipt_store.rs +++ b/crates/service/src/tap/receipt_store.rs @@ -1,7 +1,6 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{hex::ToHexExt, sol_types::Eip712Domain}; use anyhow::anyhow; use bigdecimal::num_bigint::BigInt; use sqlx::{types::BigDecimal, PgPool}; @@ -9,7 +8,8 @@ use tap_core::{ manager::adapters::ReceiptStore, receipt::{state::Checking, ReceiptWithState}, }; -use tokio::{select, sync::mpsc::Receiver, task::JoinHandle}; +use thegraph_core::alloy::{hex::ToHexExt, sol_types::Eip712Domain}; +use tokio::{sync::mpsc::Receiver, task::JoinHandle}; use tokio_util::sync::CancellationToken; use super::{AdapterError, IndexerTapContext}; @@ -81,7 +81,7 @@ impl IndexerTapContext { tokio::spawn(async move { loop { let mut buffer = Vec::with_capacity(BUFFER_SIZE); - select! { + tokio::select! { biased; _ = receiver.recv_many(&mut buffer, BUFFER_SIZE) => { if let Err(e) = inner_context.store_receipts(buffer).await { diff --git a/crates/service/src/wallet.rs b/crates/service/src/wallet.rs index d1777adc..3fd30131 100644 --- a/crates/service/src/wallet.rs +++ b/crates/service/src/wallet.rs @@ -1,10 +1,10 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::signers::local::{ +use bip39::Mnemonic; +use thegraph_core::alloy::signers::local::{ coins_bip39::English, LocalSignerError, MnemonicBuilder, PrivateKeySigner, }; -use bip39::Mnemonic; /// Build Wallet from Private key or Mnemonic pub fn build_wallet(value: &str) -> Result { diff --git a/crates/service/tests/router_test.rs b/crates/service/tests/router_test.rs index ff3a40ed..306b4681 100644 --- a/crates/service/tests/router_test.rs +++ b/crates/service/tests/router_test.rs @@ -3,7 +3,6 @@ use std::{net::SocketAddr, time::Duration}; -use alloy::primitives::Address; use axum::{body::to_bytes, extract::ConnectInfo, http::Request, Extension}; use axum_extra::headers::Header; use indexer_config::{BlockchainConfig, GraphNodeConfig, IndexerConfig, NonZeroGRT}; @@ -17,6 +16,7 @@ use sqlx::PgPool; use test_assets::{ create_signed_receipt, SignedReceiptRequest, INDEXER_ALLOCATIONS, TAP_EIP712_DOMAIN, }; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch; use tower::Service; use wiremock::{ diff --git a/crates/tap-agent/Cargo.toml b/crates/tap-agent/Cargo.toml index 6a613d8e..bbdf0819 100644 --- a/crates/tap-agent/Cargo.toml +++ b/crates/tap-agent/Cargo.toml @@ -14,7 +14,6 @@ indexer-watcher = { path = "../watcher" } indexer-allocation = { path = "../allocation" } indexer-config = { path = "../config" } indexer-query = { path = "../query" } -alloy.workspace = true anyhow.workspace = true async-trait.workspace = true sqlx.workspace = true @@ -36,12 +35,12 @@ bigdecimal = { workspace = true, features = ["serde"] } graphql_client.workspace = true ruint = { version = "1.12.3", features = [ - "num-traits", + "num-traits", ], default-features = false } futures-util = { version = "0.3.28", default-features = false } jsonrpsee = { version = "0.24.0", features = ["http-client", "tracing"] } ractor = { version = "0.13", features = [ - "async-trait", + "async-trait", ], default-features = false } tap_aggregator.workspace = true futures = { version = "0.3.30", default-features = false } diff --git a/crates/tap-agent/src/agent/sender_account.rs b/crates/tap-agent/src/agent/sender_account.rs index 68f643be..5a7fdbf4 100644 --- a/crates/tap-agent/src/agent/sender_account.rs +++ b/crates/tap-agent/src/agent/sender_account.rs @@ -7,11 +7,6 @@ use std::{ time::Duration, }; -use alloy::{ - hex::ToHexExt, - primitives::{Address, U256}, - sol_types::Eip712Domain, -}; use bigdecimal::{num_bigint::ToBigInt, ToPrimitive}; use futures::{stream, StreamExt}; use indexer_monitor::{EscrowAccounts, SubgraphClient}; @@ -27,6 +22,11 @@ use ractor::{Actor, ActorProcessingErr, ActorRef, MessagingErr, SupervisionEvent use reqwest::Url; use sqlx::PgPool; use tap_core::rav::SignedRAV; +use thegraph_core::alloy::{ + hex::ToHexExt, + primitives::{Address, U256}, + sol_types::Eip712Domain, +}; use tokio::{sync::watch::Receiver, task::JoinHandle}; use tracing::Level; @@ -1040,10 +1040,6 @@ pub mod tests { time::{Duration, SystemTime, UNIX_EPOCH}, }; - use alloy::{ - hex::ToHexExt, - primitives::{Address, U256}, - }; use indexer_monitor::{DeploymentDetails, EscrowAccounts, SubgraphClient}; use ractor::{call, Actor, ActorRef, ActorStatus}; use reqwest::Url; @@ -1053,6 +1049,10 @@ pub mod tests { flush_messages, ALLOCATION_ID_0, ALLOCATION_ID_1, TAP_SENDER as SENDER, TAP_SIGNER as SIGNER, }; + use thegraph_core::alloy::{ + hex::ToHexExt, + primitives::{Address, U256}, + }; use tokio::sync::{ watch::{self, Sender}, Notify, diff --git a/crates/tap-agent/src/agent/sender_accounts_manager.rs b/crates/tap-agent/src/agent/sender_accounts_manager.rs index b96f372b..08d7c604 100644 --- a/crates/tap-agent/src/agent/sender_accounts_manager.rs +++ b/crates/tap-agent/src/agent/sender_accounts_manager.rs @@ -7,7 +7,6 @@ use std::{ time::Duration, }; -use alloy::{primitives::Address, sol_types::Eip712Domain}; use anyhow::{anyhow, bail}; use futures::{stream, StreamExt}; use indexer_allocation::Allocation; @@ -20,6 +19,7 @@ use ractor::{ use reqwest::Url; use serde::Deserialize; use sqlx::{postgres::PgListener, PgPool}; +use thegraph_core::alloy::{primitives::Address, sol_types::Eip712Domain}; use tokio::{ select, sync::watch::{self, Receiver}, @@ -604,13 +604,13 @@ mod tests { time::Duration, }; - use alloy::hex::ToHexExt; use indexer_monitor::{DeploymentDetails, EscrowAccounts, SubgraphClient}; use ractor::{concurrency::JoinHandle, Actor, ActorRef, ActorStatus}; use reqwest::Url; use ruint::aliases::U256; use sqlx::{postgres::PgListener, PgPool}; use test_assets::{flush_messages, TAP_SENDER as SENDER}; + use thegraph_core::alloy::hex::ToHexExt; use tokio::sync::{mpsc, mpsc::error::TryRecvError, watch, Notify}; use super::{ diff --git a/crates/tap-agent/src/agent/sender_allocation.rs b/crates/tap-agent/src/agent/sender_allocation.rs index 86520eee..6b4db48d 100644 --- a/crates/tap-agent/src/agent/sender_allocation.rs +++ b/crates/tap-agent/src/agent/sender_allocation.rs @@ -6,7 +6,6 @@ use std::{ time::{Duration, Instant}, }; -use alloy::{hex::ToHexExt, primitives::Address, sol_types::Eip712Domain}; use anyhow::{anyhow, ensure}; use bigdecimal::{num_bigint::BigInt, ToPrimitive}; use indexer_monitor::{EscrowAccounts, SubgraphClient}; @@ -25,6 +24,7 @@ use tap_core::{ }, signed_message::EIP712SignedMessage, }; +use thegraph_core::alloy::{hex::ToHexExt, primitives::Address, sol_types::Eip712Domain}; use thiserror::Error; use tokio::sync::watch::Receiver; diff --git a/crates/tap-agent/src/lib.rs b/crates/tap-agent/src/lib.rs index 78675afe..d0f6452e 100644 --- a/crates/tap-agent/src/lib.rs +++ b/crates/tap-agent/src/lib.rs @@ -1,10 +1,10 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::sol_types::Eip712Domain; use indexer_config::Config; use lazy_static::lazy_static; use tap_core::tap_eip712_domain; +use thegraph_core::alloy::sol_types::Eip712Domain; lazy_static! { pub static ref CONFIG: Config = cli::get_config().expect("Failed to load configuration"); diff --git a/crates/tap-agent/src/tap/context.rs b/crates/tap-agent/src/tap/context.rs index b543bb21..15efdbca 100644 --- a/crates/tap-agent/src/tap/context.rs +++ b/crates/tap-agent/src/tap/context.rs @@ -1,9 +1,9 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::primitives::Address; use indexer_monitor::EscrowAccounts; use sqlx::PgPool; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch::Receiver; pub mod checks; diff --git a/crates/tap-agent/src/tap/context/checks/allocation_id.rs b/crates/tap-agent/src/tap/context/checks/allocation_id.rs index 46990da9..734d4dd4 100644 --- a/crates/tap-agent/src/tap/context/checks/allocation_id.rs +++ b/crates/tap-agent/src/tap/context/checks/allocation_id.rs @@ -3,7 +3,6 @@ use std::time::Duration; -use alloy::primitives::Address; use anyhow::anyhow; use indexer_monitor::SubgraphClient; use indexer_query::{tap_transactions, TapTransactions}; @@ -13,6 +12,7 @@ use tap_core::receipt::{ state::Checking, ReceiptWithState, }; +use thegraph_core::alloy::primitives::Address; use tokio::sync::watch::Receiver; pub struct AllocationId { diff --git a/crates/tap-agent/src/tap/context/checks/signature.rs b/crates/tap-agent/src/tap/context/checks/signature.rs index dc5f25d9..c750557e 100644 --- a/crates/tap-agent/src/tap/context/checks/signature.rs +++ b/crates/tap-agent/src/tap/context/checks/signature.rs @@ -1,7 +1,6 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{primitives::U256, sol_types::Eip712Domain}; use anyhow::anyhow; use indexer_monitor::EscrowAccounts; use tap_core::receipt::{ @@ -9,6 +8,7 @@ use tap_core::receipt::{ state::Checking, ReceiptWithState, }; +use thegraph_core::alloy::{primitives::U256, sol_types::Eip712Domain}; use tokio::sync::watch::Receiver; pub struct Signature { diff --git a/crates/tap-agent/src/tap/context/error.rs b/crates/tap-agent/src/tap/context/error.rs index aa5d443f..4120fbab 100644 --- a/crates/tap-agent/src/tap/context/error.rs +++ b/crates/tap-agent/src/tap/context/error.rs @@ -1,7 +1,7 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::primitives::Address; +use thegraph_core::alloy::primitives::Address; #[derive(Debug, thiserror::Error)] pub enum AdapterError { diff --git a/crates/tap-agent/src/tap/context/escrow.rs b/crates/tap-agent/src/tap/context/escrow.rs index bded312e..268448c1 100644 --- a/crates/tap-agent/src/tap/context/escrow.rs +++ b/crates/tap-agent/src/tap/context/escrow.rs @@ -1,9 +1,9 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::primitives::Address; use async_trait::async_trait; use tap_core::manager::adapters::EscrowHandler as EscrowAdapterTrait; +use thegraph_core::alloy::primitives::Address; use super::{error::AdapterError, TapAgentContext}; diff --git a/crates/tap-agent/src/tap/context/rav.rs b/crates/tap-agent/src/tap/context/rav.rs index 43ad3466..0956624d 100644 --- a/crates/tap-agent/src/tap/context/rav.rs +++ b/crates/tap-agent/src/tap/context/rav.rs @@ -3,9 +3,6 @@ use std::str::FromStr; -#[allow(deprecated)] -use alloy::signers::Signature; -use alloy::{hex::ToHexExt, primitives::Address}; use bigdecimal::{ num_bigint::{BigInt, ToBigInt}, ToPrimitive, @@ -15,6 +12,9 @@ use tap_core::{ manager::adapters::{RAVRead, RAVStore}, rav::{ReceiptAggregateVoucher, SignedRAV}, }; +#[allow(deprecated)] +use thegraph_core::alloy::signers::Signature; +use thegraph_core::alloy::{hex::ToHexExt, primitives::Address}; use super::{error::AdapterError, TapAgentContext}; diff --git a/crates/tap-agent/src/tap/context/receipt.rs b/crates/tap-agent/src/tap/context/receipt.rs index ca01a356..3844f4ed 100644 --- a/crates/tap-agent/src/tap/context/receipt.rs +++ b/crates/tap-agent/src/tap/context/receipt.rs @@ -7,13 +7,13 @@ use std::{ str::FromStr, }; -use alloy::{hex::ToHexExt, primitives::Address}; use bigdecimal::{num_bigint::ToBigInt, ToPrimitive}; use sqlx::{postgres::types::PgRange, types::BigDecimal}; use tap_core::{ manager::adapters::{safe_truncate_receipts, ReceiptDelete, ReceiptRead}, receipt::{state::Checking, Receipt, ReceiptWithState, SignedReceipt}, }; +use thegraph_core::alloy::{hex::ToHexExt, primitives::Address}; use super::{error::AdapterError, TapAgentContext}; use crate::tap::signers_trimmed; @@ -192,7 +192,6 @@ impl ReceiptDelete for TapAgentContext { mod test { use std::collections::HashMap; - use alloy::{primitives::U256, signers::local::PrivateKeySigner}; use indexer_monitor::EscrowAccounts; use lazy_static::lazy_static; use sqlx::PgPool; @@ -200,6 +199,7 @@ mod test { ALLOCATION_ID_0, ALLOCATION_ID_1, TAP_EIP712_DOMAIN as TAP_EIP712_DOMAIN_SEPARATOR, TAP_SENDER as SENDER, TAP_SIGNER as SIGNER, }; + use thegraph_core::alloy::{primitives::U256, signers::local::PrivateKeySigner}; use tokio::sync::watch::{self, Receiver}; use super::*; diff --git a/crates/tap-agent/src/tap/mod.rs b/crates/tap-agent/src/tap/mod.rs index a08b557d..d4b11d92 100644 --- a/crates/tap-agent/src/tap/mod.rs +++ b/crates/tap-agent/src/tap/mod.rs @@ -1,8 +1,8 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{hex::ToHexExt, primitives::Address}; use indexer_monitor::EscrowAccounts; +use thegraph_core::alloy::{hex::ToHexExt, primitives::Address}; use tokio::sync::watch::Receiver; pub mod context; diff --git a/crates/tap-agent/src/test.rs b/crates/tap-agent/src/test.rs index 1220ac4b..9dc2ca73 100644 --- a/crates/tap-agent/src/test.rs +++ b/crates/tap-agent/src/test.rs @@ -1,11 +1,6 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use alloy::{ - primitives::{address, hex::ToHexExt, Address}, - signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, - sol_types::Eip712Domain, -}; use bigdecimal::num_bigint::BigInt; use lazy_static::lazy_static; use sqlx::{types::BigDecimal, PgPool}; @@ -15,6 +10,11 @@ use tap_core::{ signed_message::EIP712SignedMessage, tap_eip712_domain, }; +use thegraph_core::alloy::{ + primitives::{address, hex::ToHexExt, Address}, + signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, + sol_types::Eip712Domain, +}; lazy_static! { pub static ref ALLOCATION_ID_0: Address = @@ -179,9 +179,9 @@ pub async fn store_rav_with_options( pub mod actors { use std::sync::Arc; - use alloy::primitives::Address; use ractor::{Actor, ActorProcessingErr, ActorRef, SupervisionEvent}; use test_assets::{ALLOCATION_ID_0, TAP_SIGNER}; + use thegraph_core::alloy::primitives::Address; use tokio::sync::{mpsc, watch, Notify}; use super::create_rav; diff --git a/crates/tap-agent/src/tracker/generic_tracker.rs b/crates/tap-agent/src/tracker/generic_tracker.rs index 54a3c6a0..d81a392b 100644 --- a/crates/tap-agent/src/tracker/generic_tracker.rs +++ b/crates/tap-agent/src/tracker/generic_tracker.rs @@ -7,7 +7,7 @@ use std::{ time::Duration, }; -use alloy::primitives::Address; +use thegraph_core::alloy::primitives::Address; use super::{ global_tracker::GlobalTracker, AllocationStats, DefaultFromExtra, DurationInfo, SenderFeeStats, diff --git a/crates/tap-agent/src/tracker/tracker_tests.rs b/crates/tap-agent/src/tracker/tracker_tests.rs index cf75eb9f..9904c7ed 100644 --- a/crates/tap-agent/src/tracker/tracker_tests.rs +++ b/crates/tap-agent/src/tracker/tracker_tests.rs @@ -6,7 +6,7 @@ use std::{ time::{Duration, SystemTime, UNIX_EPOCH}, }; -use alloy::primitives::address; +use thegraph_core::alloy::primitives::address; use super::SimpleFeeTracker; use crate::{agent::unaggregated_receipts::UnaggregatedReceipts, tracker::SenderFeeTracker}; diff --git a/crates/test-assets/Cargo.toml b/crates/test-assets/Cargo.toml index 5c5e298a..568c14b9 100644 --- a/crates/test-assets/Cargo.toml +++ b/crates/test-assets/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" [dependencies] indexer-allocation = { path = "../allocation" } -alloy.workspace = true bip39 = "2.0.0" lazy_static.workspace = true tap_core.workspace = true diff --git a/crates/test-assets/src/lib.rs b/crates/test-assets/src/lib.rs index 2023e555..e142d997 100644 --- a/crates/test-assets/src/lib.rs +++ b/crates/test-assets/src/lib.rs @@ -1,13 +1,12 @@ // Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs. // SPDX-License-Identifier: Apache-2.0 -use std::{collections::HashMap, str::FromStr, time::Duration}; - -use alloy::{ - primitives::U256, - signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, - sol_types::Eip712Domain, +use std::{ + collections::HashMap, + str::FromStr, + time::{Duration, SystemTime, UNIX_EPOCH}, }; + use bip39::Mnemonic; use indexer_allocation::{Allocation, AllocationStatus, SubgraphDeployment}; use lazy_static::lazy_static; @@ -16,7 +15,14 @@ use tap_core::{ signed_message::EIP712SignedMessage, tap_eip712_domain, }; -use thegraph_core::{deployment_id, DeploymentId}; +use thegraph_core::{ + alloy::{ + primitives::{address, Address, U256}, + signers::local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner}, + sol_types::Eip712Domain, + }, + deployment_id, DeploymentId, +}; use tokio::sync::Notify; use typed_builder::TypedBuilder; @@ -315,10 +321,6 @@ lazy_static! { ); } -use std::time::{SystemTime, UNIX_EPOCH}; - -use alloy::primitives::{address, Address}; - #[derive(TypedBuilder)] pub struct SignedReceiptRequest { #[builder(default = Address::ZERO)]