From 776b6acb82e06112020a3a07bdb272959d4d83cc Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Thu, 12 Oct 2023 18:14:15 +0200 Subject: [PATCH] chore: Update alloy-primitives and related dependencies --- Cargo.lock | 310 ++++++++++++++++++++++++--- common/Cargo.toml | 6 +- common/src/signature_verification.rs | 2 +- service/Cargo.toml | 8 +- 4 files changed, 291 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a8fc84ed7..c1aec0359 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,6 +95,26 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0628ec0ba5b98b3370bb6be17b12f23bfce8ee4ad83823325a20546d9b03b78" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "proptest", + "rand 0.8.5", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-rlp" version = "0.3.2" @@ -117,7 +137,24 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.28", - "syn-solidity", + "syn-solidity 0.3.2", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a98ad1696a2e17f010ae8e43e9f2a1e930ed176a8e3ff77acfeff6dfb07b42c" +dependencies = [ + "const-hex", + "dunce", + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.28", + "syn-solidity 0.4.2", "tiny-keccak", ] @@ -127,8 +164,20 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaa7c9a4354b1ff9f1c85adf22802af046e20e4bb55e19b9dc6ca8cbc6f7f4e5" dependencies = [ - "alloy-primitives", - "alloy-sol-macro", + "alloy-primitives 0.3.3", + "alloy-sol-macro 0.3.2", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d7107bed88e8f09f0ddcc3335622d87bfb6821f3e0c7473329fb1cfad5e015" +dependencies = [ + "alloy-primitives 0.4.2", + "alloy-sol-macro 0.4.2", "const-hex", "serde", ] @@ -209,6 +258,130 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "array-init" version = "0.0.4" @@ -476,7 +649,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -902,7 +1075,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.17", "serde", "serde_json", "thiserror", @@ -1411,6 +1584,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1420,7 +1604,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.0", "syn 1.0.109", ] @@ -1861,7 +2045,7 @@ checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" dependencies = [ "ethers-core", "reqwest", - "semver", + "semver 1.0.17", "serde", "serde_json", "thiserror", @@ -1970,7 +2154,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver", + "semver 1.0.17", "serde", "serde_json", "solang-parser", @@ -2035,6 +2219,17 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "faux" version = "0.1.10" @@ -2785,7 +2980,7 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" name = "indexer-common" version = "0.1.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.4.2", "anyhow", "arc-swap", "bs58 0.5.0", @@ -3768,7 +3963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -4444,7 +4639,7 @@ dependencies = [ "futures", "futures-timer", "rstest_macros", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -4456,7 +4651,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.0", "syn 1.0.109", "unicode-ident", ] @@ -4467,8 +4662,17 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95294d6e3a6192f3aabf91c38f56505a625aa495533442744185a36d75a790c4" dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "parity-scale-codec", + "primitive-types", "proptest", "rand 0.8.5", + "rlp", "ruint-macro", "serde", "valuable", @@ -4509,13 +4713,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.17", ] [[package]] @@ -4711,18 +4924,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" dependencies = [ "cc", ] @@ -4750,6 +4963,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.17" @@ -4759,6 +4981,15 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -4878,8 +5109,8 @@ dependencies = [ name = "service" version = "0.1.0" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.4.2", + "alloy-sol-types 0.4.2", "anyhow", "async-graphql 4.0.16", "async-graphql-axum", @@ -5437,7 +5668,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver", + "semver 1.0.17", "serde", "serde_json", "sha2 0.10.7", @@ -5480,6 +5711,18 @@ dependencies = [ "syn 2.0.28", ] +[[package]] +name = "syn-solidity" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b837ef12ab88835251726eb12237655e61ec8dc8a280085d1961cdc3dfd047" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -5495,11 +5738,10 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tap_core" version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef687d224045e494e4779d6d80cd9eca46f0c204c413d2b081e015241fa5597" +source = "git+https://github.com/jannis/timeline-aggregation-protocol?branch=jannis/update-alloy#27bf30963e4acb50d12b423e528ff6024786be9a" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.4.2", + "alloy-sol-types 0.4.2", "anyhow", "async-trait", "ethereum-types", @@ -5793,8 +6035,8 @@ name = "toolshed" version = "0.2.2" source = "git+https://github.com/edgeandnode/toolshed?branch=main#714393efb0c02e27f406be1cce826f4961e979ae" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.3.3", + "alloy-sol-types 0.3.2", "async-graphql 6.0.7", "bs58 0.5.0", "ethers-core", @@ -6545,7 +6787,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", + "rustc_version 0.4.0", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -6573,6 +6815,20 @@ name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] [[package]] name = "zip" diff --git a/common/Cargo.toml b/common/Cargo.toml index 74748f50c..307526ffd 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy-primitives = { version = "0.3.3", features = ["serde"] } +alloy-primitives = { version = "0.4.2", features = ["serde"] } anyhow = "1.0.75" arc-swap = "1.6.0" bs58 = "0.5.0" @@ -19,7 +19,7 @@ log = "0.4.20" lru = "0.11.1" regex = "1.7.1" reqwest = "0.11.20" -secp256k1 = { version = "0.27.0", features = ["recovery"] } +secp256k1 = { version = "0.28.0", features = ["recovery"] } serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" tokio = { version = "1.32.0", features = ["full", "macros", "rt"] } @@ -33,4 +33,4 @@ test-log = "0.2.12" wiremock = "0.5.19" [features] -mock = ["dep:faux"] +mock = ["dep:faux"] \ No newline at end of file diff --git a/common/src/signature_verification.rs b/common/src/signature_verification.rs index c76dbbbb1..9a4cbc60e 100644 --- a/common/src/signature_verification.rs +++ b/common/src/signature_verification.rs @@ -29,7 +29,7 @@ impl SignatureVerifier { message: &[u8], signature: &RecoverableSignature, ) -> Result { - let message = Message::from_slice(&keccak(message).to_fixed_bytes()).unwrap(); + let message = Message::from_digest_slice(&keccak(message).to_fixed_bytes()).unwrap(); match self.signer.load().as_ref() { // If we already have the public key we can do the fast path. diff --git a/service/Cargo.toml b/service/Cargo.toml index d558e8870..1924888cc 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -42,11 +42,11 @@ autometrics = { version = "0.3.3", features = ["prometheus-exporter"] } clap = { version = "4.3.1", features = ["derive", "env"] } prometheus = "0.13.3" hex = "0.4.3" -tap_core = "0.5.1" +tap_core = { git = "https://github.com/jannis/timeline-aggregation-protocol", branch = "jannis/update-alloy" } ethereum-types = "0.14.1" sqlx = { version = "0.7.1", features = ["postgres", "runtime-tokio", "bigdecimal", "rust_decimal", "time"] } -alloy-primitives = { version = "0.3.3", features = ["serde"] } -alloy-sol-types = "0.3.2" +alloy-primitives = { version = "0.4.2", features = ["serde"] } +alloy-sol-types = "0.4.2" lazy_static = "1.4.0" toolshed = { git = "https://github.com/edgeandnode/toolshed", branch = "main", features = ["graphql"] } @@ -65,4 +65,4 @@ wiremock = "0.5.19" version = "1" default-features = false # Disable features which are enabled by default -features = ["precommit-hook", "run-cargo-fmt", "run-cargo-clippy"] +features = ["precommit-hook", "run-cargo-fmt", "run-cargo-clippy"] \ No newline at end of file