From 4b01e3aa56aa40f37779799c63496b8875df30a3 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Fri, 21 Jun 2024 16:14:21 -0700 Subject: [PATCH 01/17] feat: use `kzg-rs` --- Cargo.lock | 523 ++++++++---------- crates/precompile/Cargo.toml | 7 + crates/precompile/src/kzg_point_evaluation.rs | 3 + crates/primitives/Cargo.toml | 12 +- crates/primitives/src/kzg.rs | 4 + crates/primitives/src/kzg/env_settings.rs | 42 +- .../src/kzg/trusted_setup_points.rs | 4 + crates/primitives/src/lib.rs | 2 - 8 files changed, 292 insertions(+), 305 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c51803c082..4e9aea5011 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2feb5f466b3a786d5a622d8926418bc6a0d38bf632909f6ee9298a4a1d8c6e0" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" dependencies = [ "num_enum", "strum", @@ -171,6 +171,7 @@ dependencies = [ "lru", "pin-project", "reqwest 0.12.5", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -197,7 +198,7 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -212,6 +213,7 @@ dependencies = [ "futures", "pin-project", "reqwest 0.12.5", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -278,7 +280,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -294,7 +296,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "syn-solidity", "tiny-keccak", ] @@ -310,7 +312,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "syn-solidity", ] @@ -353,6 +355,7 @@ dependencies = [ "alloy-json-rpc", "alloy-transport", "reqwest 0.12.5", + "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -544,7 +547,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -555,7 +558,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -604,7 +607,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -720,6 +723,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" +dependencies = [ + "ff", + "group", + "pairing", + "rand_core", + "subtle", +] + [[package]] name = "blst" version = "0.3.12" @@ -880,6 +896,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-chunks" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d63d857efc8e722f18e9e2bbdd32b53084211090eb4b3df5d3170eddd0c76d" + [[package]] name = "const-hex" version = "1.12.0" @@ -1076,7 +1098,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1089,7 +1111,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1113,17 +1135,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "dunce" version = "1.0.4" @@ -1216,7 +1227,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1408,6 +1419,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ + "bitvec", "rand_core", "subtle", ] @@ -1517,7 +1529,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1818,9 +1830,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1882,10 +1894,29 @@ dependencies = [ "http 0.2.12", "hyper 0.14.29", "rustls 0.21.12", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.23.10", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.27.2" @@ -1939,134 +1970,14 @@ dependencies = [ "tracing", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2242,6 +2153,25 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kzg-rs" +version = "0.1.0" +source = "git+https://github.com/0xWOLAND/kzg-rs#14b7b61b6328f3bf3ffcbd75c09bb142b4198afd" +dependencies = [ + "bls12_381", + "const-chunks", + "glob", + "hex", + "once_cell", + "regex", + "serde", + "serde_derive", + "serde_json", + "serde_yaml", + "sp1-derive", + "subtle", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2269,12 +2199,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -2320,9 +2244,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2463,7 +2387,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2541,7 +2465,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2574,6 +2498,15 @@ dependencies = [ "sha2", ] +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -2685,7 +2618,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2714,7 +2647,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2858,9 +2791,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -3036,6 +2969,7 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.29", "hyper-rustls 0.24.2", + "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -3044,14 +2978,17 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -3064,8 +3001,10 @@ dependencies = [ [[package]] name = "reqwest" version = "0.12.5" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -3078,6 +3017,7 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.27.2", + "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", "ipnet", @@ -3093,6 +3033,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -3122,6 +3063,7 @@ dependencies = [ "ethers-providers", "indicatif", "reqwest 0.12.5", + "reqwest 0.12.5", "revm-interpreter", "revm-precompile", "rstest", @@ -3154,6 +3096,7 @@ dependencies = [ "criterion", "eyre", "k256", + "kzg-rs", "once_cell", "p256", "rand", @@ -3184,6 +3127,7 @@ dependencies = [ "enumn", "hashbrown", "hex", + "kzg-rs", "once_cell", "serde", ] @@ -3320,7 +3264,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.67", "unicode-ident", ] @@ -3407,6 +3351,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-webpki 0.101.7", + "rustls-webpki 0.101.7", "sct", ] @@ -3423,6 +3368,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls" +version = "0.23.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3469,6 +3427,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -3660,7 +3629,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3687,6 +3656,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3782,6 +3764,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sp1-derive" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "spin" version = "0.5.2" @@ -3804,12 +3796,6 @@ dependencies = [ "der", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -3865,7 +3851,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3883,9 +3869,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "syn" @@ -3900,9 +3886,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -3918,7 +3904,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3933,17 +3919,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -4009,7 +3984,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4061,16 +4036,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -4081,6 +4046,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.38.0" @@ -4106,7 +4086,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4129,6 +4109,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.10", + "rustls-pki-types", + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" @@ -4161,8 +4153,10 @@ dependencies = [ "futures-util", "log", "rustls 0.21.12", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] @@ -4245,7 +4239,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4297,6 +4291,7 @@ dependencies = [ "log", "rand", "rustls 0.21.12", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -4334,12 +4329,27 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -4358,6 +4368,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -4372,9 +4388,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -4387,18 +4403,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "valuable" version = "0.1.0" @@ -4478,7 +4482,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-shared", ] @@ -4512,7 +4516,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4738,18 +4742,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -4778,30 +4770,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.34" @@ -4819,28 +4787,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.67", ] [[package]] @@ -4860,27 +4807,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "syn 2.0.67", ] diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index a242a36e5d..76087dad77 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -47,6 +47,11 @@ bn = { package = "substrate-bn", version = "0.6", default-features = false } # KZG point evaluation precompile c-kzg = { version = "1.0.2", default-features = false, optional = true } +# Optionally use `kzg-rs` for a pure Rust implementation of KZG point evaluation. +kzg-rs = { git = "https://github.com/0xWOLAND/kzg-rs", default-features = false, features = [ + 'cache', +], optional = true } + # BLS12-381 precompiles blst = { version = "0.3.12", optional = true } @@ -98,6 +103,8 @@ secp256r1 = ["dep:p256"] # Enables the KZG point evaluation precompile. c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg"] +kzg-rs = ["dep:kzg-rs", "revm-primitives/kzg-rs"] + portable = ["revm-primitives/portable", "c-kzg?/portable"] # Use `secp256k1` as a faster alternative to `k256`. diff --git a/crates/precompile/src/kzg_point_evaluation.rs b/crates/precompile/src/kzg_point_evaluation.rs index 22192ce56d..81d730ad78 100644 --- a/crates/precompile/src/kzg_point_evaluation.rs +++ b/crates/precompile/src/kzg_point_evaluation.rs @@ -1,5 +1,8 @@ use crate::{Address, Error, Precompile, PrecompileResult, PrecompileWithAddress}; +#[cfg(not(feature = "kzg-rs"))] use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings}; +#[cfg(feature = "kzg-rs")] +use kzg_rs::{Bytes32, Bytes48, KzgProof, KzgSettings}; use revm_primitives::{hex_literal::hex, Bytes, Env, PrecompileOutput}; use sha2::{Digest, Sha256}; diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index ee3ad1ff68..750872e2b5 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -22,7 +22,7 @@ rust_2018_idioms = "deny" all = "warn" [dependencies] -alloy-eips = { version = "0.1", default-features = false, features = ["k256"]} +alloy-eips = { version = "0.1", default-features = false } alloy-primitives = { version = "0.7.2", default-features = false, features = [ "rlp", ] } @@ -35,6 +35,11 @@ bitflags = { version = "2.5.0", default-features = false } c-kzg = { version = "1.0.2", default-features = false, optional = true } once_cell = { version = "1.19", default-features = false, optional = true } +# Optionally use `kzg-rs` for a pure Rust implementation of KZG. +kzg-rs = { git = "https://github.com/0xWOLAND/kzg-rs", default-features = false, features = [ + 'cache', +], optional = true } + # utility enumn = "0.1" derive_more = { version = "0.99", optional = true } @@ -51,7 +56,7 @@ serde = { version = "1.0", default-features = false, features = [ hex = { version = "0.4", default-features = false } [features] -default = ["std", "c-kzg", "portable"] +default = ["std", "kzg-rs"] std = [ "serde?/std", "alloy-eips/std", @@ -70,12 +75,13 @@ serde = [ "bitvec/serde", "bitflags/serde", "c-kzg?/serde", + "kzg-rs?/serde", ] arbitrary = [ "std", "alloy-eips/arbitrary", "alloy-primitives/arbitrary", - "bitflags/arbitrary" + "bitflags/arbitrary", ] asm-keccak = ["alloy-primitives/asm-keccak"] portable = ["c-kzg?/portable"] diff --git a/crates/primitives/src/kzg.rs b/crates/primitives/src/kzg.rs index 8d37463f0c..b7adc3ee68 100644 --- a/crates/primitives/src/kzg.rs +++ b/crates/primitives/src/kzg.rs @@ -1,7 +1,11 @@ mod env_settings; mod trusted_setup_points; +#[cfg(feature = "kzg-rs")] +pub use kzg_rs::KzgSettings; +#[cfg(not(feature = "kzg-rs"))] pub use c_kzg::KzgSettings; + pub use env_settings::EnvKzgSettings; pub use trusted_setup_points::{ parse_kzg_trusted_setup, G1Points, G2Points, KzgErrors, BYTES_PER_G1_POINT, BYTES_PER_G2_POINT, diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index d9b5f24350..bb5a768697 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -2,24 +2,64 @@ use super::{ trusted_setup_points::{G1_POINTS, G2_POINTS}, KzgSettings, }; +use core::hash::{Hash, Hasher}; use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; /// KZG Settings that allow us to specify a custom trusted setup. /// or use hardcoded default settings. -#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Default, Eq)] pub enum EnvKzgSettings { /// Default mainnet trusted setup #[default] Default, /// Custom trusted setup. + #[cfg(feature = "kzg-rs")] + Custom(Arc), + #[cfg(not(feature = "kzg-rs"))] Custom(Arc), } +// Implement PartialEq and Hash manually because `kzg_rs::KzgSettings` does not implement them +impl PartialEq for EnvKzgSettings { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Self::Default, Self::Default) => true, + (Self::Custom(a), Self::Custom(b)) => Arc::ptr_eq(a, b), + _ => false, + } + } +} + +impl Hash for EnvKzgSettings { + fn hash(&self, state: &mut H) { + core::mem::discriminant(self).hash(state); + match self { + Self::Default => {} + Self::Custom(settings) => Arc::::as_ptr(settings).hash(state), + } + } +} + impl EnvKzgSettings { /// Return set KZG settings. /// /// In will initialize the default settings if it is not already loaded. + #[cfg(feature = "kzg-rs")] + pub fn get(&self) -> &KzgSettings { + match self { + Self::Default => { + static DEFAULT: OnceBox = OnceBox::new(); + DEFAULT.get_or_init(|| { + let settings = KzgSettings::load_trusted_setup_file() + .expect("failed to load default trusted setup"); + Box::new(settings) + }) + } + Self::Custom(settings) => settings, + } + } + #[cfg(not(feature = "kzg-rs"))] pub fn get(&self) -> &KzgSettings { match self { Self::Default => { diff --git a/crates/primitives/src/kzg/trusted_setup_points.rs b/crates/primitives/src/kzg/trusted_setup_points.rs index dc90b64bed..5228f5f9ba 100644 --- a/crates/primitives/src/kzg/trusted_setup_points.rs +++ b/crates/primitives/src/kzg/trusted_setup_points.rs @@ -2,8 +2,12 @@ use core::fmt; use derive_more::{AsMut, AsRef, Deref, DerefMut}; use std::boxed::Box; +#[cfg(feature = "c-kzg")] pub use c_kzg::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; +#[cfg(not(feature = "c-kzg"))] +pub use kzg_rs::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; + /// Number of G1 Points. pub const NUM_G1_POINTS: usize = 4096; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 78e939d5f7..089e674ad8 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -12,7 +12,6 @@ mod constants; pub mod db; pub mod env; -#[cfg(feature = "c-kzg")] pub mod kzg; pub mod precompile; pub mod result; @@ -38,7 +37,6 @@ cfg_if::cfg_if! { } } -#[cfg(feature = "c-kzg")] pub use kzg::{EnvKzgSettings, KzgSettings}; pub use precompile::*; pub use result::*; From 03640604dcbdfe2f37e4ef80c80ead3816334a6f Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Fri, 21 Jun 2024 18:57:30 -0700 Subject: [PATCH 02/17] fix: use `c-kzg` by default in std env --- Cargo.lock | 51 ++--------------------- crates/primitives/Cargo.toml | 3 +- crates/primitives/src/kzg/env_settings.rs | 49 +++------------------- 3 files changed, 11 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e9aea5011..21ecfada2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -896,12 +896,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "const-chunks" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d63d857efc8e722f18e9e2bbdd32b53084211090eb4b3df5d3170eddd0c76d" - [[package]] name = "const-hex" version = "1.12.0" @@ -2156,29 +2150,21 @@ dependencies = [ [[package]] name = "kzg-rs" version = "0.1.0" -source = "git+https://github.com/0xWOLAND/kzg-rs#14b7b61b6328f3bf3ffcbd75c09bb142b4198afd" +source = "git+https://github.com/0xWOLAND/kzg-rs#a0dbaf3d7796d3c19baf8f1870a421584481f012" dependencies = [ "bls12_381", - "const-chunks", "glob", "hex", "once_cell", - "regex", - "serde", - "serde_derive", - "serde_json", - "serde_yaml", - "sp1-derive", - "subtle", ] [[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" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -3656,19 +3642,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha1" version = "0.10.6" @@ -3764,16 +3737,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sp1-derive" -version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "spin" version = "0.5.2" @@ -4368,12 +4331,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.7.1" diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 750872e2b5..95264b7f1f 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -56,7 +56,7 @@ serde = { version = "1.0", default-features = false, features = [ hex = { version = "0.4", default-features = false } [features] -default = ["std", "kzg-rs"] +default = ["std", "c-kzg", "portable"] std = [ "serde?/std", "alloy-eips/std", @@ -75,7 +75,6 @@ serde = [ "bitvec/serde", "bitflags/serde", "c-kzg?/serde", - "kzg-rs?/serde", ] arbitrary = [ "std", diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index bb5a768697..978429b12b 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -2,64 +2,27 @@ use super::{ trusted_setup_points::{G1_POINTS, G2_POINTS}, KzgSettings, }; -use core::hash::{Hash, Hasher}; use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; /// KZG Settings that allow us to specify a custom trusted setup. /// or use hardcoded default settings. -#[derive(Debug, Clone, Default, Eq)] +#[cfg(feature = "kzg-rs")] +pub use kzg_rs::EnvKzgSettings; + +#[cfg(not(feature = "kzg-rs"))] +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] pub enum EnvKzgSettings { /// Default mainnet trusted setup #[default] Default, /// Custom trusted setup. - #[cfg(feature = "kzg-rs")] - Custom(Arc), - #[cfg(not(feature = "kzg-rs"))] Custom(Arc), } -// Implement PartialEq and Hash manually because `kzg_rs::KzgSettings` does not implement them -impl PartialEq for EnvKzgSettings { - fn eq(&self, other: &Self) -> bool { - match (self, other) { - (Self::Default, Self::Default) => true, - (Self::Custom(a), Self::Custom(b)) => Arc::ptr_eq(a, b), - _ => false, - } - } -} - -impl Hash for EnvKzgSettings { - fn hash(&self, state: &mut H) { - core::mem::discriminant(self).hash(state); - match self { - Self::Default => {} - Self::Custom(settings) => Arc::::as_ptr(settings).hash(state), - } - } -} - +#[cfg(not(feature = "kzg-rs"))] impl EnvKzgSettings { /// Return set KZG settings. - /// - /// In will initialize the default settings if it is not already loaded. - #[cfg(feature = "kzg-rs")] - pub fn get(&self) -> &KzgSettings { - match self { - Self::Default => { - static DEFAULT: OnceBox = OnceBox::new(); - DEFAULT.get_or_init(|| { - let settings = KzgSettings::load_trusted_setup_file() - .expect("failed to load default trusted setup"); - Box::new(settings) - }) - } - Self::Custom(settings) => settings, - } - } - #[cfg(not(feature = "kzg-rs"))] pub fn get(&self) -> &KzgSettings { match self { Self::Default => { From 824cd0d34e339d9873818634b0c6e38379557760 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Fri, 21 Jun 2024 19:45:45 -0700 Subject: [PATCH 03/17] refactor: feature gate by `c-kzg` --- crates/precompile/src/kzg_point_evaluation.rs | 4 ++-- crates/primitives/src/kzg.rs | 6 +++--- crates/primitives/src/kzg/env_settings.rs | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/precompile/src/kzg_point_evaluation.rs b/crates/precompile/src/kzg_point_evaluation.rs index 81d730ad78..d8efc10d84 100644 --- a/crates/precompile/src/kzg_point_evaluation.rs +++ b/crates/precompile/src/kzg_point_evaluation.rs @@ -1,7 +1,7 @@ use crate::{Address, Error, Precompile, PrecompileResult, PrecompileWithAddress}; -#[cfg(not(feature = "kzg-rs"))] +#[cfg(feature = "c-kzg")] use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings}; -#[cfg(feature = "kzg-rs")] +#[cfg(not(feature = "c-kzg"))] use kzg_rs::{Bytes32, Bytes48, KzgProof, KzgSettings}; use revm_primitives::{hex_literal::hex, Bytes, Env, PrecompileOutput}; use sha2::{Digest, Sha256}; diff --git a/crates/primitives/src/kzg.rs b/crates/primitives/src/kzg.rs index b7adc3ee68..737cd00fe0 100644 --- a/crates/primitives/src/kzg.rs +++ b/crates/primitives/src/kzg.rs @@ -1,10 +1,10 @@ mod env_settings; mod trusted_setup_points; -#[cfg(feature = "kzg-rs")] -pub use kzg_rs::KzgSettings; -#[cfg(not(feature = "kzg-rs"))] +#[cfg(feature = "c-kzg")] pub use c_kzg::KzgSettings; +#[cfg(not(feature = "c-kzg"))] +pub use kzg_rs::KzgSettings; pub use env_settings::EnvKzgSettings; pub use trusted_setup_points::{ diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index 978429b12b..d21c9d97ed 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -7,10 +7,10 @@ use std::{boxed::Box, sync::Arc}; /// KZG Settings that allow us to specify a custom trusted setup. /// or use hardcoded default settings. -#[cfg(feature = "kzg-rs")] +#[cfg(not(feature = "c-kzg"))] pub use kzg_rs::EnvKzgSettings; -#[cfg(not(feature = "kzg-rs"))] +#[cfg(feature = "c-kzg")] #[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] pub enum EnvKzgSettings { /// Default mainnet trusted setup @@ -20,9 +20,11 @@ pub enum EnvKzgSettings { Custom(Arc), } -#[cfg(not(feature = "kzg-rs"))] +#[cfg(feature = "c-kzg")] impl EnvKzgSettings { /// Return set KZG settings. + /// + /// In will initialize the default settings if it is not already loaded. pub fn get(&self) -> &KzgSettings { match self { Self::Default => { From cd1d0d3b16638631253430b4db8eb1343fe7750b Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Sat, 22 Jun 2024 14:57:50 -0700 Subject: [PATCH 04/17] fix: use published crate --- Cargo.lock | 7 ++++--- crates/precompile/Cargo.toml | 2 +- crates/primitives/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21ecfada2e..9741f8175b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2150,7 +2150,8 @@ dependencies = [ [[package]] name = "kzg-rs" version = "0.1.0" -source = "git+https://github.com/0xWOLAND/kzg-rs#a0dbaf3d7796d3c19baf8f1870a421584481f012" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9920cd4460ce3cbca19c62f3bb9a9611562478a4dc9d2c556f4a7d049c5b6b" dependencies = [ "bls12_381", "glob", @@ -2786,9 +2787,9 @@ dependencies = [ [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 76087dad77..a902443d58 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -48,7 +48,7 @@ bn = { package = "substrate-bn", version = "0.6", default-features = false } c-kzg = { version = "1.0.2", default-features = false, optional = true } # Optionally use `kzg-rs` for a pure Rust implementation of KZG point evaluation. -kzg-rs = { git = "https://github.com/0xWOLAND/kzg-rs", default-features = false, features = [ +kzg-rs = { version = "0.1", default-features = false, features = [ 'cache', ], optional = true } diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 95264b7f1f..bdd120cb31 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -36,7 +36,7 @@ c-kzg = { version = "1.0.2", default-features = false, optional = true } once_cell = { version = "1.19", default-features = false, optional = true } # Optionally use `kzg-rs` for a pure Rust implementation of KZG. -kzg-rs = { git = "https://github.com/0xWOLAND/kzg-rs", default-features = false, features = [ +kzg-rs = { version = "0.1", default-features = false, features = [ 'cache', ], optional = true } From 6656ac16c6ade1f3b60b0edf4564bda764f6947c Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Thu, 27 Jun 2024 20:46:39 -0700 Subject: [PATCH 05/17] fix: `kzg-rs` import --- Cargo.lock | 454 +++++++++++++++++++++++------------ crates/precompile/src/lib.rs | 14 +- crates/primitives/src/lib.rs | 6 + 3 files changed, 320 insertions(+), 154 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9741f8175b..2a459f112f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "d2feb5f466b3a786d5a622d8926418bc6a0d38bf632909f6ee9298a4a1d8c6e0" dependencies = [ "num_enum", "strum", @@ -171,7 +171,6 @@ dependencies = [ "lru", "pin-project", "reqwest 0.12.5", - "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -198,7 +197,7 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -213,7 +212,6 @@ dependencies = [ "futures", "pin-project", "reqwest 0.12.5", - "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -280,7 +278,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -296,7 +294,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "syn-solidity", "tiny-keccak", ] @@ -312,7 +310,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "syn-solidity", ] @@ -355,7 +353,6 @@ dependencies = [ "alloy-json-rpc", "alloy-transport", "reqwest 0.12.5", - "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -547,7 +544,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -558,7 +555,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -607,7 +604,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1092,7 +1089,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1105,7 +1102,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1129,6 +1126,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "dunce" version = "1.0.4" @@ -1221,7 +1229,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1523,7 +1531,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1824,9 +1832,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" @@ -1888,29 +1896,10 @@ dependencies = [ "http 0.2.12", "hyper 0.14.29", "rustls 0.21.12", - "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.2" @@ -1964,14 +1953,134 @@ dependencies = [ "tracing", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -2161,11 +2270,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.9.8", + "spin 0.5.2", ] [[package]] @@ -2186,6 +2295,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2231,9 +2346,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -2374,7 +2489,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2452,7 +2567,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2605,7 +2720,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2634,7 +2749,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2778,18 +2893,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", @@ -2956,7 +3071,6 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.29", "hyper-rustls 0.24.2", - "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -2965,17 +3079,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", - "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", - "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -2988,10 +3099,8 @@ dependencies = [ [[package]] name = "reqwest" version = "0.12.5" -version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -3004,7 +3113,6 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.27.2", - "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", "ipnet", @@ -3020,7 +3128,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -3050,7 +3157,6 @@ dependencies = [ "ethers-providers", "indicatif", "reqwest 0.12.5", - "reqwest 0.12.5", "revm-interpreter", "revm-precompile", "rstest", @@ -3251,7 +3357,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.67", + "syn 2.0.66", "unicode-ident", ] @@ -3338,7 +3444,6 @@ dependencies = [ "log", "ring 0.17.8", "rustls-webpki 0.101.7", - "rustls-webpki 0.101.7", "sct", ] @@ -3355,19 +3460,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle", - "zeroize", -] - [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3414,17 +3506,6 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "rustls-webpki" -version = "0.102.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" -dependencies = [ - "ring 0.17.8", - "rustls-pki-types", - "untrusted 0.9.0", -] - [[package]] name = "rustversion" version = "1.0.17" @@ -3616,7 +3697,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3760,6 +3841,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3815,7 +3902,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3833,9 +3920,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -3850,9 +3937,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.67" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3868,7 +3955,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3883,6 +3970,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3948,7 +4046,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4001,30 +4099,25 @@ dependencies = [ ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "serde", - "serde_json", + "displaydoc", + "zerovec", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinytemplate" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ - "tinyvec_macros", + "serde", + "serde_json", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" version = "1.38.0" @@ -4050,7 +4143,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4073,18 +4166,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls 0.23.10", - "rustls-pki-types", - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -4117,10 +4198,8 @@ dependencies = [ "futures-util", "log", "rustls 0.21.12", - "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", - "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] @@ -4203,7 +4282,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4255,7 +4334,6 @@ dependencies = [ "log", "rand", "rustls 0.21.12", - "rustls 0.21.12", "sha1", "thiserror", "url", @@ -4293,27 +4371,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -4346,9 +4409,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -4361,6 +4424,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "valuable" version = "0.1.0" @@ -4440,7 +4515,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -4474,7 +4549,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4700,6 +4775,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -4728,6 +4815,30 @@ dependencies = [ "tap", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -4745,7 +4856,28 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", ] [[package]] @@ -4765,5 +4897,27 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", +] + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index fbd8e69cbc..18bab9dc8d 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -23,14 +23,20 @@ pub mod secp256k1; pub mod secp256r1; pub mod utilities; -pub use fatal_precompile::fatal_precompile; +#[cfg(feature = "kzg-rs")] +// silence lint +use kzg_rs as _; -pub use primitives::{ +use core::hash::Hash; +use once_cell::race::OnceBox; +#[doc(hidden)] +pub use revm_primitives as primitives; +#[doc(hidden)] +pub use revm_primitives as primitives; +pub use revm_primitives::{ precompile::{PrecompileError as Error, *}, Address, Bytes, HashMap, HashSet, Log, B256, }; -#[doc(hidden)] -pub use revm_primitives as primitives; use cfg_if::cfg_if; use core::hash::Hash; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 089e674ad8..b70985eae4 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -12,6 +12,7 @@ mod constants; pub mod db; pub mod env; +#[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] pub mod kzg; pub mod precompile; pub mod result; @@ -37,9 +38,14 @@ cfg_if::cfg_if! { } } +#[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] pub use kzg::{EnvKzgSettings, KzgSettings}; pub use precompile::*; pub use result::*; pub use specification::*; pub use state::*; pub use utilities::*; + +#[cfg(feature = "kzg-rs")] +// silence lint +use kzg_rs as _; From 183005ab28f7cb2c0a1ff96270028c5a4791d8a9 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Fri, 28 Jun 2024 11:44:14 -0700 Subject: [PATCH 06/17] feat: use `cfg_if` for `kzg-rs` imports --- crates/precompile/Cargo.toml | 4 +- crates/precompile/src/kzg_point_evaluation.rs | 11 ++-- crates/precompile/src/lib.rs | 3 +- crates/primitives/src/kzg.rs | 11 ++-- crates/primitives/src/kzg/env_settings.rs | 61 ++++++++++--------- .../src/kzg/trusted_setup_points.rs | 12 ++-- 6 files changed, 56 insertions(+), 46 deletions(-) diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index a902443d58..3efa1b8d52 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -60,8 +60,8 @@ p256 = { version = "0.13.2", optional = true, default-features = false, features "ecdsa", ] } -# utils -cfg-if = { version = "1.0", default-features = false } +# Utility +cfg-if = "1" [dev-dependencies] criterion = "0.5" diff --git a/crates/precompile/src/kzg_point_evaluation.rs b/crates/precompile/src/kzg_point_evaluation.rs index d8efc10d84..6f295219a6 100644 --- a/crates/precompile/src/kzg_point_evaluation.rs +++ b/crates/precompile/src/kzg_point_evaluation.rs @@ -1,8 +1,11 @@ use crate::{Address, Error, Precompile, PrecompileResult, PrecompileWithAddress}; -#[cfg(feature = "c-kzg")] -use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings}; -#[cfg(not(feature = "c-kzg"))] -use kzg_rs::{Bytes32, Bytes48, KzgProof, KzgSettings}; +cfg_if::cfg_if! { + if #[cfg(feature = "c-kzg")] { + use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings}; + } else if #[cfg(feature = "kzg-rs")] { + use kzg_rs::{Bytes32, Bytes48, KzgProof, KzgSettings}; + } +} use revm_primitives::{hex_literal::hex, Bytes, Env, PrecompileOutput}; use sha2::{Digest, Sha256}; diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 18bab9dc8d..eed8d5e23e 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -23,8 +23,9 @@ pub mod secp256k1; pub mod secp256r1; pub mod utilities; -#[cfg(feature = "kzg-rs")] // silence lint +use cfg_if as _; +#[cfg(feature = "kzg-rs")] use kzg_rs as _; use core::hash::Hash; diff --git a/crates/primitives/src/kzg.rs b/crates/primitives/src/kzg.rs index 737cd00fe0..e3fc8cf586 100644 --- a/crates/primitives/src/kzg.rs +++ b/crates/primitives/src/kzg.rs @@ -1,10 +1,13 @@ mod env_settings; mod trusted_setup_points; -#[cfg(feature = "c-kzg")] -pub use c_kzg::KzgSettings; -#[cfg(not(feature = "c-kzg"))] -pub use kzg_rs::KzgSettings; +cfg_if::cfg_if! { + if #[cfg(feature = "c-kzg")] { + pub use c_kzg::KzgSettings; + } else if #[cfg(feature = "kzg-rs")] { + pub use kzg_rs::KzgSettings; + } +} pub use env_settings::EnvKzgSettings; pub use trusted_setup_points::{ diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index d21c9d97ed..3b69c1b349 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -5,38 +5,39 @@ use super::{ use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; -/// KZG Settings that allow us to specify a custom trusted setup. -/// or use hardcoded default settings. -#[cfg(not(feature = "c-kzg"))] -pub use kzg_rs::EnvKzgSettings; - -#[cfg(feature = "c-kzg")] -#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] -pub enum EnvKzgSettings { - /// Default mainnet trusted setup - #[default] - Default, - /// Custom trusted setup. - Custom(Arc), -} +cfg_if::cfg_if! { + if #[cfg(feature = "c-kzg")] { + /// KZG Settings that allow us to specify a custom trusted setup. + /// or use hardcoded default settings. + #[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] + pub enum EnvKzgSettings { + /// Default mainnet trusted setup + #[default] + Default, + /// Custom trusted setup. + Custom(Arc), + } -#[cfg(feature = "c-kzg")] -impl EnvKzgSettings { - /// Return set KZG settings. - /// - /// In will initialize the default settings if it is not already loaded. - pub fn get(&self) -> &KzgSettings { - match self { - Self::Default => { - static DEFAULT: OnceBox = OnceBox::new(); - DEFAULT.get_or_init(|| { - let settings = - KzgSettings::load_trusted_setup(G1_POINTS.as_ref(), G2_POINTS.as_ref()) - .expect("failed to load default trusted setup"); - Box::new(settings) - }) + impl EnvKzgSettings { + /// Return set KZG settings. + /// + /// In will initialize the default settings if it is not already loaded. + pub fn get(&self) -> &KzgSettings { + match self { + Self::Default => { + static DEFAULT: OnceBox = OnceBox::new(); + DEFAULT.get_or_init(|| { + let settings = + KzgSettings::load_trusted_setup(G1_POINTS.as_ref(), G2_POINTS.as_ref()) + .expect("failed to load default trusted setup"); + Box::new(settings) + }) + } + Self::Custom(settings) => settings, + } } - Self::Custom(settings) => settings, } + } else if #[cfg(feature = "kzg-rs")] { + pub use kzg_rs::EnvKzgSettings; } } diff --git a/crates/primitives/src/kzg/trusted_setup_points.rs b/crates/primitives/src/kzg/trusted_setup_points.rs index 5228f5f9ba..c89c4e642e 100644 --- a/crates/primitives/src/kzg/trusted_setup_points.rs +++ b/crates/primitives/src/kzg/trusted_setup_points.rs @@ -2,11 +2,13 @@ use core::fmt; use derive_more::{AsMut, AsRef, Deref, DerefMut}; use std::boxed::Box; -#[cfg(feature = "c-kzg")] -pub use c_kzg::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; - -#[cfg(not(feature = "c-kzg"))] -pub use kzg_rs::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; +cfg_if::cfg_if! { + if #[cfg(feature = "c-kzg")] { + pub use c_kzg::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; + } else if #[cfg(feature = "kzg-rs")] { + pub use kzg_rs::{BYTES_PER_G1_POINT, BYTES_PER_G2_POINT}; + } +} /// Number of G1 Points. pub const NUM_G1_POINTS: usize = 4096; From b985f08566ea42a138935416ae817ab549eb660f Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Fri, 21 Jun 2024 16:14:21 -0700 Subject: [PATCH 07/17] feat: use `kzg-rs` --- Cargo.lock | 479 ++++++++-------------- crates/primitives/Cargo.toml | 3 +- crates/primitives/src/kzg/env_settings.rs | 1 + 3 files changed, 183 insertions(+), 300 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a459f112f..76577d0d7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2feb5f466b3a786d5a622d8926418bc6a0d38bf632909f6ee9298a4a1d8c6e0" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" dependencies = [ "num_enum", "strum", @@ -171,6 +171,7 @@ dependencies = [ "lru", "pin-project", "reqwest 0.12.5", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -197,7 +198,7 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -212,6 +213,7 @@ dependencies = [ "futures", "pin-project", "reqwest 0.12.5", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -278,7 +280,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -294,7 +296,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "syn-solidity", "tiny-keccak", ] @@ -310,7 +312,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "syn-solidity", ] @@ -353,6 +355,7 @@ dependencies = [ "alloy-json-rpc", "alloy-transport", "reqwest 0.12.5", + "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -544,7 +547,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -555,7 +558,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -604,7 +607,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -893,6 +896,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-chunks" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d63d857efc8e722f18e9e2bbdd32b53084211090eb4b3df5d3170eddd0c76d" + [[package]] name = "const-hex" version = "1.12.0" @@ -1089,7 +1098,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1102,7 +1111,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1126,17 +1135,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "dunce" version = "1.0.4" @@ -1229,7 +1227,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1531,7 +1529,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1832,9 +1830,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1896,10 +1894,29 @@ dependencies = [ "http 0.2.12", "hyper 0.14.29", "rustls 0.21.12", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.23.10", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.27.2" @@ -1953,134 +1970,14 @@ dependencies = [ "tracing", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2295,12 +2192,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -2346,9 +2237,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2489,7 +2380,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2567,7 +2458,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2720,7 +2611,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2749,7 +2640,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2893,9 +2784,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -3071,6 +2962,7 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.29", "hyper-rustls 0.24.2", + "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -3079,14 +2971,17 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -3099,8 +2994,10 @@ dependencies = [ [[package]] name = "reqwest" version = "0.12.5" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -3113,6 +3010,7 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.27.2", + "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", "ipnet", @@ -3128,6 +3026,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -3157,6 +3056,7 @@ dependencies = [ "ethers-providers", "indicatif", "reqwest 0.12.5", + "reqwest 0.12.5", "revm-interpreter", "revm-precompile", "rstest", @@ -3357,7 +3257,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.67", "unicode-ident", ] @@ -3444,6 +3344,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-webpki 0.101.7", + "rustls-webpki 0.101.7", "sct", ] @@ -3460,6 +3361,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls" +version = "0.23.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3506,6 +3420,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -3697,7 +3622,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3724,6 +3649,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3819,6 +3757,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sp1-derive" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "spin" version = "0.5.2" @@ -3841,12 +3789,6 @@ dependencies = [ "der", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -3902,7 +3844,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3920,9 +3862,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "syn" @@ -3937,9 +3879,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -3955,7 +3897,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3970,17 +3912,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -4046,7 +3977,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4098,16 +4029,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -4118,6 +4039,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.38.0" @@ -4143,7 +4079,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4166,6 +4102,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.10", + "rustls-pki-types", + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" @@ -4198,8 +4146,10 @@ dependencies = [ "futures-util", "log", "rustls 0.21.12", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] @@ -4282,7 +4232,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -4334,6 +4284,7 @@ dependencies = [ "log", "rand", "rustls 0.21.12", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -4371,12 +4322,27 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -4395,6 +4361,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -4409,9 +4381,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -4424,18 +4396,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "valuable" version = "0.1.0" @@ -4515,7 +4475,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-shared", ] @@ -4549,7 +4509,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4775,18 +4735,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -4815,30 +4763,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.34" @@ -4856,28 +4780,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.67", ] [[package]] @@ -4897,27 +4800,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "syn 2.0.67", ] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index bdd120cb31..6add44ceb4 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -56,7 +56,7 @@ serde = { version = "1.0", default-features = false, features = [ hex = { version = "0.4", default-features = false } [features] -default = ["std", "c-kzg", "portable"] +default = ["std", "kzg-rs"] std = [ "serde?/std", "alloy-eips/std", @@ -75,6 +75,7 @@ serde = [ "bitvec/serde", "bitflags/serde", "c-kzg?/serde", + "kzg-rs?/serde", ] arbitrary = [ "std", diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index 3b69c1b349..7b267f9874 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -2,6 +2,7 @@ use super::{ trusted_setup_points::{G1_POINTS, G2_POINTS}, KzgSettings, }; +use core::hash::{Hash, Hasher}; use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; From ac5f264fa0b7145409e2c4458a55814eb6494e63 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Mon, 8 Jul 2024 10:35:04 -0700 Subject: [PATCH 08/17] fix: `kzg-rs` import --- Cargo.lock | 463 ++++++++++++++-------- crates/precompile/src/lib.rs | 9 +- crates/primitives/Cargo.toml | 2 +- crates/primitives/src/kzg/env_settings.rs | 2 +- crates/primitives/src/lib.rs | 2 +- 5 files changed, 308 insertions(+), 170 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76577d0d7f..d0441f7cd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "d2feb5f466b3a786d5a622d8926418bc6a0d38bf632909f6ee9298a4a1d8c6e0" dependencies = [ "num_enum", "strum", @@ -171,7 +171,6 @@ dependencies = [ "lru", "pin-project", "reqwest 0.12.5", - "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -198,7 +197,7 @@ checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -213,7 +212,6 @@ dependencies = [ "futures", "pin-project", "reqwest 0.12.5", - "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -280,7 +278,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -296,7 +294,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "syn-solidity", "tiny-keccak", ] @@ -312,7 +310,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "syn-solidity", ] @@ -355,7 +353,6 @@ dependencies = [ "alloy-json-rpc", "alloy-transport", "reqwest 0.12.5", - "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -547,7 +544,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -558,7 +555,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -607,7 +604,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -896,12 +893,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "const-chunks" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d63d857efc8e722f18e9e2bbdd32b53084211090eb4b3df5d3170eddd0c76d" - [[package]] name = "const-hex" version = "1.12.0" @@ -1098,7 +1089,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1111,7 +1102,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1135,6 +1126,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "dunce" version = "1.0.4" @@ -1227,7 +1229,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1529,7 +1531,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -1830,9 +1832,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" @@ -1894,29 +1896,10 @@ dependencies = [ "http 0.2.12", "hyper 0.14.29", "rustls 0.21.12", - "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.2" @@ -1970,14 +1953,134 @@ dependencies = [ "tracing", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -2163,6 +2266,9 @@ dependencies = [ "glob", "hex", "once_cell", + "serde", + "serde_derive", + "serde_yaml", ] [[package]] @@ -2192,6 +2298,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2237,9 +2349,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -2380,7 +2492,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2458,7 +2570,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2611,7 +2723,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2640,7 +2752,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -2784,9 +2896,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -2962,7 +3074,6 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.29", "hyper-rustls 0.24.2", - "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -2971,17 +3082,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", - "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", - "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -2994,10 +3102,8 @@ dependencies = [ [[package]] name = "reqwest" version = "0.12.5" -version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", @@ -3010,7 +3116,6 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.27.2", - "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", "ipnet", @@ -3026,7 +3131,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -3056,7 +3160,6 @@ dependencies = [ "ethers-providers", "indicatif", "reqwest 0.12.5", - "reqwest 0.12.5", "revm-interpreter", "revm-precompile", "rstest", @@ -3257,7 +3360,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.67", + "syn 2.0.66", "unicode-ident", ] @@ -3344,7 +3447,6 @@ dependencies = [ "log", "ring 0.17.8", "rustls-webpki 0.101.7", - "rustls-webpki 0.101.7", "sct", ] @@ -3361,19 +3463,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle", - "zeroize", -] - [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3420,17 +3509,6 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "rustls-webpki" -version = "0.102.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" -dependencies = [ - "ring 0.17.8", - "rustls-pki-types", - "untrusted 0.9.0", -] - [[package]] name = "rustversion" version = "1.0.17" @@ -3622,7 +3700,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3757,16 +3835,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sp1-derive" -version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "spin" version = "0.5.2" @@ -3789,6 +3857,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3844,7 +3918,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3862,9 +3936,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -3879,9 +3953,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.67" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3897,7 +3971,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -3912,6 +3986,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3977,7 +4062,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4030,30 +4115,25 @@ dependencies = [ ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "serde", - "serde_json", + "displaydoc", + "zerovec", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinytemplate" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ - "tinyvec_macros", + "serde", + "serde_json", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" version = "1.38.0" @@ -4079,7 +4159,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4102,18 +4182,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls 0.23.10", - "rustls-pki-types", - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -4146,10 +4214,8 @@ dependencies = [ "futures-util", "log", "rustls 0.21.12", - "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", - "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] @@ -4232,7 +4298,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", ] [[package]] @@ -4284,7 +4350,6 @@ dependencies = [ "log", "rand", "rustls 0.21.12", - "rustls 0.21.12", "sha1", "thiserror", "url", @@ -4322,27 +4387,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -4381,9 +4431,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -4396,6 +4446,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "valuable" version = "0.1.0" @@ -4475,7 +4537,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -4509,7 +4571,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4735,6 +4797,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -4763,6 +4837,30 @@ dependencies = [ "tap", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -4780,7 +4878,28 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", ] [[package]] @@ -4800,5 +4919,27 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.66", +] + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index eed8d5e23e..1eac5234db 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -23,25 +23,22 @@ pub mod secp256k1; pub mod secp256r1; pub mod utilities; -// silence lint -use cfg_if as _; +pub use fatal_precompile::fatal_precompile; + #[cfg(feature = "kzg-rs")] +// silence lint use kzg_rs as _; use core::hash::Hash; use once_cell::race::OnceBox; #[doc(hidden)] pub use revm_primitives as primitives; -#[doc(hidden)] -pub use revm_primitives as primitives; pub use revm_primitives::{ precompile::{PrecompileError as Error, *}, Address, Bytes, HashMap, HashSet, Log, B256, }; use cfg_if::cfg_if; -use core::hash::Hash; -use once_cell::race::OnceBox; use std::{boxed::Box, vec::Vec}; pub fn calc_linear_cost_u32(len: usize, base: u64, word: u64) -> u64 { diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 6add44ceb4..4712a123dc 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -22,7 +22,7 @@ rust_2018_idioms = "deny" all = "warn" [dependencies] -alloy-eips = { version = "0.1", default-features = false } +alloy-eips = { version = "0.1", default-features = false, features = ["k256"] } alloy-primitives = { version = "0.7.2", default-features = false, features = [ "rlp", ] } diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index 7b267f9874..707b2a7b5b 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -2,7 +2,7 @@ use super::{ trusted_setup_points::{G1_POINTS, G2_POINTS}, KzgSettings, }; -use core::hash::{Hash, Hasher}; +use core::hash::Hash; use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index b70985eae4..a36f2b90ec 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -46,6 +46,6 @@ pub use specification::*; pub use state::*; pub use utilities::*; -#[cfg(feature = "kzg-rs")] +#[cfg(all(feature = "c-kzg", feature = "kzg-rs"))] // silence lint use kzg_rs as _; From 51a9fca096dbbbb77f593744f39dc3f3b71b016e Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Mon, 8 Jul 2024 10:55:38 -0700 Subject: [PATCH 09/17] chore: add `kzg-rs` feature to revm-interpreter --- crates/interpreter/Cargo.toml | 2 ++ crates/precompile/Cargo.toml | 4 ++-- crates/precompile/src/lib.rs | 11 +++++------ crates/primitives/Cargo.toml | 2 +- crates/primitives/src/kzg/env_settings.rs | 3 +-- crates/revm/Cargo.toml | 1 + 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/crates/interpreter/Cargo.toml b/crates/interpreter/Cargo.toml index 022e0e8a74..da07fefad2 100644 --- a/crates/interpreter/Cargo.toml +++ b/crates/interpreter/Cargo.toml @@ -81,3 +81,5 @@ optional_eip3607 = ["revm-primitives/optional_eip3607"] optional_gas_refund = ["revm-primitives/optional_gas_refund"] optional_no_base_fee = ["revm-primitives/optional_no_base_fee"] optional_beneficiary_reward = ["revm-primitives/optional_beneficiary_reward"] + +kzg-rs = ["revm-primitives/kzg-rs"] diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 3efa1b8d52..a902443d58 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -60,8 +60,8 @@ p256 = { version = "0.13.2", optional = true, default-features = false, features "ecdsa", ] } -# Utility -cfg-if = "1" +# utils +cfg-if = { version = "1.0", default-features = false } [dev-dependencies] criterion = "0.5" diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 1eac5234db..c8dc01fcad 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -28,17 +28,16 @@ pub use fatal_precompile::fatal_precompile; #[cfg(feature = "kzg-rs")] // silence lint use kzg_rs as _; - -use core::hash::Hash; -use once_cell::race::OnceBox; -#[doc(hidden)] -pub use revm_primitives as primitives; -pub use revm_primitives::{ +pub use primitives::{ precompile::{PrecompileError as Error, *}, Address, Bytes, HashMap, HashSet, Log, B256, }; +#[doc(hidden)] +pub use revm_primitives as primitives; use cfg_if::cfg_if; +use core::hash::Hash; +use once_cell::race::OnceBox; use std::{boxed::Box, vec::Vec}; pub fn calc_linear_cost_u32(len: usize, base: u64, word: u64) -> u64 { diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 4712a123dc..28780940c0 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -56,7 +56,7 @@ serde = { version = "1.0", default-features = false, features = [ hex = { version = "0.4", default-features = false } [features] -default = ["std", "kzg-rs"] +default = ["std", "c-kzg", "portable"] std = [ "serde?/std", "alloy-eips/std", diff --git a/crates/primitives/src/kzg/env_settings.rs b/crates/primitives/src/kzg/env_settings.rs index 707b2a7b5b..8e48ca98aa 100644 --- a/crates/primitives/src/kzg/env_settings.rs +++ b/crates/primitives/src/kzg/env_settings.rs @@ -2,7 +2,6 @@ use super::{ trusted_setup_points::{G1_POINTS, G2_POINTS}, KzgSettings, }; -use core::hash::Hash; use once_cell::race::OnceBox; use std::{boxed::Box, sync::Arc}; @@ -10,7 +9,7 @@ cfg_if::cfg_if! { if #[cfg(feature = "c-kzg")] { /// KZG Settings that allow us to specify a custom trusted setup. /// or use hardcoded default settings. - #[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] + #[derive(Debug, Clone, Default, PartialEq, Eq )] pub enum EnvKzgSettings { /// Default mainnet trusted setup #[default] diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 14614d4410..7c1ce4c5dc 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -126,6 +126,7 @@ optional_beneficiary_reward = ["revm-interpreter/optional_beneficiary_reward"] # See comments in `revm-precompile` secp256k1 = ["revm-precompile/secp256k1"] c-kzg = ["revm-precompile/c-kzg"] +kzg-rs = ["revm-precompile/kzg-rs"] blst = ["revm-precompile/blst"] [[example]] From fcee3f3f1a879bb7ae0973ee7ba589d3815aa57b Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 9 Jul 2024 11:37:29 -0700 Subject: [PATCH 10/17] fix: check kzg-rs enable in revm/precompile --- crates/precompile/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index c8dc01fcad..0e45fc34cc 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -15,7 +15,7 @@ pub mod bn128; pub mod fatal_precompile; pub mod hash; pub mod identity; -#[cfg(feature = "c-kzg")] +#[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] pub mod kzg_point_evaluation; pub mod modexp; pub mod secp256k1; @@ -145,7 +145,7 @@ impl Precompiles { // EIP-4844: Shard Blob Transactions cfg_if! { - if #[cfg(feature = "c-kzg")] { + if #[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] { let precompile = kzg_point_evaluation::POINT_EVALUATION.clone(); } else { // TODO move constants to separate file. From 1b44f903f64d90958275932ff796d4d8e7f7a01e Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 9 Jul 2024 19:17:47 -0700 Subject: [PATCH 11/17] fix: kzg-rs include once_cell and derive_more in primitives, update feature tags --- crates/primitives/Cargo.toml | 1 + crates/primitives/src/env.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 28780940c0..bf558952f6 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -111,3 +111,4 @@ rand = ["alloy-primitives/rand"] # See comments in `revm-precompile` c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"] +kzg-rs = ["dep:kzg-rs", "dep:once_cell", "dep:derive_more"] diff --git a/crates/primitives/src/env.rs b/crates/primitives/src/env.rs index 1ec9c717f8..45cfb119c5 100644 --- a/crates/primitives/src/env.rs +++ b/crates/primitives/src/env.rs @@ -275,7 +275,7 @@ pub struct CfgEnv { /// Chain ID is introduced EIP-155 pub chain_id: u64, /// KZG Settings for point evaluation precompile. By default, this is loaded from the ethereum mainnet trusted setup. - #[cfg(feature = "c-kzg")] + #[cfg(any(feature = "c-kzg", feature = "kzg-rs"))] #[cfg_attr(feature = "serde", serde(skip))] pub kzg_settings: crate::kzg::EnvKzgSettings, /// Bytecode that is created with CREATE/CREATE2 is by default analysed and jumptable is created. From 1d970781c7f91ba70fd2d124b765144bbe402233 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 11:30:17 +0200 Subject: [PATCH 12/17] Update crates/primitives/src/lib.rs --- crates/primitives/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index a36f2b90ec..f84d74fccd 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -47,5 +47,5 @@ pub use state::*; pub use utilities::*; #[cfg(all(feature = "c-kzg", feature = "kzg-rs"))] -// silence lint +// silence kzg-rs lint as c-kzg will be used as default if both are enabled use kzg_rs as _; From 0ca0107d1849651905e520aea34542ed13aa6b3a Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 11:32:34 +0200 Subject: [PATCH 13/17] Update crates/precompile/src/lib.rs --- crates/precompile/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 0e45fc34cc..662dca6a21 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -25,8 +25,8 @@ pub mod utilities; pub use fatal_precompile::fatal_precompile; -#[cfg(feature = "kzg-rs")] -// silence lint +#[cfg(all(feature = "c-kzg", feature = "kzg-rs"))] +// silence kzg-rs lint as c-kzg will be used as default if both are enabled. use kzg_rs as _; pub use primitives::{ precompile::{PrecompileError as Error, *}, From 804de08179f89786b02faca6a56dbc61a390c702 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 11:37:16 +0200 Subject: [PATCH 14/17] Update crates/primitives/Cargo.toml --- crates/primitives/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index bf558952f6..3d8719768a 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -111,4 +111,5 @@ rand = ["alloy-primitives/rand"] # See comments in `revm-precompile` c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"] +# `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. kzg-rs = ["dep:kzg-rs", "dep:once_cell", "dep:derive_more"] From 8342f9c73edc8f34d933b357e7093bbda453264a Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 11:38:01 +0200 Subject: [PATCH 15/17] Update crates/revm/Cargo.toml --- crates/revm/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 7c1ce4c5dc..f5013c4b7b 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -126,6 +126,7 @@ optional_beneficiary_reward = ["revm-interpreter/optional_beneficiary_reward"] # See comments in `revm-precompile` secp256k1 = ["revm-precompile/secp256k1"] c-kzg = ["revm-precompile/c-kzg"] +# `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. kzg-rs = ["revm-precompile/kzg-rs"] blst = ["revm-precompile/blst"] From 172c90bdf9f7b03bcaa8e4171cfb2163bc417451 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 11:38:31 +0200 Subject: [PATCH 16/17] Update crates/precompile/Cargo.toml --- crates/precompile/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index a902443d58..18495b0d75 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -103,6 +103,7 @@ secp256r1 = ["dep:p256"] # Enables the KZG point evaluation precompile. c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg"] +# `kzg-rs` is not audited but useful for `no_std` environment, use it with causing and default to `c-kzg` if possible. kzg-rs = ["dep:kzg-rs", "revm-primitives/kzg-rs"] portable = ["revm-primitives/portable", "c-kzg?/portable"] From 65e2a8f20202f3c5451f56decf3a93ffaf2ed649 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 10 Jul 2024 12:02:25 +0200 Subject: [PATCH 17/17] Update crates/primitives/src/lib.rs --- crates/primitives/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index f84d74fccd..e29efe9b12 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -47,5 +47,5 @@ pub use state::*; pub use utilities::*; #[cfg(all(feature = "c-kzg", feature = "kzg-rs"))] -// silence kzg-rs lint as c-kzg will be used as default if both are enabled +// silence kzg-rs lint as c-kzg will be used as default if both are enabled. use kzg_rs as _;