From 5f672beefda931bada766e3d00040a1009fa0bd1 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 22 Jun 2024 20:02:53 +0200 Subject: [PATCH] Further optimize CPU runner --- Cargo.lock | 671 +++++++++++++++++++++++++++----------------------- Cargo.toml | 14 +- README.md | 3 + src/lib.rs | 221 ++++++++--------- src/main.rs | 2 +- src/reward.rs | 126 +++++++++- 6 files changed, 604 insertions(+), 433 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7b4e4d..3e0c20c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "alloy-primitives" -version = "0.5.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c234f92024707f224510ff82419b2be0e1d8e1fd911defcac5a085cd7f83898" +checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" dependencies = [ "alloy-rlp", "bytes", @@ -16,6 +16,7 @@ dependencies = [ "getrandom", "hex-literal", "itoa", + "k256", "keccak-asm", "proptest", "rand", @@ -26,9 +27,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" dependencies = [ "arrayvec", "bytes", @@ -46,7 +47,7 @@ dependencies = [ "ark-std 0.3.0", "derivative", "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.19", "paste", "rustc_version 0.3.3", "zeroize", @@ -66,7 +67,7 @@ dependencies = [ "digest 0.10.7", "itertools", "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.19", "paste", "rustc_version 0.4.0", "zeroize", @@ -99,7 +100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.19", "quote", "syn 1.0.109", ] @@ -111,7 +112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.19", "proc-macro2", "quote", "syn 1.0.109", @@ -144,7 +145,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.19", "rand", ] @@ -154,7 +155,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.19", "rand", ] @@ -166,21 +167,32 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.67", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bit-set" @@ -205,9 +217,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -244,18 +256,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" [[package]] name = "cfg-if" @@ -274,22 +283,22 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "const-hex" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -298,6 +307,12 @@ dependencies = [ "serde", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "convert_case" version = "0.4.0" @@ -306,9 +321,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -318,25 +333,21 @@ name = "create2crunch" version = "0.3.0" dependencies = [ "alloy-primitives", - "byteorder", "console", "fs4", "ocl", "rand", - "rayon", "rustc-hash", "separator", "terminal_size", - "tiny-keccak", ] [[package]] name = "crossbeam" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb9105919ca8e40d437fc9cbb8f1975d916f1bd28afe795a48aae32a2cc8920" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -346,54 +357,46 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -401,6 +404,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -411,6 +426,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "derivative" version = "2.2.0" @@ -424,15 +449,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.67", ] [[package]] @@ -451,14 +476,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "encode_unicode" @@ -483,9 +543,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -493,9 +553,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fastrlp" @@ -508,6 +568,16 @@ dependencies = [ "bytes", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -528,12 +598,12 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fs4" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" +checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -556,24 +626,36 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hex" @@ -587,6 +669,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -609,9 +700,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -628,15 +719,28 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] [[package]] name = "keccak-asm" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -644,15 +748,15 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -662,15 +766,15 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "nodrop" @@ -680,32 +784,30 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", - "num-traits 0.2.17", + "num-traits 0.2.19", ] [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.19", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", - "num-traits 0.2.17", + "num-traits 0.2.19", ] [[package]] @@ -714,14 +816,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.19", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -729,13 +831,13 @@ dependencies = [ [[package]] name = "ocl" -version = "0.19.6" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c3ce118fd2f00eeb3c01f8073db1ee127cac0b2f79848192c7889b2bd7fe40" +checksum = "4297afb442d411793e4e24ee5a2977d15b6c95c743418f1c0ce0a2397d7ec8a3" dependencies = [ "futures", "nodrop", - "num-traits 0.2.17", + "num-traits 0.2.19", "ocl-core", "qutex", "thiserror", @@ -751,7 +853,7 @@ dependencies = [ "cl-sys", "enum_primitive", "num-complex", - "num-traits 0.2.17", + "num-traits 0.2.19", "ocl-core-vector", "rustc_version 0.4.0", "thiserror", @@ -763,14 +865,20 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f562279e046ca160aeed5eaf6f7c4eb9fa56cb8fd9d038dbdbf56225caeb8074" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.19", ] +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -782,9 +890,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -794,21 +902,31 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", "ucd-trie", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -828,43 +946,18 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_datetime", "toml_edit", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -877,9 +970,9 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.1", + "bitflags 2.5.0", "lazy_static", - "num-traits 0.2.17", + "num-traits 0.2.19", "rand", "rand_chacha", "rand_xorshift", @@ -897,18 +990,18 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "qutex" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4a51ba3d773c196f9450a6b239077ad8dda608b15263b4c9f29e58909883f" +checksum = "11778238e7d8b0e3ca62033fdc69e01ef5cdb08809cdc2398b2ce5ec873a1757" dependencies = [ "crossbeam", "futures", @@ -960,40 +1053,21 @@ dependencies = [ ] [[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" +name = "regex-syntax" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "bitflags 1.3.2", + "hmac", + "subtle", ] -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - [[package]] name = "rlp" version = "0.5.2" @@ -1006,9 +1080,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.11.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -1016,7 +1090,7 @@ dependencies = [ "bytes", "fastrlp", "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.19", "parity-scale-codec", "primitive-types", "proptest", @@ -1030,15 +1104,15 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc-hex" @@ -1061,16 +1135,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1089,6 +1163,20 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.11.0" @@ -1100,9 +1188,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "semver-parser" @@ -1121,40 +1209,77 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.67", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] name = "sha3-asm" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" dependencies = [ "cc", "cfg-if", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "subtle" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" + [[package]] name = "syn" version = "1.0.109" @@ -1168,9 +1293,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -1185,13 +1310,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] @@ -1208,22 +1332,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.52" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.52" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.67", ] [[package]] @@ -1237,15 +1361,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1290,9 +1414,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "valuable" @@ -1321,15 +1445,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -1345,22 +1460,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -1380,25 +1480,20 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -1407,15 +1502,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1425,15 +1514,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1443,15 +1526,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1461,15 +1544,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1479,15 +1556,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1497,15 +1568,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1515,15 +1580,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -1539,9 +1604,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -1554,5 +1619,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.67", ] diff --git a/Cargo.toml b/Cargo.toml index a3aa08f..fcc7d37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,25 +6,23 @@ edition = "2021" rust-version = "1.65" [dependencies] -alloy-primitives = { version = "0.5", features = ["rand"] } -byteorder = "1.5" +alloy-primitives = { version = "0.7", features = ["rand"] } console = "0.15" -fs4 = "0.7" +fs4 = "0.8" ocl = "0.19" rand = "0.8" -rayon = "1.0" -rustc-hash = "1.1" +rustc-hash = "2.0" separator = "0.4.1" terminal_size = "0.3.0" -tiny-keccak = "2.0" [profile.release] opt-level = 3 lto = "fat" -strip = true +debug = "line-tables-only" +strip = "debuginfo" panic = "abort" codegen-units = 1 [features] -default = [] +default = ["asm"] asm = ["alloy-primitives/asm-keccak"] diff --git a/README.md b/README.md index 171c70f..86b476a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ $ export FACTORY="0x0000000000ffe8b47b3e2130213b802212439497" $ export CALLER="" $ export INIT_CODE_HASH="" $ cargo run --release $FACTORY $CALLER $INIT_CODE_HASH + +# Note: if compilation fails, try disabling default features: +$ cargo run --release --no-default-features $FACTORY $CALLER $INIT_CODE_HASH ``` For each efficient address found, the salt, resultant addresses, and value *(i.e. approximate rarity)* will be written to `efficient_addresses.txt`. Verify that one of the salts actually results in the intended address before getting in too deep - ideally, the CREATE2 factory will have a view method for checking what address you'll get for submitting a particular salt. Be sure not to change the factory address or the init code without first removing any existing data to prevent the two salt types from becoming commingled. There's also a *very* simple monitoring tool available if you run `$python3 analysis.py` in another tab. diff --git a/src/lib.rs b/src/lib.rs index fecc7f4..b643d05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,13 +1,12 @@ #![warn(unused_crate_dependencies, unreachable_pub)] #![deny(unused_must_use, rust_2018_idioms)] -use alloy_primitives::{hex, Address, FixedBytes}; -use byteorder::{BigEndian, ByteOrder, LittleEndian}; +use alloy_primitives::{hex, Address, FixedBytes, Keccak256}; use console::Term; use fs4::FileExt; use ocl::{Buffer, Context, Device, MemFlags, Platform, ProQue, Program, Queue}; use rand::{thread_rng, Rng}; -use rayon::prelude::*; +use reward::Score; use separator::Separatable; use std::error::Error; use std::fmt::Write as _; @@ -15,10 +14,9 @@ use std::fs::{File, OpenOptions}; use std::io::prelude::*; use std::time::{SystemTime, UNIX_EPOCH}; use terminal_size::{terminal_size, Height}; -use tiny_keccak::{Hasher, Keccak}; mod reward; -pub use reward::Reward; +pub use reward::Rewards; // workset size (tweak this!) const WORK_SIZE: u32 = 0x4000000; // max. 0x15400000 to abs. max 0xffffffff @@ -49,8 +47,8 @@ pub struct Config { /// Validate the provided arguments and construct the Config struct. impl Config { - pub fn new(mut args: std::env::Args) -> Result { - // get args, skipping first arg (program name) + pub fn from_args(mut args: impl Iterator) -> Result { + // skip first arg (program name) args.next(); let Some(factory_address_string) = args.next() else { @@ -77,27 +75,16 @@ impl Config { }; // convert main arguments from hex string to vector of bytes - let Ok(factory_address_vec) = hex::decode(factory_address_string) else { + let Ok(factory_address) = hex::decode_to_array(factory_address_string) else { return Err("could not decode factory address argument"); }; - let Ok(calling_address_vec) = hex::decode(calling_address_string) else { + let Ok(calling_address) = hex::decode_to_array(calling_address_string) else { return Err("could not decode calling address argument"); }; - let Ok(init_code_hash_vec) = hex::decode(init_code_hash_string) else { + let Ok(init_code_hash) = hex::decode_to_array(init_code_hash_string) else { return Err("could not decode initialization code hash argument"); }; - // convert from vector to fixed array - let Ok(factory_address) = factory_address_vec.try_into() else { - return Err("invalid length for factory address argument"); - }; - let Ok(calling_address) = calling_address_vec.try_into() else { - return Err("invalid length for calling address argument"); - }; - let Ok(init_code_hash) = init_code_hash_vec.try_into() else { - return Err("invalid length for initialization code hash argument"); - }; - // convert gpu arguments to u8 values let Ok(gpu_device) = gpu_device_string.parse::() else { return Err("invalid gpu device value"); @@ -146,7 +133,7 @@ pub fn cpu(config: Config) -> Result<(), Box> { let file = output_file(); // create object for computing rewards (relative rarity) for a given address - let rewards = Reward::new(); + let rewards = Rewards::new(); // begin searching for addresses loop { @@ -158,80 +145,104 @@ pub fn cpu(config: Config) -> Result<(), Box> { header[41..].copy_from_slice(&FixedBytes::<6>::random()[..]); // create new hash object - let mut hash_header = Keccak::v256(); + let mut hash_header = Keccak256::new(); // update hash with header - hash_header.update(&header); + hash_header.update(header); // iterate over a 6-byte nonce and compute each address - (0..MAX_INCREMENTER) - .into_par_iter() // parallelization - .for_each(|salt| { - let salt = salt.to_le_bytes(); - let salt_incremented_segment = &salt[..6]; - - // clone the partially-hashed object - let mut hash = hash_header.clone(); - - // update with body and footer (total: 38 bytes) - hash.update(salt_incremented_segment); - hash.update(&config.init_code_hash); - - // hash the payload and get the result - let mut res: [u8; 32] = [0; 32]; - hash.finalize(&mut res); - - // get the address that results from the hash - let address = <&Address>::try_from(&res[12..]).unwrap(); - - // count total and leading zero bytes - let mut total = 0; - let mut leading = 21; - for (i, &b) in address.iter().enumerate() { - if b == 0 { - total += 1; - } else if leading == 21 { - // set leading on finding non-zero byte - leading = i; - } - } + let n_jobs = std::thread::available_parallelism().map_or(1, |x| x.get()); + std::thread::scope(|scope| { + for idx in 0..n_jobs { + let f = mk_cpu_task(&config, &file, &rewards, &header, &hash_header, idx, n_jobs); + std::thread::Builder::new() + .name(format!("worker-{idx}")) + .spawn_scoped(scope, f) + .unwrap(); + } + }) + } +} - // only proceed if there are at least three zero bytes - if total < 3 { - return; - } +fn mk_cpu_task<'a>( + config: &'a Config, + file: &'a File, + rewards: &'a Rewards, + header: &'a [u8; 47], + hash_header: &'a Keccak256, + idx: usize, + incr: usize, +) -> impl FnOnce() + 'a { + move || { + cpu_task( + config, + file, + rewards, + header, + hash_header, + idx as u64, + incr as u64, + ) + } +} - // look up the reward amount - let key = leading * 20 + total; - let reward_amount = rewards.get(&key); +fn cpu_task( + config: &Config, + mut file: &File, + rewards: &Rewards, + header: &[u8; 47], + hash_header: &Keccak256, + mut salt: u64, + incr: u64, +) { + while salt < MAX_INCREMENTER { + let salt_bytes = salt.to_le_bytes(); + salt += incr; + let salt_incremented_segment = &salt_bytes[..6]; + + // clone the partially-hashed object + let mut hash = hash_header.clone(); + + // update with body and footer (total: 38 bytes) + hash.update(salt_incremented_segment); + hash.update(config.init_code_hash); + + // hash the payload and get the result + let res = hash.finalize(); + + // get the address that results from the hash + let address = <&Address>::try_from(&res[12..]).unwrap(); + + // calculate the score of the address + let score = Score::calculate(address); + + // only proceed if there are at least three zero bytes + if score.total < 3 { + continue; + } - // only proceed if an efficient address has been found - if reward_amount.is_none() { - return; - } + // only proceed if an efficient address has been found + let Some(reward_amount) = rewards.get(score) else { + continue; + }; - // get the full salt used to create the address - let header_hex_string = hex::encode(header); - let body_hex_string = hex::encode(salt_incremented_segment); - let full_salt = format!("0x{}{}", &header_hex_string[42..], &body_hex_string); + // get the full salt used to create the address + let header_hex_string = hex::encode(header); + let body_hex_string = hex::encode(salt_incremented_segment); + let full_salt = format!("0x{}{}", &header_hex_string[42..], &body_hex_string); - // display the salt and the address. - let output = format!( - "{full_salt} => {address} => {}", - reward_amount.unwrap_or("0") - ); - println!("{output}"); + // display the salt and the address. + let output = format!("{full_salt} => {address} => {reward_amount}"); + println!("{output}"); - // create a lock on the file before writing - file.lock_exclusive().expect("Couldn't lock file."); + // create a lock on the file before writing + file.lock_exclusive().expect("Couldn't lock file."); - // write the result to file - writeln!(&file, "{output}") - .expect("Couldn't write to `efficient_addresses.txt` file."); + // write the result to file + writeln!(file, "{output}").expect("Couldn't write to `efficient_addresses.txt` file."); - // release the file lock - file.unlock().expect("Couldn't unlock file.") - }); + // release the file lock + file.unlock().expect("Couldn't unlock file.") } } @@ -266,7 +277,7 @@ pub fn gpu(config: Config) -> ocl::Result<()> { let file = output_file(); // create object for computing rewards (relative rarity) for a given address - let rewards = Reward::new(); + let rewards = Rewards::new(); // track how many addresses have been found and information about them let mut found: u64 = 0; @@ -333,7 +344,7 @@ pub fn gpu(config: Config) -> ocl::Result<()> { // reset nonce & create a buffer to view it in little-endian // for more uniformly distributed nonces, we shall initialize it to a random value - let mut nonce: [u32; 1] = rng.gen(); + let mut nonce: u32 = rng.gen(); let mut view_buf = [0; 8]; // build a corresponding buffer for passing the nonce to the kernel @@ -341,11 +352,11 @@ pub fn gpu(config: Config) -> ocl::Result<()> { .queue(ocl_pq.queue().clone()) .flags(MemFlags::new().read_only()) .len(1) - .copy_host_slice(&nonce) + .copy_host_slice(&[nonce]) .build()?; // establish a buffer for nonces that result in desired addresses - let mut solutions: Vec = vec![0; 1]; + let mut solutions = vec![0u64; 1]; let solutions_buffer = Buffer::builder() .queue(ocl_pq.queue().clone()) .flags(MemFlags::new().write_only()) @@ -398,7 +409,7 @@ pub fn gpu(config: Config) -> ocl::Result<()> { } // fill the buffer for viewing the properly-formatted nonce - LittleEndian::write_u64(&mut view_buf, (nonce[0] as u64) << 32); + view_buf.copy_from_slice(&((nonce as u64) << 32).to_le_bytes()); // calculate the terminal height, defaulting to a height of ten rows let height = terminal_size().map(|(_w, Height(h))| h).unwrap_or(10); @@ -427,7 +438,7 @@ pub fn gpu(config: Config) -> ocl::Result<()> { "current search space: {}xxxxxxxx{:08x}\t\t\ threshold: {} leading or {} total zeroes", hex::encode(salt), - BigEndian::read_u64(&view_buf), + u64::from_be_bytes(view_buf), config.leading_zeroes_threshold, config.total_zeroes_threshold ))?; @@ -467,14 +478,14 @@ pub fn gpu(config: Config) -> ocl::Result<()> { } // if no solution has yet been found, increment the nonce - nonce[0] += 1; + nonce += 1; // update the nonce buffer with the incremented nonce value nonce_buffer = Buffer::builder() .queue(ocl_pq.queue().clone()) .flags(MemFlags::new().read_write()) .len(1) - .copy_host_slice(&nonce) + .copy_host_slice(&[nonce]) .build()?; } @@ -494,33 +505,15 @@ pub fn gpu(config: Config) -> ocl::Result<()> { solution_message[45..53].copy_from_slice(&solution); solution_message[53..].copy_from_slice(&config.init_code_hash); - // create new hash object - let mut hash = Keccak::v256(); - - // update with header - hash.update(&solution_message); - - // hash the payload and get the result - let mut res: [u8; 32] = [0; 32]; - hash.finalize(&mut res); + let res = alloy_primitives::keccak256(solution_message); // get the address that results from the hash let address = <&Address>::try_from(&res[12..]).unwrap(); - // count total and leading zero bytes - let mut total = 0; - let mut leading = 0; - for (i, &b) in address.iter().enumerate() { - if b == 0 { - total += 1; - } else if leading == 0 { - // set leading on finding non-zero byte - leading = i; - } - } + // only proceed if an efficient address has been found + let score @ Score { total, leading } = Score::calculate(address); + let reward = rewards.get(score).unwrap_or("0"); - let key = leading * 20 + total; - let reward = rewards.get(&key).unwrap_or("0"); let output = format!( "0x{}{}{} => {} => {}", hex::encode(config.calling_address), diff --git a/src/main.rs b/src/main.rs index 5bcfb48..7502ce8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use std::env; use std::process; fn main() { - let config = Config::new(env::args()).unwrap_or_else(|err| { + let config = Config::from_args(env::args()).unwrap_or_else(|err| { eprintln!("Failed parsing arguments: {err}"); process::exit(1); }); diff --git a/src/reward.rs b/src/reward.rs index 8422179..f794ee3 100644 --- a/src/reward.rs +++ b/src/reward.rs @@ -1,12 +1,14 @@ +use alloy_primitives::Address; use rustc_hash::FxHashMap; -pub struct Reward { - reward: FxHashMap, +pub struct Rewards { + rewards: FxHashMap, } -impl Reward { +impl Rewards { + /// Creates a new `Rewards` table. pub fn new() -> Self { - let reward = FxHashMap::from_iter([ + let rewards = FxHashMap::from_iter([ (5, "4"), (6, "454"), (7, "57926"), @@ -208,11 +210,121 @@ impl Reward { (399, "340282366920938463463374607431768211456"), (420, "87112285931760246646623899502532662132736"), ]); - Reward { reward } + Rewards { rewards } } + /// Gets the reward for the given score. #[inline] - pub fn get(&self, value: &usize) -> Option<&'static str> { - self.reward.get(value).copied() + pub fn get(&self, value: Score) -> Option<&'static str> { + self.rewards.get(&value.key()).copied() + } +} + +impl Default for Rewards { + fn default() -> Self { + Self::new() + } +} + +/// A score for an address. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Score { + /// Total number of zero bytes in the address. + pub total: u8, + /// Number of zero bytes at the beginning of the address. + pub leading: u8, +} + +impl Score { + /// Calculates the score for the given address. + #[inline] + pub fn calculate(address: &Address) -> Self { + let total = address.iter().filter(|&&b| b == 0).count() as u8; + let leading = { + let a = u128::from_be_bytes(address[..16].try_into().unwrap()); + let b = u32::from_be_bytes(address[16..20].try_into().unwrap()); + let mut leading_bits = a.leading_zeros(); + if leading_bits == u128::BITS { + leading_bits += b.leading_zeros(); + } + (leading_bits / 8) as u8 + }; + Self { total, leading } + } + + /// Calculates the key to look up in the rewards table. + #[inline] + fn key(&self) -> usize { + self.leading as usize * 20 + self.total as usize + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn score_reference(address: &Address) -> Score { + Score { + total: address.iter().filter(|&&b| b == 0).count() as u8, + leading: address.iter().position(|&b| b != 0).unwrap_or(20) as u8, + } + } + + #[test] + fn score_calculation() { + let tests = [ + ("1111111111111111111111111111111111111111", (0, 0)), + ("0011111111111111111111111111111111111111", (1, 1)), + ("0000111111111111111111111111111111111111", (2, 2)), + ("0011001111111111111111111111111111111111", (2, 1)), + ("0000000000000000111111111111111111111111", (8, 8)), + ("0000000000000000001111111111111111111111", (9, 9)), + ("0000000000000011001111111111111111111111", (8, 7)), + ("0000000000000000000000000000000011111111", (16, 16)), + ("0000000000000000000000000000000000111111", (17, 17)), + ("0000000000000000000000000000000011001111", (17, 16)), + ("0000000000000000000000000000001100001111", (17, 15)), + ]; + for (address, (total, leading)) in tests { + let address = address.parse().unwrap(); + let expected_score = Score { total, leading }; + assert_eq!(expected_score, score_reference(&address)); + assert_eq!(Score::calculate(&address), expected_score, "{address}"); + } + } + + #[test] + fn random_score_calculation() { + let mut rng = rand::thread_rng(); + for _ in 0..256 { + let address = Address::random_with(&mut rng); + assert_eq!(Score::calculate(&address), score_reference(&address)); + } + } + + #[test] + fn reward_calculation() { + let rewards = Rewards::new(); + let tests = [ + ("0x00000049da7B57fc3e21Dc1020EDD77555d1b286", "1"), + ("0x00000089468965a58FDC920f66f149092a8D2808", "1"), + ("0x0000A6832be100b395A69B000fe00A542dA71071", "2"), + ("0x00001006001A00c1583f545B29f971B56eF38657", "2"), + ("0x0000A1d57aA3e2462772B0006Bd2bb2C001C78B6", "2"), + ("0x5dF21975f600c30016007493981c003994000F03", "4"), + ("0x0000008cf8957fdF4Cc6f8009c302710D4206CBb", "16"), + ("0x000000597A8f1485A5a4de00C889517E060427DA", "16"), + ("0x00000059A7f2AdF974E19370000F0A50D7b08a46", "16"), + ("0x00EF0066AB6102B2007C00BcDE1bEece70060066", "18"), + ]; + for (address, expected_reward) in tests { + let address = address.parse().unwrap(); + let score = Score::calculate(&address); + assert_eq!( + rewards.get(score), + Some(expected_reward), + "{address} -> {score:?}" + ); + } } }