diff --git a/Cargo.lock b/Cargo.lock index 10f96a9c0b..11e1c3f1bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,29 +384,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bindgen" -version = "0.66.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" -dependencies = [ - "bitflags 2.4.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.46", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -501,11 +478,10 @@ dependencies = [ [[package]] name = "c-kzg" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32700dc7904064bb64e857d38a1766607372928e2466ee5f02a869829b3297d7" +checksum = "b9d8c306be83ec04bf5f73710badd8edf56dea23f2f0d8b7f9fe4644d371c758" dependencies = [ - "bindgen", "blst", "cc", "glob", @@ -529,15 +505,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -580,17 +547,6 @@ dependencies = [ "half", ] -[[package]] -name = "clang-sys" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "2.34.0" @@ -1458,15 +1414,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "http" version = "0.2.11" @@ -1722,28 +1669,12 @@ dependencies = [ "spin 0.5.2", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libm" version = "0.2.8" @@ -1789,12 +1720,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1815,16 +1740,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num" version = "0.4.1" @@ -2017,12 +1932,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pem" version = "1.1.1" @@ -2156,16 +2065,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "prettyplease" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" -dependencies = [ - "proc-macro2", - "syn 2.0.46", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -2454,6 +2353,7 @@ name = "revm-precompile" version = "2.2.0" dependencies = [ "aurora-engine-modexp", + "blst", "c-kzg", "k256", "once_cell", @@ -2472,6 +2372,7 @@ dependencies = [ "auto_impl", "bitflags 2.4.2", "bitvec", + "blst", "c-kzg", "cfg-if", "derive_more", @@ -2622,12 +2523,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hex" version = "2.1.0" @@ -2923,12 +2818,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "shlex" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" - [[package]] name = "signature" version = "2.2.0" @@ -3671,18 +3560,6 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index f8d6dd62a0..b5c384142e 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -22,7 +22,10 @@ sha2 = { version = "0.10", default-features = false } aurora-engine-modexp = { version = "1.0", default-features = false } # Optional KZG point evaluation precompile -c-kzg = { version = "0.4.0", default-features = false, optional = true } +c-kzg = { version = "0.4.1", default-features = false, optional = true } + +# TODO: make specific feature for this in c-kzg-4844 +blst = { version = "0.3.11", default-features = false, optional = true } # ecRecover precompile k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] } @@ -50,7 +53,9 @@ optimism = ["revm-primitives/optimism"] # These libraries may not work on all no_std platforms as they depend on C. # Enables the KZG point evaluation precompile. -c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg"] +# TODO: remove `blst` dep when `c-kzg` has a portable feature +c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg", "dep:blst", "blst?/portable"] + # Use `secp256k1` as a faster alternative to `k256`. # The problem that `secp256k1` has is it fails to build for `wasm` target on Windows and Mac as it is c lib. # In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default. diff --git a/crates/precompile/src/kzg_point_evaluation.rs b/crates/precompile/src/kzg_point_evaluation.rs index 814b9eb421..68bc5117c4 100644 --- a/crates/precompile/src/kzg_point_evaluation.rs +++ b/crates/precompile/src/kzg_point_evaluation.rs @@ -3,6 +3,9 @@ use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings}; use revm_primitives::{hex_literal::hex, Env}; use sha2::{Digest, Sha256}; +// TODO: remove when we have `portable` feature in `c-kzg` +use blst as _; + pub const POINT_EVALUATION: PrecompileWithAddress = PrecompileWithAddress(ADDRESS, Precompile::Env(run)); diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 3bcc8028eb..8ae25419f8 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -26,8 +26,10 @@ bitvec = { version = "1", default-features = false, features = ["alloc"] } bitflags = { version = "2.4.2", default-features = false } # For setting the CfgEnv KZGSettings. Enabled by c-kzg flag. -c-kzg = { version = "0.4.0", default-features = false, optional = true } +c-kzg = { version = "0.4.1", default-features = false, optional = true } once_cell = { version = "1.19", default-features = false, optional = true } +# TODO: make specific feature for this in c-kzg-4844 +blst = { version = "0.3.11", default-features = false, optional = true } # utility enumn = "0.1" @@ -84,4 +86,5 @@ optional_no_base_fee = [] optional_beneficiary_reward = [] # See comments in `revm-precompile` -c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"] +# TODO: remove `blst` dep when `c-kzg` has a portable feature +c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more", "dep:blst", "blst?/portable"] diff --git a/crates/primitives/src/kzg.rs b/crates/primitives/src/kzg.rs index 8d37463f0c..f86d26fbf7 100644 --- a/crates/primitives/src/kzg.rs +++ b/crates/primitives/src/kzg.rs @@ -1,6 +1,9 @@ mod env_settings; mod trusted_setup_points; +// TODO: remove when we have `portable` feature in `c-kzg` +use blst as _; + pub use c_kzg::KzgSettings; pub use env_settings::EnvKzgSettings; pub use trusted_setup_points::{ diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index f6aa5b0686..780707f4d8 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -73,7 +73,7 @@ ethersdb = [ "futures", "ethers-providers", "ethers-core", -] # Negate optimism default handler +] # Negate optimism default handler dev = [ "memory_limit",